mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-24 02:02:55 +08:00
feat(course): 添加自定义考试功能并优化试卷组件
- 新增自定义考试试卷类型支持 - 实现试卷预览和编辑功能 - 添加试题管理组件,支持单选、多选、判断题 - 集成雪花ID生成器用于试题唯一标识 - 优化课程创建流程,支持考试内容配置 - 扩展SCSS样式库,增加flex布局和间距工具类 - 新增课程API模块,完善考试相关接口 - 实现试卷内容动态加载和保存逻辑
This commit is contained in:
@@ -118,18 +118,41 @@ const columns = [
|
||||
];
|
||||
|
||||
// 事件发射
|
||||
const emit = defineEmits(["chooseItem", "choosePreviewItem"]);
|
||||
const emit = defineEmits(["chooseItem", "choosePreviewItem", "chooseCusExam"]);
|
||||
|
||||
// 处理选择项目
|
||||
const handleChooseItem = (row) => {
|
||||
emit("chooseItem", {
|
||||
switch (props.resType) {
|
||||
case 61:
|
||||
console.log(row);
|
||||
if (row.counts === 0) {
|
||||
ElMessage.error("此试卷无试题内容,请重新选择");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// emit("chooseItem", {
|
||||
// ...row,
|
||||
// isDrag: false,
|
||||
// completeSetup: 0,
|
||||
// setupTage: "",
|
||||
// resType: props.resType,
|
||||
// dir: props.resType === 50 ? "scorm" : "course",
|
||||
// });
|
||||
break;
|
||||
}
|
||||
let obj = {
|
||||
...row,
|
||||
isDrag: false,
|
||||
completeSetup: 0,
|
||||
setupTage: "",
|
||||
resType: props.resType,
|
||||
dir: props.resType === 50 ? "scorm" : "course",
|
||||
});
|
||||
};
|
||||
if (props.resType === 61) {
|
||||
obj.paperType = 2;
|
||||
}
|
||||
emit("chooseItem", obj);
|
||||
};
|
||||
|
||||
const handlePreviewItem = (row) => {
|
||||
@@ -267,6 +290,14 @@ const handleBeforeUpload = (file) => {
|
||||
|
||||
return true;
|
||||
};
|
||||
const openCusExam = () => {
|
||||
emit("chooseCusExam", {
|
||||
resType: props.resType,
|
||||
dir: props.resType === 50 ? "scorm" : "course",
|
||||
paperType: 1,
|
||||
name: "自定义考试",
|
||||
});
|
||||
};
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
@@ -292,7 +323,10 @@ onMounted(() => {
|
||||
>上传新{{ getType(props.resType) }}</el-button
|
||||
>
|
||||
</el-upload>
|
||||
<el-button v-if="[61].includes(props.resType)" type="primary"
|
||||
<el-button
|
||||
v-if="[61].includes(props.resType)"
|
||||
type="primary"
|
||||
@click="openCusExam"
|
||||
>自定义考试</el-button
|
||||
>
|
||||
<span class="desc ml10" v-if="![61].includes(props.resType)"
|
||||
|
||||
Reference in New Issue
Block a user