From 55cc4c8bbbd66ce4b33fff8712d4c53e2080b5a0 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期一, 22 七月 2024 16:25:25 +0800
Subject: [PATCH] 提交

---
 src/views/onlineEducation/systemManage/courseClassification/index.vue |  118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 111 insertions(+), 7 deletions(-)

diff --git a/src/views/onlineEducation/systemManage/courseClassification/index.vue b/src/views/onlineEducation/systemManage/courseClassification/index.vue
index d868c47..a3234ac 100644
--- a/src/views/onlineEducation/systemManage/courseClassification/index.vue
+++ b/src/views/onlineEducation/systemManage/courseClassification/index.vue
@@ -1,12 +1,116 @@
 <template>
-<div>课程分类</div>
+  <div class="app-container">
+    <div>
+      <el-form style="display: flex;flex-wrap: wrap">
+        <el-form-item>
+          <el-button type="primary" plain @click="openDialog('addFirst',{})" icon="Plus"> 添加</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+<!--    <div style="margin-bottom: 10px">-->
+<!--      <el-form>-->
+<!--        <el-form-item label="分类名称">-->
+<!--          <el-input style="width: 20%" v-model="data.queryParams.name "></el-input>-->
+<!--          <el-button type="primary" style="margin-left: 30px" @click="getList">查询</el-button>-->
+<!--          <el-button plain @click="reset">重置</el-button>-->
+<!--          <el-button type="success" plain @click="openDialog('addFirst',{})">添加</el-button>-->
+<!--        </el-form-item>-->
+
+<!--      </el-form>-->
+<!--    </div>-->
+    <!-- 表格数据 -->
+    <el-table v-loading="loading" :data="dataList" :border="true" row-key="id">
+      <el-table-column label="序号" type="index" align="center" width="80" />
+      <el-table-column label="名称" >
+        <template #default="scope">
+          <span>{{scope.row.name}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="排序" prop="sort" align="center" width="80" />
+      <el-table-column label="状态" prop="status" align="center"  width="80">
+        <template #default="scope">
+          <span>{{scope.row.status ==0 ? '正常' : '停用'}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250" >
+        <template #default="scope">
+          <el-button type="success" plain @click="openDialog('add',scope.row)">添加</el-button>
+          <el-button type="primary" plain @click="openDialog('edit',scope.row)">编辑</el-button>
+          <el-button type="danger" plain @click="handleDelete(scope.row.id)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <class-dialog ref="areaRef" @getList="getList"></class-dialog>
+  </div>
 </template>
+
 <script setup>
+import {getCurrentInstance, onMounted, reactive, ref, toRefs} from "vue";
+import {ElMessage, ElMessageBox} from "element-plus";
+import classDialog from "./components/courseClassDialog.vue"
+import {delArea, getArea} from "@/api/backManage/area";
+import {getDictList} from "@/api/backManage/evaluate";
+import {delMonitor} from "@/api/sysUsers";
+import {delClassification, getClassification} from "@/api/onlineEducation/courseClass";
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const areaRef = ref();
+const cityList = ref([])
+const data = reactive({
+  queryParams: {
+    name: '',
+  },
+  total: 0,
+  dataList: [
+  ]
+});
+
+const { queryParams, total, dataList } = toRefs(data);
+
+//页面加载
+onMounted(() => {
+  getList();
+});
+const getList = async () => {
+  loading.value = true;
+  const res = await getClassification(data.queryParams);
+  if(res.code === 200){
+    dataList.value = res.data
+  }else{
+    ElMessage.warning(res.message)
+  }
+  loading.value = false;
+}
+
+const openDialog = (type, value) => {
+  areaRef.value.openDialog(type, value);
+}
+
+/** 重置新增的表单以及其他数据  */
+function reset() {
+ data.queryParams.name = '';
+ data.queryParams.pageNum = 1;
+ getList();
+}
+const handleDelete = (val) => {
+  ElMessageBox.confirm(
+      '确定删除此条数据?',
+      '提示',
+      {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+      .then( async() => {
+        const res = await delClassification(val)
+        if(res.code == 200){
+          ElMessage.success('数据删除成功')
+          await getList()
+        }else{
+          ElMessage.warning(res.message)
+        }
+      })
+}
+
 
 </script>
-
-
-
-<style scoped lang="scss">
-
-</style>

--
Gitblit v1.9.2