diff --git a/src/api/contest.js b/src/api/contest.js index 910e8399a..f78d09814 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -2,14 +2,14 @@ import request from '@/utils/request'; /** * 获取竞赛试卷分页列表 - * @param {Object} data - * @param {String} data.name 试卷名称 + * @param {Object} params + * @param {String} params.name 试卷名称 */ -export function getPaperList(data) { +export function getPaperList(params) { return request({ - url: '/api/exercise/race/pager/page', + url: '/api/exercise/race/paper/page', method: 'GET', - data + params }); } @@ -19,6 +19,7 @@ export function getPaperList(data) { * @param {String} data.name 试卷名称 * @param {String} data.desc 基础描述 * @param {Number} data.seasonId 所属赛季id + * @param {Boolean} data.supportCopy 是否支持拷贝 */ export function createPaper(data) { return request({ @@ -50,81 +51,42 @@ export function deletePaper(id) { }); } -/** - * 获取竞赛模块分页列表 +/** 模块修改任务设置 * @param {Object} data - * @param {String} data.paperName 试卷名称 - * @param {Number} data.paperId 试卷id - * @param {String} data.code 模块名称 + * @param {Array} data.modules 所有模块 + * @param {Number} data.modules[i].module_name 模块名字 + * @param {Number} data.modules[i].duration 考试总时间 + * @param {Number} data.modules[i].group 任务分组 + * @param {Number} data.modules[i].group.taskIds 此分组中的任务id + * @param {Number} data.modules[i].group.name 此组的名字 + * @param {Number} data.modules[i].group.group 此分组的子分组 */ -export function getModuleList(data) { +export function paperModuleTaskSetting(paperId, data) { return request({ - url: '/api/exercise/race/module/page', - method: 'GET', - data - }); -} - -/** - * 创建模块 - * @param {Object} data - * @param {String} data.code 模块名称 - * @param {String} data.desc 基础描述 - * @param {Number} data.paperId 试卷id - */ -export function createModule(data) { - return request({ - url: '/api/exercise/race/module', + url: `/api/exercise/race/paper/${paperId}/config`, method: 'POST', data }); } -/** 修改模块 - * @param {Object} data 同创建试卷 +/** 查看试卷明细 * @param {Number} id 模块id */ -export function editModule(id, data) { +export function getPaperDetail(id) { return request({ - url: `/api/exercise/race/module/${id}`, - method: 'POST', - data - }); -} - -/** 删除指定模块 - * @param {Number} id 模块id - */ -export function deleteModule(id) { - return request({ - url: `/api/exercise/race/module/${id}`, - method: 'DELETE' - }); -} - -/** 查看模块明细 - * @param {Number} id 模块id - */ -export function getModuleDetail(id) { - return request({ - url: `/api/exercise/race/module/${id}`, + url: `/api/exercise/race/paper/${id}`, method: 'GET' }); } -/** 模块修改任务设置 - * @param {Object} data - * @param {Number} data.taskIds 模块里所有任务id(一级任务的id) - * @param {Number} data.group 任务分组 - * @param {Number} data.group.taskIds 次分组中的任务id - * @param {Number} data.group.name 分组的名字 - * @param {Number} data.group.group 次分组的子分组 +/** 试卷拷贝 + * @param {Number} id 模块id */ -export function moduleTaskSetting(moudleId, data) { +export function copyPaper(id) { + console.log(id); return request({ - url: `/api/exercise/race/module/setting/${moudleId}/task`, - method: 'POST', - data + url: `/api/exercise/race/paper/${id}/copy`, + method: 'PUT' }); } diff --git a/src/i18n/langs/en/newRouter.js b/src/i18n/langs/en/newRouter.js index 45ee4a18c..98c457412 100644 --- a/src/i18n/langs/en/newRouter.js +++ b/src/i18n/langs/en/newRouter.js @@ -40,7 +40,6 @@ export default { userRulesManage: 'User Rights Statistics', contestDataManage:'Contest data management', contestSubjectManage:'contest subject management', - contestModuleManage:'contest module management', contestTaskManage:'contest task management', contestSceneManage:'contest scene management', contestTaskScoreManage:'contest task score management', diff --git a/src/i18n/langs/zh/newRouter.js b/src/i18n/langs/zh/newRouter.js index 41580e8ac..392714626 100644 --- a/src/i18n/langs/zh/newRouter.js +++ b/src/i18n/langs/zh/newRouter.js @@ -40,7 +40,6 @@ export default { userRulesManage: '用户权限管理', contestDataManage:'竞赛数据管理', contestSubjectManage:'竞赛题目管理', - contestModuleManage:'竞赛模块管理', contestTaskManage:'竞赛任务管理', contestSceneManage:'竞赛场景管理', contestTaskScoreManage:'竞赛任务评分管理', diff --git a/src/router/index.js b/src/router/index.js index e1ea739b9..ae89ca33e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -223,7 +223,6 @@ const ThirdJumpSim = () => import('@/views/newMap/display/thirdJump'); const TmsPage = () => import('@/views/jlmap3d/drive/sceneview/tmsPage'); const ContestSubjectManage = () => import('@/views/contestDataManage/contestSubjectManage/ContestSubjectManage'); -const ContestModuleManage = () => import('@/views/contestDataManage/contestModuleManage/ContestModuleManage'); const ContestTaskManage = () => import('@/views/contestDataManage/contestTaskManage/ContestTaskManage'); const ContestSceneManage = () => import('@/views/contestDataManage/contestSceneManage/ContestSceneManage'); const ContestTaskScoreManage = () => import('@/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage'); @@ -2040,14 +2039,6 @@ export const asyncRouter = [ i18n: 'newRouter.contestSubjectManage' } }, - { - // 竞赛模块管理 - path: 'contestModuleManage', - component: ContestModuleManage, - meta: { - i18n: 'newRouter.contestModuleManage' - } - }, { // 竞赛任务管理 path: 'contestTaskManage', diff --git a/src/views/contestDataManage/contestModuleManage/AddEditModule.vue b/src/views/contestDataManage/contestModuleManage/AddEditModule.vue deleted file mode 100644 index 8c5f02472..000000000 --- a/src/views/contestDataManage/contestModuleManage/AddEditModule.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - diff --git a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue b/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue deleted file mode 100644 index 18ce2e1f2..000000000 --- a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - - - diff --git a/src/views/contestDataManage/contestModuleManage/DetailModule.vue b/src/views/contestDataManage/contestModuleManage/DetailModule.vue deleted file mode 100644 index 909a4849a..000000000 --- a/src/views/contestDataManage/contestModuleManage/DetailModule.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - diff --git a/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue index 8e5c0a90f..4b4fb83ae 100644 --- a/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue +++ b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue @@ -17,6 +17,9 @@ /> + + + {{ $t('global.confirm') }} @@ -35,7 +38,8 @@ export default { id: '', name: '', // 试卷名称 desc: '', // 任务描述 - seasonId: '' // 所属赛季id + seasonId: '', // 所属赛季id + supportCopy:false // 是否支持拷贝 }, seasonOptions:[], loading: false @@ -71,6 +75,7 @@ export default { this.formModel.name = row.name; this.formModel.desc = row.desc; this.formModel.seasonId = row.seasonId; + this.formModel.supportCopy = row.supportCopy; } else { this.formModel = { id: '', @@ -78,9 +83,6 @@ export default { desc: '', seasonId: '' }; - this.$nextTick(() => { - this.$refs.ruleForm.resetFields(); - }); } }, handleClose() { @@ -88,9 +90,9 @@ export default { id: '', name: '', desc: '', - seasonId: '' + seasonId: '', + supportCopy:false }; - this.$refs.ruleForm.resetFields(); this.dialogVisible = false; this.loading = false; }, @@ -101,7 +103,7 @@ export default { const data = Object.assign({}, this.formModel); delete data.id; if (this.formModel.id) { - editPaper(data).then(() => { + editPaper(this.formModel.id, data).then(() => { this.$message.success('修改试卷成功!'); this.handleClose(); this.$emit('paperListRefresh'); diff --git a/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue index 85ca9b256..697e34c2a 100644 --- a/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue +++ b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue @@ -8,17 +8,19 @@ :query-list="examQueryList" /> + + + diff --git a/src/views/contestDataManage/contestSubjectManage/EditModuleTask.vue b/src/views/contestDataManage/contestSubjectManage/EditModuleTask.vue new file mode 100644 index 000000000..4fe6b75e0 --- /dev/null +++ b/src/views/contestDataManage/contestSubjectManage/EditModuleTask.vue @@ -0,0 +1,166 @@ + + + diff --git a/src/views/contestDataManage/contestTaskManage/AddEditTask.vue b/src/views/contestDataManage/contestTaskManage/AddEditTask.vue index 5957a6ca2..e25590eaf 100644 --- a/src/views/contestDataManage/contestTaskManage/AddEditTask.vue +++ b/src/views/contestDataManage/contestTaskManage/AddEditTask.vue @@ -7,8 +7,8 @@ - - + + @@ -31,7 +31,7 @@ export default { id: '', name: '', // 任务名称 desc: '', // 任务描述 - contest: '', // 考核内容 + content: '', // 考核内容 standards: '', // 评价标准 parentId:'' }, @@ -48,7 +48,7 @@ export default { desc: [ { required: true, message: '请输入任务描述', trigger: 'blur' } ], - contest: [ + content: [ { required: true, message: '请输入考核内容', trigger: 'blur' } ], standards: [ @@ -72,14 +72,14 @@ export default { this.formModel.id = row.id; this.formModel.name = row.name; this.formModel.desc = row.desc; - this.formModel.contest = row.contest; + this.formModel.content = row.content; this.formModel.standards = row.standards; } else { this.formModel = { id: '', name: '', desc: '', - contest: '', + content: '', standards:'', parentId:'' }; @@ -93,7 +93,7 @@ export default { id: '', name: '', desc: '', - contest: '', + content: '', standards:'', parentId:'' }; @@ -111,7 +111,7 @@ export default { delete data.parentId; } if (this.formModel.id) { - editTask(data).then(() => { + editTask(this.formModel.id, data).then(() => { this.$message.success('修改任务成功!'); this.handleClose(); this.$emit('reloadTaskTree');