Commit 524a971b authored by 纪泽龙's avatar 纪泽龙

试卷考试详情添加完毕,发布提示优化完成

parent 39aed7b5
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 15:23:58
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-21 16:56:26
* @LastEditTime: 2023-02-01 17:24:30
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/Lesson-table.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -16,7 +16,10 @@
@select-all="all"
ref="multipleTable"
>
<el-table-column type="selection"></el-table-column>
<el-table-column
v-if='!disabled'
type="selection"
></el-table-column>
<el-table-column label="姓名" align="center" prop="staffName">
</el-table-column>
<el-table-column
......@@ -55,10 +58,14 @@ export default {
selectNameList: {
type: Array,
},
disabled: {
type: Boolean,
},
},
created() {
// this.listStaff();
},
data() {
return {
queryParams: {
......@@ -71,6 +78,9 @@ export default {
nameList: [],
loading: false,
};
},
mounted() {
},
methods: {
listStaff() {
......@@ -109,6 +119,11 @@ export default {
}
this.$emit("selectAll", this.nameList, allSelect);
},
selectable(row, rowIndex) {
if (!this.disabled) {
return true;
}
},
// 切换选项
toggleSelection(staffId, SeclctFlag = false) {
const item = this.nameList.find((item) => {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 17:39:55
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-13 15:37:54
* @LastEditTime: 2023-02-02 10:56:52
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangePapel.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -36,13 +36,14 @@
>
</el-input>
<div>
<el-button @click="searchTable" size="mini">搜索</el-button>
<el-button @click="searchTable" size="mini">搜索</el-button>
</div>
</div>
<div class="left-middle-table">
<ChangPapelTable
ref="table"
:selectNameList.sync="selectNameList"
:disabled="disabled"
@selectOne="selectOne"
@selectAll="selectAll"
/>
......@@ -60,7 +61,7 @@
:key="item.staffId"
>
<div>{{ item.staffName }}</div>
<div class="close" @click="deleteName(item.staffId)">x</div>
<div class="close" @click="deleteName(item.staffId)">x</div>
</div>
</div>
<div class="bottom-text">已选择{{selectNameList.length}}</div>
......@@ -83,6 +84,9 @@ export default {
type: String,
default: null,
},
disabled:{
type:Boolean,
}
},
data() {
return {
......@@ -143,6 +147,7 @@ export default {
this.$refs.table.listStaff();
},
deleteName(staffId) {
if(this.disabled) return;
const index = this.selectNameList.findIndex((item) => {
return item.staffId == staffId;
});
......
......@@ -89,6 +89,7 @@
type="danger"
v-if="index > 0"
@click.prevent="removeDomain(question)"
:disabled="checkLock"
>删除</el-button
>
</div>
......@@ -121,7 +122,7 @@
<div style="padding-left: 30px" v-if="form.topicType != 3">
<el-button
size="mini"
:disabled="!checkLock"
:disabled="checkLock"
type="primary"
@click.prevent="add(addValue)"
>新增选项</el-button
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-02-01 15:51:54
* @LastEditTime: 2023-02-02 10:05:15
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......
......@@ -133,7 +133,9 @@
>
<template v-slot="{ row: { topicNum, courseId, status } }">
<div @click="checkQuestion(courseId, status)" class="timuNum">
<div v-if="topicNum > 0">{{status==0? `已录入${topicNum}题`:'查看' }}</div>
<div v-if="topicNum > 0">
{{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</div>
<div v-else>未录入</div>
</div>
</template>
......@@ -173,7 +175,7 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="issueLesson(courseId)"
@click="issueDilog(courseId)"
>发布</el-button
>
</template>
......@@ -194,16 +196,65 @@
:checkLock.sync="checkLock"
:visible.sync="dilogFlag"
/>
<el-dialog title="发布详情" :visible.sync="issueVisible" width="60%">
<div class="detail flex">
<div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
>/,<span>{{ danxs }}</span
>题,计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore
}}</span
>
</div>
<div class="detail-item">
多选题<span>{{ bottomFrom.multipleChoiceScore }}</span
>/,<span>{{ duoxs }}</span> 题,计<span class="textC">{{
duoxs * bottomFrom.multipleChoiceScore
}}</span
>
</div>
<div class="detail-item">
判断提<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
<div class="detail-item">
一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
}}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button>
<el-button type="primary" @click="issueLesson(issueCourseId)"
>确认发布</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getQuestion,
getLessons,
getLessonById,
issue,
deleteLesson,
} from "@/api/educationPlanExam/lessonsProgram.js";
// 获取培训计划
import { getPlanList } from "@/api/educationPlanExam/trainingProgram";
import { mapGetters, mapMutations } from "vuex";
......@@ -231,11 +282,21 @@ export default {
courseName: null,
releaseTime: "",
},
// 表单参数
form: {},
// 表单校验
dilogFlag: false,
// 发布弹框
issueVisible: false,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
judgmentScore: 0,
qualifiedNum: 0,
},
issueCourseId: null,
questionList: [],
componentsNum: 1,
// 点击的id,如果是新增为空
courseId: null,
......@@ -245,6 +306,15 @@ export default {
},
computed: {
...mapGetters(["courseOptions"]),
danxs() {
return this.questionList.filter((item) => item.topicType === 1).length;
},
duoxs() {
return this.questionList.filter((item) => item.topicType === 2).length;
},
pds() {
return this.questionList.filter((item) => item.topicType === 3).length;
},
},
created() {
this.getPlanList();
......@@ -355,9 +425,39 @@ export default {
})
.catch(() => {});
},
// 发布弹框
issueDilog(courseId) {
getQuestion({courseId})
.then((res) => {
this.questionList = res.rows.map((item) => {
return {
topicType: item.topicType,
topicId: item.topicId,
topicTitle: item.topicTitle,
};
});
})
.then((res) => {
return getLessonById(courseId);
})
.then((res) => {
this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore,
multipleChoiceScore: res.data.multipleChoiceScore,
judgmentScore: res.data.judgmentScore,
qualifiedNum: res.data.qualifiedNum,
};
})
.then((res) => {
this.issueVisible = true;
this.issueCourseId = courseId;
});
//
},
// 发布
issueLesson(courseId) {
this.$confirm("请确定发布", {
this.$confirm("确定要发布吗", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -367,14 +467,14 @@ export default {
return getLessonById(courseId);
})
.then((res) => {
if (
res.data.singleChoiceScore > 0 &&
res.data.multipleChoiceScore > 0 &&
res.data.judgmentScore > 0 &&
res.data.qualifiedNum > 0
) {
return true;
}
// if (
// res.data.singleChoiceScore >= 0 &&
// res.data.multipleChoiceScore >= 0 &&
// res.data.judgmentScore >= 0 &&
// res.data.qualifiedNum >= 0
// ) {
return true;
// }
})
.then((res) => {
if (res) {
......@@ -394,6 +494,7 @@ export default {
type: "success",
});
this.getList();
this.issueVisible = false;
}
})
.catch(() => {});
......@@ -493,4 +594,17 @@ export default {
::v-deep .el-dialog {
margin-top: 15vh !important;
}
.detail {
// position: absolute;
// bottom: -20px;
// left: 10px;
.textC {
font-weight: 800;
font-size: 18px;
}
.detail-item {
margin-right: 20px;
color: red;
}
}
</style>
......@@ -11,9 +11,15 @@
size="mini"
@input="topicTypeChange"
>
<el-radio-button :label="1">单选</el-radio-button>
<el-radio-button :label="2">多选</el-radio-button>
<el-radio-button :label="3">判断</el-radio-button>
<el-radio-button :disabled="checkLock" :label="1"
>单选</el-radio-button
>
<el-radio-button :disabled="checkLock" :label="2"
>多选</el-radio-button
>
<el-radio-button :disabled="checkLock" :label="3"
>判断</el-radio-button
>
</el-radio-group>
</div>
<div class="right">{{ courseName }}</div>
......@@ -28,7 +34,7 @@
:rules="{
required: true,
message: '必须输入题目内容',
trigger: 'blur',
trigger: ['blur', 'change'],
}"
>
<el-input
......@@ -37,6 +43,7 @@
resize="none"
rows="4"
v-model="form.topicTitle"
:disabled="checkLock"
>
</el-input>
</el-form-item>
......@@ -54,7 +61,7 @@
:rules="{
required: true,
message: '第一项不能为空不能为空',
trigger: 'blur',
trigger: ['blur', 'change'],
}"
>
<div class="add-select flex">
......@@ -64,6 +71,7 @@
style="flex: 1; margin-right: 10px"
rows="2"
v-model="question.value"
:disabled="checkLock"
></el-input>
<div class="flex algin-items">
<div
......@@ -78,6 +86,7 @@
type="danger"
v-if="index > 0"
@click.prevent="removeDomain(question)"
:disabled="checkLock"
>删除</el-button
>
</div>
......@@ -108,7 +117,11 @@
设为正确答案
</div> -->
<div style="padding-left: 30px">
<el-button size="mini" type="primary" @click.prevent="add(addValue)"
<el-button
size="mini"
type="primary"
@click.prevent="add(addValue)"
:disabled="checkLock"
>新增选项</el-button
>
</div>
......@@ -143,6 +156,9 @@ export default {
topicId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
components: {},
data() {
......@@ -229,6 +245,7 @@ export default {
}
},
rightAnswerClick(index) {
if (this.checkLock) return;
if (this.form.topicType === 2) {
const ind = this.answerNum.indexOf(index);
if (ind < 0) {
......@@ -247,6 +264,7 @@ export default {
},
// 删除选项
removeDomain(question) {
if (this.checkLock) return;
const index = this.form.questions.indexOf(question);
console.log(index);
// 如果是正确答案,就让正确答案清空
......@@ -333,9 +351,9 @@ export default {
reset() {
this.form = {
topicTitle: "",
questions: [{ value: "" }, { value: "" }, { value: "" }],
questions: [{ value: "" }, { value: "" }],
};
this.answerNum = null;
this.answerNum = [];
this.addValue = "";
},
},
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-28 10:29:18
* @LastEditTime: 2023-02-01 18:02:14
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangeQuestion.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -193,7 +193,7 @@ export default {
this.loading = false;
});
},
saveAndNext() {
save(num = 2) {
const topicInfos = this.list
.filter((item) => item.checked)
.map((item) => {
......@@ -202,18 +202,20 @@ export default {
quan: item.changeNum,
};
});
console.log(this.courseId, topicInfos);
const data = { courseId: this.courseId, topicInfos };
console.log(data);
bachAddTopic(data).then((res) => {
console.log(res);
if (res.code == 200) {
this.$parent.$parent.componentsNumChange(2);
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.$parent.getList();
}
});
},
saveAndNext() {
this.save(3);
},
resetClick() {},
search() {
this.getList();
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-28 10:31:06
* @LastEditTime: 2023-02-01 17:34:25
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -24,6 +24,7 @@
:is="currentComponent"
:courseId.sync="courseId"
:topicId.sync="topicId"
:checkLock="checkLock"
ref="current"
></component>
</transition>
......@@ -32,7 +33,7 @@
<QuestionList/> -->
</div>
<div slot="footer" class="dialog-footer">
<!-- <div slot="footer" class="dialog-footer">
<el-button
type="primary"
v-if="this.componentsNum == 2"
......@@ -62,6 +63,51 @@
>{{ "确认" }}</el-button
>
<el-button @click="dialogCancel">取消</el-button>
</div> -->
<div slot="footer" class="dialog-footer" v-if="!checkLock">
<el-button
type="primary"
v-if="this.componentsNum == 2 && !checkLock"
@click="componentsNumChange(4)"
>从题库选择</el-button
>
<el-button
type="primary"
v-if="this.componentsNum == 4 || this.componentsNum == 3"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button
type="primary"
v-if="
this.componentsNum == 1 ||
this.componentsNum == 3 ||
this.componentsNum == 4
"
@click="save"
>保存</el-button
>
<el-button type="primary" @click="saveAndNext" v-if="!checkLock">{{
saveNextText
}}</el-button>
<el-button
v-if="this.componentsNum == 2"
type="primary"
@click="dialogCancel"
>{{ "确认" }}</el-button
>
<el-button @click="dialogCancel">取消</el-button>
</div>
<div slot="footer" class="dialog-footer" v-else>
<el-button
type="primary"
v-if="this.componentsNum == 3 && checkLock"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button type="primary" @click="dialogCancel">{{ "确认" }}</el-button>
<el-button @click="dialogCancel">取消</el-button>
</div>
</el-dialog>
</template>
......@@ -86,6 +132,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
// components: {
// Lesson,
......@@ -137,11 +186,9 @@ export default {
text = "保存并录入题目";
} else if (this.componentsNum == 2) {
text = "录入考题";
} else if (this.componentsNum == 3) {
} else {
text = "保存并录入下一题";
} else {
text = "确定选择";
}
}
return text;
},
},
......@@ -168,6 +215,7 @@ export default {
this.topicId = null;
}
this.$emit("update:visible", false);
this.$emit("update:checkLock", false);
},
// 把ID改变了
changeCourseId(courseId) {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-26 16:31:34
* @LastEditTime: 2023-02-01 16:58:26
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -16,7 +16,11 @@
:rules="rules"
>
<el-form-item label="考试标题" prop="courseName">
<el-input style="width: 700px" v-model="form.courseName"></el-input>
<el-input
:disabled="checkLock"
style="width: 700px"
v-model="form.courseName"
></el-input>
</el-form-item>
<div class="top flex">
<el-form-item label="开始时间" prop="testStartTime">
......@@ -27,6 +31,7 @@
type="datetime"
placeholder="选择日期时间"
default-time="00:00:00"
:disabled="checkLock"
/>
</el-form-item>
<el-form-item label="结束时间" prop="testEndTime">
......@@ -36,6 +41,7 @@
type="datetime"
placeholder="选择日期时间"
default-time="00:00:00"
:disabled="checkLock"
/>
</el-form-item>
</div>
......@@ -43,6 +49,7 @@
<ChangePapel
ref="changePaple"
:jsonSelectNameList="jsonSelectNameList"
:disabled="checkLock"
@getPeopleList="getPeopleList"
/>
</el-form-item>
......@@ -70,6 +77,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
components: {
// Editor,
......@@ -196,14 +206,17 @@ export default {
message: "保存课程成功",
type: "success",
});
this.$parent.$parent.dialogCancel();
} else if (num == 3) {
this.$message({
message: "保存课程成功,请开始录入题目",
type: "success",
});
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.changeCourseId(courseId);
}
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.changeCourseId(courseId);
// this.$parent.$parent.componentsNumChange(num);
// this.$parent.$parent.changeCourseId(courseId);
this.$parent.$parent.$parent.getList();
return true;
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-31 14:04:09
* @LastEditTime: 2023-02-01 17:45:09
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -34,13 +34,15 @@
>
</div>
<div class="detail-item">
判断提<span>{{ bottomFrom.judgmentScore }}</span>/题,共<span>{{ pds }}</span> 题,计<span
class="textC"
>{{ pds * bottomFrom.judgmentScore }}</span
判断提<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
一共<span>{{ danxs + duoxs + pds }}</span>道题,总共计<span class="textC">{{
一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
......@@ -70,12 +72,21 @@
<div class="right">
<div>
<el-button
v-if="!checkLock"
@click="edit(item.topicId)"
icon="el-icon-edit"
type="text"
>修改</el-button
>
<el-button
v-if="checkLock"
@click="edit(item.topicId)"
icon="el-icon-edit"
type="text"
>查看</el-button
>
<el-button
v-if="!checkLock"
@click="deleteLesson(item.topicId)"
icon="el-icon-delete"
type="text"
......@@ -106,6 +117,7 @@
v-model="bottomFrom.singleChoiceScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -117,6 +129,7 @@
v-model="bottomFrom.multipleChoiceScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -129,6 +142,7 @@
v-model="bottomFrom.judgmentScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -141,6 +155,7 @@
v-model="bottomFrom.qualifiedNum"
style="width: 60px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div>为合格</div>
......@@ -151,6 +166,7 @@
icon="el-icon-check"
size="mini"
type="success"
:disabled="checkLock"
>保存</el-button
>
</div>
......@@ -171,6 +187,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
components: {},
data() {
......
......@@ -82,9 +82,11 @@
prop="topicNum"
width="180"
>
<template v-slot="{ row: { topicNum, courseId } }">
<div class="timuNum">
<div v-if="topicNum > 0">{{ `已录入${topicNum}题` }}</div>
<template v-slot="{ row: { topicNum, courseId, status } }">
<div class="timuNum" @click="checkQuestion(courseId, status)">
<div v-if="topicNum > 0">
{{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</div>
<div v-else>未录入</div>
</div>
</template>
......@@ -102,15 +104,14 @@
>
<template v-slot="{ row: { status, courseId, qualifiedNum } }">
<!-- <div>{{status}}</div> -->
<el-button
:disabled="status == 1"
<!-- <el-button
v-if="status == 0"
size="mini"
type="text"
icon="el-icon-edit"
@click="checkQuestion(courseId)"
>录入考题</el-button
>
> -->
<el-button
v-if="status == 0"
size="mini"
......@@ -139,8 +140,8 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="issueLesson(courseId, qualifiedNum)"
>发布考试</el-button
@click="issueDilog(courseId)"
>发布</el-button
>
</template>
</el-table-column>
......@@ -157,17 +158,62 @@
ref="Dia"
:componentsNum.sync="componentsNum"
:courseId.sync="courseId"
:checkLock="checkLock"
:checkLock.sync="checkLock"
:visible.sync="dilogFlag"
/>
<el-dialog title="提示" :visible.sync="issue" width="30%">
<div>123</div>
<el-dialog title="发布详情" :visible.sync="issueVisible" width="60%">
<div class="detail flex">
<div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
>/,<span>{{ danxs }}</span
>题,计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore
}}</span
>
</div>
<div class="detail-item">
多选题<span>{{ bottomFrom.multipleChoiceScore }}</span
>/,<span>{{ duoxs }}</span> 题,计<span class="textC">{{
duoxs * bottomFrom.multipleChoiceScore
}}</span
>
</div>
<div class="detail-item">
判断提<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
<div class="detail-item">
一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
}}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button>
<el-button type="primary" @click="issueLesson(issueCourseId)"
>确认发布</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getQuestion,
getLessons,
getLessonById,
issue,
......@@ -207,6 +253,17 @@ export default {
// 表单校验
dilogFlag: false,
// 发布
issueVisible: false,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
judgmentScore: 0,
qualifiedNum: 0,
},
issueCourseId: null,
questionList: [],
componentsNum: 1,
// 点击的id,如果是新增为空
courseId: null,
......@@ -217,6 +274,15 @@ export default {
},
computed: {
...mapGetters(["courseOptions"]),
danxs() {
return this.questionList.filter((item) => item.topicType === 1).length;
},
duoxs() {
return this.questionList.filter((item) => item.topicType === 2).length;
},
pds() {
return this.questionList.filter((item) => item.topicType === 3).length;
},
},
created() {
// this.getPlanList();
......@@ -280,7 +346,7 @@ export default {
this.courseId = courseId;
this.dilogFlag = true;
},
checkLesson(courseId) {
checkLesson(courseId) {
this.checkLock = true;
this.$refs.Dia.title = "修改考试试卷";
this.componentsNum = 1;
......@@ -289,8 +355,12 @@ export default {
},
// 直接查看考题
checkQuestion(courseId) {
checkQuestion(courseId, status) {
// 要查看考题的id
if (status == 1) {
this.checkLock = true;
}
this.courseId = courseId;
console.log(this.courseId);
// 2代表列表组件
......@@ -334,8 +404,39 @@ export default {
.catch(() => {});
},
// 发布
issueLesson(courseId, qualifiedNum) {
this.$confirm("请确定发布", {
issueDilog(courseId) {
getQuestion({courseId})
.then((res) => {
console.log(res)
this.questionList = res.rows.map((item) => {
return {
topicType: item.topicType,
topicId: item.topicId,
topicTitle: item.topicTitle,
};
});
})
.then((res) => {
return getLessonById(courseId);
})
.then((res) => {
this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore ||0,
multipleChoiceScore: res.data.multipleChoiceScore||0,
judgmentScore: res.data.judgmentScore||0,
qualifiedNum: res.data.qualifiedNum||0,
};
})
.then((res) => {
this.issueVisible = true;
this.issueCourseId = courseId;
});
//
},
issueLesson(courseId) {
this.$confirm("确定要发布吗", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -345,14 +446,14 @@ export default {
return getLessonById(courseId);
})
.then((res) => {
if (
res.data.singleChoiceScore > 0 &&
res.data.multipleChoiceScore > 0 &&
res.data.judgmentScore > 0 &&
res.data.qualifiedNum > 0
) {
return true;
}
// if (
// res.data.singleChoiceScore > 0 &&
// res.data.multipleChoiceScore > 0 &&
// res.data.judgmentScore > 0 &&
// res.data.qualifiedNum > 0
// ) {
return true;
// }
})
.then((res) => {
if (res) {
......@@ -374,6 +475,7 @@ export default {
type: "success",
});
this.getList();
this.issueVisible = false;
}
})
.catch(() => {});
......@@ -392,7 +494,7 @@ export default {
}
.timuNum {
color: #1d84ff;
// cursor: pointer;
cursor: pointer;
}
::v-deep .el-select {
width: 100%;
......@@ -400,4 +502,17 @@ export default {
::v-deep .el-dialog {
margin-top: 15vh !important;
}
.detail {
// position: absolute;
// bottom: -20px;
// left: 10px;
.textC {
font-weight: 800;
font-size: 18px;
}
.detail-item {
margin-right: 20px;
color: red;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment