| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style="margin-bottom: 10px"> |
| | | <el-button type="success" plain @click="openDialog('addFirst',{courseId: data.courseId})">章添加</el-button> |
| | | <div style="margin-bottom: 10px;display:flex;justify-content: space-between;align-items: center"> |
| | | <el-button type="success" plain @click="openDialog('addFirst',{courseId: data.courseId})" :disabled="disabled">章添加</el-button> |
| | | <el-button type="primary" plain @click="back">返回</el-button> |
| | | </div> |
| | | <!-- 表格数据 --> |
| | |
| | | <el-table-column label="排序" prop="sort" align="center" width="80" /> |
| | | <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)" v-if="!scope.row.chapterId">节添加</el-button> |
| | | <el-button type="primary" plain @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button type="danger" plain @click="handleDelete(scope.row)">删除</el-button> |
| | | <el-button type="success" plain @click="openDialog('add',scope.row)" v-if="!scope.row.chapterId" :disabled="disabled">节添加</el-button> |
| | | <el-button type="primary" plain @click="openDialog('edit',scope.row)" :disabled="disabled">编辑</el-button> |
| | | <el-button type="danger" plain @click="handleDelete(scope.row)" :disabled="disabled">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | import {useRoute,useRouter} from 'vue-router' |
| | | import {delClassification, getClassification} from "@/api/onlineEducation/courseClass"; |
| | | import {delChapter, delPeriod, getChapters} from "@/api/onlineEducation/chapters"; |
| | | import Cookies from "js-cookie"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const route = useRoute() |
| | | const router = useRouter(); |
| | |
| | | }); |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | |
| | | const backValue = ref() |
| | | const disabled = ref(false) |
| | | //页面加载 |
| | | onMounted(() => { |
| | | |
| | | data.courseId = route.query.courseId |
| | | backValue.value = JSON.parse(route.query.val) |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | if((backValue.value.state === 2 || backValue.value.state === 1 ) && userInfo.userType == 1){ |
| | | disabled.value = true; |
| | | } |
| | | data.courseId = backValue.value.id |
| | | console.log("rou",data.courseId) |
| | | getList(); |
| | | }); |
| | |
| | | }) |
| | | } |
| | | const back = () => { |
| | | router.push("/courseManage/course"); |
| | | |
| | | const obj = { |
| | | pageNum: backValue.value.pageNum, |
| | | pageSize: backValue.value.pageSize, |
| | | } |
| | | const v = JSON.stringify(obj) |
| | | router.push({ path: "/courseManage/course", query: { val: v } }); |
| | | } |
| | | |
| | | |