From 55f821ecb4b61bda2e4308b0a04b5ec0d767b31e Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期五, 16 八月 2024 09:58:58 +0800 Subject: [PATCH] 修改 --- src/views/onlineEducation/platformManage/index.vue | 84 ++++++++++++++++++++++++++++-------------- 1 files changed, 56 insertions(+), 28 deletions(-) diff --git a/src/views/onlineEducation/platformManage/index.vue b/src/views/onlineEducation/platformManage/index.vue index b815984..6a4bf1a 100644 --- a/src/views/onlineEducation/platformManage/index.vue +++ b/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('确认禁用该平台?', '提示', { -- Gitblit v1.9.2