zhouwx
2024-08-16 55f821ecb4b61bda2e4308b0a04b5ec0d767b31e
src/views/onlineEducation/platformManage/index.vue
@@ -21,18 +21,18 @@
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            v-if="scope.row.status == 1"-->
<!--            @click="handleEnable(scope.row)"-->
<!--          >启用</el-button>-->
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            v-if="scope.row.status == 0"-->
<!--            @click="handleDisable(scope.row)"-->
<!--          >监管禁用</el-button>-->
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.status == 1"
            @click="handleEnable(scope.row)"
          >启用</el-button>
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.status == 0"
            @click="handleEnable(scope.row)"
          >监管禁用</el-button>
          <el-button
            size="mini"
            type="text"
@@ -62,7 +62,7 @@
<script>
import addDialog from '@/views/onlineEducation/platformManage/components/addDialog.vue'
import { delExam } from '@/api/coalMine/placeManage/exam'
import { delPlat, listPlat } from '@/api/onlineEducation/plat'
import { delPlat, listPlat, modPlatStatus } from '@/api/onlineEducation/plat'
export default {
  name: "platformManage",
  components: {addDialog},
@@ -125,21 +125,49 @@
      this.$refs.addDialogRef.openDialog(type, data);
    },
    handleEnable(data){
      this.$confirm('确认启用该平台?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // delExam( val.siteId).then((res) => {
        //   if (res.code == 200) {
        //     this.$message({
        //       type:'success',
        //       message: '删除成功'
        //     })
        //     this.getList()
        //   }
        // })
      })
      if(data.status == 1){
        this.$confirm('确认启用该平台?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          const param={
            id:data.id,
            status: 0
          }
          modPlatStatus( param).then((res) => {
            if (res.code == 200) {
              this.$message({
                type:'success',
                message: '操作成功'
              })
              this.getList()
            }
          })
        })
      }else {
        this.$confirm('确认禁用该平台?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          const param={
            id:data.id,
            status: 1
          }
          modPlatStatus( param).then((res) => {
            if (res.code == 200) {
              this.$message({
                type:'success',
                message: '操作成功'
              })
              this.getList()
            }
          })
        })
      }
    },
    handleDisable(data){
      this.$confirm('确认禁用该平台?', '提示', {