From 0599da13aac82a4bef0f83e0b6836602d9351535 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 23 Nov 2020 17:05:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=BC=94=E7=BB=83?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/competition.js | 113 ----------- src/views/lesson/home.vue | 2 +- src/views/newMap/jointTrainingNew/index.vue | 68 +------ .../newMap/jointTrainingNew/menuDemon.vue | 182 +++--------------- 4 files changed, 30 insertions(+), 335 deletions(-) diff --git a/src/api/competition.js b/src/api/competition.js index 248589fd9..070fe28a1 100644 --- a/src/api/competition.js +++ b/src/api/competition.js @@ -1,118 +1,5 @@ import request from '@/utils/request'; -/** 裁判退出仿真*/ -export function refereeExitSimulation(group) { - return request({ - url: `/api/v1/competition/room/${group}/refree`, - method: 'delete' - }); -} - -/** 参赛者创建演练房间 */ -export function participantCreatTrainingRoom(id, data) { - return request({ - url: `/api/v1/competition/${id}/room`, - method: 'post', - data: data - }); -} - -/** 查询用户是否已经报名该竞赛 */ -export function getIsSignUp(raceId, params = {}) { - return request({ - url: `/api/race/${raceId}/isSignUp`, - method: 'get', - params - }); -} - -/** 提交试卷 */ -export function postCompetitionTheory(data) { - return request({ - url: `/api/v1/competitionTheory/submit`, - method: 'post', - data - }); -} - -/** 查询竞赛报名人员详情 */ -export function getRaceUserById(raceId) { - return request({ - url: `/api/race/${raceId}/raceUser`, - method: 'get' - }); -} - -/** 查询加载的实操题 */ -export function getPracticalQuestion(competitionId) { - return request({ - url: `/api/v1/competitionPractical/competition/${competitionId}`, - method: 'get' - }); -} - -/** 查询加载的理论题 */ -export function getTheoryQuestion(competitionId) { - return request({ - url: `/api/v1/competitionTheory/competition/${competitionId}`, - method: 'get' - }); -} - -/** 查询理论题作答详情 */ -export function getCompetitionDetail(competitionId) { - return request({ - url: `/api/v1/competitionTheory/detail/competition/${competitionId}`, - method: 'get' - }); -} - -/** 根据id查询竞赛信息 */ -export function getRaceById(id) { - return request({ - url: `/api/race/${id}`, - method: 'get' - }); -} - -/** 退出当前赛场 */ -export function quitCurrentRace(id, params) { - return request({ - url: `/api/v1/competition/${id}/room`, - method: 'delete', - params - }); -} - -/** 查看加载的竞赛试题 */ -export function getTestPaperDatail(competitionId) { - return request({ - url: `/api/v1/competition/${competitionId}/testPaper`, - method: 'get' - }); -} -/** 提交实操结果 */ -export function submitPracticalCompetition(group, competitionId) { - return request({ - url: `/api/v1/competitionPractical/${group}/${competitionId}/finish`, - method: 'put' - }); -} -/** 开始实操竞赛 */ -export function startPracticalCompetition(group, competitionId) { - return request({ - url: `/api/v1/competitionPractical/${group}/${competitionId}/start`, - method: 'put' - }); -} -/** 查询实操考试结果 */ -export function getPracticalCompetitionResult(competitionId) { - return request({ - url: `/api/v1/competitionPractical/${competitionId}/result`, - method: 'get' - }); -} - // 以下drts项目使用 /** 项目获取试题列表 */ diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index 154d1a4ab..8a58d0fd8 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -9,7 +9,7 @@ {{ $t('lesson.newConstruction') }} - + diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index 9fb2b0feb..f37747a1c 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -17,13 +17,13 @@ :user-role="userRole" :is-admin="isAdmin" :device-code="deviceCode" - :countdown-time="countdownTime" + @passflow="passflow" @faultdevice="faultdevice" @getUserRole="getUserRole" @hidepanel="hidepanel" @devicemodel="devicemodel" - @startCounting="startCounting" + @hidejl3dcctv="hidejl3dcctv" @runPlanLoadShow="runPlanLoadShow" @handlerMemberManage="handlerMemberManage" @@ -47,7 +47,6 @@ - { - this.questionList.push({name: elem.question.name, description:elem.question.description}); - }); - } - } else if (this.project == 'refereeJsxt') { - resp['code'] = 200; - resp.data['userRole'] = 'ADMIN'; - } else { - resp = await this.getUserRole(); - } + resp = await this.getUserRole(); if (resp && resp.code == 200) { this.setSimulationPrdType(); } @@ -441,25 +402,6 @@ export default { this.hideIbp(); } }, - /* 竞赛系统倒计时 */ - startCounting() { - const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical'; - const startTime = localStore.get(storeKey); - if (!startTime) { - const storeValue = new Date().getTime(); - localStore.set(storeKey, storeValue); - } - this.countdown = setInterval(() => { - if (this.practicalTime <= 0) { - if (this.countdown) { - clearInterval(this.countdown); - } - this.$refs.demonMenu.submit(); - } - this.practicalTime--; - this.countdownTime = computationTime(this.practicalTime); - }, 1000); - }, async getTrainDetail() { try { await loadNewMapDataByGroup(this.group); diff --git a/src/views/newMap/jointTrainingNew/menuDemon.vue b/src/views/newMap/jointTrainingNew/menuDemon.vue index 726febd69..bba1e7aeb 100644 --- a/src/views/newMap/jointTrainingNew/menuDemon.vue +++ b/src/views/newMap/jointTrainingNew/menuDemon.vue @@ -27,19 +27,14 @@
- 退出 - 退出 + + 退出
@@ -58,10 +53,8 @@ import { ranAsPlan, exitRunPlan, clearSimulation } from '@/api/simulation'; import { exitFullscreen } from '@/utils/screen'; import { getSimulationQrcode } from '@/api/jointSimulation'; import { getSessionStorage } from '@/utils/auth'; -import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition'; import { NoSimulationQrCodeList } from '@/scripts/ProjectConfig'; import { getPublishLessonListByMapId } from '@/api/jmap/lesson'; -import localStore from 'storejs'; export default { name: 'MenuDemonJoint', @@ -80,10 +73,6 @@ export default { type: String, required: true }, - countdownTime: { - type: String, - required: true - }, deviceCode: { type: String, default() { @@ -115,7 +104,6 @@ export default { return { backLoading: false, chatShow: true, - jsStart: true, isGoback: false, noSimulationQrCodeList: NoSimulationQrCodeList, isShow3dmodel :false, @@ -218,10 +206,6 @@ export default { }); }, async beforeDestroy() { - if (this.project === 'jsxt') { - quitCurrentRace(this.$route.query.raceId, {group:this.group}).then(res=>{ - }); - } // 返回 销毁仿真 重置状态 this.isGoback = true; if (this.isAdmin) { @@ -303,9 +287,6 @@ export default { time: model.initTime }; ranAsPlan(data, this.group).then(res => { - if (this.project == 'jsxt') { - this.jsStart = false; - } this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); }).catch((error) => { if (error.code == '5001') { @@ -375,30 +356,30 @@ export default { this.$emit('passflow'); }, jumpjl3dtrafficplan() { - const routeData = this.$router.resolve({ - path:'/jlmap3d/trafficplan', - query:{ - mapid:this.mapId, - group:this.group, - project: this.project, - noPreLogout: true, - lineCode:this.lineCode - } - }); - window.open(routeData.href, '_blank', 'noopener noreferrer'); + const routeData = this.$router.resolve({ + path:'/jlmap3d/trafficplan', + query:{ + mapid:this.mapId, + group:this.group, + project: this.project, + noPreLogout: true, + lineCode:this.lineCode + } + }); + window.open(routeData.href, '_blank', 'noopener noreferrer'); }, jumpjl3dtraffictrain() { - const routeData = this.$router.resolve({ - path:'/jlmap3d/traffictrain', - query:{ - mapid:this.mapId, - group:this.group, - project: this.project, - noPreLogout: true, - lineCode:this.lineCode - } - }); - window.open(routeData.href, '_blank', 'noopener noreferrer'); + const routeData = this.$router.resolve({ + path:'/jlmap3d/traffictrain', + query:{ + mapid:this.mapId, + group:this.group, + project: this.project, + noPreLogout: true, + lineCode:this.lineCode + } + }); + window.open(routeData.href, '_blank', 'noopener noreferrer'); }, jumpjl3dfaultdevice() { this.$emit('faultdevice'); @@ -406,41 +387,6 @@ export default { jumpjlmap3dmodel() { this.$emit('devicemodel'); }, - startCompetition() { - startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => { - this.$emit('startCounting'); - this.jsStart = false; - }).catch(()=> { - this.$message.error('开始竞赛失败'); - }); - }, - endCompetition() { - this.$confirm('此操作将结束并提交本次竞赛,是否继续', this.$t('global.tips'), { - confirmButtonText: this.$t('global.confirm'), - cancelButtonText: this.$t('global.cancel'), - type: 'warning' - }).then(() => { - this.submit(); - }); - }, - // 竞赛退出 - refeeEndCompetition() { - refereeExitSimulation(this.group).then(resp => { - this.$router.replace({ path: `/refereeJsxt/home`, query: { raceId: this.$route.query.raceId } }); - }).catch(()=> { - this.$message.success('退出系统失败'); - }); - }, - // 竞赛提交 - submit() { - submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => { - const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical'; - localStore.remove(storeKey); - this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } }); - }).catch(()=> { - this.$message.error('提交试卷失败!'); - }); - }, otherVrView() { const routeData = this.$router.resolve({ path:'/jlmap3d/othervr', @@ -545,86 +491,6 @@ export default { - From c8256de5c7b21d2d8ebebc4e4ba9fb190cdaea20 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 23 Nov 2020 17:32:17 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 3 ++- src/layout/components/Entry.vue | 15 +++++++---- src/permission.js | 16 +++++++----- src/router/index_Common.js | 26 +++++++++---------- src/scripts/ProjectConfig.js | 45 +++++++++++++++++---------------- src/views/login/index.vue | 17 +++++++------ 6 files changed, 66 insertions(+), 56 deletions(-) diff --git a/src/App.vue b/src/App.vue index 140e6bfeb..48b7c900a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -91,7 +91,8 @@ export default { }, subscribeMessage(res) { if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) { - if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt' && !(getSessionStorage('project').includes('design'))) { + // getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt' && + if (!(getSessionStorage('project').includes('design'))) { this.$refs.deomonTopic.doShow(res); } this.$store.dispatch('socket/setSimulationInvite'); diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index fef6d8cf0..b9e0b79a3 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -61,28 +61,33 @@ export default { handle: this.goEmpty, isHelp:true, style:'padding-right:0px;', - hidden:getSessionStorage('project').endsWith('heb') || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') + hidden:getSessionStorage('project').endsWith('heb') + // || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') }, { name: 'global.scan', // 扫码 handle: this.qcodeEntry, - hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') || process.env.VUE_APP_PRO === 'local' || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') + hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') || process.env.VUE_APP_PRO === 'local' + // || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') }, { name: 'global.quickEntry', // 快速入口 handle: this.quickEntry, - hidden: getSessionStorage('project').startsWith('design') || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') + hidden: getSessionStorage('project').startsWith('design') + // || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') }, { name: LangStorage.getLang('zh') === 'zh' ? 'English' : '中文', handle: this.switchLanguage, - hidden: getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt'), + hidden: false, + // getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt'), tip: true }, { name: 'global.help', handle: this.goToHelp, - hidden: getSessionStorage('project').endsWith('heb') || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') + hidden: getSessionStorage('project').endsWith('heb') + // || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') } ], diff --git a/src/permission.js b/src/permission.js index 756f714ac..dbba522de 100644 --- a/src/permission.js +++ b/src/permission.js @@ -33,10 +33,10 @@ function getRouteInfo(to) { if (to.query.projectDevice && to.query.type) { loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`; } - if (current_session && current_session == 'jsxt' || current_session && current_session == 'refereeJsxt') { - const raceId = getSessionStorage('raceId'); // 登陆时候保存 竞赛id - loginPath = `${loginPath}?raceId=${raceId}`; - } + // if (current_session && current_session == 'jsxt' || current_session && current_session == 'refereeJsxt') { + // const raceId = getSessionStorage('raceId'); // 登陆时候保存 竞赛id + // loginPath = `${loginPath}?raceId=${raceId}`; + // } return loginPath; } @@ -91,9 +91,11 @@ router.beforeEach((to, from, next) => { next(); } else if (to.path.substr(0, 13) == whiteList[2]) { next(); - } else if (to.path == '/jsxtApply') { - next(); - } else { + } + // else if (to.path == '/jsxtApply') { + // next(); + // } + else { // 否则全部重定向到登录页 next(loginPath); } diff --git a/src/router/index_Common.js b/src/router/index_Common.js index d27b240de..1dbdb7412 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -134,7 +134,7 @@ const QuestionsRuleManage = () => import('@/views/system/questionsRuleManage/ind const PreTheoryImport = () => import('@/views/competitionManage/bankList/preImport'); const PlanScheduleWicket = () => import('@/views/newMap/displayNew/demon/planSchedule'); -import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; +// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { getSessionStorage } from '@/utils/auth'; /** @@ -282,18 +282,18 @@ export const constantRoutes = [ { path: '*', redirect: '/404', hidden: true } ]; // 项目登录路径 -GenerateRouteProjectList.forEach(item => { - constantRoutes.push({ - path: `/${item}/login`, - component: Login, - hidden: true - }); - constantRoutes.push({ - path: `/${item}`, - redirect: `/${item}/login`, - hidden: true - }); -}); +// GenerateRouteProjectList.forEach(item => { +// constantRoutes.push({ +// path: `/${item}/login`, +// component: Login, +// hidden: true +// }); +// constantRoutes.push({ +// path: `/${item}`, +// redirect: `/${item}/login`, +// hidden: true +// }); +// }); // 公共路由不需要过滤 直接可以访问 export const publicAsyncRoute = [ { diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index d18cab427..147f3c3e4 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -205,24 +205,24 @@ export const loginInfo = { navigationMarginLeft: '60px', systemType: '012' }, - jsxt:{ - title: '城市轨道交通竞赛平台', - loginPath: '/jsxt/login', - loginParam: 'DEFAULT', - titleDistance: '-150px', - navigationLogoWidth: '40px', - navigationMarginLeft: '60px', - systemType: '015' - }, - refereeJsxt:{ - title: '城市轨道交通裁判平台', - loginPath: '/refereeJsxt/login', - loginParam: 'DEFAULT', - titleDistance: '-150px', - navigationLogoWidth: '40px', - navigationMarginLeft: '60px', - systemType: '015' - }, + // jsxt:{ + // title: '城市轨道交通竞赛平台', + // loginPath: '/jsxt/login', + // loginParam: 'DEFAULT', + // titleDistance: '-150px', + // navigationLogoWidth: '40px', + // navigationMarginLeft: '60px', + // systemType: '015' + // }, + // refereeJsxt:{ + // title: '城市轨道交通裁判平台', + // loginPath: '/refereeJsxt/login', + // loginParam: 'DEFAULT', + // titleDistance: '-150px', + // navigationLogoWidth: '40px', + // navigationMarginLeft: '60px', + // systemType: '015' + // }, jyd: { title: '城市轨道交通实训平台', loginPath:'/login?project=jyd', @@ -364,8 +364,8 @@ export const ProjectIcon = { designhyd: FaviconHeb, xadt: FaviconXadt, designxadt: FaviconXadt, - jsxt: Favicon, - refereeJsxt: Favicon, + // jsxt: Favicon, + // refereeJsxt: Favicon, jyd: FaviconJyd, designjyd: FaviconJyd, tky: FaviconTky, @@ -405,8 +405,9 @@ export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', export const CaseHideProjectList = ['heb', 'designheb']; // 案例展示隐藏的项目 export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'hyd', 'designhyd']; // 登录页右下角版本开发基于不展示 export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd']; // 登录页右下角主体不展示 -export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目 -export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式 +// export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目 +// 'jsxt', 'refereeJsxt', +export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式 export const NoQrcodeList = ['heb', 'designheb']; export const NoSimulationQrCodeList = ['heb', 'bjd']; export const goOtherPlatformMenu = { // 导航栏快速切换平台 diff --git a/src/views/login/index.vue b/src/views/login/index.vue index ebc7b37c3..a4f1a0b96 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -336,15 +336,16 @@ export default { this.modelType = 'design'; this.loginClient = 'Design'; this.path = UrlConfig.design.prefix; - } else if (this.project.startsWith('jsxt')) { - this.path = '/jsxt/home'; - } else if (this.project.startsWith('refereeJsxt')) { - this.cookiesName = 'UserDesignName'; - this.cookiesToken = 'UserDesignToken'; - this.modelType = 'design'; - this.loginClient = 'Design'; - this.path = '/refereeJsxt/home'; } + // else if (this.project.startsWith('jsxt')) { + // this.path = '/jsxt/home'; + // } else if (this.project.startsWith('refereeJsxt')) { + // this.cookiesName = 'UserDesignName'; + // this.cookiesToken = 'UserDesignToken'; + // this.modelType = 'design'; + // this.loginClient = 'Design'; + // this.path = '/refereeJsxt/home'; + // } const nowLang = LangStorage.getLang('zh'); if (nowLang === 'zh') { From 9aa16839d0decacabea8e570f6cbf3f2dffac0f9 Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Mon, 23 Nov 2020 17:57:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=88=97=E8=BD=A6=E5=9D=90=E6=A0=87=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/main/loaders/DriverLoadNew.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jlmap3d/main/loaders/DriverLoadNew.js b/src/jlmap3d/main/loaders/DriverLoadNew.js index 8d2a52dcd..4519de089 100644 --- a/src/jlmap3d/main/loaders/DriverLoadNew.js +++ b/src/jlmap3d/main/loaders/DriverLoadNew.js @@ -68,7 +68,7 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist, let signaldata = JSON.parse(netdata.signals); let standsdata = JSON.parse(netdata.stands); let psddata = data.psdList; - assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,-13); + assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,0); assetloader.assetPromiseOver(sceneload) .then(function(data){