zhouwx
2025-01-06 c3bb35b20d6e076f73a1cad50fd6b9b94ca399a7
src/views/onlineEducation/platformManage/index.vue
@@ -8,26 +8,30 @@
    >新增</el-button>
    <el-table v-loading="loading" :data="expertList">
      <el-table-column label="平台编号" align="center" type="index"width="80" />
      <el-table-column label="平台名称" align="center" prop="name" />
      <el-table-column label="AccessKey" align="center" prop="AccessKey" />
      <el-table-column label="SecretKey" align="center" prop="SecretKey" />
      <el-table-column label="联系人" align="center" prop="people" />
      <el-table-column label="平台名称" align="center" prop="institutionalName" />
      <el-table-column label="AccessKey" align="center" prop="accessKey" />
      <el-table-column label="SecretKey" align="center" prop="secretKey" />
      <el-table-column label="联系人" align="center" prop="contacts" />
      <el-table-column label="联系电话" align="center" prop="phone" />
      <el-table-column label="更新时间" align="center" prop="updateTime" />
      <el-table-column label="是否禁用" align="center" prop="isDisabled" />
      <el-table-column label="是否禁用" align="center" prop="isDisabled" >
        <template #default="scope">
          {{scope.row.status == 0 ? '启用' : '禁用'}}
        </template>
      </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.isDisabled === '是'"
            v-if="scope.row.status == 1"
            @click="handleEnable(scope.row)"
          >启用</el-button>
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.isDisabled === '否'"
            @click="handleDisable(scope.row)"
            v-if="scope.row.status == 0"
            @click="handleEnable(scope.row)"
          >监管禁用</el-button>
          <el-button
            size="mini"
@@ -47,7 +51,7 @@
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageIndex"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
@@ -58,6 +62,7 @@
<script>
import addDialog from '@/views/onlineEducation/platformManage/components/addDialog.vue'
import { delExam } from '@/api/coalMine/placeManage/exam'
import { delPlat, listPlat, modPlatStatus } from '@/api/onlineEducation/plat'
export default {
  name: "platformManage",
  components: {addDialog},
@@ -71,7 +76,7 @@
      total: 0,
      expertList: [],
      queryParams: {
        pageIndex: 1,
        pageNum: 1,
        pageSize: 10
      },
      classiFy: [],
@@ -90,32 +95,14 @@
  methods: {
    getList(){
      this.loading = true;
      this.expertList = [
        {
          id: 1,
          name: '测试数据1',
          AccessKey: '12345',
          SecretKey: '12345',
          people: '张三',
          phone: '13453456456',
          updateTime: '2024-6-11 10:32:00 ',
          isDisabled: '是'
        },
        {
          id: 2,
          name: '测试数据3',
          AccessKey: '14564',
          SecretKey: '16665',
          people: '李四',
          phone: '13453456456',
          updateTime: '2024-6-11 10:33:00 ',
          isDisabled: '否'
      listPlat( this.queryParams).then((res) => {
        if (res.code == 200) {
          this.expertList = res.rows
          this.total = res.total
          this.loading = false;
        }
      ]
      this.total = 2
      this.loading = false;
      })
    },
    handleDelete(val) {
      this.$confirm('删除此条信息,是否继续', '提示', {
@@ -123,36 +110,64 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // delExam( val.siteId).then((res) => {
        //   if (res.code == 200) {
        //     this.$message({
        //       type:'success',
        //       message: '删除成功'
        //     })
        //     this.getList()
        //   }
        // })
        delPlat( val.id).then((res) => {
          if (res.code == 200) {
            this.$message({
              type:'success',
              message: '删除成功'
            })
            this.getList()
          }
        })
      })
    },
    handleAdd(type,data){
      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('确认禁用该平台?', '提示', {