fuliqi
2024-10-28 296e4072a15c6e15ba915144fa385ee4afb3c988
src/views/class-management/ClassStaff.vue
@@ -3,18 +3,18 @@
  <div class="app-container">
    <div style="display: flex; flex-direction: row">
      <div style="padding-bottom:20px">
        <span class="item">{{ title }}</span>
        <span class="item">{{ this.$route.query.className }}</span>
        <el-button class="item" @click="handlerAddStudent" type="primary" size="small">新增学员</el-button>
        <el-button class="item" @click="open = true" type="primary" size="small">学员调整</el-button>
      </div>
      <div>
        <el-form :inline="true" :model="searchForm" class="demo-form-inline">
          <el-form-item label="学员姓名">
            <el-input v-model="searchForm.studentName" size="small" clearable @clear="page"
            <el-input v-model="searchForm.studentName" size="small" clearable @clear="page" @input="page"
                      placeholder="学员姓名"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="page">查询</el-button>
            <el-button type="primary" @click="page" size="small">查询</el-button>
          </el-form-item>
        </el-form>
      </div>
@@ -60,7 +60,13 @@
      >
        <template slot-scope="scope">
          <el-button @click="handlerEditStudent(scope.row)" type="warning" size="small">编辑</el-button>
          <el-button @click="remove(scope.row.id)" type="danger" size="small">删除</el-button>
          <el-popconfirm
            style="margin: 0 5px"
            title="确定要删除该成员吗?"
            @confirm="remove(scope.row.id)"
          >
            <el-button slot="reference" type="danger" size="small">删除</el-button>
          </el-popconfirm>
        </template>
      </el-table-column>
    </el-table>
@@ -79,7 +85,6 @@
      :before-close="handleAddClose"
      :close-on-click-modal="false">
      <el-form :model="studentForm" :rules="studentRules" ref="studentForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="学号" prop="id" v-show="false"/>
        <el-form-item label="姓名" prop="realName">
          <el-input v-model="studentForm.realName"></el-input>
        </el-form-item>
@@ -139,10 +144,10 @@
  getClassesUsers,
  deleteClassesUserById,
  addClassesUser,
  edit,
  editClassesUser
} from '@/api/classesUser'
import Pagination from '@/components/Pagination'
import {deleteExamById} from "@/api/exam";
export default {
  components: { Pagination },
@@ -248,9 +253,15 @@
      this.resetStudentForm()
    },
    remove (id) {
      deleteClassesUserById(id).then(res => {
        this.$message.success(res.data.message)
        this.page()
      this.$confirm('确认是否删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteClassesUserById(id).then(res => {
          this.$message.success(res.data.message)
          this.page()
        })
      })
    },
    sexFormatter (row) {