fuliqi
2024-10-17 0cefa99d2ae9ba43e60fe3e1beceb000dd186931
src/views/class-management/Class.vue
@@ -52,24 +52,24 @@
          <el-tag v-if="scope.row.status === '解散'" 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"
        label="教师"
        prop="createUserName"
      ></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="开班时间"
@@ -98,9 +98,24 @@
          <el-button v-if="scope.row.status !== '解散'" @click="studentManager(scope.row.id)" size="small"
                     type="success">成员管理
          </el-button>
          <el-button v-if="scope.row.status !== '解散'" @click="dissolution(scope.row.id)" type="danger"
                     size="small">解散
          </el-button>
          <el-popconfirm
            class="confirm"
            title="确定要解散该班级?"
            @confirm="dissolution(scope.row.id)"
          >
            <el-button slot="reference" v-if="scope.row.status !== '解散'" type="danger"
                       size="small">解散
            </el-button>
          </el-popconfirm>
          <el-popconfirm
            class="confirm"
            title="确定要恢复该班级吗?"
            @confirm="recover(scope.row.id)"
          >
            <el-button slot="reference" v-if="scope.row.status === '解散'" type="success"
                       size="small">恢复正常
            </el-button>
          </el-popconfirm>
        </template>
      </el-table-column>
    </el-table>
@@ -174,7 +189,7 @@
</template>
<script>
import { addClasses, editClasses, getClassess, dissolution } from '@/api/classes'
import { addClasses, editClasses, getClassess, dissolution, recover } from '@/api/classes'
import { addClassesNotify } from '@/api/classesNotify'
import Pagination from '@/components/Pagination'
@@ -305,6 +320,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
@@ -333,6 +354,9 @@
</script>
<style scoped lang="scss">
.confirm {
  margin-left: 5px;
}
.flex {
  display: flex;
}