From 54e06ab83d8fbebf91f8e0c3a621da743ac5af26 Mon Sep 17 00:00:00 2001
From: 黄何裕 <1053952480@qq.com>
Date: 星期四, 08 八月 2024 09:28:06 +0800
Subject: [PATCH] 课表页面开发

---
 src/views/student/index.vue |  130 +++++++++++++++++++++++++++++--------------
 1 files changed, 88 insertions(+), 42 deletions(-)

diff --git a/src/views/student/index.vue b/src/views/student/index.vue
index d91dae9..3a28c1b 100644
--- a/src/views/student/index.vue
+++ b/src/views/student/index.vue
@@ -6,8 +6,9 @@
       <el-tab-pane label="宸茶繃鏈�" name="expired" />
       <el-tab-pane label="宸插仠鐢�" name="deactivated" />
     </el-tabs>
-    <div style="display: flex; justify-content: space-between;">
-      <el-button type="primary" size="small" @click="showCreate">鏂板缓瀛﹀憳</el-button>
+    <div style="display: flex; justify-content: space-between">
+      <!-- <el-button type="primary" size="small" @click="showCreate">鏂板缓瀛﹀憳</el-button> -->
+      <el-button type="primary" size="small">瀵煎嚭瀛﹀憳</el-button>
       <div style="width: 300px">
         <el-input
           placeholder="鎸夊鍚嶆悳绱�"
@@ -18,43 +19,82 @@
           <el-button
             slot="append"
             icon="el-icon-search"
-            @click="fetchData"
+            @click="handleClick"
           ></el-button>
         </el-input>
       </div>
     </div>
-    <el-table
-      v-loading="listLoading"
-      :data="list"
-      element-loading-text="Loading"
-      fit
-    >
-      <el-table-column label="濮撳悕" prop="">
-        <template slot-scope="scope">
-          <el-link
+    <div style="height: calc(100vh - 248px)">
+      <el-table
+        v-loading="listLoading"
+        :data="list"
+        element-loading-text="Loading"
+        fit
+        height="100%"
+      >
+        <el-table-column label="濮撳悕" prop="">
+          <template slot-scope="scope">
+            <el-link
             type="primary"
             :underline="false"
             @click="goDetails(scope.row)"
             >{{ scope.row.name }}</el-link
           >
-        </template>
-      </el-table-column>
-      <el-table-column label="鎬у埆" width="80">
-        <template slot-scope="scope">
-          {{ scope.row.gender == "FEMALE" ? "濂�" : "鐢�" }}
-        </template>
-      </el-table-column>
-      <el-table-column label="鎵嬫満鍙�" width="200" prop="mobile">
-        <template slot-scope="scope">
-          {{ scope.row.mobile ? scope.row.mobile : "--" }}
-        </template>
-      </el-table-column>
-      <el-table-column label="鏄惁缁戝畾寰俊" width="200">
-        <template slot-scope="scope">
-          {{ scope.row.user ? "鏄�" : "鍚�" }}
-        </template>
-      </el-table-column>
-    </el-table>
+            <!-- <el-link type="primary" :underline="false">{{
+              scope.row.name
+            }}</el-link> -->
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="鎬у埆"
+          width="80"
+          v-if="activeName !== 'deactivated'"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.gender == "FEMALE" ? "濂�" : "鐢�" }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="鎵嬫満鍙�"
+          width="200"
+          prop="mobile"
+          v-if="activeName !== 'deactivated'"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.mobile ? scope.row.mobile : "--" }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="鏄惁缁戝畾寰俊"
+          width="200"
+          v-if="activeName !== 'deactivated'"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.user ? "鏄�" : "鍚�" }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="鎿嶄綔"
+          width="200"
+          v-if="activeName == 'deactivated'"
+        >
+          <template slot-scope="">
+            <el-link type="primary" :underline="false">鍒犻櫎</el-link>
+            &nbsp;&nbsp;&nbsp;&nbsp;
+            <el-link type="primary" :underline="false">鎭㈠</el-link>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="鍋滅敤鏃堕棿"
+          width="200"
+          v-if="activeName == 'deactivated'"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.modifyTime }}
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
     <div>
       <el-pagination
         @size-change="handleSizeChange"
@@ -67,13 +107,13 @@
       >
       </el-pagination>
     </div>
-    <StudentCreate ref="studentCreate"/>
+    <StudentCreate ref="studentCreate" />
   </div>
 </template>
 
 <script>
 import { getData, getRenew, getExpire, getDeleted } from "@/api/student";
-import StudentCreate from './components/create.vue'
+import StudentCreate from "./components/create.vue";
 
 export default {
   filters: {
@@ -86,7 +126,7 @@
       return statusMap[status];
     },
   },
-  components:{
+  components: {
     StudentCreate,
   },
   data() {
@@ -96,7 +136,7 @@
       activeName: "all",
       total: 0,
       data: {
-        staffId: JSON.parse(localStorage.getItem('user')).staffs[0].id,
+        staffId: JSON.parse(localStorage.getItem("user")).staffs[0].id,
         keyword: "",
         pageIn: {
           //鍙�夛紝濡傛灉鏄垎椤垫煡璇紝闇�瑕佸姞涓娿��
@@ -124,11 +164,11 @@
     },
     handleSizeChange(val) {
       this.data.pageIn.size = val;
-      this.fetchData();
+      this.handleClick();
     },
     handleCurrentChange(val) {
       this.data.pageIn.index = val - 1;
-      this.fetchData();
+      this.handleClick();
     },
     handleClick(tab, event) {
       if (this.activeName == "pendingFees") {
@@ -149,9 +189,15 @@
         this.fetchData();
       } else if (this.activeName == "deactivated") {
         this.listLoading = true;
-        getExpire(this.data).then((response) => {
-          this.list = response.data.findPlayerExpire.ls;
-          this.total = response.data.findPlayerExpire.pageOut.total;
+        let data = {
+          itemType: "PLAYER",
+          staffId: JSON.parse(localStorage.getItem("user")).staffs[0].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;
         });
       }
@@ -164,9 +210,9 @@
         },
       });
     },
-    showCreate(){
-      this.$refs.studentCreate.showDialog()
-    }
+    showCreate() {
+      this.$refs.studentCreate.showDialog();
+    },
   },
 };
 </script>

--
Gitblit v1.8.0