修改部分会议提到的bug

This commit is contained in:
2023-03-14 18:11:48 +08:00
parent afcb62b4eb
commit 92657ea736
18 changed files with 1186 additions and 284 deletions

View File

@@ -27,6 +27,7 @@ const props = defineProps(['course_id','chapter_info'])
const emit = defineEmits(['reload'])
import UploadCommon from '@/components/upload/common.vue'
// 变量
const is_sub = ref(-1)
const dialogChapterVisible = ref(false)
// const dialogChapterTitle = ref('')
const chapterForm = ref({pid:0,sort:0})
@@ -61,6 +62,7 @@ function addChapterFunc() { // 添加大章节
dialogChapterTitle.value = '添加大章节'
}
async function deleteChapterFunc(item) { //删除大章节
is_sub.value = -1
delFunc(item.course_chapter_id)
}
function delFunc(id) {
@@ -71,7 +73,9 @@ function delFunc(id) {
})
.then(async() => {
const res = await api.delChapter({
ids:[id]
ids:[id],
course_id:parseInt(props.course_id),
sub:parseInt(is_sub.value)
})
if (res.code === 0) {
ElMessage({
@@ -132,14 +136,17 @@ function editChapterChildFunc(item,main_index) { // 打开编辑子章节窗口
// item.exam_ids =item.exam_id?[item.exam_id]: []
item.examination_id = item.exam_id
chapterChildForm.value = _.cloneDeep(item)
chapterChildForm.value.price /= 100
dialogChapterChildVisible.value = true
}
function deleteChapterChildFunc(item) { // 删除子章节
is_sub.value = 1
delFunc(item.course_subsection_id)
}
async function enterChapterChildDialog() { // 提交小章节
chapterChildForm.value.sort = parseInt(chapterChildForm.value.sort)
chapterChildForm.value.price = parseInt(chapterChildForm.value.price)
// chapterChildForm.value.price = parseInt(chapterChildForm.value.price*100)
chapterChildForm.value.price = chapterChildForm.value.price*100
const params = {
...chapterChildForm.value
}
@@ -219,7 +226,9 @@ function addExamFunc(data) {
{{scope.row.exam_id === 0?'未添加习题':scope.row.exam_id}}
</template>
</el-table-column>
<el-table-column align="left" label="章节价格" min-width="60" prop="price" />
<el-table-column align="left" label="章节价格" min-width="60" prop="price">
<template #default="scope">{{scope.row.price/100}}</template>
</el-table-column>
<!-- <el-table-column align="left" label="是否免费" min-width="60">-->
<!-- <template #default="scope">-->
<!-- {{scope.row.is_free === 1? '是':'否'}}-->