From 64a673419bdf156ffd79086d74ec3d88b5266678 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 29 Mar 2021 15:01:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/company.js | 15 ++ src/api/management/exam.js | 10 +- src/views/exam/detail/courseDetail.vue | 164 ++++++------------ src/views/exam/detail/examDetail.vue | 4 +- src/views/exam/index.vue | 46 ++--- .../newMap/jointTrainingNew/menuDemon.vue | 35 ++-- .../organization/classManage/bindExams.vue | 97 +++++++++++ src/views/organization/classManage/index.vue | 15 +- src/views/organization/examManage/index.vue | 52 +++--- src/views/organization/lessonManage/index.vue | 10 -- src/views/publish/examRule/index.vue | 13 ++ 11 files changed, 255 insertions(+), 206 deletions(-) create mode 100644 src/views/organization/classManage/bindExams.vue diff --git a/src/api/company.js b/src/api/company.js index 305405d1d..2e5d617de 100644 --- a/src/api/company.js +++ b/src/api/company.js @@ -309,3 +309,18 @@ export function getCanApplyToList(ruleId) { method: 'get' }); } +/** 给班级安排考试 */ +export function applyExamToClass(clsId, data) { + return request({ + url: `/api/company/orgExam/${clsId}`, + method: 'post', + data + }); +} +/** 查询班级下的考试 */ +export function getExamListInClass(clsId) { + return request({ + url: `api/company/orgExam/${clsId}/list`, + method: 'get' + }); +} diff --git a/src/api/management/exam.js b/src/api/management/exam.js index 09a6cc5d5..8cefc50d5 100644 --- a/src/api/management/exam.js +++ b/src/api/management/exam.js @@ -93,7 +93,7 @@ export function getExamListProject(params) { params }); } -/** 查询本项目下自己创建的考试列表不分页 */ +/** 查询本项目下的考试列表不分页 */ export function getExamListProjectUnpage(params) { return request({ url: `/api/exam/list/loginProject`, @@ -109,3 +109,11 @@ export function getExamListSelfByClassId(params) { params }); } +/** 根据地图ID和prdType查询试卷列表 */ +export function getExamListByMapIdAndPrdType(mapId, prdType) { + return request({ + url: `/api/exam/list/${mapId}`, + method: 'get', + params: { prdType: prdType } + }); +} diff --git a/src/views/exam/detail/courseDetail.vue b/src/views/exam/detail/courseDetail.vue index 88aa76d6c..92505e6a9 100644 --- a/src/views/exam/detail/courseDetail.vue +++ b/src/views/exam/detail/courseDetail.vue @@ -1,82 +1,71 @@ + diff --git a/src/views/organization/classManage/index.vue b/src/views/organization/classManage/index.vue index 92369c5dd..30592b942 100644 --- a/src/views/organization/classManage/index.vue +++ b/src/views/organization/classManage/index.vue @@ -9,6 +9,7 @@ /> + @@ -16,11 +17,13 @@ import { getClassListPage, deleteDeptInfo } from '@/api/company'; import CreateClass from './createClass'; import BindLessons from './bindLessons'; +import BindExams from './bindExams'; export default { name: 'ClassManage', components: { CreateClass, - BindLessons + BindLessons, + BindExams }, data() { return { @@ -70,7 +73,7 @@ export default { { type: 'button', title: this.$t('global.operate'), - width: '450', + width: '510', buttons: [ { name: '编辑班级', @@ -95,6 +98,11 @@ export default { handleClick: this.handleBindLesson, type: 'primary' }, + { + name: '安排考试', + handleClick: this.handleBindExam, + type: 'primary' + }, { name: '删除', handleClick: this.handleDeleteClass, @@ -152,6 +160,9 @@ export default { }, classCreate() { this.$refs.createClass.doShow(); + }, + handleBindExam(index, row) { + this.$refs.bindExams.doShow(row); } } }; diff --git a/src/views/organization/examManage/index.vue b/src/views/organization/examManage/index.vue index d20f66c9b..989d625ca 100644 --- a/src/views/organization/examManage/index.vue +++ b/src/views/organization/examManage/index.vue @@ -15,6 +15,7 @@ import { getLessonProjectListNoPage } from '@/api/jmap/lesson'; import { getClassListUnPage } from '@/api/company'; import { getExamListProject, deleteExam } from '@/api/management/exam'; import localStore from 'storejs'; +import { getPublishMapListOnline } from '@/api/jmap/map'; export default { name: 'ExamManage', @@ -24,6 +25,7 @@ export default { pageSize: 'pageSize', pageIndex: 'pageNum' }, + mapIdList: [], examQueryForm: { leftSpan: 14, textAlign: 'right', @@ -46,23 +48,6 @@ export default { type: 'text', label: '创建人:' } - // self: { - // type: 'select', - // label: '本人创建:', - // config: { - // data: [ - // { label: '是', value: true }, - // { label: '否', value: false } - // ] - // } - // } - // clsId: { - // type: 'select', - // label: '班级:', - // config: { - // data: [] - // } - // } } }, examQueryList: { @@ -74,15 +59,20 @@ export default { title: '试卷名称', prop: 'name' }, - // { - // title: '课程名称', - // prop: 'lessonId', - // type: 'tag', - // columnValue: (row) => { - // return this.$convertField(row.lessonId, this.lessonList || [], ['id', 'name']); - // }, - // tagType: (row) => { } - // }, + { + title: '归属地图', + prop: 'mapId', + type: 'tag', + columnValue: (row) => { return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']); }, + tagType: (row) => { return ''; } + }, + { + title: '产品类型', + prop: 'prdType', + type: 'tag', + columnValue: (row) => { if (row.prdType === '01') { return '现地工作站'; } else if (row.prdType === '02') { return '行调工作站'; } }, + tagType: (row) => { return ''; } + }, { title: '班级', prop: 'clsIds', @@ -151,15 +141,13 @@ export default { } }, created() { - getLessonProjectListNoPage().then(response => { - this.lessonList = response.data; - this.lessonList.forEach(item => { - this.examQueryForm.queryObject.lessonId.config.data.push({ value: item.id, label: item.name }); - }); - }); getClassListUnPage().then(response => { this.classList = response.data; }); + this.mapIdList = []; + getPublishMapListOnline().then(response => { + this.mapIdList = response.data; + }); }, methods: { handleQueryGrade(index, row) { diff --git a/src/views/organization/lessonManage/index.vue b/src/views/organization/lessonManage/index.vue index c9cb8c0b5..b6903750f 100644 --- a/src/views/organization/lessonManage/index.vue +++ b/src/views/organization/lessonManage/index.vue @@ -15,7 +15,6 @@ import { getPublishMapListOnline } from '@/api/jmap/map'; import { getLessonProjectList, forceDeleteLesson } from '@/api/jmap/lesson'; import EditLessonInfo from './editLessonInfo'; -import localStore from 'storejs'; export default { name: 'LessonManage', components: { @@ -96,11 +95,6 @@ export default { return row.creatorId == this.userId; } }, - { - name: '考试管理', - handleClick: this.handleExamManage, - type: 'primary' - }, { name: '课程详情', handleClick: this.handleLessonDetail, @@ -155,10 +149,6 @@ export default { this.$refs.lessonQueryListPage.refresh(true); }); }, - handleExamManage(index, row) { - localStore.set('/info/organization/examManage', { lessonId: row.id }); - this.$router.replace('/info/organization/examManage'); - }, handleLessonDetail(index, row) { this.$router.push(`/info/lessonDetail?lessonId=${row.id}`); } diff --git a/src/views/publish/examRule/index.vue b/src/views/publish/examRule/index.vue index 120c4403b..8e0248877 100644 --- a/src/views/publish/examRule/index.vue +++ b/src/views/publish/examRule/index.vue @@ -14,12 +14,14 @@