diff --git a/src/api/contest.js b/src/api/contest.js new file mode 100644 index 000000000..7b703a883 --- /dev/null +++ b/src/api/contest.js @@ -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' + }); +} diff --git a/src/api/simulation.js b/src/api/simulation.js index 00973172e..afead9ca8 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -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 + }); +} diff --git a/src/i18n/langs/en/newRouter.js b/src/i18n/langs/en/newRouter.js index 1ee49ab46..98c457412 100644 --- a/src/i18n/langs/en/newRouter.js +++ b/src/i18n/langs/en/newRouter.js @@ -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', diff --git a/src/i18n/langs/zh/newRouter.js b/src/i18n/langs/zh/newRouter.js index 2c07c485d..392714626 100644 --- a/src/i18n/langs/zh/newRouter.js +++ b/src/i18n/langs/zh/newRouter.js @@ -38,6 +38,12 @@ export default { permissionManage: '权限管理', authorityTransferManage: '权限分发管理', userRulesManage: '用户权限管理', + contestDataManage:'竞赛数据管理', + contestSubjectManage:'竞赛题目管理', + contestTaskManage:'竞赛任务管理', + contestSceneManage:'竞赛场景管理', + contestTaskScoreManage:'竞赛任务评分管理', + contestSeasonManage:'竞赛赛季管理', fileManage: '文件管理', frontResourceManage: '前端资源管理', iscsPrerecordManage: 'ISCS预录管理', diff --git a/src/router/index.js b/src/router/index.js index c8b11cf8b..2e7181bd1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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, diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 5b771ceb4..da3a97803 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -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; } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index c3d8d55e6..b1a97e917 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -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'; diff --git a/src/views/contest/contestDetail.vue b/src/views/contest/contestDetail.vue new file mode 100644 index 000000000..a5a9dc502 --- /dev/null +++ b/src/views/contest/contestDetail.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/src/views/contest/contestList.vue b/src/views/contest/contestList.vue new file mode 100644 index 000000000..606fa4c5a --- /dev/null +++ b/src/views/contest/contestList.vue @@ -0,0 +1,188 @@ + + + + diff --git a/src/views/contest/paperList.vue b/src/views/contest/paperList.vue new file mode 100644 index 000000000..2f6f488fd --- /dev/null +++ b/src/views/contest/paperList.vue @@ -0,0 +1,150 @@ + + + diff --git a/src/views/contest/scoreRule.vue b/src/views/contest/scoreRule.vue new file mode 100644 index 000000000..663ae5435 --- /dev/null +++ b/src/views/contest/scoreRule.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue b/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue new file mode 100644 index 000000000..61e26e7d3 --- /dev/null +++ b/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/views/contestDataManage/contestSeasonManage/ContestSeasonManage.vue b/src/views/contestDataManage/contestSeasonManage/ContestSeasonManage.vue new file mode 100644 index 000000000..61d3902f2 --- /dev/null +++ b/src/views/contestDataManage/contestSeasonManage/ContestSeasonManage.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/src/views/contestDataManage/contestSeasonManage/add.vue b/src/views/contestDataManage/contestSeasonManage/add.vue new file mode 100644 index 000000000..d0d1f4ec3 --- /dev/null +++ b/src/views/contestDataManage/contestSeasonManage/add.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue new file mode 100644 index 000000000..14663b638 --- /dev/null +++ b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue @@ -0,0 +1,147 @@ + + + diff --git a/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue new file mode 100644 index 000000000..191ca2009 --- /dev/null +++ b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/src/views/contestDataManage/contestSubjectManage/EditModule.vue b/src/views/contestDataManage/contestSubjectManage/EditModule.vue new file mode 100644 index 000000000..fe31ad71b --- /dev/null +++ b/src/views/contestDataManage/contestSubjectManage/EditModule.vue @@ -0,0 +1,354 @@ + + + + + diff --git a/src/views/contestDataManage/contestSubjectManage/EditModuleTask.vue b/src/views/contestDataManage/contestSubjectManage/EditModuleTask.vue new file mode 100644 index 000000000..83e4eded8 --- /dev/null +++ b/src/views/contestDataManage/contestSubjectManage/EditModuleTask.vue @@ -0,0 +1,163 @@ + + + diff --git a/src/views/contestDataManage/contestTaskManage/AddEditTask.vue b/src/views/contestDataManage/contestTaskManage/AddEditTask.vue new file mode 100644 index 000000000..cd0db49d9 --- /dev/null +++ b/src/views/contestDataManage/contestTaskManage/AddEditTask.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/views/contestDataManage/contestTaskManage/BindTask.vue b/src/views/contestDataManage/contestTaskManage/BindTask.vue new file mode 100644 index 000000000..9535ef365 --- /dev/null +++ b/src/views/contestDataManage/contestTaskManage/BindTask.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue b/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue new file mode 100644 index 000000000..63e995d85 --- /dev/null +++ b/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/src/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage.vue b/src/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage.vue new file mode 100644 index 000000000..c2bf6d560 --- /dev/null +++ b/src/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/views/contestDataManage/contestTaskScoreManage/add.vue b/src/views/contestDataManage/contestTaskScoreManage/add.vue new file mode 100644 index 000000000..5d4d19144 --- /dev/null +++ b/src/views/contestDataManage/contestTaskScoreManage/add.vue @@ -0,0 +1,71 @@ + + + diff --git a/src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue b/src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue new file mode 100644 index 000000000..fed5eaf47 --- /dev/null +++ b/src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue @@ -0,0 +1,100 @@ + + + diff --git a/src/views/contestDataManage/contestTaskScoreManage/edit.vue b/src/views/contestDataManage/contestTaskScoreManage/edit.vue new file mode 100644 index 000000000..9b1a1e813 --- /dev/null +++ b/src/views/contestDataManage/contestTaskScoreManage/edit.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/views/contestDataManage/contestTaskScoreManage/importScene.vue b/src/views/contestDataManage/contestTaskScoreManage/importScene.vue new file mode 100644 index 000000000..34732c424 --- /dev/null +++ b/src/views/contestDataManage/contestTaskScoreManage/importScene.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/src/views/contestDataManage/contestTaskScoreManage/selectScene.vue b/src/views/contestDataManage/contestTaskScoreManage/selectScene.vue new file mode 100644 index 000000000..107f7b428 --- /dev/null +++ b/src/views/contestDataManage/contestTaskScoreManage/selectScene.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/views/login/normalLogin.vue b/src/views/login/normalLogin.vue index 51fcde7f5..be5575642 100644 --- a/src/views/login/normalLogin.vue +++ b/src/views/login/normalLogin.vue @@ -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'; diff --git a/src/views/newMap/display/trainingDesign/draftTrainingList.vue b/src/views/newMap/display/trainingDesign/draftTrainingList.vue index ff54eb823..949f697e0 100644 --- a/src/views/newMap/display/trainingDesign/draftTrainingList.vue +++ b/src/views/newMap/display/trainingDesign/draftTrainingList.vue @@ -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('请输入发布后名称', '提示', {