Commit da7f9600 authored by 纪泽龙's avatar 纪泽龙

题库管理类型展示,培训考试从题库录入

parent c809948b
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 17:39:55
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-26 09:36:52
* @LastEditTime: 2023-01-13 15:37:54
* @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
-->
......@@ -248,7 +248,7 @@ export default {
padding-left: 11px;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none; /* Chrome Safari */
// display: none; /* Chrome Safari */
}
.item {
width: 70px;
......
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-28 10:29:18
* @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
-->
<template>
<div class="table-wrapper">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="所属单位" prop="deptId" ref="treeItem">
<Treeselect
class="tree"
v-model="queryParams.deptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择归属部门"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="题库名称" prop="bankName">
<el-input
v-model="queryParams.bankName"
placeholder="考试时间"
clearable
size="small"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="search"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetClick"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" height="435" ref="multipleTable">
<!-- <el-table-column type="selection"></el-table-column> -->
<el-table-column label="" align="center" prop="profession">
<template v-slot="{ row }">
<!-- <div> -->
<el-checkbox
:disabled="row.numberQuestions == 0"
v-model="row.checked"
></el-checkbox>
<!-- </div> -->
</template>
</el-table-column>
<el-table-column label="题库名称" align="center" prop="bankName">
</el-table-column>
<el-table-column label="所属单位" align="center" prop="courseType">
<template v-slot="scope">
<div>
{{ selectList(deptOptions, scope.row.deptId) || "-" }}
</div>
</template>
</el-table-column>
<el-table-column
label="包含题目数量"
align="center"
prop="numberQuestions"
:formatter="formatter"
>
</el-table-column>
<el-table-column label="选取题目数量" align="center" prop="profession">
<template v-slot="{ row }">
<div>
<!-- <el-input
:disabled="!row.checked|| row.numberQuestions==0 "
v-model="row.changeNum"
size="mini"
style="width: 100px"
></el-input> -->
<el-input-number
v-model="row.changeNum"
:disabled="!row.checked || row.numberQuestions == 0"
size="mini"
:min="1"
:max="+row.numberQuestions ? +row.numberQuestions : 1000000"
label="描述文字"
></el-input-number>
</div>
</template>
</el-table-column>
</el-table>
<!-- <div> -->
<el-pagination
:layout="'prev, pager, next'"
v-show="total > 0"
:total="total"
:current-page="queryParams.pageNum"
:page-sizes="[queryParams.pageSize]"
@current-change="currentChangeClick"
/>
</div>
</template>
<script>
import { listBank, delBank } from "@/api/educationPlanExam/questionBank";
import { bachAddTopic } from "@/api/educationPlanExam/lessonsProgram.js";
// 部门列表
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "",
components: {
Treeselect,
},
props: {
courseId: {
type: Number,
},
},
data() {
return {
queryParams: {
deptId: null,
courseName: "",
pageNum: 1,
pageSize: 10,
},
list: [
{
checked: false,
},
],
total: 20,
loading: false,
// 题库id
deptId: null,
// 归属部门列表
deptOptions: [],
};
},
created() {
this.getList();
this.getTreeselect();
},
methods: {
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
// console.log("123", this.deptOptions);
// console.log(this.selectList(this.deptOptions, 175));
});
},
// 递归查值的方法
selectList(list, id) {
for (let i = 0; i < list.length; i++) {
let item = list[i];
if (item.id == id) {
return item.label;
} else {
if (Array.isArray(item.children)) {
let a = this.selectList(item.children, id);
if (a) {
return a;
}
}
}
}
},
getList() {
this.loading = true;
listBank(this.queryParams)
.then((res) => {
console.log(res);
this.list = res.rows.map((item, index) => {
return {
bankNum:
index +
1 +
(this.queryParams.pageNum - 1) * this.queryParams.pageSize,
checked: false,
changeNum: 0,
...item,
};
});
this.total = res.total;
})
.finally(() => {
this.loading = false;
});
},
saveAndNext() {
const topicInfos = this.list
.filter((item) => item.checked)
.map((item) => {
return {
bankId: item.bankId,
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.$parent.getList();
}
});
},
resetClick() {},
search() {
this.getList();
},
currentChangeClick() {},
formatter(row, column, cellValue, index) {
// console.log(row, column, cellValue, index);
if (!cellValue) return "-";
else return cellValue;
},
},
};
</script>
<style lang="scss" scoped>
.table-wrapper {
padding-top: 22px;
width: 100%;
height: 550px;
overflow: hidden;
// padding-bottom: 10px;
margin-bottom: 20px;
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-04 17:50:46
* @LastEditTime: 2023-01-13 15:59:47
* @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
-->
......@@ -18,7 +18,7 @@
@closed="closeFinished"
destroy-on-close
>
<div v-if="visible" ref="myBody" class="body ">
<div v-if="visible" ref="myBody" class="body">
<transition name="fade" mode="out-in">
<component
:is="currentComponent"
......@@ -33,13 +33,25 @@
</div>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
v-if="this.componentsNum == 2"
@click="componentsNumChange(4)"
>从题库选择</el-button
>
<el-button
type="primary"
v-if="this.componentsNum == 1 || this.componentsNum == 3"
@click="save"
>保存</el-button
>
<el-button
type="primary"
v-if="this.componentsNum == 4"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button type="primary" @click="saveAndNext">{{
saveNextText
}}</el-button>
......@@ -58,6 +70,8 @@
import Lesson from "./Lesson";
import AddQuestion from "./AddQuestion";
import QuestionList from "./QuestionList";
import ChangeQuestion from "./ChangeQuestion";
export default {
name: "AnswerLesson",
......@@ -102,13 +116,16 @@ export default {
this.currentComponent = QuestionList;
this.title = "题目列表";
} else {
} else if(num===3) {
this.currentComponent = AddQuestion;
if (this.topicId) {
this.title = "修改题目";
} else {
this.title = "新增题目";
}
}else if (num == 4) {
this.currentComponent = ChangeQuestion;
this.title = "从题库选题";
}
},
deep: true,
......@@ -146,7 +163,7 @@ export default {
// 隐藏与显示dialog
dialogCancel() {
// 录入考题的时候不会有修改的缓存
if (this.topicId) {
if (this.topicId) {
this.topicId = null;
}
this.$emit("update:visible", false);
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-12 16:43:02
* @LastEditTime: 2023-01-13 16:26:33
* @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
-->
......@@ -18,20 +18,35 @@
</div>
<div class="detail flex">
<div class="detail-item">
单选题{{bottomFrom.singleChoiceScore}}分/题,共{{ danxs }}题,计{{ danxs * bottomFrom.singleChoiceScore }}
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
>分/题,共<span>{{ danxs }}</span
>题,计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore
}}</span
>
</div>
<div class="detail-item">
多选题{{bottomFrom.multipleChoiceScore}}分/题,共{{ duoxs }}题,计{{ duoxs * bottomFrom.multipleChoiceScore }}
多选题<span>{{ bottomFrom.multipleChoiceScore }}</span
>分/题,共<span>{{ duoxs }}</span> 题,计<span class="textC">{{
duoxs * bottomFrom.multipleChoiceScore
}}</span
>
</div>
<div class="detail-item">
判断提{{bottomFrom.judgmentScore}}/题,共{{ pds }}题,计{{ pds * bottomFrom.judgmentScore }}
判断提<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
一共{{danxs+duoxs+pds}}道题,总共计{{
一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
}}
}}</span
>
</div>
</div>
......@@ -345,11 +360,15 @@ export default {
}
.detail {
position: absolute;
top: 45px;
bottom: -20px;
left: 10px;
.textC {
font-weight: 800;
font-size: 18px;
}
.detail-item {
margin-right: 20px;
color:red;
color: red;
}
}
.table {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-12 09:59:39
* @LastEditTime: 2023-01-15 13:47:35
* @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
-->
......@@ -275,6 +275,7 @@ export default {
return listSubject(bankId).then((res) => {
this.questionList = res.rows.map((item) => {
return {
topicType:item.topicType,
subjectId: item.subjectId,
topicTitle: item.topicTitle,
};
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-12 16:44:31
* @LastEditTime: 2023-01-13 16:26:00
* @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
-->
......@@ -19,26 +19,33 @@
<div class="detail flex">
<div class="detail-item">
单选题{{ bottomFrom.singleChoiceScore }}分/题,共{{ danxs }}题,计{{
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
>分/题,共<span>{{ danxs }}</span
>题,计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore
}}
}}</span
>
</div>
<div class="detail-item">
多选题{{ bottomFrom.multipleChoiceScore }}分/题,共{{ duoxs }}题,计{{
多选题<span>{{ bottomFrom.multipleChoiceScore }}</span
>分/题,共<span>{{ duoxs }}</span> 题,计<span class="textC">{{
duoxs * bottomFrom.multipleChoiceScore
}}
}}</span
>
</div>
<div class="detail-item">
判断提{{ bottomFrom.judgmentScore }}/题,共{{ pds }}题,计{{
pds * bottomFrom.judgmentScore
}}
判断提<span>{{ bottomFrom.judgmentScore }}</span>/题,共<span>{{ pds }}</span> 题,计<span
class="textC"
>{{ pds * bottomFrom.judgmentScore }}</span
>
</div>
<div class="detail-item">
一共{{ danxs + duoxs + pds }}道题,总共计{{
一共<span>{{ danxs + duoxs + pds }}</span>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
}}
}}</span
>
</div>
</div>
......@@ -358,8 +365,12 @@ export default {
}
.detail {
position: absolute;
top: 45px;
bottom: -20px;
left: 10px;
.textC {
font-weight: 800;
font-size: 18px;
}
.detail-item {
margin-right: 20px;
color: red;
......
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