Commit be94399c authored by 吴卿华's avatar 吴卿华

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	danger-manage-web/src/views/educationPlanExam/questionBank/index.vue
parents 5ab88ae0 f9fd8af2
...@@ -73,13 +73,13 @@ spring: ...@@ -73,13 +73,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 36.138.181.113 host: 127.0.0.1
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 6378
# 数据库索引 # 数据库索引
database: 1 database: 1
# 密码 # 密码
password: 1qaz2wsx3edc password: Redis@2021
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
......
...@@ -73,13 +73,13 @@ spring: ...@@ -73,13 +73,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 36.138.181.113 host: 127.0.0.1
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 6378
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
password: 1qaz2wsx3edc password: Redis@2021
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
......
...@@ -205,7 +205,7 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -205,7 +205,7 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
} }
//新增考试人员 //新增考试人员
List<JSONObject> personList = JSONObject.parseArray(course.getTestPersons(),JSONObject.class); List<JSONObject> personList = JSONObject.parseArray(course.getTestPersons(),JSONObject.class);
List<String> persons = personList.stream().map(item ->(String)item.get("peoPleId")).collect(Collectors.toList()); List<String> persons = personList.stream().map(item ->String.valueOf(item.get("peoPleId"))).collect(Collectors.toList());
tTrainCourseMapper.insertUserCourse(tTrainCourse.getCourseId(),persons,tTrainCourse.getPersonnelType()); tTrainCourseMapper.insertUserCourse(tTrainCourse.getCourseId(),persons,tTrainCourse.getPersonnelType());
tTrainCourse.setStatus(1); tTrainCourse.setStatus(1);
tTrainCourse.setReleaseTime(new Date()); tTrainCourse.setReleaseTime(new Date());
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TBankSubject; import com.zehong.system.domain.TBankSubject;
...@@ -144,6 +143,7 @@ public class TTrainCourseTopicServiceImpl implements ITTrainCourseTopicService ...@@ -144,6 +143,7 @@ public class TTrainCourseTopicServiceImpl implements ITTrainCourseTopicService
return 0; return 0;
} }
List<TTrainCourseTopic> topics = new ArrayList<>(); List<TTrainCourseTopic> topics = new ArrayList<>();
int count = 0;
for(BatchTopicVo.TopicInfos topic : batchTopicVo.getTopicInfos()){ for(BatchTopicVo.TopicInfos topic : batchTopicVo.getTopicInfos()){
//获取题库试题 //获取题库试题
TBankSubject tBankSubject = new TBankSubject(); TBankSubject tBankSubject = new TBankSubject();
...@@ -160,8 +160,13 @@ public class TTrainCourseTopicServiceImpl implements ITTrainCourseTopicService ...@@ -160,8 +160,13 @@ public class TTrainCourseTopicServiceImpl implements ITTrainCourseTopicService
courseTopic.setCreateTime(new Date()); courseTopic.setCreateTime(new Date());
topics.add(courseTopic); topics.add(courseTopic);
} }
count += topic.getQuan();
} }
//批量新增试题 //批量新增试题
return tTrainCourseTopicMapper.batchInsertTTrainCourseTopic(topics); tTrainCourseTopicMapper.batchInsertTTrainCourseTopic(topics);
//更新试题数量
TTrainCourse course = tTrainCourseMapper.selectTTrainCourseById(batchTopicVo.getCourseId());
course.setTopicNum(course.getTopicNum() + count);
return tTrainCourseMapper.updateTTrainCourse(course);
} }
} }
...@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insetsPlanPost"> <insert id="insetsPlanPost">
INSERT INTO t_train_plan_post(plan_id,post_id) VALUES INSERT INTO t_train_plan_post(plan_id,post_id) VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
(#{planId},#{item.staffId}) (#{planId},#{item.peoPleId})
</foreach> </foreach>
</insert> </insert>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-23 11:02:24 * @Date: 2022-09-23 11:02:24
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 11:37:33 * @LastEditTime: 2022-12-28 09:57:47
* @FilePath: /danger-manage-web/src/api/educationPlanExam/trainingProgram.js * @FilePath: /danger-manage-web/src/api/educationPlanExam/trainingProgram.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -71,7 +71,7 @@ export function deleteLesson(query) { ...@@ -71,7 +71,7 @@ export function deleteLesson(query) {
export function testPublish(data) { export function testPublish(data) {
return request({ return request({
url: '/system/course/testPublish', url: '/system/course/testPublish',
method: 'put', method: 'post',
data:data data:data
}) })
} }
...@@ -165,7 +165,7 @@ export function testPersonDetailByCourseId(query) { ...@@ -165,7 +165,7 @@ export function testPersonDetailByCourseId(query) {
*/ */
export function bachAddTopic(data) { export function bachAddTopic(data) {
return request({ return request({
url: '/system/course/bachAddTopic', url: 'system/topic/bachAddTopic',
method: 'post', method: 'post',
data: data data: data
}) })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 17:39:55 * @Date: 2022-12-19 17:39:55
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-24 16:12:47 * @LastEditTime: 2022-12-26 09:36:52
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangePapel.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<div class="close" @click="deleteName(item.staffId)">x</div> <div class="close" @click="deleteName(item.staffId)">x</div>
</div> </div>
</div> </div>
<div class="bottom-text">已选择n</div> <div class="bottom-text">已选择{{selectNameList.length}}</div>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 15:23:58 * @Date: 2022-12-19 15:23:58
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-24 16:51:34 * @LastEditTime: 2022-12-25 16:47:17
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/Lesson-table.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -17,19 +17,19 @@ ...@@ -17,19 +17,19 @@
ref="multipleTable" ref="multipleTable"
> >
<el-table-column type="selection"></el-table-column> <el-table-column type="selection"></el-table-column>
<el-table-column label="负责人" align="center" prop="staffName"> <el-table-column label="负责人" align="center" prop="name">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="手机号" label="手机号"
align="center" align="center"
prop="deptName" prop="phone"
:formatter="formatter" :formatter="formatter"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="所属单位" label="所属单位"
align="center" align="center"
prop="profession" prop="contractorName"
:formatter="formatter" :formatter="formatter"
> >
</el-table-column> </el-table-column>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<script> <script>
import { listStaff } from "@/api/safetyManagement/staff"; import { listStaff } from "@/api/safetyManagement/staff";
import { listContractorPerson } from "@/api/contractor/contractorPerson";
export default { export default {
name: "", name: "",
props: { props: {
...@@ -64,8 +65,8 @@ export default { ...@@ -64,8 +65,8 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
deptId: null, contractorId: null,
staffName: null, name: null,
}, },
total: 0, total: 0,
nameList: [], nameList: [],
...@@ -75,12 +76,13 @@ export default { ...@@ -75,12 +76,13 @@ export default {
methods: { methods: {
listStaff() { listStaff() {
this.loading = true; this.loading = true;
listStaff(this.queryParams).then((res) => { listContractorPerson(this.queryParams).then((res) => {
console.log('res',res)
this.total = res.total; this.total = res.total;
this.nameList = res.rows; this.nameList = res.rows;
this.$nextTick((item) => { this.$nextTick((item) => {
this.selectNameList.forEach((item) => { this.selectNameList.forEach((item) => {
this.toggleSelection(item.staffId, true); this.toggleSelection(item.id, true);
}); });
this.loading = false; this.loading = false;
}); });
...@@ -110,9 +112,9 @@ export default { ...@@ -110,9 +112,9 @@ export default {
this.$emit("selectAll", this.nameList, allSelect); this.$emit("selectAll", this.nameList, allSelect);
}, },
// 切换选项 // 切换选项
toggleSelection(staffId, SeclctFlag = false) { toggleSelection(id, SeclctFlag = false) {
const item = this.nameList.find((item) => { const item = this.nameList.find((item) => {
return item.staffId == staffId; return item.id == id;
}); });
this.$refs.multipleTable.toggleRowSelection(item, SeclctFlag); this.$refs.multipleTable.toggleRowSelection(item, SeclctFlag);
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 17:39:55 * @Date: 2022-12-19 17:39:55
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-24 16:12:56 * @LastEditTime: 2022-12-25 17:49:17
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangePapel.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="changePeople-left"> <div class="changePeople-left">
<div class="top-search flex"> <div class="top-search flex">
<el-select <el-select
v-model="deptId" v-model="id"
filterable filterable
placeholder="请选择" placeholder="请选择"
size="mini" size="mini"
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
> >
<el-option <el-option
v-for="item in searchList" v-for="item in searchList"
:key="item.deptId" :key="item.id"
:label="item.deptName" :label="item.contractorName"
:value="item.deptId" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
<el-input <el-input
v-model="staffName" v-model="name"
size="mini" size="mini"
placeholder="请输入姓名" placeholder="请输入姓名"
suffix-icon="el-icon-date" suffix-icon="el-icon-date"
...@@ -57,10 +57,10 @@ ...@@ -57,10 +57,10 @@
<div <div
class="item flex" class="item flex"
v-for="item in selectNameList" v-for="item in selectNameList"
:key="item.staffId" :key="item.id"
> >
<div>{{ item.staffName }}</div> <div>{{ item.name }}</div>
<div class="close" @click="deleteName(item.staffId)">x</div> <div class="close" @click="deleteName(item.id)">x</div>
</div> </div>
</div> </div>
<div class="bottom-text">已选择n人</div> <div class="bottom-text">已选择n人</div>
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<script> <script>
import ChangPapelTable from "./ChangPapelTable"; import ChangPapelTable from "./ChangPapelTable";
import { listDept } from "@/api/system/dept"; import { listDept } from "@/api/system/dept";
import { listAll } from "@/api/contractor/contractorInfo";
export default { export default {
name: "PeopleGuestChange", name: "PeopleGuestChange",
...@@ -88,13 +89,15 @@ export default { ...@@ -88,13 +89,15 @@ export default {
return { return {
selectNameList: [], selectNameList: [],
searchList: [], searchList: [],
deptId: null, // 这个id是访客跟承包商的id。也叫id
staffName: null, id: null,
name: null,
}; };
}, },
created() { created() {
listDept().then((res) => { listAll().then((res) => {
console.log(res); console.log(res);
// return;
this.searchList = res.data; this.searchList = res.data;
}); });
}, },
...@@ -108,8 +111,8 @@ export default { ...@@ -108,8 +111,8 @@ export default {
if (Array.isArray(this.selectNameList)) { if (Array.isArray(this.selectNameList)) {
json = this.selectNameList.map((item) => { json = this.selectNameList.map((item) => {
return { return {
peoPleId: item.staffId, peoPleId: item.id,
peoPleName: item.staffName, peoPleName: item.name,
}; };
}); });
} else { } else {
...@@ -124,8 +127,8 @@ export default { ...@@ -124,8 +127,8 @@ export default {
if (jsonSelectNameList) { if (jsonSelectNameList) {
this.selectNameList = JSON.parse(jsonSelectNameList).map((item) => { this.selectNameList = JSON.parse(jsonSelectNameList).map((item) => {
return { return {
staffId: item.peoPleId, id: item.peoPleId,
staffName: item.peoPleName, name: item.peoPleName,
}; };
}); });
} else { } else {
...@@ -137,25 +140,25 @@ export default { ...@@ -137,25 +140,25 @@ export default {
this.$refs.table.queryParams = { this.$refs.table.queryParams = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
deptId: this.deptId, contractorId: this.id,
staffName: this.staffName, name: this.name,
}; };
this.$refs.table.listStaff(); this.$refs.table.listStaff();
}, },
deleteName(staffId) { deleteName(id) {
const index = this.selectNameList.findIndex((item) => { const index = this.selectNameList.findIndex((item) => {
return item.staffId == staffId; return item.id == id;
}); });
if (index >= 0) { if (index >= 0) {
console.log(index); console.log(index);
this.selectNameList.splice(index, 1); this.selectNameList.splice(index, 1);
this.$refs.table.toggleSelection(staffId); this.$refs.table.toggleSelection(id);
} }
}, },
addName(row) { addName(row) {
const index = this.selectNameList.findIndex((item) => { const index = this.selectNameList.findIndex((item) => {
// console.log(item.id) // console.log(item.id)
return item.staffId == row.staffId; return item.id == row.id;
}); });
console.log(index); console.log(index);
if (index >= 0) { if (index >= 0) {
...@@ -170,7 +173,7 @@ export default { ...@@ -170,7 +173,7 @@ export default {
if (allSelect) { if (allSelect) {
all.forEach((item) => { all.forEach((item) => {
const index = this.selectNameList.findIndex((iten) => { const index = this.selectNameList.findIndex((iten) => {
return iten.staffId == item.staffId; return iten.id == item.id;
}); });
if (index < 0) { if (index < 0) {
this.selectNameList.push(item); this.selectNameList.push(item);
...@@ -178,7 +181,7 @@ export default { ...@@ -178,7 +181,7 @@ export default {
}); });
} else { } else {
all.forEach((item) => { all.forEach((item) => {
this.deleteName(item.staffId); this.deleteName(item.id);
}); });
} }
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49 * @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-17 10:24:41 * @LastEditTime: 2022-12-26 09:54:47
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -145,6 +145,10 @@ export default { ...@@ -145,6 +145,10 @@ export default {
}, },
// 隐藏与显示dialog // 隐藏与显示dialog
dialogCancel() { dialogCancel() {
// 录入考题的时候不会有修改的缓存
if (this.topicId) {
this.topicId = null;
}
this.$emit("update:visible", false); this.$emit("update:visible", false);
}, },
// 把ID改变了 // 把ID改变了
......
...@@ -123,7 +123,12 @@ ...@@ -123,7 +123,12 @@
// getQuestion, // getQuestion,
// getLessonById, // getLessonById,
// } from "@/api/educationPlanExam/lessonsProgram.js"; // } from "@/api/educationPlanExam/lessonsProgram.js";
import { addSubject ,getSubject,listSubject,updateSubject} from "@/api/educationPlanExam/subject"; import {
addSubject,
getSubject,
listSubject,
updateSubject,
} from "@/api/educationPlanExam/subject";
export default { export default {
name: "AnswerLesson", name: "AnswerLesson",
...@@ -158,7 +163,7 @@ export default { ...@@ -158,7 +163,7 @@ export default {
// 如果存在就是修改 // 如果存在就是修改
if (this.subjectId) { if (this.subjectId) {
getSubject(this.subjectId).then((res) => { getSubject(this.subjectId).then((res) => {
console.log('?',res.data); console.log("?", res.data);
const data = res.data; const data = res.data;
this.form = { this.form = {
topicTitle: data.topicTitle, topicTitle: data.topicTitle,
...@@ -176,12 +181,12 @@ export default { ...@@ -176,12 +181,12 @@ export default {
methods: { methods: {
getQuestion() { getQuestion() {
listSubject({ bankId: this.bankId }).then((res) => { listSubject({ bankId: this.bankId }).then((res) => {
console.log(res) console.log(res);
// 如果是修改 就是原来的值,如果不是,就是总数+1 // 如果是修改 就是原来的值,如果不是,就是总数+1
if (this.subjectId) { if (this.subjectId) {
res.rows.forEach((item, index) => { res.rows.forEach((item, index) => {
if (item.subjectId == this.subjectId) { if (item.subjectId == this.subjectId) {
this.questionNextNum = index+1; this.questionNextNum = index + 1;
} }
}); });
} else { } else {
...@@ -243,7 +248,7 @@ export default { ...@@ -243,7 +248,7 @@ export default {
// 把修改的这个归位,变成正常添加 // 把修改的这个归位,变成正常添加
this.$emit("update:subjectId", null); this.$emit("update:subjectId", null);
this.$message({ this.$message({
message: "添加题目成功", message: this.subjectId ? "添加题目成功" : "修改题目成功",
type: "success", type: "success",
}); });
this.$parent.$parent.componentsNumChange(num); this.$parent.$parent.componentsNumChange(num);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49 * @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-17 14:28:56 * @LastEditTime: 2022-12-26 09:55:56
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -145,6 +145,10 @@ export default { ...@@ -145,6 +145,10 @@ export default {
}, },
// 隐藏与显示dialog // 隐藏与显示dialog
dialogCancel() { dialogCancel() {
// 录入题目的时候不会有修改的缓存
if (this.subjectId) {
this.subjectId = null;
}
this.$emit("update:visible", false); this.$emit("update:visible", false);
}, },
// 把ID改变了 // 把ID改变了
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05 * @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-17 14:28:57 * @LastEditTime: 2022-12-27 16:03:40
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -17,15 +17,16 @@ ...@@ -17,15 +17,16 @@
<div class="right">{{ courseName }}</div> <div class="right">{{ courseName }}</div>
</div> </div>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="info" type="info"
plain plain
icon="el-icon-upload2" icon="el-icon-upload2"
size="mini" size="mini"
@click="handleImport" @click="handleImport"
>导入</el-button> >导入</el-button
</el-col> >
</el-col>
</el-row> </el-row>
<div class="table flex" v-loading="loading"> <div class="table flex" v-loading="loading">
...@@ -89,13 +90,24 @@ ...@@ -89,13 +90,24 @@
</div> --> </div> -->
<!-- 设备导入对话框 --> <!-- 设备导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> <el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload <el-upload
ref="upload" ref="upload"
:limit="1" :limit="1"
accept=".xlsx, .xls" accept=".xlsx, .xls"
:headers="upload.headers" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport+ '&bankId=' + upload.bankId" :action="
upload.url +
'?updateSupport=' +
upload.updateSupport +
'&bankId=' +
upload.bankId
"
:disabled="upload.isUploading" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
...@@ -108,17 +120,19 @@ ...@@ -108,17 +120,19 @@
<em>点击上传</em> <em>点击上传</em>
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
<!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的设备数据--> <!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的设备数据-->
<!-- <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>--> <!-- <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>-->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleDownload(upload)" @click="handleDownload(upload)"
>下载模板</el-button> >下载模板</el-button
>
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
提示:仅允许导入“xls”或“xlsx”格式文件!
</div> </div>
<div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button> <el-button type="primary" @click="submitFileForm">确 定</el-button>
...@@ -160,7 +174,7 @@ export default { ...@@ -160,7 +174,7 @@ export default {
// 设备导入参数 // 设备导入参数
upload: { upload: {
//题库id //题库id
bankId:0, bankId: 0,
// 是否显示弹出层(用户导入) // 是否显示弹出层(用户导入)
open: false, open: false,
// 弹出层标题(用户导入) // 弹出层标题(用户导入)
...@@ -172,7 +186,7 @@ export default { ...@@ -172,7 +186,7 @@ export default {
// 设置上传的请求头部 // 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// 上传的地址 // 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/subject/import" url: process.env.VUE_APP_BASE_API + "/system/subject/import",
}, },
queryParams: { queryParams: {
bankId:0 bankId:0
...@@ -209,7 +223,7 @@ export default { ...@@ -209,7 +223,7 @@ export default {
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {
this.upload.bankId=this.bankId; this.upload.bankId = this.bankId;
this.upload.title = "题目导入"; this.upload.title = "题目导入";
this.upload.open = true; this.upload.open = true;
}, },
...@@ -223,10 +237,12 @@ export default { ...@@ -223,10 +237,12 @@ export default {
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getQuestion({ bankId: this.bankId }); this.getQuestion({ bankId: this.bankId });
// this.getList();
this.$parent.$parent.$parent.getList();
}, },
/** 下载模板操作 */ /** 下载模板操作 */
importTemplate() { importTemplate() {
importTemplate().then(response => { importTemplate().then((response) => {
this.download(response.msg); this.download(response.msg);
}); });
}, },
......
...@@ -301,6 +301,7 @@ export default { ...@@ -301,6 +301,7 @@ export default {
this.loading = true; this.loading = true;
listBank(this.queryParams) listBank(this.queryParams)
.then((res) => { .then((res) => {
console.log(res);
this.bankList = res.rows.map((item, index) => { this.bankList = res.rows.map((item, index) => {
return { return {
bankNum: bankNum:
......
...@@ -116,14 +116,13 @@ ...@@ -116,14 +116,13 @@
</template> </template>
<script> <script>
// import { import {
// addQuestion, addQuestion,
// checkQuestion, checkQuestion,
// changeQuestion, changeQuestion,
// getQuestion, getQuestion,
// getLessonById, getLessonById,
// } from "@/api/educationPlanExam/lessonsProgram.js"; } from "@/api/educationPlanExam/lessonsProgram.js";
import { addSubject ,getSubject,listSubject,updateSubject} from "@/api/educationPlanExam/subject";
export default { export default {
name: "AnswerLesson", name: "AnswerLesson",
...@@ -132,10 +131,10 @@ export default { ...@@ -132,10 +131,10 @@ export default {
// type: Boolean, // type: Boolean,
// default: false, // default: false,
// }, // },
bankId: { courseId: {
type: Number, type: Number,
}, },
subjectId: { topicId: {
type: Number, type: Number,
}, },
}, },
...@@ -156,9 +155,9 @@ export default { ...@@ -156,9 +155,9 @@ export default {
created() { created() {
// 如果存在就是修改 // 如果存在就是修改
if (this.subjectId) { if (this.topicId) {
getSubject(this.subjectId).then((res) => { checkQuestion(this.topicId).then((res) => {
console.log('?',res.data); console.log(res.data);
const data = res.data; const data = res.data;
this.form = { this.form = {
topicTitle: data.topicTitle, topicTitle: data.topicTitle,
...@@ -171,16 +170,16 @@ export default { ...@@ -171,16 +170,16 @@ export default {
// 查询是第几道题 // 查询是第几道题
this.getQuestion(); this.getQuestion();
// 获取课程标题 // 获取课程标题
// this.getLessonById(this.bankId); this.getLessonById(this.courseId);
}, },
methods: { methods: {
getQuestion() { getQuestion() {
listSubject({ bankId: this.bankId }).then((res) => { getQuestion({ courseId: this.courseId }).then((res) => {
// 如果是修改 就是原来的值,如果不是,就是总数+1
console.log(res) console.log(res)
// 如果是修改 就是原来的值,如果不是,就是总数+1 if (this.topicId) {
if (this.subjectId) {
res.rows.forEach((item, index) => { res.rows.forEach((item, index) => {
if (item.subjectId == this.subjectId) { if (item.topicId == this.topicId) {
this.questionNextNum = index+1; this.questionNextNum = index+1;
} }
}); });
...@@ -189,18 +188,18 @@ export default { ...@@ -189,18 +188,18 @@ export default {
} }
}); });
}, },
// getLessonById(bankId) { getLessonById(courseId) {
// getLessonById(bankId).then((res) => { getLessonById(courseId).then((res) => {
// console.log(res); console.log(res);
// this.courseName = res.data.courseName; this.courseName = res.data.courseName;
// }); });
// }, },
addQuestion(data) { addQuestion(data) {
// 如果是修改,就用修改的方法,如果是新增,就用新增的方法 // 如果是修改,就用修改的方法,如果是新增,就用新增的方法
if (this.subjectId) { if (this.topicId) {
return updateSubject({ subjectId: this.subjectId, ...data }); return changeQuestion({ topicId: this.topicId, ...data });
} else { } else {
return addSubject({ bankId: this.bankId, ...data }); return addQuestion({ courseId: this.courseId, ...data });
} }
}, },
rightAnswerClick(index) { rightAnswerClick(index) {
...@@ -241,7 +240,7 @@ export default { ...@@ -241,7 +240,7 @@ export default {
this.addQuestion(data).then((res) => { this.addQuestion(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
// 把修改的这个归位,变成正常添加 // 把修改的这个归位,变成正常添加
this.$emit("update:subjectId", null); this.$emit("update:topicId", null);
this.$message({ this.$message({
message: "添加题目成功", message: "添加题目成功",
type: "success", type: "success",
......
<!--
* @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 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49 * @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-19 14:01:37 * @LastEditTime: 2022-12-28 10:31:06
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<component <component
:is="currentComponent" :is="currentComponent"
:bankId.sync="bankId" :courseId.sync="courseId"
:subjectId.sync="subjectId" :topicId.sync="topicId"
ref="current" ref="current"
></component> ></component>
</transition> </transition>
...@@ -33,13 +33,25 @@ ...@@ -33,13 +33,25 @@
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button
type="primary"
v-if="this.componentsNum == 2"
@click="componentsNumChange(4)"
>从题库选择</el-button
>
<el-button <el-button
type="primary" type="primary"
v-if="this.componentsNum == 1 || this.componentsNum == 3" v-if="this.componentsNum == 1 || this.componentsNum == 3"
@click="save" @click="save"
>保存</el-button >保存</el-button
> >
<el-button
type="primary"
v-if="this.componentsNum == 4"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button type="primary" @click="saveAndNext">{{ <el-button type="primary" @click="saveAndNext">{{
saveNextText saveNextText
}}</el-button> }}</el-button>
...@@ -58,6 +70,7 @@ ...@@ -58,6 +70,7 @@
import Lesson from "./Lesson"; import Lesson from "./Lesson";
import AddQuestion from "./AddQuestion"; import AddQuestion from "./AddQuestion";
import QuestionList from "./QuestionList"; import QuestionList from "./QuestionList";
import ChangeQuestion from "./ChangeQuestion";
export default { export default {
name: "AnswerLesson", name: "AnswerLesson",
...@@ -70,7 +83,7 @@ export default { ...@@ -70,7 +83,7 @@ export default {
type: Number, type: Number,
default: 1, default: 1,
}, },
bankId: { courseId: {
type: Number, type: Number,
}, },
}, },
...@@ -85,7 +98,7 @@ export default { ...@@ -85,7 +98,7 @@ export default {
title: "录入课程", title: "录入课程",
currentComponent: Lesson, currentComponent: Lesson,
// 当前题目查看 // 当前题目查看
subjectId: null, topicId: null,
}; };
}, },
watch: { watch: {
...@@ -93,7 +106,7 @@ export default { ...@@ -93,7 +106,7 @@ export default {
handler(num) { handler(num) {
if (num === 1) { if (num === 1) {
this.currentComponent = Lesson; this.currentComponent = Lesson;
if (this.bankId) { if (this.courseId) {
this.title = "修改课程"; this.title = "修改课程";
} else { } else {
this.title = "新增课程"; this.title = "新增课程";
...@@ -102,13 +115,16 @@ export default { ...@@ -102,13 +115,16 @@ export default {
this.currentComponent = QuestionList; this.currentComponent = QuestionList;
this.title = "题目列表"; this.title = "题目列表";
} else { } else if (num === 3) {
this.currentComponent = AddQuestion; this.currentComponent = AddQuestion;
if (this.subjectId) { if (this.topicId) {
this.title = "修改题目"; this.title = "修改题目";
} else { } else {
this.title = "新增题目"; this.title = "新增题目";
} }
} else if (num == 4) {
this.currentComponent = ChangeQuestion;
this.title = "从题库选题";
} }
}, },
deep: true, deep: true,
...@@ -121,8 +137,10 @@ export default { ...@@ -121,8 +137,10 @@ export default {
text = "保存并录入题目"; text = "保存并录入题目";
} else if (this.componentsNum == 2) { } else if (this.componentsNum == 2) {
text = "录入考题"; text = "录入考题";
} else { } else if (this.componentsNum == 3) {
text = "保存并录入下一题"; text = "保存并录入下一题";
} else {
text = "确定选择";
} }
return text; return text;
}, },
...@@ -145,11 +163,15 @@ export default { ...@@ -145,11 +163,15 @@ export default {
}, },
// 隐藏与显示dialog // 隐藏与显示dialog
dialogCancel() { dialogCancel() {
// 录入考题的时候不会有修改的缓存
if (this.topicId) {
this.topicId = null;
}
this.$emit("update:visible", false); this.$emit("update:visible", false);
}, },
// 把ID改变了 // 把ID改变了
changeCourseId(bankId) { changeCourseId(courseId) {
this.$emit("update:bankId", bankId); this.$emit("update:courseId", courseId);
}, },
// 改变当前组件 // 改变当前组件
componentsNumChange(num) { componentsNumChange(num) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05 * @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-17 14:28:57 * @LastEditTime: 2022-12-26 16:55:10
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<div ref="myBody" class="add-question flex"> <div ref="myBody" class="add-question flex">
<div class="text flex"> <div class="text flex">
<div class="left"> <div class="left">
目前有<span>{{ questionNum || 0 }}</span 目前有<span>{{ questionNum }}</span
>道题 >道题
<!-- <span class="warn">温馨提示:发布课程前需要进行考试设置</span> --> <span class="warn">温馨提示:发布课程前需要进行考试设置</span>
</div> </div>
<div class="right">{{ courseName }}</div> <div class="right">{{ courseName }}</div>
</div> </div>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<div class="td-wrapper"> <div class="td-wrapper">
<div <div
v-for="(item, index) in questionList" v-for="(item, index) in questionList"
:key="item.subjectId" :key="item.topicId"
class="td flex" class="td flex"
> >
<div class="left">{{ index + 1 }}</div> <div class="left">{{ index + 1 }}</div>
...@@ -35,13 +35,13 @@ ...@@ -35,13 +35,13 @@
<div class="right"> <div class="right">
<div> <div>
<el-button <el-button
@click="edit(item.subjectId)" @click="edit(item.topicId)"
icon="el-icon-edit" icon="el-icon-edit"
type="text" type="text"
>修改</el-button >修改</el-button
> >
<el-button <el-button
@click="deleteLesson(item.subjectId)" @click="deleteLesson(item.topicId)"
icon="el-icon-delete" icon="el-icon-delete"
type="text" type="text"
>删除</el-button >删除</el-button
...@@ -51,9 +51,8 @@ ...@@ -51,9 +51,8 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="rightNum flex"> <div class="rightNum flex">
<div class="left">考试设置</div>
<div class="left">录入考题</div>
<div class="middle flex"> <div class="middle flex">
<div class="left-text">答对题目大于</div> <div class="left-text">答对题目大于</div>
<div> <div>
...@@ -73,8 +72,8 @@ ...@@ -73,8 +72,8 @@
type="success" type="success"
>保存</el-button >保存</el-button
> >
</div> </div>
</div> --> </div>
</div> </div>
</template> </template>
...@@ -85,13 +84,10 @@ import { ...@@ -85,13 +84,10 @@ import {
changeLesson, changeLesson,
getLessonById, getLessonById,
} from "@/api/educationPlanExam/lessonsProgram"; } from "@/api/educationPlanExam/lessonsProgram";
import { listSubject, delSubject } from "@/api/educationPlanExam/subject";
import { getBank } from "@/api/educationPlanExam/questionBank";
export default { export default {
name: "AnswerLesson", name: "AnswerLesson",
props: { props: {
bankId: { courseId: {
type: Number, type: Number,
}, },
}, },
...@@ -118,11 +114,11 @@ export default { ...@@ -118,11 +114,11 @@ export default {
// }, // },
created() { created() {
console.log("this.bankId", this.bankId); console.log("this.courseId", this.courseId);
if (this.bankId) { if (this.courseId) {
this.getQuestion({ bankId: this.bankId }); this.getQuestion({ courseId: this.courseId });
// 获取只题目正确几题算过关 // 获取只题目正确几题算过关
this.getLessonById(this.bankId); this.getLessonById(this.courseId);
} }
}, },
methods: { methods: {
...@@ -132,14 +128,13 @@ export default { ...@@ -132,14 +128,13 @@ export default {
saveAndNext() { saveAndNext() {
this.$parent.$parent.componentsNumChange(3); this.$parent.$parent.componentsNumChange(3);
}, },
getQuestion(bankId) { getQuestion(courseId) {
console.log(bankId); return getQuestion(courseId).then((res) => {
return listSubject(bankId).then((res) => { console.log(res);
console.log("题库res", res);
this.questionList = res.rows.map((item) => { this.questionList = res.rows.map((item) => {
return { return {
subjectId: item.subjectId, topicId: item.topicId,
topicTitle: item.topicTitle, topicTitle: item.topicTitle,
}; };
}); });
...@@ -147,18 +142,18 @@ export default { ...@@ -147,18 +142,18 @@ export default {
return true; return true;
}); });
}, },
getLessonById(bankId) { getLessonById(courseId) {
getBank(bankId).then((res) => { getLessonById(courseId).then((res) => {
// console.log(res); console.log(res);
// this.rightNum = res.data.qualifiedNum; this.rightNum = res.data.qualifiedNum;
this.courseName = res.data.bankName; this.courseName = res.data.courseName;
}); });
}, },
edit(subjectId) { edit(topicId) {
this.$emit("update:subjectId", subjectId); this.$emit("update:topicId", topicId);
this.$parent.$parent.componentsNumChange(3); this.$parent.$parent.componentsNumChange(3);
}, },
deleteLesson(subjectId) { deleteLesson(topicId) {
this.$confirm("请确定删除该题", { this.$confirm("请确定删除该题", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
...@@ -166,7 +161,7 @@ export default { ...@@ -166,7 +161,7 @@ export default {
}) })
.then(() => { .then(() => {
this.loading = true; this.loading = true;
return delSubject(subjectId); return deleteQuestion(topicId);
}) })
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
...@@ -175,7 +170,7 @@ export default { ...@@ -175,7 +170,7 @@ export default {
type: "success", type: "success",
}); });
} }
return this.getQuestion({ bankId: this.bankId }); return this.getQuestion({ courseId: this.courseId });
}) })
.finally(() => { .finally(() => {
this.loading = false; this.loading = false;
...@@ -192,7 +187,7 @@ export default { ...@@ -192,7 +187,7 @@ export default {
return; return;
} }
changeLesson({ changeLesson({
bankId: this.bankId, courseId: this.courseId,
qualifiedNum: this.rightNum, qualifiedNum: this.rightNum,
}).then((res) => { }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
...@@ -200,6 +195,7 @@ export default { ...@@ -200,6 +195,7 @@ export default {
message: "答题合格数修改成功", message: "答题合格数修改成功",
type: "success", type: "success",
}); });
this.$parent.$parent.$parent.getList();
} }
}); });
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49 * @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-19 14:01:37 * @LastEditTime: 2022-12-28 15:01:59
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
:is="currentComponent" :is="currentComponent"
:bankId.sync="bankId" :bankId.sync="bankId"
:subjectId.sync="subjectId" :subjectId.sync="subjectId"
:jsonData="jsonData"
ref="current" ref="current"
></component> ></component>
</transition> </transition>
...@@ -73,6 +74,9 @@ export default { ...@@ -73,6 +74,9 @@ export default {
bankId: { bankId: {
type: Number, type: Number,
}, },
jsonData:{
type:Array,
}
}, },
// components: { // components: {
// Lesson, // Lesson,
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="right flex"> <div class="right flex">
<template v-if="!isActive"> <template v-if="!isActive">
<div> <div>
<el-button type="text" @click="edit">编辑</el-button> <el-button type="text" @click="edit(personnelOptions)">编辑</el-button>
<el-button type="text" @click="deletePlan">删除</el-button> <el-button type="text" @click="deletePlan">删除</el-button>
</div> </div>
</template> </template>
...@@ -95,10 +95,10 @@ export default { ...@@ -95,10 +95,10 @@ export default {
}; };
}, },
methods: { methods: {
edit() { edit(personnelOptions) {
// 编辑 // 编辑
//console.log(this.infoData); console.log(personnelOptions);
this.$parent.addClick(this.infoData); this.$parent.addClick(this.infoData,personnelOptions);
//this.$emit("edit", this.oldInfoData); //this.$emit("edit", this.oldInfoData);
}, },
save() { save() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44 * @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-21 17:30:33 * @LastEditTime: 2022-12-28 15:06:07
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -25,30 +25,31 @@ ...@@ -25,30 +25,31 @@
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--<el-form-item label="开始时间" prop="releaseTime">--> <!--<el-form-item label="开始时间" prop="releaseTime">-->
<!--<el-date-picker-->
<!--v-model="form.startTime"-->
<!--value-format="yyyy-MM-dd HH:mm:ss"-->
<!--type="datetime"-->
<!--placeholder="开始时间"-->
<!--default-time="12:00:00"-->
<!--&gt;-->
<!--</el-date-picker>-->
<!--</el-form-item>-->
</div>
<!--<el-form-item label="结束时间" prop="releaseTime">-->
<!--<el-date-picker--> <!--<el-date-picker-->
<!--v-model="form.endTime"--> <!--v-model="form.startTime"-->
<!--value-format="yyyy-MM-dd HH:mm:ss"--> <!--value-format="yyyy-MM-dd HH:mm:ss"-->
<!--type="datetime"--> <!--type="datetime"-->
<!--placeholder="结束时间"--> <!--placeholder="开始时间"-->
<!--default-time="12:00:00"--> <!--default-time="12:00:00"-->
<!--&gt;--> <!--&gt;-->
<!--</el-date-picker>--> <!--</el-date-picker>-->
<!--</el-form-item>-->
</div>
<!--<el-form-item label="结束时间" prop="releaseTime">-->
<!--<el-date-picker-->
<!--v-model="form.endTime"-->
<!--value-format="yyyy-MM-dd HH:mm:ss"-->
<!--type="datetime"-->
<!--placeholder="结束时间"-->
<!--default-time="12:00:00"-->
<!--&gt;-->
<!--</el-date-picker>-->
<!--</el-form-item>--> <!--</el-form-item>-->
<el-form-item label="选择人员" prop="releaseTime"> <el-form-item label="选择人员" prop="releaseTime">
...@@ -90,7 +91,7 @@ import { ...@@ -90,7 +91,7 @@ import {
addPlan, addPlan,
editPlan, editPlan,
getPlanList, getPlanList,
getPlan getPlan,
} from "@/api/educationPlanExam/trainingProgram"; } from "@/api/educationPlanExam/trainingProgram";
export default { export default {
name: "", name: "",
...@@ -98,6 +99,9 @@ export default { ...@@ -98,6 +99,9 @@ export default {
bankId: { bankId: {
type: Number, type: Number,
}, },
jsonData: {
tyoe: Array,
},
// jsonSelectNameList: { // jsonSelectNameList: {
// type: String, // type: String,
// default: // default:
...@@ -109,13 +113,16 @@ export default { ...@@ -109,13 +113,16 @@ export default {
}, },
data() { data() {
return { return {
options: [{ options: [
value: 1, {
label: '内部员工' value: 1,
}, { label: "内部员工",
value: 2, },
label: '承包商培训' {
}], value: 2,
label: "承包商培训",
},
],
form: { form: {
bankName: "", bankName: "",
// courseType: "", // courseType: "",
...@@ -123,13 +130,13 @@ export default { ...@@ -123,13 +130,13 @@ export default {
// video: "", // video: "",
// enclosure: "", // enclosure: "",
deptId: null, deptId: null,
personnelType:1, personnelType: 1,
abc: 0, abc: 0,
}, },
// 参考人员 // 参考人员
jsonSelectNameList: null, jsonSelectNameList: null,
peopleList:[], peopleList: [],
// 归属部门列表 // 归属部门列表
deptOptions: [], deptOptions: [],
...@@ -162,7 +169,7 @@ export default { ...@@ -162,7 +169,7 @@ export default {
mounted() { mounted() {
// this.jsonSelectNameList // this.jsonSelectNameList
// '[{"staffId":880,"staffName":"孙卓亚"},{"staffId":871,"staffName":"张玉宾"},{"staffId":869,"staffName":"李二朝"},{"staffId":870,"staffName":"盖永峰"},{"staffId":868,"staffName":"刘丽艳"},{"staffId":867,"staffName":"霍文俊"},{"staffId":866,"staffName":"刘志坚"},{"staffId":865,"staffName":"郝文权"},{"staffId":864,"staffName":"齐雪军"},{"staffId":852,"staffName":"刘江平"},{"staffId":853,"staffName":"谷建海"},{"staffId":851,"staffName":"丁振国"},{"staffId":850,"staffName":"齐江波"},{"staffId":849,"staffName":"周立新"},{"staffId":848,"staffName":"史志波"},{"staffId":847,"staffName":"王增波"},{"staffId":846,"staffName":"杨彦龙"},{"staffId":845,"staffName":"杨华国"},{"staffId":844,"staffName":"王青华"}]'; // '[{"staffId":880,"staffName":"孙卓亚"},{"staffId":871,"staffName":"张玉宾"},{"staffId":869,"staffName":"李二朝"},{"staffId":870,"staffName":"盖永峰"},{"staffId":868,"staffName":"刘丽艳"},{"staffId":867,"staffName":"霍文俊"},{"staffId":866,"staffName":"刘志坚"},{"staffId":865,"staffName":"郝文权"},{"staffId":864,"staffName":"齐雪军"},{"staffId":852,"staffName":"刘江平"},{"staffId":853,"staffName":"谷建海"},{"staffId":851,"staffName":"丁振国"},{"staffId":850,"staffName":"齐江波"},{"staffId":849,"staffName":"周立新"},{"staffId":848,"staffName":"史志波"},{"staffId":847,"staffName":"王增波"},{"staffId":846,"staffName":"杨彦龙"},{"staffId":845,"staffName":"杨华国"},{"staffId":844,"staffName":"王青华"}]';
this.$refs.changePaple.changeNameList(this.jsonSelectNameList); this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
}, },
methods: { methods: {
...@@ -184,8 +191,12 @@ export default { ...@@ -184,8 +191,12 @@ export default {
this.form = { this.form = {
bankName: res.data.planName, bankName: res.data.planName,
deptId: res.data.planId, deptId: res.data.planId,
personnelType: res.data.personnelType personnelType: res.data.personnelType,
}; };
// 人名复现
this.jsonSelectNameList = JSON.stringify(this.jsonData);
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
// const data = res.data; // const data = res.data;
// const { bankName, courseType, courseConent, video, enclosure } = // const { bankName, courseType, courseConent, video, enclosure } =
// data; // data;
...@@ -216,36 +227,34 @@ export default { ...@@ -216,36 +227,34 @@ export default {
console.log("参考人员", list); console.log("参考人员", list);
this.peopleList = list; this.peopleList = list;
}, },
savePlan(){ savePlan() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if(this.peopleList.length<3){ if (this.peopleList.length < 3) {
this.$message.error('请至少选择一个考试人员'); this.$message.error("请至少选择一个考试人员");
return return;
} }
//console.log(this.peopleList); //console.log(this.peopleList);
this.form.peopleList = this.peopleList.toString(); this.form.peopleList = this.peopleList.toString();
this.form.planName = this.form.bankName; this.form.planName = this.form.bankName;
console.log(this.form) console.log(this.form);
if(this.bankId!=null){ if (this.bankId != null) {
this.form.planId = this.bankId; this.form.planId = this.bankId;
return editPlan(this.form).then((res) => { return editPlan(this.form).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$parent.$parent.$parent.getPlanList(); this.$parent.$parent.$parent.getPlanList();
} }
}); });
}else { } else {
return addPlan(this.form).then((res) => { return addPlan(this.form).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$parent.$parent.$parent.getPlanList(); this.$parent.$parent.$parent.getPlanList();
} }
}); });
} }
} }
}); });
}, },
save(num = 2) { save(num = 2) {
// 因为富文本编辑器会残留<p><br></p>,所以要清 // 因为富文本编辑器会残留<p><br></p>,所以要清
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-16 17:07:30 * @Date: 2022-09-16 17:07:30
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 17:46:09 * @LastEditTime: 2022-12-28 15:04:15
* @FilePath: /danger-manage-web/src/views/trainingProgram/index.vue * @FilePath: /danger-manage-web/src/views/trainingProgram/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
:componentsNum.sync="componentsNum" :componentsNum.sync="componentsNum"
:bankId.sync="bankId" :bankId.sync="bankId"
:visible.sync="dilogFlag" :visible.sync="dilogFlag"
:jsonData='jsonData'
/> />
</div> </div>
</template> </template>
...@@ -102,6 +103,8 @@ export default { ...@@ -102,6 +103,8 @@ export default {
data() { data() {
return { return {
personnelOptions, personnelOptions,
// 选人复显示
jsonData:null,
isActiveId: 999, isActiveId: 999,
list: [], list: [],
// 当点击编辑的时候,会记录最初始的 // 当点击编辑的时候,会记录最初始的
...@@ -228,7 +231,7 @@ export default { ...@@ -228,7 +231,7 @@ export default {
this.isActiveId = 999; this.isActiveId = 999;
}, },
changeList() {}, changeList() {},
addClick(form) { addClick(form,json) {
this.$refs.Dia.title = "新增培训计划"; this.$refs.Dia.title = "新增培训计划";
this.componentsNum = 2; this.componentsNum = 2;
...@@ -238,6 +241,13 @@ export default { ...@@ -238,6 +241,13 @@ export default {
//console.log("=======") //console.log("=======")
this.$refs.Dia.title = "修改培训计划"; this.$refs.Dia.title = "修改培训计划";
this.bankId = form.planId; this.bankId = form.planId;
this.jsonData = json.map(item=>{
return {
peoPleId:item.postId,
peoPleName:item.postName,
}
})
} }
//this.addOpen = true; //this.addOpen = true;
}, },
......
<template>
<div class="form-wrapper">
<div style="width: 100%;height:100%;">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="培训名称" prop="name">
<el-input v-model="ruleForm.name"></el-input>
</el-form-item>
<el-form-item label="培训内容" prop="region">
<el-input type="textarea" v-model="ruleForm.region" rows="5"></el-input>
</el-form-item>
</el-form>
</div>
<el-form>
<div class="flex">
<el-form-item label="视频上传" v-if="!readOnly" prop="video">
<FileUpload
listType="picture"
@resFun="getFileInfoVideo"
@remove="listRemoveVideo"
:fileArr="fileListVideo"
:fileSize="500"
:fileType="['mp4']"
/>
<el-input v-show="false" disabled v-model="form.video"></el-input>
</el-form-item>
<el-form-item label="附件上传" v-if="!readOnly" prop="enclosure">
<FileUpload
listType="picture"
@resFun="getFileInfoFile"
@remove="listRemoveFile"
:fileArr="fileListFile"
/>
<el-input v-show="false" disabled v-model="form.enclosure"></el-input>
</el-form-item>
</div>
</el-form>
<visitorQuestion></visitorQuestion>
</div>
</template>
<script>
import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png";
import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion";
// import visitorDia from "@/views/educationPlanExam/visitorProgram/visitorDia";
export default {
data() {
return {
ruleForm: {
name: '',
region: '',
},
form: {
video: "",
enclosure: "",
},
fileListVideo: [],
fileListFile: [],
readOnly: false,
rules: {
name: [
{ required: true, message: '请输入培训名称', trigger: 'blur' }
],
region: [
{ required: true, message: '请输入培训内容', trigger: 'change' }
],
video: [
{ required: true, trigger: "blue", message: "视频不能为空" }
],
enclosure: [
{ required: true, trigger: "blur", message: "附件不能为空" },
],
}
};
},
components: {
FileUpload,
visitorQuestion,
},
created() {
if (this.courseId) {
this.getLessonById();
}
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
getFileInfoVideo(res) {
this.form.video = res.url;
// this.form.videoName = res.fileName;
this.fileListVideo = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveVideo(e) {
this.fileListVideo = [];
this.form.video = "";
// this.form.videoName = null;
},
getFileInfoFile(res) {
this.form.enclosure = res.url;
// this.form.enclosureName = res.fileName;
this.fileListFile = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveFile(e) {
this.fileListFild = [];
this.form.enclosure = "";
// this.form.fileName = null;
},
}
}
</script>
<style lang="scss" scoped>
.form-wrapper {
padding-top: 30px;
width: 80%;
height: 100%;
margin-bottom: 20px;
}
.flex{
width: 100%;
justify-content: space-around;
padding: 20px 30px;
}
</style>
\ No newline at end of file
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 17:54:16
* @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
-->
<template>
<div ref="myBody" class="add-question flex">
<div style="color: #1890ff;">题目管理</div>
<div class="text flex">
<div class="left">
<el-button type="primary" plain @click="dialogVisible = true">{{
saveNextText
}}</el-button>
目前有<span></span>道题
<span class="warn">温馨提示:发布课程前需要进行考试设置</span>
</div>
<!-- <div class="right">{{courseName}}</div> -->
</div>
<div class="table flex">
<div class="th flex">
<div class="left">序号</div>
<div class="middle">题目名称</div>
<div class="right">操作</div>
</div>
</div>
<div class="d3">
<div class="rightNum flex">
<div class="left">考试设置</div>
<div class="middle flex">
<div class="left-text">答对题目大于</div>
<div>
<el-input
v-model="rightNum"
style="width: 60px"
size="mini"
></el-input>
</div>
<div>为合格</div>
</div>
<div class="right">
<el-button
@click="saveRightNum"
icon="el-icon-check"
size="mini"
type="success"
>保存</el-button
>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
>{{ "确认" }}</el-button
>
<el-button>取消</el-button>
</div>
</div>
<el-dialog
title="录入题目"
:visible.sync="dialogVisible"
>
<visitorAdd></visitorAdd>
<span slot="footer" class="dialog-footer">
<!-- <el-button>保存</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> -->
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="save"
>保存</el-button
>
<el-button type="primary" @click="saveAndNext">{{
saveNextText
}}</el-button>
<el-button
v-if="this.componentsNum == 2"
type="primary"
>{{ "确认" }}</el-button
>
<el-button @click="dialogVisible = false">取消</el-button>
</div>
</span>
</el-dialog>
</div>
</template>
<script>
import visitorAdd from "@/views/educationPlanExam/visitorProgram/visitorAdd";
export default {
name: "AnswerLesson",
props: {
courseId: {
type: Number,
},
visible: {
type: Boolean,
default: false,
},
componentsNum: {
type: Number,
default: 1,
},
},
components: {
visitorAdd,
},
data() {
return {
dialogVisible: false,
rightNum: 0,
};
},
computed: {
saveNextText() {
let text;
if (this.componentsNum == 1) {
text = "保存并录入题目";
} else if (this.componentsNum == 2) {
text = "录入考题";
} else {
text = "保存并录入下一题";
}
return text;
},
},
created() {
console.log("this.courseId", this.courseId);
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
save() {
// this.answerClear();
this.$refs.current.save();
},
saveRightNum() {
},
saveAndNext() {
this.$refs.current.saveAndNext();
},
},
};
</script>
<style lang="scss" scoped>
.add-question {
width: 100%;
height: 550px;
// overflow: hidden;
flex-direction: column;
padding-bottom: 7px;
margin-bottom: 20px;
border-bottom: 1px solid #bbbbbb00;
.text {
margin-top: 13px;
margin-bottom: 32px;
justify-content: space-between;
height: 28px;
.left {
line-height: 28px;
color: #101010;
font-size: 14px;
.warn {
display: inline-flex;
font-size: 12px;
color: red;
margin-left: 10px;
}
}
.right {
width: 411px;
line-height: 28px;
background: #1d84ff;
padding-right: 5px;
color: #fff;
text-align: right;
}
}
.table {
flex: 1;
height: 0;
flex-direction: column;
.th {
width: 100%;
height: 70px;
line-height: 70px;
background: #f5f5f5;
color: #606266;
> div {
height: 100%;
}
.left {
width: 15%;
text-align: center;
}
.middle {
width: 60%;
padding-left: 100px;
}
.right {
width: 25%;
text-align: center;
}
}
.td-wrapper {
flex: 1;
overflow-y: auto;
// 这样子元素才能有滚动条
.td {
height: 68px;
line-height: 68px;
box-sizing: border-box;
border-bottom: 1px solid #bbbbbb;
&:last-child {
border-bottom: none;
}
> div {
height: 100%;
}
.left {
width: 15%;
text-align: center;
}
.middle {
width: 60%;
padding-left: 10px;
}
.right {
width: 25%;
text-align: center;
}
}
}
}
.d3{
display: flex;
justify-content: right;
}
.dialog-footer{
margin-top: 15px;
}
.rightNum {
margin-top: 5px;
width: 50%;
height: 55px;
box-sizing: border-box;
border: 1px solid #bbbbbb;
line-height: 55px;
margin-right: 20px;
> .left {
width: 140px;
background: #0bab0c;
font-size: 14px;
color: #fff;
text-align: center;
}
> .middle {
> div {
margin-right: 5px;
}
.left-text {
margin-left: 10px;
}
.middle {
margin-right: 20px;
}
}
.right {
margin-left: 20px;
}
// background: black;
}
}
</style>
\ No newline at end of file
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