课程添加自考开关

This commit is contained in:
@fawn-nine
2024-10-16 13:06:15 +08:00
parent be61850df2
commit 80948d6d59
2 changed files with 16 additions and 4 deletions

View File

@@ -24,7 +24,13 @@
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input> <el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="自考开关" prop="canzk">
<el-switch
v-model="dataForm.canzk"
active-text="开启"
inactive-text="关闭">
</el-switch>
</el-form-item>
<el-form-item <el-form-item
label="课程图" label="课程图"
prop="image" prop="image"
@@ -243,7 +249,8 @@ export default {
id: 0, id: 0,
title: "", title: "",
etitle:'', etitle:'',
titleAbbr:'' titleAbbr:'',
canzk: false, // 是否开启自考
// publisherName: '', // publisherName: '',
// splits: 0, // splits: 0,
// authorId: [], // authorId: [],
@@ -420,6 +427,7 @@ export default {
attr.push(img); attr.push(img);
this.fileList = attr; this.fileList = attr;
} }
data.canzk = data.canzk == '1' ? true : false
this.dataForm = { ...data }; this.dataForm = { ...data };
} }
}); });
@@ -461,6 +469,7 @@ export default {
data: this.$http.adornData({ data: this.$http.adornData({
id: this.dataForm.id || undefined, id: this.dataForm.id || undefined,
title: this.dataForm.title, title: this.dataForm.title,
canzk: this.dataForm.canzk ? '1' : '0', // 是否可以自考 0/ 1 0 否 1 是
sort: this.dataForm.sort, sort: this.dataForm.sort,
image: this.dataForm.image, image: this.dataForm.image,
content: this.dataForm.content, content: this.dataForm.content,
@@ -478,6 +487,8 @@ export default {
this.visible = false; this.visible = false;
this.relationProductIds = [] this.relationProductIds = []
this.relationProducts = [] this.relationProducts = []
this.dataForm.canzk = false
this.$emit("refreshDataList"); this.$emit("refreshDataList");
} }
}); });

View File

@@ -532,14 +532,14 @@ export default {
examProportion: this.ClassModelForm.singleChoice + ":" + this.ClassModelForm.multipleChoice, // 单选:多选 examProportion: this.ClassModelForm.singleChoice + ":" + this.ClassModelForm.multipleChoice, // 单选:多选
examTime:parseInt(this.ClassModelForm.examTime), // 考试时长 examTime:parseInt(this.ClassModelForm.examTime), // 考试时长
}) })
}).then(({ data }) => { }).then(({ data }) => {
this.flag = false;
if (data && data.code == 0) { if (data && data.code == 0) {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.$nextTick(() => { this.$nextTick(() => {
this.handleClose(); this.handleClose();
}); });
} else { } else {
this.flag = false;
this.$message.error(data.msg); this.$message.error(data.msg);
} }
}).catch(e =>{ }).catch(e =>{
@@ -637,6 +637,7 @@ export default {
this.$refs["ClassModelForm"].resetFields(); this.$refs["ClassModelForm"].resetFields();
this.userList = []; this.userList = [];
this.courseList = []; this.courseList = [];
this.flag = false;
}); });
this.$emit("handleClose"); this.$emit("handleClose");
} }