From f8289e778a1ae84a3ecda75cf1c9ff3e9d7ca3a8 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 29 十月 2024 14:43:32 +0800
Subject: [PATCH] 正式环境

---
 src/views/class-management/Class.vue |  158 +++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 107 insertions(+), 51 deletions(-)

diff --git a/src/views/class-management/Class.vue b/src/views/class-management/Class.vue
index 91a17f6..d567a34 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>
@@ -37,7 +37,7 @@
     >
       <el-table-column
         align="center"
-        label="鐝骇"
+        label="鐝骇鍚嶇О"
         prop="className"
         width="180px"
       ></el-table-column>
@@ -52,24 +52,24 @@
           <el-tag v-if="scope.row.status === '瑙f暎'" type="danger">{{ scope.row.status }}</el-tag>
         </template>
       </el-table-column>
-      <el-table-column
-        width="100px"
-        align="center"
-        label="鍗曚綅"
-        prop="unit"
-      ></el-table-column>
+<!--      <el-table-column-->
+<!--        width="100px"-->
+<!--        align="center"-->
+<!--        label="鍗曚綅"-->
+<!--        prop="unit"-->
+<!--      ></el-table-column>-->
       <el-table-column
         align="center"
-        width="100px"
+        width="300px"
         label="鏁欏笀"
-        prop="createUserName"
+        prop="teacherNamesStr"
       ></el-table-column>
-      <el-table-column
-        align="center"
-        width="120px"
-        label="鑱旂郴鐢佃瘽"
-        prop="teacherPhone"
-      ></el-table-column>
+<!--      <el-table-column-->
+<!--        align="center"-->
+<!--        width="120px"-->
+<!--        label="鑱旂郴鐢佃瘽"-->
+<!--        prop="teacherPhone"-->
+<!--      ></el-table-column>-->
       <el-table-column
         width="140px"
         label="寮�鐝椂闂�"
@@ -88,53 +88,80 @@
         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)"
-                     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暎'" 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-show="scope.row.status !== '瑙f暎'" @click="studentManager(scope.row.id,scope.row.className)" size="small"
                      type="success">鎴愬憳绠$悊
           </el-button>
-          <el-button v-if="scope.row.status !== '瑙f暎'" @click="dissolution(scope.row.id)" type="danger"
-                     size="small">瑙f暎
-          </el-button>
+          <el-popconfirm
+            class="confirm"
+            title="纭畾瑕佽В鏁h鐝骇锛�"
+            @confirm="dissolution(scope.row.id)"
+          >
+            <el-button slot="reference" v-show="scope.row.status !== '瑙f暎'" type="danger"
+                       size="small">瑙f暎
+            </el-button>
+          </el-popconfirm>
+          <el-popconfirm
+            class="confirm"
+            title="纭畾瑕佹仮澶嶈鐝骇鍚楋紵"
+            @confirm="recover(scope.row.id)"
+          >
+            <el-button slot="reference" v-show="scope.row.status === '瑙f暎'" type="success"
+                       size="small">鎭㈠姝e父
+            </el-button>
+          </el-popconfirm>
         </template>
       </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">
-      <el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm">
-        <el-form-item label="閫氱煡鐝骇锛�" prop="className">
-          <span>{{ notifyForm.className }}</span>
-        </el-form-item>
-        <el-form-item label="閫氱煡鍐呭锛�" prop="notifyContent">
-          <el-input type="textarea" v-model="notifyForm.notifyContent" size="small"></el-input>
-        </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="handleNotifyClose">鍙� 娑�</el-button>
-        <el-button type="primary" @click="submitNotifyForm">纭� 瀹�</el-button>
-      </span>
-    </el-dialog>
+<!--    <el-dialog-->
+<!--      title="鐝骇閫氱煡"-->
+<!--      :visible.sync="notifyOpen"-->
+<!--      width="600px"-->
+<!--      :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>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="閫氱煡鍐呭锛�" prop="notifyContent">-->
+<!--          <el-input type="textarea" v-model="notifyForm.notifyContent" size="small"></el-input>-->
+<!--        </el-form-item>-->
+<!--      </el-form>-->
+<!--      <span slot="footer" class="dialog-footer">-->
+<!--        <el-button @click="handleNotifyClose">鍙� 娑�</el-button>-->
+<!--        <el-button type="primary" @click="submitNotifyForm">纭� 瀹�</el-button>-->
+<!--      </span>-->
+<!--    </el-dialog>-->
 
     <el-dialog
       :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>
+        </el-form-item>
+        <el-form-item label="鑰佸笀閰嶇疆" prop="teacherList">
+          <el-select v-model="form.teacherList" multiple clearable size="small" placeholder="璇烽�夋嫨">
+            <el-option
+              v-for="item in teacherList"
+              :key="item.id"
+              :label="item.realName"
+              :value="item.id">
+            </el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="鐝骇鏃堕棿" required>
           <el-col :span="11">
@@ -174,7 +201,7 @@
 </template>
 
 <script>
-import { addClasses, editClasses, getClassess, dissolution } from '@/api/classes'
+import { addClasses, editClasses, getClassess, dissolution, recover, getTeacherList } from '@/api/classes'
 import { addClassesNotify } from '@/api/classesNotify'
 import Pagination from '@/components/Pagination'
 
@@ -182,6 +209,7 @@
   components: { Pagination },
   data () {
     return {
+      teacherList: [],
       notifyOpen: false,
       notifyForm: {
         className: '',
@@ -198,11 +226,12 @@
         status: '',
         subject: null,
         pageSize: 10,
-        pageNum: 1
+        currentPage: 1
       },
       form: {
         id: null,
         className: '',
+        teacherList: [],
         status: '',
         verifyStatus: '',
         startTime: null,
@@ -231,6 +260,11 @@
     }
   },
   methods: {
+    getTeacherList () {
+      getTeacherList().then(res => {
+        this.teacherList = res.data.data
+      })
+    },
     handlerOpenNotify (row) {
       this.notifyOpen = true
       this.notifyForm.className = row.className
@@ -269,6 +303,7 @@
       this.form = {
         id: null,
         className: '',
+        teacherList: [],
         status: '',
         verifyStatus: '',
         startTime: null,
@@ -305,6 +340,12 @@
         this.page()
       })
     },
+    recover (id) {
+      recover(id).then(res => {
+        this.$message.success(res.data.message)
+        this.page()
+      })
+    },
     handlerEdit (row) {
       this.form = row
       this.open = true
@@ -313,13 +354,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 () {
@@ -328,11 +380,15 @@
   },
   created () {
     this.page()
-  },
+    this.getTeacherList()
+  }
 }
 </script>
 
 <style scoped lang="scss">
+.confirm {
+  margin-left: 5px;
+}
 .flex {
   display: flex;
 }

--
Gitblit v1.8.0