From c3bb35b20d6e076f73a1cad50fd6b9b94ca399a7 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期一, 06 一月 2025 16:15:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/onlineEducation/platformManage/index.vue |  130 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 96 insertions(+), 34 deletions(-)

diff --git a/src/views/onlineEducation/platformManage/index.vue b/src/views/onlineEducation/platformManage/index.vue
index 06ae0cf..6a4bf1a 100644
--- a/src/views/onlineEducation/platformManage/index.vue
+++ b/src/views/onlineEducation/platformManage/index.vue
@@ -8,25 +8,40 @@
     >新增</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" >
+        <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"
-            icon="el-icon-view"
+            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"
             @click="handleAdd('edit',scope.row)"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             style="color: #f56c6c"
-            icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:experts:remove']"
           >删除</el-button>
@@ -36,7 +51,7 @@
     <pagination
       v-show="total>0"
       :total="total"
-      :page.sync="queryParams.pageIndex"
+      :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
@@ -47,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},
@@ -60,7 +76,7 @@
       total: 0,
       expertList: [],
       queryParams: {
-        pageIndex: 1,
+        pageNum: 1,
         pageSize: 10
       },
       classiFy: [],
@@ -79,33 +95,82 @@
   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 '
-
-        },
-        {
-          id: 2,
-          name: '测试数据3',
-          AccessKey: '14564',
-          SecretKey: '16665',
-          people: '李四',
-          phone: '13453456456',
-          updateTime: '2024-6-11 10:33:00 '
-
+      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('删除此条信息,是否继续', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        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){
+      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('确认禁用该平台?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
@@ -121,9 +186,6 @@
         // })
       })
     },
-    handleAdd(type,data){
-      this.$refs.addDialogRef.openDialog(type, data);
-    }
   }
 };
 </script>

--
Gitblit v1.9.2