From 296e4072a15c6e15ba915144fa385ee4afb3c988 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 28 十月 2024 11:36:17 +0800
Subject: [PATCH] websocket定时ping

---
 src/views/class-management/Class.vue |   43 ++++++++++++++++++++++++++++---------------
 1 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/src/views/class-management/Class.vue b/src/views/class-management/Class.vue
index a259483..5dffd29 100644
--- a/src/views/class-management/Class.vue
+++ b/src/views/class-management/Class.vue
@@ -13,7 +13,7 @@
     <div>
       <el-form :inline="true" :model="searchForm" class="demo-form-inline">
         <el-form-item label="鐝骇鍚嶇О">
-          <el-input v-model="searchForm.className" size="small" clearable @clear="page"
+          <el-input v-model="searchForm.className" size="small" clearable @clear="page" @input="page"
                     placeholder="鐝骇鍚嶇О"></el-input>
         </el-form-item>
         <el-form-item label="鐝骇鐘舵��">
@@ -23,7 +23,7 @@
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="page">鏌ヨ</el-button>
+          <el-button type="primary" size="small" @click="page">鏌ヨ</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -88,14 +88,14 @@
         fixed="right"
       >
         <template slot-scope="scope">
-          <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerEdit(scope.row)"
+          <el-button v-show="scope.row.status !== '瑙f暎'" size="small" @click="handlerEdit(scope.row)"
                      type="primary">淇敼
           </el-button>
-          <el-button v-if="scope.row.status !== '瑙f暎'" size="small" type="warning">鐝骇楠岃瘉</el-button>
-          <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerOpenNotify(scope.row)"
+          <el-button v-show="scope.row.status !== '瑙f暎'" size="small" type="warning">鐝骇楠岃瘉</el-button>
+          <el-button v-show="scope.row.status !== '瑙f暎'" size="small" @click="handlerOpenNotify(scope.row)"
                      type="info">閫氱煡
           </el-button>
-          <el-button v-if="scope.row.status !== '瑙f暎'" @click="studentManager(scope.row.id)" size="small"
+          <el-button v-show="scope.row.status !== '瑙f暎'" @click="studentManager(scope.row.id,scope.row.className)" size="small"
                      type="success">鎴愬憳绠$悊
           </el-button>
           <el-popconfirm
@@ -103,7 +103,7 @@
             title="纭畾瑕佽В鏁h鐝骇锛�"
             @confirm="dissolution(scope.row.id)"
           >
-            <el-button slot="reference" v-if="scope.row.status !== '瑙f暎'" type="danger"
+            <el-button slot="reference" v-show="scope.row.status !== '瑙f暎'" type="danger"
                        size="small">瑙f暎
             </el-button>
           </el-popconfirm>
@@ -112,7 +112,7 @@
             title="纭畾瑕佹仮澶嶈鐝骇鍚楋紵"
             @confirm="recover(scope.row.id)"
           >
-            <el-button slot="reference" v-if="scope.row.status === '瑙f暎'" type="success"
+            <el-button slot="reference" v-show="scope.row.status === '瑙f暎'" type="success"
                        size="small">鎭㈠姝e父
             </el-button>
           </el-popconfirm>
@@ -120,14 +120,15 @@
       </el-table-column>
     </el-table>
 
-      <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageIndex"
+      <pagination v-show="total>0" :total="total" :page.sync="searchForm.currentPage"
                   :limit.sync="searchForm.pageSize"
                   @pagination="page"/>
     <el-dialog
       title="鐝骇閫氱煡"
       :visible.sync="notifyOpen"
       width="600px"
-      :before-close="handleClose">
+      :before-close="handleNotifyClose"
+      :close-on-click-modal="false">
       <el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm">
         <el-form-item label="閫氱煡鐝骇锛�" prop="className">
           <span>{{ notifyForm.className }}</span>
@@ -146,7 +147,8 @@
       :title="title"
       :visible.sync="open"
       width="700px"
-      :before-close="handleClose">
+      :before-close="handleClose"
+      :close-on-click-modal="false">
       <el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm">
         <el-form-item label="鐝骇鍚嶇О" prop="className">
           <el-input v-model="form.className" size="small"></el-input>
@@ -213,7 +215,7 @@
         status: '',
         subject: null,
         pageSize: 10,
-        pageNum: 1
+        currentPage: 1
       },
       form: {
         id: null,
@@ -320,7 +322,7 @@
         this.page()
       })
     },
-    recover(id) {
+    recover (id) {
       recover(id).then(res => {
         this.$message.success(res.data.message)
         this.page()
@@ -334,13 +336,24 @@
       this.open = false
       this.resetForm()
     },
+    handleNotifyClose () {
+      this.notifyOpen = false
+      this.resetNotifyForm()
+    },
+    resetNotifyForm () {
+      this.notifyForm = {
+        className: '',
+        notifyContent: '',
+        classesId: null
+      }
+    },
     handlerAdd () {
       this.open = true
       this.title = '鏂板鐝骇'
     },
     // 璺宠浆(鏌ョ湅鐝骇浜哄憳鎯呭喌)
-    studentManager (classesId) {
-      this.$router.push({ path: '/classes/class-management/Class-staff', query: { classesId: classesId } })
+    studentManager (classesId,className) {
+      this.$router.push({ path: '/classes/class-management/Class-staff', query: { classesId: classesId, className: className } })
     },
     // 杩斿洖涓婁竴涓〉闈�
     goBack () {

--
Gitblit v1.8.0