Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
13aefab82b
331
src/api/contest.js
Normal file
331
src/api/contest.js
Normal file
@ -0,0 +1,331 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取竞赛试卷分页列表
|
||||
* @param {Object} params
|
||||
* @param {String} params.name 试卷名称
|
||||
*/
|
||||
export function getPaperList(params) {
|
||||
return request({
|
||||
url: '/api/exercise/race/paper/page',
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建试卷
|
||||
* @param {Object} data
|
||||
* @param {String} data.name 试卷名称
|
||||
* @param {String} data.desc 基础描述
|
||||
* @param {Number} data.seasonId 所属赛季id
|
||||
* @param {Boolean} data.supportCopy 是否支持拷贝
|
||||
*/
|
||||
export function createPaper(data) {
|
||||
return request({
|
||||
url: '/api/exercise/race/paper',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改试卷
|
||||
* @param {Object} data 同创建试卷
|
||||
* @param {Number} id 试卷id
|
||||
*/
|
||||
export function editPaper(id, data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/paper/${id}`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除指定试卷
|
||||
* @param {Number} id 任务id
|
||||
*/
|
||||
export function deletePaper(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/paper/${id}`,
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
/** 模块修改任务设置
|
||||
* @param {Object} data
|
||||
* @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 paperModuleTaskSetting(paperId, data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/paper/${paperId}/config`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 查看试卷明细
|
||||
* @param {Number} id 模块id
|
||||
*/
|
||||
export function getPaperDetail(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/paper/${id}`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/** 试卷拷贝
|
||||
* @param {Number} id 模块id
|
||||
*/
|
||||
export function copyPaper(id) {
|
||||
console.log(id);
|
||||
return request({
|
||||
url: `/api/exercise/race/paper/${id}/copy`,
|
||||
method: 'PUT'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查看所有任务数据 */
|
||||
export function getTaskTreeDatas() {
|
||||
return request({
|
||||
url: '/api/exercise/race/task/tree',
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建任务
|
||||
* @param {Object} data
|
||||
* @param {String} data.name 任务名称
|
||||
* @param {String} data.desc 基础描述
|
||||
* @param {String} data.content 考核内容
|
||||
* @param {String} data.standards 评价标准
|
||||
* @param {Number} data.parentId 如果是子任务,需要父任务的id
|
||||
*/
|
||||
export function createTask(data) {
|
||||
return request({
|
||||
url: '/api/exercise/race/task',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改指定任务
|
||||
* @param {Object} data 同创建任务
|
||||
* @param {Number} id 任务id
|
||||
*/
|
||||
export function editTask(id, data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${id}`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除指定任务
|
||||
* @param {Number} id 任务id
|
||||
*/
|
||||
export function deleteTask(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${id}`,
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查看任务详情
|
||||
* @param {Number} id 任务id
|
||||
*/
|
||||
export function getTaskDetail(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${id}`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查看指定子任务
|
||||
* @param {Number} id 任务id
|
||||
*/
|
||||
export function getchildrenTaskDatas(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${id}/children`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/** 任务绑定
|
||||
* @param {Array} data
|
||||
* @param {Number} taskId 任务id
|
||||
* @param {Number} data[i].bindId 绑定id,根据bindtype来区分对应的id
|
||||
* @param {String} data[i].bindType rule =0评分规则;scene=1场景
|
||||
* @param {Number} data[i].status 0=绑定 ;1=解绑
|
||||
*/
|
||||
export function bindTask(taskId, data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${taskId}/bind`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 竞赛赛季添加
|
||||
* @param {Object} data
|
||||
* @param {Number} data.group 分组 1-高职 2中职
|
||||
* @param {String} data.term 赛季
|
||||
* @param {String} data.code 编号
|
||||
*/
|
||||
export function addContestSeason(data) {
|
||||
return request({
|
||||
url: '/api/exercise/race/season',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 竞赛赛季分页查询
|
||||
* @param {Object} params
|
||||
* @param {Number} params.group 分组 1-高职 2中职
|
||||
* @param {String} params.term 赛季
|
||||
* @param {String} params.code 编号
|
||||
*/
|
||||
export function queryContestSeasonPaged(params) {
|
||||
return request({
|
||||
url: '/api/exercise/race/season/page',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 竞赛赛季修改
|
||||
* @param {Object} data
|
||||
* @param {Number} id 赛季id
|
||||
* @param {String} data.group 分组 ZZ=中职;GZ=高职
|
||||
* @param {String} data.term 赛季
|
||||
* @param {String} data.code 编号
|
||||
*/
|
||||
export function updateContestSeason(id, data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/season/${id}`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 竞赛赛季删除
|
||||
* @param {Number} id 赛季id
|
||||
*/
|
||||
export function deleteContestSeason(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/season/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 竞赛评分创建基本信息
|
||||
* @param {Object} data
|
||||
* @param {String} data.name 名称
|
||||
*/
|
||||
export function createContextScore(data) {
|
||||
return request({
|
||||
url: '/api/exercise/race/score',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 竞赛评分列表分页
|
||||
* @param {Object} params
|
||||
* @param {String} params.name 名称
|
||||
*/
|
||||
export function queryContextScorePaged(params) {
|
||||
return request({
|
||||
url: '/api/exercise/race/score/page',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 竞赛评分删除
|
||||
* @param {Number} id 评分id
|
||||
*/
|
||||
export function deleteContextScore(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/score/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 竞赛评分修改评分详情内容
|
||||
* @param {Number} id 评分id
|
||||
* @param {Object} data
|
||||
* @param {Array [object]} data.units 评分单元
|
||||
* @param {String} data.units[0].text 文字描述
|
||||
* @param {Number} data.units[0].sceneStepId 场景步骤ID
|
||||
* @param {Number} data.units[0].score 分值
|
||||
* @param {String} data.units[0].worker 作业程序
|
||||
* @param {String} data.units[0].criteria 评分标准
|
||||
*/
|
||||
export function updateContextScoreDetail(id, data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/score/edit/rule/${id}`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 竞赛评分详情
|
||||
* @param {Number} id 评分id
|
||||
*/
|
||||
export function getContextScoreDetail(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/score/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 竞赛场景分页查询
|
||||
* @param {Object} params
|
||||
* @param {String} params.type 竞赛类型 local=场景;link=3D
|
||||
*/
|
||||
export function queryContestSencePaged(params) {
|
||||
return request({
|
||||
url: '/api/exercise/race/scene/page',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 竞赛场景删除
|
||||
* @param {Number} id 场景id
|
||||
*/
|
||||
export function deleteContestSence(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/scene/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 竞赛场景详情
|
||||
* @param {Number} id 场景id
|
||||
*/
|
||||
export function getContextSenceDetail(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/scene/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 实训场景发布到大赛场景
|
||||
* @param {Object} data
|
||||
* @param {Number} data.traningPublishId 草稿实训场景id
|
||||
* @param {String} data.name 大赛场景名称
|
||||
*/
|
||||
export function publishContextSence(data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/scene/publish/training`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 竞赛试卷测试模块任务集合
|
||||
* @param {String} paperId 试卷id
|
||||
* @param {String} moduleId 模块id
|
||||
*/
|
||||
export function getTaskTree(paperId, moduleId) {
|
||||
return request({
|
||||
url: `/api/exercise/race/paper/page/${paperId}/module/${moduleId}/task`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
@ -599,3 +599,11 @@ export function controlYjTrain(simulationId, right) {
|
||||
params: { right }
|
||||
});
|
||||
}
|
||||
/** 创建仿真(不通过功能id) */
|
||||
export function createSimulationNoFunction(mapId, data) {
|
||||
return request({
|
||||
url: `/simulation/new/${mapId}`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -38,6 +38,12 @@ export default {
|
||||
permissionManage: 'Permission',
|
||||
authorityTransferManage: 'Privilege distribution management',
|
||||
userRulesManage: 'User Rights Statistics',
|
||||
contestDataManage:'Contest data management',
|
||||
contestSubjectManage:'contest subject management',
|
||||
contestTaskManage:'contest task management',
|
||||
contestSceneManage:'contest scene management',
|
||||
contestTaskScoreManage:'contest task score management',
|
||||
contestSeasonManage:'contest season management',
|
||||
fileManage: 'File Manage',
|
||||
frontResourceManage: 'Front-End Resource Management',
|
||||
iscsPrerecordManage: 'ISCS Advance record management',
|
||||
|
@ -38,6 +38,12 @@ export default {
|
||||
permissionManage: '权限管理',
|
||||
authorityTransferManage: '权限分发管理',
|
||||
userRulesManage: '用户权限管理',
|
||||
contestDataManage:'竞赛数据管理',
|
||||
contestSubjectManage:'竞赛题目管理',
|
||||
contestTaskManage:'竞赛任务管理',
|
||||
contestSceneManage:'竞赛场景管理',
|
||||
contestTaskScoreManage:'竞赛任务评分管理',
|
||||
contestSeasonManage:'竞赛赛季管理',
|
||||
fileManage: '文件管理',
|
||||
frontResourceManage: '前端资源管理',
|
||||
iscsPrerecordManage: 'ISCS预录管理',
|
||||
|
@ -220,7 +220,16 @@ const UserRulesManage = () => import('@/views/userRulesManage/index');
|
||||
const AuthorityTransfer = () => import('@/views/authorityTransfer/index');
|
||||
const CreateDistribute = () => import('@/views/authorityTransfer/create/index');
|
||||
const ThirdJumpSim = () => import('@/views/newMap/display/thirdJump');
|
||||
const TmsPage = () => import('@/views/jlmap3d/drive/sceneview/tmsPage')
|
||||
const TmsPage = () => import('@/views/jlmap3d/drive/sceneview/tmsPage');
|
||||
|
||||
const ContestSubjectManage = () => import('@/views/contestDataManage/contestSubjectManage/ContestSubjectManage');
|
||||
const ContestTaskManage = () => import('@/views/contestDataManage/contestTaskManage/ContestTaskManage');
|
||||
const ContestSceneManage = () => import('@/views/contestDataManage/contestSceneManage/ContestSceneManage');
|
||||
const ContestTaskScoreManage = () => import('@/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage');
|
||||
const ContestSeasonManage = () => import('@/views/contestDataManage/contestSeasonManage/ContestSeasonManage');
|
||||
const ContestScoreEdit = () => import('@/views/contestDataManage/contestTaskScoreManage/edit');
|
||||
const ContestList = () => import('@/views/contest/contestList');
|
||||
const ContestDetail = () => import('@/views/contest/contestDetail');
|
||||
|
||||
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
|
||||
// import { getSessionStorage } from '@/utils/auth';
|
||||
@ -324,13 +333,13 @@ export const constantRoutes = [
|
||||
path: '/jlmap3d/lcjy',
|
||||
component: LcJy,
|
||||
hidden: true
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: '/tmsPage',
|
||||
component: TmsPage,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/tmsPage',
|
||||
component: TmsPage,
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{
|
||||
path: '/data2json',
|
||||
@ -666,8 +675,24 @@ export const publicAsyncRoute = [
|
||||
path: '/pis',
|
||||
component: PisScreen,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/contest',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
component: ContestList,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'detail',
|
||||
component: ContestDetail,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
];
|
||||
// 城市轨道项目
|
||||
export const asyncRouter = [
|
||||
@ -2017,6 +2042,60 @@ export const asyncRouter = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{ // 竞赛数据管理
|
||||
path: 'contestDataManage',
|
||||
component: TransitionIndex,
|
||||
meta: {
|
||||
i18n: 'newRouter.contestDataManage'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
// 竞赛题目管理
|
||||
path: 'contestSubjectManage',
|
||||
component: ContestSubjectManage,
|
||||
meta: {
|
||||
i18n: 'newRouter.contestSubjectManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
// 竞赛任务管理
|
||||
path: 'contestTaskManage',
|
||||
component: ContestTaskManage,
|
||||
meta: {
|
||||
i18n: 'newRouter.contestTaskManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
// 竞赛场景管理
|
||||
path: 'contestSceneManage',
|
||||
component: ContestSceneManage,
|
||||
meta: {
|
||||
i18n: 'newRouter.contestSceneManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
// 竞赛任务评分管理
|
||||
path: 'contestTaskScoreManage',
|
||||
component: ContestTaskScoreManage,
|
||||
meta: {
|
||||
i18n: 'newRouter.contestTaskScoreManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'contestTaskScoreEdit',
|
||||
component: ContestScoreEdit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
// 竞赛赛季管理
|
||||
path: 'contestSeasonManage',
|
||||
component: ContestSeasonManage,
|
||||
meta: {
|
||||
i18n: 'newRouter.contestSeasonManage'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{ // 项目数据管理
|
||||
path: 'projectDataManage',
|
||||
component: TransitionIndex,
|
||||
|
@ -40,7 +40,9 @@ function hasPermission(roles, route, parentsRoles) {
|
||||
*/
|
||||
function resetAsyncRouter() {
|
||||
let list = publicAsyncRoute;
|
||||
list = [...list, ...asyncRouter];
|
||||
if (getSessionStorage('project') !== 'dsxl') {
|
||||
list = [...list, ...asyncRouter];
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -23,25 +23,25 @@ export function handlerUrl() {
|
||||
let OSS_URL;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// 开发分支
|
||||
BASE_API = 'http://192.168.3.233/rtss-server';
|
||||
BASE_API = 'http://192.168.33.233/rtss-server';
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://114.116.51.125/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.47:9000'; // 周寅
|
||||
// BASE_API = 'http://192.168.33.93:9000'; // 周寅
|
||||
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.33.207:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
|
||||
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
BASE_SITE = 'https://test.joylink.club/cbtc';
|
||||
OSS_URL = 'https://192.168.3.233/oss-rtss';
|
||||
OSS_URL = 'http://192.168.33.233/oss-rtss';
|
||||
} else if (process.env.NODE_ENV === 'test' && process.env.VUE_APP_PRO === 'local-test') {
|
||||
// 本地打包测试分支
|
||||
BASE_API = 'https://192.168.3.233/rtss-server'; // api地址
|
||||
BASE_SITE = 'https://192.168.3.233/cbtc'; // 前端项目地址
|
||||
OSS_URL = 'https://192.168.3.233/oss-rtss'; // 资源地址
|
||||
BASE_API = 'http://192.168.33.233/rtss-server'; // api地址
|
||||
BASE_SITE = 'http://192.168.33.233/cbtc'; // 前端项目地址
|
||||
OSS_URL = 'http://192.168.33.233/oss-rtss'; // 资源地址
|
||||
} else if (process.env.NODE_ENV === 'test') {
|
||||
// 测试分支
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
|
254
src/views/contest/contestDetail.vue
Normal file
254
src/views/contest/contestDetail.vue
Normal file
@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<el-row class="container">
|
||||
<el-col :span="5" class="container-left">
|
||||
<el-tree
|
||||
:data="taskData"
|
||||
node-key="name"
|
||||
current-node-key
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
:highlight-current="false"
|
||||
style="background-color: transparent;max-height: calc(100% - 54px);overflow-y: auto;"
|
||||
:expand-on-click-node="false"
|
||||
>
|
||||
<div slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<div :style="{ color: nowData.name === data.name? '#8f079d': '#fff' }">{{ data.groupName||data.name }}</div>
|
||||
</div>
|
||||
</el-tree>
|
||||
<div class="button-group">
|
||||
<el-button-group>
|
||||
<el-button size="small" type="primary" @click="submit">提交</el-button>
|
||||
<el-button size="small" type="danger" @click="goBack">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="19" class="container-right">
|
||||
<el-card class="box-card" style="color: #fff;background-color: transparent;height: 100%">
|
||||
<div slot="header" style="text-align: center">
|
||||
<span style="font-size: 28px;">{{ nowData.name }}</span>
|
||||
</div>
|
||||
<div style="padding: 20px;">
|
||||
<el-row style="margin-top: 10px;white-space: pre-wrap;">
|
||||
<el-col :span="3" style="text-align: right;">基础描述:</el-col>
|
||||
<el-col :span="20">{{ nowData.desc }}</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;white-space: pre-wrap;">
|
||||
<el-col :span="3" style="text-align: right;">考核内容:</el-col>
|
||||
<el-col :span="20">{{ nowData.content }}</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;white-space: pre-wrap;">
|
||||
<el-col :span="3" style="text-align: right;">评价标准:</el-col>
|
||||
<el-col :span="20">{{ nowData.standards }}</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div style="text-align: center;margin-top: 15px;">
|
||||
<el-button v-show="nowData.ruleId" type="primary">评分表</el-button>
|
||||
<el-button v-show="nowData.sceneId" type="primary">开始任务</el-button>
|
||||
<el-button type="primary" :disabled="nowKey === taskList.length-1" @click="nextTask">下一任务</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<score-rule ref="scoreRule" />
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTaskTree } from '@/api/contest';
|
||||
import ScoreRule from './scoreRule';
|
||||
export default {
|
||||
name: 'ContestDetail',
|
||||
components: {
|
||||
ScoreRule
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nowKey: 0,
|
||||
taskList: [],
|
||||
taskData: [],
|
||||
nowData: {},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
disabled: true
|
||||
},
|
||||
funcitonData: {
|
||||
type: 'METRO',
|
||||
itemMap: {
|
||||
DEFAULT_MEMBER: ''
|
||||
},
|
||||
domConfig: {
|
||||
singleMember: false,
|
||||
singleClient: false,
|
||||
client: 'dispatchWork',
|
||||
hasTraining: false,
|
||||
hasExam: false,
|
||||
trainingDesign: true,
|
||||
hasLpf: false,
|
||||
hasVoice: true,
|
||||
joint: false,
|
||||
hasDeviceManage: false,
|
||||
hasMemberManage: true
|
||||
}
|
||||
},
|
||||
resp: {
|
||||
customModuleId: 2,
|
||||
child: [
|
||||
{
|
||||
id: 0,
|
||||
name: '车站行车作业',
|
||||
desc: '',
|
||||
content: '',
|
||||
standards: '',
|
||||
sceneId: 0,
|
||||
ruleId: 0,
|
||||
parentId: 0,
|
||||
children: [
|
||||
{
|
||||
id: 45,
|
||||
name: '正常行车组织工作',
|
||||
desc: '利用智慧城轨运营模拟训练平台ATS系统,加载既定的列车运行图,选取某时刻(9:00)开始模拟列车运行。',
|
||||
content: '1,组织管辖车站范围内图定列车按计划运行\n2,控制权交接',
|
||||
standards: '。。',
|
||||
sceneId: 0,
|
||||
ruleId: 0,
|
||||
parentId: 0,
|
||||
children: [
|
||||
{
|
||||
id: 46,
|
||||
name: '组织管辖车站范围内图定列车按计划运行',
|
||||
desc: '核对运行计划。',
|
||||
content: '行调与车站值班员确认本站站台及相邻区间列车状态。',
|
||||
standards: '车站值班员手指口呼确认本站站台及相邻区间列车占用状态并与行调核对车次及位置正确、用语标准。',
|
||||
sceneId: 0,
|
||||
ruleId: 0,
|
||||
parentId: 45,
|
||||
isTask: true
|
||||
},
|
||||
{
|
||||
id: 47,
|
||||
name: '控制权交接',
|
||||
desc: '控制权交接操作。',
|
||||
content: '行调与车站值班员确认ATS站中控状态并进行控制权转换操作。',
|
||||
standards: '车站值班员手指口呼确认本站ATS站中控状态并进行控制权转换操作,正常完成控制权转换。按标准用语汇报。',
|
||||
sceneId: 0,
|
||||
ruleId: 0,
|
||||
parentId: 45,
|
||||
isTask: true
|
||||
}
|
||||
],
|
||||
isTask: true
|
||||
},
|
||||
{
|
||||
id: 35,
|
||||
name: '运营工作准备',
|
||||
desc: '利用智慧城轨运营模拟训练平台ATS系统,加载既定的列车运行图,选取运营开始前30分钟,开始运营前检查工作。',
|
||||
content: '1,人员准备\n2,检查ATS设备\n3,检查IBP\n4,站台门检查',
|
||||
standards: '。。',
|
||||
sceneId: 0,
|
||||
ruleId: 0,
|
||||
parentId: 0,
|
||||
children: [
|
||||
{
|
||||
id: 41,
|
||||
name: '人员准备',
|
||||
desc: '检查人员工作状态',
|
||||
content: '检查运营前人员形象礼仪及精神状态。',
|
||||
standards: '运营前人员形象礼仪及精神状态符合企业服务标准要求。',
|
||||
sceneId: 0,
|
||||
ruleId: 0,
|
||||
parentId: 35,
|
||||
isTask: true
|
||||
},
|
||||
{
|
||||
id: 42,
|
||||
name: '检查本地ATS设备',
|
||||
desc: '检查车站ATS状态。',
|
||||
content: '检查车站ATS工作站中的所有道岔、信号机、计轴区段状态。',
|
||||
standards: '手指口呼确认道岔、信号机、计轴状态等设备状态是否全部正常。',
|
||||
sceneId: 0,
|
||||
ruleId: 0,
|
||||
parentId: 35,
|
||||
isTask: true
|
||||
}
|
||||
],
|
||||
isTask: true
|
||||
}
|
||||
],
|
||||
isTask: false
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.taskData = JSON.parse(this.resp);
|
||||
this.taskData = this.resp.child;
|
||||
this.taskList = [];
|
||||
this.eachTask(this.taskList, this.taskData);
|
||||
this.nowKey = 0;
|
||||
this.nowData = this.taskList[this.nowKey];
|
||||
getTaskTree(this.$route.query.paperId, this.$route.query.moduleId).then(resp => {
|
||||
|
||||
}).catch(() => this.$message.error('加载数据失败!'));
|
||||
},
|
||||
methods: {
|
||||
handleChange(data, node) {
|
||||
node.isCurrent = false;
|
||||
this.$set(node, 'isCurrent', false);
|
||||
this.nowData = data;
|
||||
},
|
||||
eachTask(list, data) {
|
||||
data.forEach(ele => {
|
||||
if (ele.isTask) {
|
||||
list.push(ele);
|
||||
}
|
||||
if (ele.children) {
|
||||
this.eachTask(list, ele.children);
|
||||
}
|
||||
});
|
||||
},
|
||||
nextTask() {
|
||||
this.nowKey++;
|
||||
this.nowData = this.taskList[this.nowKey];
|
||||
},
|
||||
goBack() {
|
||||
this.$router.push('/contest/list');
|
||||
},
|
||||
submit() {
|
||||
this.$router.push('/contest/list');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
background: linear-gradient(to bottom, #01468B, #00172E);
|
||||
height: 100%;
|
||||
}
|
||||
.container-left{
|
||||
height: 100%;
|
||||
padding-top: 10px;
|
||||
}
|
||||
.container-right{
|
||||
background: #00172E;
|
||||
border: solid 1px #01468B;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
}
|
||||
.custom-tree-node{
|
||||
color: #fff;
|
||||
}
|
||||
.button-group {
|
||||
width: 20.9%;
|
||||
text-align: right;
|
||||
padding: 10px;
|
||||
border-top: 2px solid #01468B;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
/deep/.el-tree-node__content{
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
</style>
|
188
src/views/contest/contestList.vue
Normal file
188
src/views/contest/contestList.vue
Normal file
@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<div class="trainingPlatform" :style="'padding-left:'+(widthLeft)+'px'">
|
||||
<div class="trainingPubMapList" :style="{width: widthLeft+'px'}">
|
||||
<paper-list ref="paperList" @changeModuleData="changeModuleData" />
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
</div>
|
||||
<div>
|
||||
<div style="height: 50px;text-align: center;line-height: 50px;font-size: 26px;font-weight: bolder;">{{ paperName }}</div>
|
||||
<el-tabs v-model="activeModuleName" class="tabs-box" type="border-card" @tab-click="handleTabClick">
|
||||
<template v-for="(mod, modIndex) in moduleList">
|
||||
<el-tab-pane :key="modIndex" :label="mod.moduleName" :name="mod.customModuleId+''">
|
||||
<el-card style="padding:10px">
|
||||
<div>考试时间:{{ mod.duration }}分钟</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 10px;">
|
||||
<div style="padding:10px"> 任务目录:</div>
|
||||
<el-tree
|
||||
:data="taskTreeDatas"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:expand-on-click-node="false"
|
||||
/>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 10px;">
|
||||
<div style="padding:10px"> 评分规则:</div>
|
||||
<el-table
|
||||
:data="ruleData"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
style="width: 100%;margin-top: 10px;"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="描述" prop="text" />
|
||||
<el-table-column label="作业程序" prop="worker" />
|
||||
<el-table-column label="分值" prop="score" width="50" />
|
||||
<el-table-column label="评分标准" prop="criteria" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-button type="primary" size="medium" style="margin-top: 10px;" @click="beginExercise(mod.customModuleId)">开始训练</el-button>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import paperList from './paperList';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import { getPaperDetail, getContextScoreDetail} from '@/api/contest';
|
||||
let id = 1;
|
||||
|
||||
export default {
|
||||
name: 'TrainingPlatform',
|
||||
components: {
|
||||
paperList,
|
||||
drapLeft
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
widthLeft: 380,
|
||||
paperName:'试卷',
|
||||
paperId:'',
|
||||
activeModuleName:'',
|
||||
moduleList:[],
|
||||
moduleTreeDatas:[],
|
||||
taskTreeDatas:[],
|
||||
ruleData:[]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
changeModuleData(paper) {
|
||||
this.paperName = paper.name;
|
||||
this.paperId = paper.id;
|
||||
getPaperDetail(paper.id).then((res) => {
|
||||
this.moduleList = res.data.moduleVo.modules;
|
||||
this.activeModuleName = this.moduleList[0].customModuleId + '';
|
||||
this.moduleTreeDatas = this.moduleList.map(moduleItem=>{
|
||||
let children = [];
|
||||
if (moduleItem.group.length) {
|
||||
children = moduleItem.group.map(taskCatalog=> this.transformTree(taskCatalog));
|
||||
}
|
||||
return {
|
||||
id:id++,
|
||||
label:moduleItem.moduleName,
|
||||
duration:moduleItem.duration,
|
||||
moduleScoreRuleId:moduleItem.moduleScoreRuleId,
|
||||
customModuleId:moduleItem.customModuleId,
|
||||
type:'module',
|
||||
children
|
||||
};
|
||||
});
|
||||
this.taskTreeDatas = this.moduleTreeDatas[0].children;
|
||||
getContextScoreDetail(this.moduleTreeDatas[0].moduleScoreRuleId).then(res => {
|
||||
this.ruleData = res.data.rule ? res.data.rule.units : [];
|
||||
}).catch(() => { this.ruleData = []; });
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
},
|
||||
handleTabClick(tab) {
|
||||
const moduleItem = this.moduleTreeDatas.find((item)=>item.customModuleId == tab.name);
|
||||
this.taskTreeDatas = moduleItem.children;
|
||||
getContextScoreDetail(moduleItem.moduleScoreRuleId).then(res => {
|
||||
this.ruleData = res.data.rule ? res.data.rule.units : [];
|
||||
}).catch(() => { this.ruleData = []; });
|
||||
},
|
||||
beginExercise(moduleId) {
|
||||
this.$router.push({path: '/contest/detail', query:{paperId:this.paperId, moduleId }});
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总分';
|
||||
return;
|
||||
}
|
||||
if (index === 3) {
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += '';
|
||||
} else {
|
||||
sums[index] = '/';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
},
|
||||
transformTree(data) {
|
||||
const result = {label:data.name, children:[], id:id++, type:'taskCatalog' };
|
||||
if (data.group.length) {
|
||||
const changeGroup = data.group.map(taskCatalog=>
|
||||
this.transformTree(taskCatalog)
|
||||
);
|
||||
result.children.push(...changeGroup);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.trainingPlatform {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.trainingPubMapList {
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
height: 100%;
|
||||
background: #00172E;
|
||||
}
|
||||
.tabs-box{
|
||||
height: calc(100% - 30px);
|
||||
margin: 0 10px;
|
||||
overflow-y: auto;
|
||||
background: transparent;
|
||||
&::-webkit-scrollbar{
|
||||
background: #06284a;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb{
|
||||
background: #0c0909;
|
||||
}
|
||||
&::-webkit-scrollbar-track{
|
||||
background: #06284a;
|
||||
}
|
||||
}
|
||||
</style>
|
150
src/views/contest/paperList.vue
Normal file
150
src/views/contest/paperList.vue
Normal file
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div v-loading="loading" class="paper-list-main">
|
||||
<div id="trainingMapTree" class="left-paper-list">
|
||||
<div class="paperListName">
|
||||
<el-form :inline="true" :model="formModel" class="demo-form-inline">
|
||||
<el-form-item label="组别" :label-style="{ color: 'red' }">
|
||||
<el-select v-model="formModel.group" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in groupOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛季">
|
||||
<el-select v-model="formModel.seasonId" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in seasonOptions"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="medium" @click="queryPaper">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-menu
|
||||
:default-active="defaultIndex"
|
||||
class="el-menu-vertical-demo"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
>
|
||||
<template v-for="(paper,paperIndex) in paperList">
|
||||
<el-menu-item :key="paperIndex" :index="paper.id+''" @click="showPaperDetail(paper)">
|
||||
{{ paper.name }}
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</el-menu>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { queryContestSeasonPaged, getPaperList} from '@/api/contest';
|
||||
export default {
|
||||
name: 'DemonList',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
formModel: {
|
||||
seasonId: '', // 所属赛季id
|
||||
group:'GZ' // 高职和中职
|
||||
},
|
||||
groupOption:[{
|
||||
value: 'ZZ',
|
||||
label: '中职'
|
||||
}, {
|
||||
value: 'GZ',
|
||||
label: '高职'
|
||||
}],
|
||||
seasonOptions:[],
|
||||
paperList:[],
|
||||
defaultIndex: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loading = false;
|
||||
queryContestSeasonPaged({pageSize:999}).then((res) => {
|
||||
this.seasonOptions = res.data.list;
|
||||
});
|
||||
getPaperList({ group:'GZ', pageSize:999}).then((res) => {
|
||||
this.paperList = res.data.list;
|
||||
this.defaultIndex = this.paperList[0].id + '';
|
||||
this.$emit('changeModuleData', this.paperList[0]);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
queryPaper() {
|
||||
const data = Object.assign({pageSize:999}, this.formModel);
|
||||
getPaperList(data).then((res) => {
|
||||
this.paperList = res.data.list;
|
||||
});
|
||||
|
||||
},
|
||||
showPaperDetail(paper) {
|
||||
this.$emit('changeModuleData', paper);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.paper-list-main{
|
||||
height: 100%;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
.left-paper-list{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
padding-bottom: 10px;
|
||||
background: linear-gradient(to bottom, #01468B, #00172E);
|
||||
&::-webkit-scrollbar{
|
||||
background: #06284a;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb{
|
||||
background: #0c0909;
|
||||
}
|
||||
&::-webkit-scrollbar-track{
|
||||
background: #06284a;
|
||||
}
|
||||
.paperListName{
|
||||
padding: 10px 0 10px 17px;
|
||||
background: #01468B;
|
||||
position: sticky;
|
||||
position: -webkit-sticky;
|
||||
border-bottom: 1px solid #00172E;
|
||||
top: 0;
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-menu{
|
||||
background-color: transparent;
|
||||
.el-menu-item{
|
||||
&:hover{
|
||||
background: #00172E;
|
||||
}
|
||||
&:focus{
|
||||
background-color: #00172E;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/{
|
||||
.el-menu{
|
||||
border-right-width: 0;
|
||||
}
|
||||
}
|
||||
/deep/{
|
||||
.el-form-item__label{
|
||||
color: white !important;
|
||||
}
|
||||
}
|
||||
</style>
|
67
src/views/contest/scoreRule.vue
Normal file
67
src/views/contest/scoreRule.vue
Normal file
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="评分表" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
style="width: 100%;margin-top: 10px;"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="描述" prop="text" />
|
||||
<el-table-column label="作业程序" prop="worker" />
|
||||
<el-table-column label="分值" prop="score" width="50" />
|
||||
<el-table-column label="评分标准" prop="criteria" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getContextScoreDetail } from '@/api/contest';
|
||||
export default {
|
||||
name: 'ScoreRule',
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
dialogVisible: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow(index, row) {
|
||||
this.dialogVisible = true;
|
||||
getContextScoreDetail(this.$route.query.id).then(resp => {
|
||||
this.tableData = resp.data.rule ? resp.data.rule.units : [];
|
||||
}).catch(() => { this.$message.error('初始化数据失败!'); });
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总分';
|
||||
return;
|
||||
}
|
||||
if (index === 3) {
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += '';
|
||||
} else {
|
||||
sums[index] = '/';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div>
|
||||
<query-list-page ref="user" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryContestSencePaged, deleteContestSence } from '@/api/contest';
|
||||
export default {
|
||||
name: 'ContestSeasonManage',
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '80px',
|
||||
leftSpan: 18,
|
||||
beforeQuery: this.beforeQuery,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名 称'
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '类 型',
|
||||
config: {
|
||||
data: [{label: '二维', value: 'Local'}, {label: '三维', value: 'Link'}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: queryContestSencePaged,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '名 称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '地图',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '类 型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.type === 'Local' ? '二维' : '三维'; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.createTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
prop: 'updateTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.updateTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操 作',
|
||||
width: '320',
|
||||
buttons: [
|
||||
// {
|
||||
// name: '编辑',
|
||||
// handleClick: this.doEdit
|
||||
// },
|
||||
{
|
||||
name: '删 除',
|
||||
handleClick: this.doDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
// actions: [
|
||||
// { text: '添 加', handler: this.doCreate }
|
||||
// ]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
doCreate() {
|
||||
// this.$refs.addSeason.doShow();
|
||||
},
|
||||
doEdit(row) {
|
||||
// this.$refs.addSeason.doShow(row);
|
||||
},
|
||||
doDelete(index, row) {
|
||||
this.$confirm('该操作将删除竞赛场景,是否继续?', '提 示', {
|
||||
confirmButtonText: '确 定',
|
||||
cancelButtonText: '取 消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContestSence(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
}).catch(error => {
|
||||
this.$message.error(`删除删除竞赛场景失败: ${error.message}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<div>
|
||||
<query-list-page ref="user" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<add-season ref="addSeason" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryContestSeasonPaged, deleteContestSeason } from '@/api/contest';
|
||||
import AddSeason from './add';
|
||||
export default {
|
||||
name: 'ContestSeasonManage',
|
||||
components: {
|
||||
AddSeason
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '80px',
|
||||
leftSpan: 18,
|
||||
queryObject: {
|
||||
code: {
|
||||
type: 'text',
|
||||
label: '编 号'
|
||||
},
|
||||
group: {
|
||||
type: 'select',
|
||||
label: '组 别',
|
||||
config: {
|
||||
data: [{label: '高职', value: 'GZ'}, {label: '中职', value: 'ZZ'}]
|
||||
}
|
||||
},
|
||||
term: {
|
||||
type: 'text',
|
||||
label: '年 度'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: queryContestSeasonPaged,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '编 号',
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '组 别',
|
||||
prop: 'group',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.group === 'GZ' ? '高职' : '中职'; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '年 度',
|
||||
prop: 'term'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.createTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
prop: 'updateTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.updateTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操 作',
|
||||
width: '320',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.doEdit
|
||||
},
|
||||
{
|
||||
name: '删 除',
|
||||
handleClick: this.doDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '添 加', handler: this.doCreate }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
doCreate() {
|
||||
this.$refs.addSeason.doShow();
|
||||
},
|
||||
doEdit(index, row) {
|
||||
this.$refs.addSeason.doShow(row);
|
||||
},
|
||||
doDelete(index, row) {
|
||||
this.$confirm('该操作将删除竞赛赛季,是否继续?', '提 示', {
|
||||
confirmButtonText: '确 定',
|
||||
cancelButtonText: '取 消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContestSeason(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
}).catch(error => {
|
||||
this.$message.error(`删除删除竞赛赛季失败: ${error.message}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
107
src/views/contestDataManage/contestSeasonManage/add.vue
Normal file
107
src/views/contestDataManage/contestSeasonManage/add.vue
Normal file
@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="130px">
|
||||
<el-form-item label="赛季编码:" prop="code">
|
||||
<el-input v-model="formModel.code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="赛季组别:" prop="group">
|
||||
<el-select v-model="formModel.group" filterable placeholder="请选择" size="small" style="width: 200px;">
|
||||
<el-option v-for="item in groupList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="赛季年度:" prop="term">
|
||||
<el-input v-model="formModel.term" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { addContestSeason, updateContestSeason } from '@/api/contest';
|
||||
export default {
|
||||
name: 'AddSeason',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
groupList:[{label: '高职', value: 'GZ'}, {label: '中职', value: 'ZZ'}],
|
||||
formModel: {
|
||||
id: '',
|
||||
code: '',
|
||||
term: '',
|
||||
group: 'GZ'
|
||||
},
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
code: [
|
||||
{ required: true, message: '请输入赛季编码', trigger: 'blur' }
|
||||
],
|
||||
term: [
|
||||
{ required: true, message: '请输入赛季年度', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return this.formModel.id ? '修改赛季' : '创建赛季';
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
this.dialogVisible = true;
|
||||
if (row) {
|
||||
this.formModel.id = row.id;
|
||||
this.formModel.code = row.code;
|
||||
this.formModel.term = row.term;
|
||||
this.formModel.group = row.group;
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
code: '',
|
||||
term: '',
|
||||
group: 1
|
||||
};
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = Object.assign({}, this.formModel);
|
||||
delete data.id;
|
||||
if (this.formModel.id) {
|
||||
updateContestSeason(this.formModel.id, data).then(() => {
|
||||
this.$message.success('修改竞赛赛季成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
addContestSeason(data).then(() => {
|
||||
this.$message.success('创建竞赛赛季成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
|
||||
<el-form-item label="试卷名称:" prop="name">
|
||||
<el-input v-model="formModel.name" style="width: 350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="试卷描述:" prop="desc">
|
||||
<el-input v-model="formModel.desc" type="textarea" style="width:350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="组别:" prop="group">
|
||||
<el-select v-model="formModel.group" placeholder="请选择" style="width:350px;">
|
||||
<el-option
|
||||
v-for="item in groupOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属赛季:" prop="seasonId">
|
||||
<el-select v-model="formModel.seasonId" placeholder="请选择" style="width:350px;">
|
||||
<el-option
|
||||
v-for="item in seasonOptions"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { createPaper, editPaper, queryContestSeasonPaged} from '@/api/contest';
|
||||
export default {
|
||||
name: 'AddContestTask',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
name: '', // 试卷名称
|
||||
desc: '', // 任务描述
|
||||
seasonId: '', // 所属赛季id
|
||||
group:'' // 高职和中职
|
||||
},
|
||||
seasonOptions:[],
|
||||
groupOption:[{
|
||||
value: 'ZZ',
|
||||
label: '中职'
|
||||
}, {
|
||||
value: 'GZ',
|
||||
label: '高职'
|
||||
}],
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入试卷名称', trigger: 'blur' }
|
||||
],
|
||||
desc: [
|
||||
{ required: true, message: '请输入试卷描述', trigger: 'blur' }
|
||||
],
|
||||
group: [
|
||||
{ required: true, message: '请选择试卷所属赛季', trigger: 'blur' }
|
||||
],
|
||||
seasonId: [
|
||||
{ required: true, message: '请选择试卷所属赛季', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return this.formModel.id ? '修改试卷' : '创建试卷';
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
queryContestSeasonPaged().then((res) => {
|
||||
this.seasonOptions = res.data.list;
|
||||
});
|
||||
this.dialogVisible = true;
|
||||
if (row) {
|
||||
this.formModel.id = row.id;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.desc = row.desc;
|
||||
this.formModel.seasonId = row.seasonId;
|
||||
this.formModel.group = row.group;
|
||||
} else {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
name: '',
|
||||
desc: '',
|
||||
group:'',
|
||||
seasonId: ''
|
||||
};
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
name: '',
|
||||
desc: '',
|
||||
seasonId: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = Object.assign({}, this.formModel);
|
||||
delete data.id;
|
||||
if (this.formModel.id) {
|
||||
editPaper(this.formModel.id, data).then(() => {
|
||||
this.$message.success('修改试卷成功!');
|
||||
this.handleClose();
|
||||
this.$emit('paperListRefresh');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
createPaper(data).then(() => {
|
||||
this.$message.success('创建试卷成功!');
|
||||
this.handleClose();
|
||||
this.$emit('paperListRefresh');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div style="width: 100%;">
|
||||
<QueryListPage
|
||||
ref="examQueryListPage"
|
||||
:card-padding="10"
|
||||
:query-form="examQueryForm"
|
||||
:pager-config="pagerConfig"
|
||||
:query-list="examQueryList"
|
||||
/>
|
||||
<add-edit-paper ref="addEditPaper" @paperListRefresh="paperListRefresh" />
|
||||
<edit-module ref="editModule" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { getPaperList, deletePaper, copyPaper } from '@/api/contest';
|
||||
import AddEditPaper from './AddEditPaper.vue';
|
||||
import EditModule from './EditModule.vue';
|
||||
|
||||
export default {
|
||||
name: 'SubjectManage',
|
||||
components: { AddEditPaper, EditModule },
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
seasonlist: [],
|
||||
examQueryForm: {
|
||||
reset: true,
|
||||
leftSpan: 14,
|
||||
textAlign: 'right',
|
||||
labelWidth: '90px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '试卷名称:'
|
||||
},
|
||||
seasonName: {
|
||||
type: 'text',
|
||||
label: '赛季名称:'
|
||||
},
|
||||
group: {
|
||||
type: 'select',
|
||||
label: '组 别',
|
||||
config: {
|
||||
data: [{label: '高职', value: 'GZ'}, {label: '中职', value: 'ZZ'}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
examQueryList: {
|
||||
query: obj => this.getListApi(obj),
|
||||
selectCheckShow: false,
|
||||
indexShow: false,
|
||||
columns: [
|
||||
{
|
||||
title: '试卷名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '试卷描述',
|
||||
prop: 'desc'
|
||||
},
|
||||
{
|
||||
title: '组别',
|
||||
prop: 'group',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.group === 'GZ' ? '高职' : '中职'; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '所属赛季',
|
||||
prop: 'seasonName'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.createTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
prop: 'updateTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.updateTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '350',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.editPaper,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
},
|
||||
{
|
||||
name: '模块配置',
|
||||
handleClick: this.editModule,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '拷贝试卷',
|
||||
handleClick: this.copyContestPaper,
|
||||
type: 'warning'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [{ text: '新建试卷', handler: this.creatPaper }]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.seasonlist = [];
|
||||
},
|
||||
methods: {
|
||||
getListApi(obj) {
|
||||
return getPaperList({ ...obj });
|
||||
},
|
||||
editPaper(index, row) {
|
||||
this.$refs.addEditPaper.doShow(row);
|
||||
},
|
||||
creatPaper() {
|
||||
this.$refs.addEditPaper.doShow();
|
||||
},
|
||||
handleDelete(index, data) {
|
||||
this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => deletePaper(data.id))
|
||||
.then(() => {
|
||||
this.paperListRefresh();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
})
|
||||
.catch(res => {
|
||||
if (res.code && res.code !== 200) {
|
||||
this.$message({ type: 'error', message: res.message });
|
||||
}
|
||||
});
|
||||
},
|
||||
editModule(index, row) {
|
||||
this.$refs.editModule.doShow(row);
|
||||
},
|
||||
copyContestPaper(index, row) {
|
||||
copyPaper(row.id).then(() => {
|
||||
this.paperListRefresh();
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
},
|
||||
paperListRefresh() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.examQueryListPage.refresh(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
354
src/views/contestDataManage/contestSubjectManage/EditModule.vue
Normal file
354
src/views/contestDataManage/contestSubjectManage/EditModule.vue
Normal file
@ -0,0 +1,354 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="模块配置" :visible.sync="dialogVisible" width="50%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<div class="taskContainer">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-card>
|
||||
<div class="taskTitle">
|
||||
<div>试卷模块管理</div>
|
||||
<div>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="creatModule"
|
||||
>
|
||||
新建模块
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card>
|
||||
<el-tree
|
||||
:data="taskTreeDatas"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:expand-on-click-node="false"
|
||||
>
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span :class="getLabeColorClass(data.type)">{{ node.label }}</span>
|
||||
<span>
|
||||
<el-button
|
||||
v-if="data.type=='module'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => editModule(data)"
|
||||
>
|
||||
修改模块信息
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="data.type=='taskCatalog'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => editTaskCatalog(data)"
|
||||
>
|
||||
修改任务目录
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="data.type=='module'||data.type=='taskCatalog'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => addTaskCatalog(data)"
|
||||
>
|
||||
添加任务目录
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="data.type=='taskCatalog'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => addTasks(data)"
|
||||
>
|
||||
添加任务
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="data.type=='tasks'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => moveUp(data)"
|
||||
>
|
||||
上移
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="data.type=='tasks'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => moveDown(data)"
|
||||
>
|
||||
下移
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
style="color: red;"
|
||||
size="mini"
|
||||
@click="() => deleteTreeData(data)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</span>
|
||||
</span></el-tree>
|
||||
</el-card>
|
||||
<edit-module-task ref="editModuleTask" @changeTreeData="changeTreeData" />
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import EditModuleTask from './EditModuleTask';
|
||||
import { getTaskTreeDatas, getPaperDetail, paperModuleTaskSetting} from '@/api/contest';
|
||||
let id = 1;
|
||||
|
||||
export default {
|
||||
name:'ContestTaskManage',
|
||||
components: {
|
||||
EditModuleTask
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading:false,
|
||||
paperId:'',
|
||||
taskTreeDatas:[],
|
||||
allTaskDatas:{}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow(row) {
|
||||
getTaskTreeDatas().then((res) => {
|
||||
this.allTaskDatas = res.data.reduce((acc, obj) => {
|
||||
acc[obj.name] = obj.id;
|
||||
return acc;
|
||||
}, {});
|
||||
getPaperDetail(row.id).then((res) => {
|
||||
if (res.data.moduleVo) {
|
||||
this.taskTreeDatas = res.data.moduleVo.modules.map(moduleItem=>{
|
||||
let children = [];
|
||||
if (moduleItem.group.length) {
|
||||
children = moduleItem.group.map(taskCatalog=> this.transformTree(taskCatalog));
|
||||
}
|
||||
return {
|
||||
id:id++,
|
||||
label:moduleItem.moduleName,
|
||||
duration:moduleItem.duration,
|
||||
moduleScoreRuleId:moduleItem.moduleScoreRuleId,
|
||||
type:'module',
|
||||
children
|
||||
};
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
this.paperId = row.id;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleClose() {
|
||||
id = 1;
|
||||
this.dialogVisible = false;
|
||||
this.taskTreeDatas = [];
|
||||
},
|
||||
creatModule() {
|
||||
this.$refs.editModuleTask.doShow('module', undefined, true);
|
||||
},
|
||||
editModule(data) {
|
||||
this.$refs.editModuleTask.doShow('module', data);
|
||||
},
|
||||
addTaskCatalog(data) {
|
||||
this.$refs.editModuleTask.doShow('taskCatalog', data, true);
|
||||
},
|
||||
editTaskCatalog(data) {
|
||||
this.$refs.editModuleTask.doShow('taskCatalog', data);
|
||||
},
|
||||
addTasks(data) {
|
||||
this.$refs.editModuleTask.doShow('tasks', data, true);
|
||||
},
|
||||
deleteTreeData(data) {
|
||||
this.$confirm(`确定删除${data.label}吗?`, this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => this.findLabel(this.taskTreeDatas, data.id, true));
|
||||
},
|
||||
moveUp(data) {
|
||||
const targetData = this.findLabel(this.taskTreeDatas, data.parentId);
|
||||
const index = targetData.children.findIndex(item=>item.label == data.label);
|
||||
if (index === 0) {
|
||||
return;
|
||||
}
|
||||
const temp = targetData.children[index];
|
||||
this.$set(targetData.children, index, targetData.children[index - 1]);
|
||||
this.$set(targetData.children, index - 1, temp);
|
||||
const copy = JSON.parse(JSON.stringify(this.taskTreeDatas));
|
||||
this.taskTreeDatas = [];
|
||||
this.taskTreeDatas = copy;
|
||||
},
|
||||
moveDown(data) {
|
||||
const targetData = this.findLabel(this.taskTreeDatas, data.parentId).children;
|
||||
const index = targetData.findIndex(item=>item.label == data.label);
|
||||
if (index === targetData.length - 1 || targetData[index + 1].type == 'taskCatalog') {
|
||||
return;
|
||||
}
|
||||
const temp = targetData[index];
|
||||
this.$set(targetData, index, targetData[index + 1]);
|
||||
this.$set(targetData, index + 1, temp);
|
||||
const copy = JSON.parse(JSON.stringify(this.taskTreeDatas));
|
||||
this.taskTreeDatas = [];
|
||||
this.taskTreeDatas = copy;
|
||||
},
|
||||
changeTreeData(type, data, isAdd) {
|
||||
if (data instanceof Array) {
|
||||
if (data.length > 0 && !data[0].id) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].id = id++;
|
||||
}
|
||||
}
|
||||
} else if (!data.id) {
|
||||
data.id = id++;
|
||||
}
|
||||
if (type == 'module') {
|
||||
if (isAdd) {
|
||||
this.taskTreeDatas.push(data);
|
||||
} else {
|
||||
const targetData = this.findLabel(this.taskTreeDatas, data.id);
|
||||
targetData.label = data.label;
|
||||
targetData.duration = data.duration;
|
||||
targetData.moduleScoreRuleId = data.moduleScoreRuleId;
|
||||
}
|
||||
|
||||
} else if (type == 'taskCatalog') {
|
||||
if (isAdd) {
|
||||
const targetData = this.findLabel(this.taskTreeDatas, data.parentId);
|
||||
targetData.children.push(data);
|
||||
} else {
|
||||
const targetData = this.findLabel(this.taskTreeDatas, data.id);
|
||||
targetData.label = data.label;
|
||||
}
|
||||
} else {
|
||||
const targetData = this.findLabel(this.taskTreeDatas, data[0].parentId);
|
||||
data.forEach(item=>{
|
||||
const hasTasks = targetData.children.map(item=>item.label);
|
||||
if ( !hasTasks.includes(item.label)) {
|
||||
targetData.children.unshift(item);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
const allTaskDatas = this.allTaskDatas;
|
||||
const moduleDatas = this.taskTreeDatas.map(moduleItem=>{
|
||||
let group = [];
|
||||
if (moduleItem.children.length) {
|
||||
group = moduleItem.children.map(taskCatalog=> transformTreeDataToSend(taskCatalog));
|
||||
}
|
||||
return {
|
||||
moduleName:moduleItem.label, duration:moduleItem.duration, moduleScoreRuleId:moduleItem.moduleScoreRuleId, group};
|
||||
});
|
||||
paperModuleTaskSetting(this.paperId, {modules:moduleDatas}).then(() => {
|
||||
this.$message.success('模块配置任务成功!');
|
||||
this.handleClose();
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
function transformTreeDataToSend(taskCatalog) {
|
||||
const result = {taskIds:[], name:taskCatalog.label, group:[]};
|
||||
for (let i = 0; i < taskCatalog.children.length; i++) {
|
||||
const node = taskCatalog.children[i];
|
||||
if (node.type == 'tasks') {
|
||||
result.taskIds.push(allTaskDatas[node.label]);
|
||||
} else if (node.type == 'taskCatalog') {
|
||||
result.group.push(transformTreeDataToSend(node));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
},
|
||||
transformTree(data) {
|
||||
const result = {label:data.name, children:[], id:id++, type:'taskCatalog' };
|
||||
data.taskIds.forEach(taskId => {
|
||||
let label = '';
|
||||
for (const key in this.allTaskDatas) {
|
||||
if (this.allTaskDatas[key] === taskId) {
|
||||
label = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result.children.push({label, id:id++, type:'tasks', parentId:result.id });
|
||||
});
|
||||
if (data.group.length) {
|
||||
const changeGroup = data.group.map(taskCatalog=>
|
||||
this.transformTree(taskCatalog)
|
||||
);
|
||||
result.children.push(...changeGroup);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
findLabel( treeData, targetLabelId, isDelete) {
|
||||
for (let i = 0; i < treeData.length; i++) {
|
||||
if (treeData[i].id === targetLabelId) {
|
||||
if (isDelete) {
|
||||
treeData.splice(i, 1);
|
||||
}
|
||||
return treeData[i];
|
||||
}
|
||||
if (treeData[i].children) {
|
||||
const result = this.findLabel(treeData[i].children, targetLabelId, isDelete);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
findName( treeData, targetName) {
|
||||
for (const item of treeData) {
|
||||
if (item.name === targetName) {
|
||||
return item;
|
||||
}
|
||||
if (item.group) {
|
||||
const result = this.findName(item.group, targetName);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
getLabeColorClass(value) {
|
||||
return {
|
||||
'yellow': value === 'module',
|
||||
'green': value === 'taskCatalog'
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.taskContainer{
|
||||
margin: 0 auto;
|
||||
.taskTitle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
}
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 16px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
.yellow { color: rgb(230, 162, 60); }
|
||||
.green { color: green; }
|
||||
</style>
|
@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="540px" :before-close="handleClose" center :close-on-click-modal="false" append-to-body @keydown.enter.native.prevent>
|
||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="120px">
|
||||
<el-form-item v-if="editType == 'module'" label="模块名称:" prop="moduleName">
|
||||
<el-input v-model="formModel.moduleName" style="width: 350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="editType == 'module'" label="考试时间(分钟):" prop="duration">
|
||||
<el-input v-model="formModel.duration" style="width:350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="editType == 'module'" label="评分规则:" prop="moduleScoreRuleId">
|
||||
<el-select v-model="formModel.moduleScoreRuleId" placeholder="请选择" style="width:320px;">
|
||||
<el-option
|
||||
v-for="item in bindRuleOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="editType == 'taskCatalog'" label="目录名称:" prop="taskCatalogName">
|
||||
<el-input v-model="formModel.taskCatalogName" style="width: 350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="editType == 'tasks'" label="任务:" prop="tasks">
|
||||
<el-select v-model="formModel.tasks" multiple placeholder="请选择" style="width: 350px;">
|
||||
<el-option
|
||||
v-for="item in taskOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getTaskTreeDatas, queryContextScorePaged} from '@/api/contest';
|
||||
export default {
|
||||
name: 'AddContestTask',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel:{
|
||||
moduleName:'',
|
||||
duration:'',
|
||||
moduleScoreRuleId:'',
|
||||
moduleId:'',
|
||||
taskCatalogName:'',
|
||||
taskCatalogId:'',
|
||||
tasks:[]
|
||||
},
|
||||
bindRuleOptions:[],
|
||||
taskOptions:[],
|
||||
loading: false,
|
||||
title:'',
|
||||
editType:'',
|
||||
parentId:'',
|
||||
idAdd:false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
moduleName: [
|
||||
{ required: true, message: '请输入模块名称', trigger: 'blur' }
|
||||
],
|
||||
duration: [
|
||||
{ required: true, message: '请输入考试时间', trigger: 'blur' }
|
||||
],
|
||||
taskCatalogName: [
|
||||
{ required: true, message: '请输入任务名称', trigger: 'blur' }
|
||||
],
|
||||
tasks: [
|
||||
{ required: true, message: '请选择任务', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(type, data, isAdd) {
|
||||
this.isAdd = isAdd;
|
||||
if (type == 'module') {
|
||||
queryContextScorePaged().then((res) => {
|
||||
this.bindRuleOptions = res.data.list;
|
||||
});
|
||||
this.editType = 'module';
|
||||
this.title = '创建模块';
|
||||
if (data) {
|
||||
this.title = '修改模块信息';
|
||||
this.formModel.moduleName = data.label;
|
||||
this.formModel.duration = data.duration;
|
||||
this.formModel.moduleScoreRuleId = data.moduleScoreRuleId;
|
||||
this.formModel.moduleId = data.id;
|
||||
}
|
||||
|
||||
} else if (type == 'taskCatalog') {
|
||||
this.editType = 'taskCatalog';
|
||||
this.title = isAdd ? '创建任务目录' : '修改任务目录';
|
||||
this.parentId = isAdd ? data.id : data.parentId;
|
||||
if (!isAdd) {
|
||||
this.formModel.taskCatalogId = data.id;
|
||||
this.formModel.taskCatalogName = data.label;
|
||||
}
|
||||
} else {
|
||||
this.editType = 'tasks';
|
||||
this.parentId = data.id;
|
||||
getTaskTreeDatas().then((res) => {
|
||||
this.taskOptions = res.data;
|
||||
this.formModel.tasks = data.children.filter(item => !item.children).map(item=>item.label);
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
this.title = data.label;
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
moduleName:'',
|
||||
duration:'',
|
||||
moduleScoreRuleId:'',
|
||||
taskCatalogName:'',
|
||||
tasks: []
|
||||
};
|
||||
this.parentId = '';
|
||||
this.editType = '';
|
||||
this.isAdd = false;
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.editType == 'module') {
|
||||
const data = {label:this.formModel.moduleName, duration:this.formModel.duration, moduleScoreRuleId:this.formModel.moduleScoreRuleId, type:'module', children:[]};
|
||||
if (!this.isAdd) {
|
||||
data.id = this.formModel.moduleId;
|
||||
}
|
||||
this.$emit('changeTreeData', 'module', data, this.isAdd);
|
||||
} else if (this.editType == 'taskCatalog') {
|
||||
const data = {label:this.formModel.taskCatalogName, type:'taskCatalog', parentId:this.parentId, children:[]};
|
||||
if (!this.isAdd) {
|
||||
data.id = this.formModel.taskCatalogId;
|
||||
}
|
||||
this.$emit('changeTreeData', 'taskCatalog', data, this.isAdd);
|
||||
} else {
|
||||
const data = this.formModel.tasks.reverse().map(task=>{ return {label:task, type:'tasks', parentId:this.parentId}; });
|
||||
this.$emit('changeTreeData', 'task', data);
|
||||
}
|
||||
this.handleClose();
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
133
src/views/contestDataManage/contestTaskManage/AddEditTask.vue
Normal file
133
src/views/contestDataManage/contestTaskManage/AddEditTask.vue
Normal file
@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
|
||||
<el-form-item label="任务名称:" prop="name">
|
||||
<el-input v-model="formModel.name" style="width: 350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务描述:" prop="desc">
|
||||
<el-input v-model="formModel.desc" type="textarea" style="width:350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="考核内容:" prop="content">
|
||||
<el-input v-model="formModel.content" type="textarea" style="width: 350px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="评价标准:" prop="standards">
|
||||
<el-input v-model="formModel.standards" type="textarea" style="width: 350px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { createTask, editTask} from '@/api/contest';
|
||||
export default {
|
||||
name: 'AddContestTask',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
name: '', // 任务名称
|
||||
desc: '', // 任务描述
|
||||
content: '', // 考核内容
|
||||
standards: '', // 评价标准
|
||||
parentId:''
|
||||
},
|
||||
creatSonTask:false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入任务名称', trigger: 'blur' }
|
||||
],
|
||||
desc: [
|
||||
{ required: true, message: '请输入任务描述', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
if (this.creatSonTask) return '添加子任务';
|
||||
return this.formModel.id ? '修改任务' : '新建任务';
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(row, creatSonTask) {
|
||||
this.dialogVisible = true;
|
||||
if (creatSonTask) {
|
||||
this.creatSonTask = true;
|
||||
}
|
||||
if (!creatSonTask && row) {
|
||||
this.formModel.id = row.id;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.desc = row.desc;
|
||||
this.formModel.content = row.content;
|
||||
this.formModel.standards = row.standards;
|
||||
} else {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
name: '',
|
||||
desc: '',
|
||||
content: '',
|
||||
standards:'',
|
||||
parentId:''
|
||||
};
|
||||
if (creatSonTask) {
|
||||
this.formModel.parentId = row.id;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
name: '',
|
||||
desc: '',
|
||||
content: '',
|
||||
standards:'',
|
||||
parentId:''
|
||||
};
|
||||
this.creatSonTask = false;
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = Object.assign({}, this.formModel);
|
||||
delete data.id;
|
||||
if (this.formModel.parentId == '') {
|
||||
delete data.parentId;
|
||||
}
|
||||
if (this.formModel.id) {
|
||||
editTask(this.formModel.id, data).then(() => {
|
||||
this.$message.success('修改任务成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTaskTree');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
createTask(data).then(() => {
|
||||
this.$message.success('创建任务成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTaskTree');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
103
src/views/contestDataManage/contestTaskManage/BindTask.vue
Normal file
103
src/views/contestDataManage/contestTaskManage/BindTask.vue
Normal file
@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="任务绑定" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="ruleForm" :model="formModel" label-width="120px">
|
||||
<el-form-item label="任务名称:" prop="name">
|
||||
<el-input v-model="formModel.name" style="width: 320px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定场景:" prop="sceneId">
|
||||
<el-select v-model="formModel.sceneId" placeholder="请选择" style="width:320px;">
|
||||
<el-option
|
||||
v-for="item in bindSceneOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定评分规则:" prop="ruleId">
|
||||
<el-select v-model="formModel.ruleId" placeholder="请选择" style="width:320px;">
|
||||
<el-option
|
||||
v-for="item in bindRuleOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { bindTask, queryContextScorePaged, queryContestSencePaged} from '@/api/contest';
|
||||
export default {
|
||||
name: 'AddContestTask',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
taskId: '',
|
||||
name:'',
|
||||
sceneId: '', // 绑定的场景id
|
||||
ruleId: '' // 绑定的评分id
|
||||
},
|
||||
bindSceneOptions: [],
|
||||
bindRuleOptions:[],
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
queryContextScorePaged().then((res) => {
|
||||
this.bindRuleOptions = res.data.list;
|
||||
});
|
||||
queryContestSencePaged().then((res) => {
|
||||
this.bindSceneOptions = res.data.list;
|
||||
});
|
||||
this.dialogVisible = true;
|
||||
this.formModel.taskId = row.id;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.sceneId = row.sceneId;
|
||||
this.formModel.ruleId = row.ruleId;
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
taskId: '',
|
||||
name: '',
|
||||
sceneId: '',
|
||||
ruleId: ''
|
||||
};
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = [];
|
||||
if ( this.formModel.ruleId) {
|
||||
data.push({bindType:0, bindId:this.formModel.ruleId, status:0});
|
||||
}
|
||||
if (this.formModel.sceneId) {
|
||||
data.push({bindType:1, bindId:this.formModel.sceneId, status:0});
|
||||
}
|
||||
bindTask(this.formModel.taskId, data).then(() => {
|
||||
this.$message.success('任务绑定成功!');
|
||||
this.handleClose();
|
||||
this.$emit('paperListRefresh');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div class="taskContainer">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<el-card>
|
||||
<div class="taskTitle">
|
||||
<div>竞赛任务管理</div>
|
||||
<div>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="creatTask"
|
||||
>
|
||||
新建任务
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card>
|
||||
<el-tree
|
||||
:data="taskDta"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:expand-on-click-node="false"
|
||||
>
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span>{{ node.label }}</span>
|
||||
<span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => editTask(data)"
|
||||
>
|
||||
修改任务
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
style="color: red;"
|
||||
size="mini"
|
||||
@click="() => deleteTaskById(data)"
|
||||
>
|
||||
删除任务
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => creatChildrenTask(data)"
|
||||
>
|
||||
添加子任务
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="() => bindTask(data)"
|
||||
>
|
||||
任务绑定
|
||||
</el-button>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-card>
|
||||
<add-edit-task ref="addEditTask" @reloadTaskTree="getTreeData" />
|
||||
<bind-task ref="bindTask" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddEditTask from './AddEditTask';
|
||||
import BindTask from './BindTask';
|
||||
import { getTaskTreeDatas, getTaskDetail, deleteTask} from '@/api/contest';
|
||||
|
||||
export default {
|
||||
name:'ContestTaskManage',
|
||||
components: {
|
||||
AddEditTask, BindTask
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
taskDta:[]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getTreeData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
getTreeData() {
|
||||
getTaskTreeDatas().then((res) => {
|
||||
this.taskDta = this.transformTree(res.data);
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
});
|
||||
},
|
||||
queryChildrenTask() {
|
||||
console.log(111);
|
||||
},
|
||||
creatTask() {
|
||||
this.$refs.addEditTask.doShow();
|
||||
},
|
||||
creatChildrenTask(data) {
|
||||
this.$refs.addEditTask.doShow(data, true);
|
||||
},
|
||||
editTask(data) {
|
||||
getTaskDetail(data.id).then((res) => {
|
||||
this.$refs.addEditTask.doShow(res.data);
|
||||
});
|
||||
},
|
||||
bindTask(data) {
|
||||
getTaskDetail(data.id).then((res) => {
|
||||
this.$refs.bindTask.doShow(res.data);
|
||||
});
|
||||
},
|
||||
deleteTaskById(data) {
|
||||
this.$confirm('确定删除该任务吗?', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => deleteTask(data.id))
|
||||
.then(() => {
|
||||
this.getTreeData();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
})
|
||||
.catch(res => {
|
||||
if (res.code && res.code !== 200) {
|
||||
this.$message({ type: 'error', message: res.message });
|
||||
}
|
||||
});
|
||||
},
|
||||
transformTree(data) {
|
||||
const result = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const node = data[i];
|
||||
const item = {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
parentId:node.parentId
|
||||
};
|
||||
if (node.children) {
|
||||
item.children = this.transformTree(node.children);
|
||||
}
|
||||
result.push(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.taskContainer{
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
.taskTitle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
}
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 16px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div>
|
||||
<query-list-page ref="user" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<add-score ref="addScore" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryContextScorePaged, deleteContextScore } from '@/api/contest';
|
||||
import AddScore from './add';
|
||||
export default {
|
||||
name: 'ContestSeasonManage',
|
||||
components: {
|
||||
AddScore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '80px',
|
||||
leftSpan: 18,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名 称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: queryContextScorePaged,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '名 称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.createTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
prop: 'updateTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.updateTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操 作',
|
||||
width: '320',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.doEdit
|
||||
},
|
||||
{
|
||||
name: '删 除',
|
||||
handleClick: this.doDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '添 加', handler: this.doCreate }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
doCreate() {
|
||||
this.$refs.addScore.doShow();
|
||||
},
|
||||
doEdit(index, row) {
|
||||
this.$router.push({path: '/systemManagement/contestDataManage/contestTaskScoreEdit', query:{id:row.id}});
|
||||
},
|
||||
doDelete(index, row) {
|
||||
this.$confirm('该操作将删除竞赛评分规则,是否继续?', '提 示', {
|
||||
confirmButtonText: '确 定',
|
||||
cancelButtonText: '取 消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContextScore(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
}).catch(error => {
|
||||
this.$message.error(`删除删除竞赛评分规则失败: ${error.message}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
71
src/views/contestDataManage/contestTaskScoreManage/add.vue
Normal file
71
src/views/contestDataManage/contestTaskScoreManage/add.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="130px">
|
||||
<el-form-item label="评分规则名称:" prop="name">
|
||||
<el-input v-model="formModel.name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { createContextScore } from '@/api/contest';
|
||||
export default {
|
||||
name: 'AddSeason',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
name: ''
|
||||
},
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入评分规则名称', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '创建评分规则';
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
name: ''
|
||||
};
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = Object.assign({}, this.formModel);
|
||||
createContextScore(data).then(() => {
|
||||
this.$message.success('创建评分规则成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
100
src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue
Normal file
100
src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue
Normal file
@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="130px">
|
||||
<el-form-item label="单元描述:" prop="text">
|
||||
<el-input v-model="formModel.text" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="作业程序:" prop="worker">
|
||||
<el-input v-model="formModel.worker" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="场景步骤ID:" prop="sceneStepId">-->
|
||||
<!-- <el-input v-model="formModel.sceneStepId" style="width: 200px;" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="单元分值:" prop="score">
|
||||
<el-input-number v-model="formModel.score" style="width: 200px;" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="评分标准:" prop="criteria">
|
||||
<el-input v-model="formModel.criteria" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'AddSeason',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
text: '',
|
||||
worker: '',
|
||||
score: 0,
|
||||
criteria: '',
|
||||
sceneStepId: ''
|
||||
},
|
||||
index: -1,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
text: [
|
||||
{ required: true, message: '请输入单元描述', trigger: 'blur' }
|
||||
],
|
||||
worker: [
|
||||
{ required: true, message: '请输入作业程序', trigger: 'blur' }
|
||||
],
|
||||
criteria: [
|
||||
{ required: true, message: '请输入评分标准', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '评分规则单元';
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(index, row) {
|
||||
this.dialogVisible = true;
|
||||
if (row) {
|
||||
this.index = index;
|
||||
this.formModel.text = row.text;
|
||||
this.formModel.worker = row.worker;
|
||||
this.formModel.score = row.score;
|
||||
this.formModel.criteria = row.criteria;
|
||||
this.formModel.sceneStepId = row.sceneStepId;
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
text: '',
|
||||
worker: '',
|
||||
score: 0,
|
||||
criteria: '',
|
||||
sceneStepId: ''
|
||||
};
|
||||
this.index = -1;
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = Object.assign({}, this.formModel);
|
||||
this.$emit('addData', this.index, data);
|
||||
this.handleClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
145
src/views/contestDataManage/contestTaskScoreManage/edit.vue
Normal file
145
src/views/contestDataManage/contestTaskScoreManage/edit.vue
Normal file
@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card style="margin: 10px;padding: 10px;">
|
||||
<div slot="header" style="font-size: 18px;text-align: center;">
|
||||
<span>评分规则详情</span>
|
||||
<div style="float: right; padding: 3px 0">
|
||||
<el-button type="text" @click="doAdd">添加</el-button>
|
||||
<!-- <el-button type="text" @click="doImport">场景导入</el-button>-->
|
||||
<el-button type="text" @click="doClear">清空</el-button>
|
||||
<el-button type="text" @click="doSave">保存</el-button>
|
||||
<el-button type="text" @click="goBack">返回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
style="width: 100%;margin-top: 10px;"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="描述" prop="text" />
|
||||
<el-table-column label="作业程序" prop="worker" />
|
||||
<el-table-column label="分值" prop="score" width="50" />
|
||||
<el-table-column label="评分标准" prop="criteria" />
|
||||
<!-- <el-table-column label="场景步骤ID" prop="sceneStepId" width="100">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ scope.row.sceneStepId === 0? '': scope.row.sceneStepId }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleEdit(scope.$index,scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<detail-add ref="detailAdd" @addData="addData" />
|
||||
<import-scene ref="importScene" @importData="importData" />
|
||||
<select-scene ref="selectScene" @selectSceneId="selectSceneId" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DetailAdd from './detailAdd';
|
||||
import ImportScene from './importScene';
|
||||
import SelectScene from './selectScene';
|
||||
import { updateContextScoreDetail, getContextScoreDetail } from '@/api/contest';
|
||||
export default {
|
||||
name: 'EditScoreRule',
|
||||
components: {
|
||||
DetailAdd,
|
||||
ImportScene,
|
||||
SelectScene
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData:[]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
getContextScoreDetail(this.$route.query.id).then(resp => {
|
||||
this.tableData = resp.data.rule ? resp.data.rule.units : [];
|
||||
}).catch(() => { this.$message.error('初始化数据失败!'); });
|
||||
},
|
||||
goBack() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
doSave() {
|
||||
const data = [...this.tableData];
|
||||
updateContextScoreDetail(this.$route.query.id, {units: data})
|
||||
.then(() => { this.$message.success('保存评分规则单元成功!'); })
|
||||
.catch(() => { this.$message.error('保存评分规则单元失败!'); });
|
||||
},
|
||||
handleEdit(index, data) {
|
||||
this.$refs.detailAdd.doShow(index, data);
|
||||
},
|
||||
doClear() {
|
||||
this.tableData = [];
|
||||
},
|
||||
doImport() {
|
||||
this.$refs.selectScene.doShow();
|
||||
},
|
||||
selectSceneId(id) {
|
||||
this.$refs.importScene.doShow(id);
|
||||
},
|
||||
importData(data) {
|
||||
data.forEach(elem => {
|
||||
this.tableData.push(elem);
|
||||
});
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs.detailAdd.doShow();
|
||||
},
|
||||
addData(index, data) {
|
||||
if (index > -1) {
|
||||
this.$set(this.tableData, index, data);
|
||||
} else {
|
||||
this.tableData.push(data);
|
||||
}
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总分';
|
||||
return;
|
||||
}
|
||||
if (index === 3) {
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += '';
|
||||
} else {
|
||||
sums[index] = '/';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag v-loading="loading" title="场景导入" :visible.sync="dialogVisible" width="900px" :before-close="cancel" center :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="addModel" label-width="70px" :rules="rules" :inline="true">
|
||||
<el-form-item label="角色:" prop="memberId" style="display:inline-block">
|
||||
<el-select v-model="addModel.memberId" placeholder="" style="width:200px" size="mini" @change="changeMember">
|
||||
<el-option
|
||||
v-for="item in memberList"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总分:" prop="fullMarks" style="display:inline-block">
|
||||
<el-input-number v-model="addModel.fullMarks" :disabled="true" style="width:200px" :min="0" size="mini" :step="1" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="commit">导入</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
id="gradeRules"
|
||||
ref="gradeRules"
|
||||
:data="allStepList"
|
||||
border
|
||||
:max-height="tableHeight"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="80"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
label="步骤描述"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="score"
|
||||
label="分值"
|
||||
width="200"
|
||||
>
|
||||
<template v-if="addModel.memberId == scope.row.memberId" slot-scope="scope">
|
||||
<el-input-number v-model="currentStepMap[scope.row.id]" style="width:145px" :min="0" size="mini" :step="1" @change="stepScoreChange" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {handleMemberList} from '@/utils/simulation';
|
||||
import { getContextSenceDetail } from '@/api/contest';
|
||||
export default {
|
||||
name: 'ImportScene',
|
||||
data() {
|
||||
return {
|
||||
trainingId:'',
|
||||
loading:false,
|
||||
dialogVisible: false,
|
||||
allStepList:[],
|
||||
memberList:[],
|
||||
currentStepMap:{}, // 当前角色下各步骤评分 key stepId value 得分
|
||||
gradeRulesMap:{}, // 评分规则map key:memberId value 评分规则
|
||||
addModel:{
|
||||
memberId:'',
|
||||
fullMarks:''
|
||||
},
|
||||
rules:{
|
||||
memberId: [
|
||||
{ required: true, message: '请选择角色', trigger: 'change' }
|
||||
],
|
||||
fullMarks: [
|
||||
{ required: true, message: '请输入总分', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tableHeight() {
|
||||
const s = 250;
|
||||
const h = this.$store.state.app.height;
|
||||
return h - s;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
async doShow(id) {
|
||||
this.dialogVisible = true;
|
||||
this.loading = true;
|
||||
try {
|
||||
this.trainingId = id;
|
||||
const resp = await getContextSenceDetail(id);
|
||||
this.allStepList = JSON.parse(resp.data.scene.storageSimulation.stepJson);
|
||||
const members = JSON.parse(resp.data.scene.storageSimulation.memberJson);
|
||||
const ps = resp.data.scene.storageSimulation.playerIds;
|
||||
const players = [];
|
||||
members.forEach(mem => { if (ps.includes(mem.id)) { players.push(mem); } });
|
||||
this.memberList = handleMemberList(players);
|
||||
if (this.memberList.length > 0) {
|
||||
this.changeMember(this.memberList[0].id);
|
||||
}
|
||||
this.loading = false;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
this.$message.error('初始化数据失败!');
|
||||
}
|
||||
},
|
||||
changeMember(memberId) {
|
||||
const currentStepMap = {};
|
||||
this.allStepList.forEach(each=>{
|
||||
if (each.memberId == memberId) {
|
||||
currentStepMap[each.id] = 0;
|
||||
}
|
||||
});
|
||||
if (this.gradeRulesMap[memberId]) {
|
||||
this.addModel.fullMarks = this.gradeRulesMap[memberId].fullMarks;
|
||||
this.gradeRulesMap[memberId].details.forEach(each=>{
|
||||
currentStepMap[each.elementId] = each.score;
|
||||
});
|
||||
} else {
|
||||
this.addModel.fullMarks = 0;
|
||||
}
|
||||
this.currentStepMap = Object.assign({}, currentStepMap);
|
||||
this.addModel.memberId = memberId;
|
||||
},
|
||||
cancel() {
|
||||
this.addModel.fullMarks = 0;
|
||||
this.addModel.memberId = '';
|
||||
this.gradeRulesMap = {};
|
||||
this.currentStepMap = {};
|
||||
this.allStepList = [];
|
||||
this.trainingId = '';
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
commit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const scoreDetails = [];
|
||||
for (const key in this.currentStepMap) {
|
||||
scoreDetails.push({id: key, score: this.currentStepMap[key]});
|
||||
}
|
||||
if (this.addModel.fullMarks === 0) {
|
||||
this.$message.error('规则无评分项!');
|
||||
return;
|
||||
}
|
||||
this.gradeRulesMap[this.addModel.memberId] = { memberId: this.addModel.memberId, details: scoreDetails, fullMarks: this.addModel.fullMarks };
|
||||
const data = [];
|
||||
this.allStepList.forEach(elem => {
|
||||
if (elem.memberId == this.addModel.memberId) {
|
||||
data.push({text: elem.description,
|
||||
worker: '',
|
||||
score: this.currentStepMap[elem.id],
|
||||
criteria: '',
|
||||
sceneStepId: elem.id});
|
||||
}
|
||||
});
|
||||
this.$emit('importData', data);
|
||||
this.cancel();
|
||||
}
|
||||
});
|
||||
},
|
||||
stepScoreChange() {
|
||||
let fullMarks = 0;
|
||||
for (const stepKey in this.currentStepMap) {
|
||||
fullMarks += this.currentStepMap[stepKey];
|
||||
}
|
||||
this.addModel.fullMarks = fullMarks;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="场景选择" :visible.sync="dialogVisible" width="80%" :before-close="cancel" center :close-on-click-modal="false">
|
||||
<query-list-page ref="user" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryContestSencePaged } from '@/api/contest';
|
||||
export default {
|
||||
name: 'ContestSeasonManage',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '80px',
|
||||
leftSpan: 18,
|
||||
beforeQuery: this.beforeQuery,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名 称'
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '类 型',
|
||||
config: {
|
||||
data: [{label: '二维', value: 'Local'}, {label: '三维', value: 'Link'}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: queryContestSencePaged,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '名 称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '地图',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '类 型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.type === 'Local' ? '二维' : '三维'; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.createTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
prop: 'updateTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.modifyInfo.updateTime; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操 作',
|
||||
width: '320',
|
||||
buttons: [
|
||||
{
|
||||
name: '选 择',
|
||||
handleClick: this.doSelect,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
cancel() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
doSelect(index, row) {
|
||||
this.$emit('selectSceneId', row.id);
|
||||
this.cancel();
|
||||
}
|
||||
// doDelete(index, row) {
|
||||
// this.$confirm('该操作将删除竞赛场景,是否继续?', '提 示', {
|
||||
// confirmButtonText: '确 定',
|
||||
// cancelButtonText: '取 消',
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// deleteContextSence(row.id).then(resp => {
|
||||
// this.reloadTable();
|
||||
// }).catch(error => {
|
||||
// this.$message.error(`删除删除竞赛场景失败: ${error.message}`);
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -242,6 +242,10 @@ export default {
|
||||
type: this.$route.query.type
|
||||
};
|
||||
this.judgeOtherPage(params);
|
||||
} else if (this.$store.state.projectConfig.projectCode === 'DSXL') {
|
||||
this.loading = false;
|
||||
path = '/contest/list';
|
||||
this.$router.push({ path: path });
|
||||
} else {
|
||||
this.loading = false;
|
||||
path = '/simulation/simulationIndex';
|
||||
|
@ -26,6 +26,7 @@ import ConstConfig from '@/scripts/ConstConfig';
|
||||
import { loadDraftTraining } from '@/api/jmap/training';
|
||||
import { deleteTraining, publishTraining, jumpToTraining } from '@/api/trainingManage';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { publishContextSence } from '@/api/contest';
|
||||
|
||||
export default {
|
||||
name: 'List',
|
||||
@ -84,7 +85,7 @@ export default {
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('trainingManage.operate'),
|
||||
width: '300',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('trainingManage.record'),
|
||||
@ -110,6 +111,12 @@ export default {
|
||||
type: 'text',
|
||||
showControl:(row) => { return row.id; }
|
||||
},
|
||||
{
|
||||
name: '发布至竞赛',
|
||||
handleClick: this.publishToContest,
|
||||
type: 'text',
|
||||
showControl:(row) => { return row.id; }
|
||||
},
|
||||
{
|
||||
name: this.$t('trainingManage.preview'),
|
||||
handleClick: this.previewScript,
|
||||
@ -247,6 +254,29 @@ export default {
|
||||
});
|
||||
}).catch(e => {});
|
||||
},
|
||||
publishToContest(index, row) {
|
||||
this.$prompt('请输入发布后名称', '提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
inputValue: row.name,
|
||||
inputErrorMessage: '输入不能为空',
|
||||
inputValidator: (value) => {
|
||||
if (!value) {
|
||||
return '输入不能为空';
|
||||
}
|
||||
}
|
||||
|
||||
}).then(suc => {
|
||||
if (!row.id || !suc.value) { return; }
|
||||
publishContextSence({dafitid: +row.id, name: suc.value}).then(res => {
|
||||
this.$message.success('发布至竞赛成功!');
|
||||
}).catch(err => {
|
||||
this.$message.error(`发布至竞赛失败!,${err.message}`);
|
||||
});
|
||||
});
|
||||
},
|
||||
publishScript(index, row) {
|
||||
this.$prompt('请输入发布后名称', '提示',
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user