rt-sim-training-client/src/views/newMap/display/simulationMenu.vue
joylink_cuiweidong b0431f00f8 Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly
# Conflicts:
#	src/views/newMap/display/simulationMenu.vue
2022-10-21 11:30:35 +08:00

1171 lines
48 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<div class="allSimulationMenu">
<div class="simulationMenu" @click="showMenuList">菜单</div>
<div v-show="isShowMenuList" class="simulationMenuList">
<div v-for="(each, index) in menuList" :key="index">
<div
v-if="each.children && each.isShow"
class="eachSimulationMenu"
@click="showChidren(each, index)"
>
<div>{{ each.label }}</div>
<div v-show="active == index" class="simulationMenuGroup">
<div v-for="(child, childIndex) in each.children" :key="childIndex">
<div v-if="child.isShow" class="eachSimulationMenu" @click="child.click">
{{ child.label }}
</div>
</div>
</div>
</div>
<div v-else>
<div v-if="each.isShow" class="eachSimulationMenu" @click="each.click">{{ each.label }}</div>
</div>
</div>
</div>
</div>
<contect-us ref="contectUs" />
<Jl3d-Device
v-if="deviceif"
v-show="deviceShow"
ref="Jl3dDevice"
:panel-show="deviceShow"
@closedevice3dview="jlmap3dmodel"
/>
<modify-time v-if="datie" ref="modifySysTime" />
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
<!-- <distribute-draft ref="distribute" @QrCodeShow="QrCodeShow" /> -->
<flow-data ref="flowData" />
<member-manage ref="memberManage" />
<register-book ref="registerBook" />
<train-ticket ref="trainTicket" />
<draw-select ref="drawSelect" />
<line-board ref="lineBoard" />
<scene-list ref="sceneList" @selectScript="selectScript" @goToPay="goToPay" />
<theory-exam-select ref="theoryExamSelect" @startTheoryExam="startTheoryExam" />
<theory-exam ref="theoryExam" />
<pay-page ref="payPage" />
<!-- v-if="scheduleLoadShow" -->
<scheduling ref="scheduling" :group="group" />
<!-- v-if="schedulePreviewShow" -->
<scheduling-view ref="schedulingView" :group="group" />
<run-plan-view ref="runPlanView" :group="group" />
<SelectExam ref="selectExam" @examStart="examStart" />
<ExamPanel ref="examPanel" />
<TrainingList ref="trainingList" />
</div>
</template>
<script>
// import DistributeDraft from '@/views/components/limits/distribute';
import { getPostByProjectCode } from '@/api/learn';
import { getSessionStorage } from '@/utils/auth';
import { ProjectCode } from '@/scripts/ProjectConfig';
import ContectUs from './contectUs';
import ModifyTime from './modifyTime';
import FlowData from './flowData';
import SetTime from './setTime';
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import { clearSimulation, ranAsPlan, exitRunPlan } from '@/api/simulation';
import { getToken } from '@/utils/auth';
import { Notification } from 'element-ui';
import { PermissionType } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus';
import MemberManage from './memberManage/membersManage';
import RegisterBook from '../registerBook/index';
import TrainTicket from '../trainTicket/index';
import DrawSelect from '@/jmapNew/theme/datie_01/menus/dialog/drawSelect';
import LineBoard from '../displayCity/lineBoard';
// TrainingMode
import { ScriptMode } from '@/scripts/ConstDic';
import SceneList from './sceneList';
import TheoryExamSelect from './theoryExamSelect';
import TheoryExam from './theoryExam';
import PayPage from '@/views/newMap/displayNew/demon/payPage';
import { initSimulation, simulationPause, simulationStart, destroySimulation } from '@/api/rtSimulation';
import Scheduling from './scheduling';
import SchedulingView from './schedulingView';
import RunPlanView from './runPlanView';
import SelectExam from './exam/selectExam';
import ExamPanel from './exam/examPanel';
import TrainingList from './trainingList/index.vue';
export default {
name: 'SimulationMenu',
components: {
// ChatBox,
// voiceChatBox,
// QrCode,
SetTime,
ModifyTime,
// DistributeDraft,
FlowData,
RegisterBook,
TrainTicket,
DrawSelect,
LineBoard,
SceneList,
TheoryExam,
TheoryExamSelect,
PayPage,
Scheduling,
SchedulingView,
RunPlanView,
// Equipment,
SelectExam,
ExamPanel,
ContectUs,
Jl3dDevice,
MemberManage,
TrainingList
// StatusIcon
},
props: {
mode: {
type: String,
required: true
}
},
data() {
return {
isShowMenuList: false,
scriptMode: ScriptMode.TEACH,
menuList: [],
active: -1,
openBigLPF: null,
messageBoardShow: false,
playerList: [],
isScriptLoad: false,
mapLocation: {},
userRole: 'AUDIENCE',
menuMap: {
demon: [
{
label: '仿真操作',
name: 'simulationOprate',
isShow: true,
children: [
{ label: '修改系统时间', name: 'modifySysTime', click: this.modifySysTime, isShow: false },
{ label: '退出剧本', name: 'quitScript', click: this.quitScript, isShow: true },
{ label: '开始', name: 'start', click: this.startSimulation, isShow: true }, // 暂停
{ label: '按计划行车', name: 'drivingPlan', click: this.drivingPlan, isShow: true },
{ label: '初始化', name: 'initialize', click: this.initialize, isShow: true }
]
},
{
label: '设备操作',
name: 'deviceOprate',
isShow: true,
children: [
{ label: '数字沙盘', name: 'digitalStand ', click: this.digitalStand, isShow: true },
{ label: 'cctv视图', name: 'cctvView', click: this.cctvView, isShow: false },
{ label: '故障设备', name: 'jlmap3dFault', click: this.jlmap3dFault, isShow: false },
{ label: '司机视角', name: 'jlmap3dDriver', click: this.jlmap3dDriver, isShow: true },
{ label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isShow: false },
{ label: 'IBP盘', name: 'IBP', click: this.IBP, isShow: true }
]
},
{
label: '竞赛管理',
name: 'competitionManage',
isShow: true,
children: [
{ label: '实操练习', name: 'noEvent', click: this.noEvent, isShow: true },
{ label: '理论考试', name: 'noEvent', click: this.noEvent, isShow: true }
]
},
{
label: '运行图管理',
name: 'runplanManage',
isShow: true,
children: [
{ label: '运行图编辑', name: 'noEvent', click: this.noEvent, isShow: true },
{ label: '运行图预览', name: 'noEvent', click: this.noEvent, isShow: true },
{ label: '运行图加载', name: 'noEvent', click: this.noEvent, isShow: true }
]
},
{
label: '派班计划管理',
name: 'sendRpManage',
isShow: true,
children: [
{ label: '派班计划加载', name: 'noEvent', click: this.noEvent, isShow: true },
{ label: '派班计划预览', name: 'noEvent', click: this.noEvent, isShow: true }
]
},
{
label: '联系我们',
name: 'contect',
isShow: true,
children: [
{ label: '留言板', name: 'messageBoard', click: this.messageBoard, isShow: false },
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isShow: false }
]
},
{ label: '加载剧本', name: 'loadScript', click: this.noEvent, isShow: true },
{
label: '大铁项目',
name: 'datieManage',
isShow: true,
children: [
{ label: '路票', name: 'noEvent', click: this.noEvent, isShow: true },
{ label: '簿册', name: 'noEvent', click: this.noEvent, isShow: true }
]
},
// 切换到普通模式
// 切换到故障模式
{ label: this.projectDevice ? '退出' : '返回', name: 'backOrQuit', click: this.back, isShow: true }
// <el-button v-if="isLocalStation && $route.query.lineCode!='08'
// && $route.query.lineCode!='16' && $route.query.lineCode!='19' && project !== 'teaching'"
// size="small" @click="goIbp">IBP盘</el-button>
],
teach: [
{ label: '留言板', name: 'messageBoard', click: this.messageBoard, isShow: false },
{ label: '开始', name: 'startBtn', click: this.drivingPlan, isShow: true },
{ label: '结束', name: 'endBtn', click: this.drivingPlan, isShow: true },
{ label: '返回', name: 'backBtn', click: this.drivingPlan, isShow: true }
],
mamanage: [
{ label: '留言板', name: 'messageBoard', click: this.messageBoard, isShow: false },
{ label: '开始', name: 'startBtn', click: this.drivingPlan, isShow: true },
{ label: '结束', name: 'endBtn', click: this.drivingPlan, isShow: true },
{ label: '返回', name: 'backBtn', click: this.drivingPlan, isShow: true }
],
exam: [
{ label: '开始', name: 'drivingPlan', click: this.drivingPlan, isShow: true },
{ label: '结束', name: 'drivingPlan', click: this.drivingPlan, isShow: true },
{ label: '返回', name: 'drivingPlan', click: this.drivingPlan, isShow: true }
],
joint: [
{
label: '仿真操作',
name: 'simulationOprate',
isShow: true,
children: [
{ label: '按计划行车', name: 'drivingPlan', click: this.drivingPlan, isShow: true },
{ label: '修改系统时间', name: 'modifySysTime', click: this.modifySysTime, isShow: false },
{ label: '开始', name: 'start', click: this.startSimulation, isShow: true }, // 暂停
{ label: '初始化', name: 'initialize', click: this.initialize, isShow: true }
]
},
{
label: '演练操作',
name: 'simulationOprate',
isShow: true,
children: [
{ label: '生成二维码', name: 'generateTwoCode', click: this.drivingPlan, isShow: true },
{ label: '成员管理', name: 'quitScript', click: this.drivingPlan, isShow: true }
]
},
{
label: '设备操作',
name: 'deviceOprate',
isShow: true,
children: [
{ label: 'cctv视图', name: 'cctvView', click: this.cctvView, isShow: false },
{ label: '故障设备', name: 'jlmap3dFault', click: this.jlmap3dFault, isShow: false },
{ label: '司机视角', name: 'drivingPlan', click: this.drivingPlan, isShow: true },
{ label: '设备视图', name: 'jl3dmodel', click: this.jlmap3dmodel, isShow: false },
{ label: '设备故障视图', name: 'jl3dmodel', click: this.jlmap3dmodel, isShow: false },
{ label: '设备管理', name: 'drivingPlan', click: this.drivingPlan, isShow: true }
// {label:'IBP盘', name:'drivingPlan', click:this.drivingPlan, isShow:true},
// {label:'数字沙盘', name:'drivingPlan', click:this.drivingPlan, isShow:true},
]
},
{
label: '相关系统',
name: 'simulationOprate',
isShow: true,
children: [
{ label: '教学系统', name: 'start', click: this.drivingPlan, isShow: true }, // 暂停
{ label: '考试系统', name: 'drivingPlan', click: this.drivingPlan, isShow: true }
]
},
{
label: '联系我们',
name: 'contect',
isShow: true,
children: [
{ label: '留言板', name: 'messageBoard', click: this.messageBoard, isShow: false },
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isShow: false }
]
},
{ label: this.projectDevice ? '退出' : '返回', name: 'backOrQuit', click: this.back, isShow: true }
// <!-- 客流规划视图 -->
// <el-button v-if="project == 'bjd' && (isShowScheduling || isStationSupervisor)"
// size="small" @click="jumpjl3dtrafficplan">{{ $t('display.demon.trafficplantext') }}</el-button>
// <el-button v-if="project == 'bjd' && (isShowScheduling || isStationSupervisor)"
// size="small" @click="jumpjl3dtraffictrain">{{ $t('display.demon.traffictraintext') }}</el-button>
],
bjd: [],
wjls: [],
contest: [],
training: [],
script: []
},
// {value:'xty', label:'西铁院'},
// {value: 'gzb', label: '贵州装备'},
// {value: 'xadt', label: '西安地铁'},
// {value: 'heb', label: '哈尔滨'},
// {value: 'drts', label: '调度大赛'},
// {value: 'nty', label: '南铁院(通用版)'},
// {value: 'ntyc', label: '南铁院(专用版)'},
// {value: 'ntyl', label: '南铁院(本地版)'},
// {value: 'bjd', label: '北交大'},
// {value: 'urtss', label: '陪标项目'},
// {value: 'sdy', label: '苏电院'},
// {value: 'cgy', label: '成都工业'},
// {value: 'wjls', label: '微机联锁'},
// {value: 'zzww', label: '郑州共赢'},
// {value: 'zzwwtest', label: '郑州共赢考试'},
// {value: 'richor', label: '中航锐创'},
// {value: 'richorlesson3d', label: '中航锐创(三维课程)'},
// {value: 'richor_joint', label: '中航锐创(实训室)'},
// {value: 'nologo', label: '无logo' },
// {value: 'sr_sandbox', label: '上饶沙盘'},
// {value: 'jxgm', label: '江西工贸' },
// {value: 'richor_ygy', label: '扬州工业'},
// {value: 'say', label: '苏安院'},
// {value: 'unittec_sty', label: '众合-陕铁院'},
// {value: 'richor_hhcj', label: '红河财经'},
// {value: 'teaching', label: '教学通用'},
// {value: 'richor_cxjs', label: '长兴技校'},
// {value: 'hyd_railway', label: '哈盈达大铁'},
// {value: 'wh', label: '武汉8号线'}
// projectMenuMap:{
// // 北交大
// 'bjd':[
// {label:'切换客流数据', name:'changeFlowData', click:this.changeFlowData, isShow:true},
// {label:'大客流策略', name:'bigLPFStrategy', click:this.bigLPFStrategy, isShow:true},
// {label:'权限分发', name:'distribute', click:this.distribute, isShow:true},
// // {label:'留言板', name:'messageBoard', click:this.messageBoard, isShow:true},
// {label:'联系方式', name:'contectUs', click:this.contectUs, isShow:true},
// {label:'按计划行车', name:'drivingPlan', click:this.drivingPlan, isShow:true},
// {label:'初始化', name:'initialize', click:this.initialize, isShow:true},
// {label:'返回', name:'backBJD', click:this.backBJD, isShow:true}
// // ATS行调工作站
// ],
// 'designBjd':[
// ],
// // 陪标项目
// 'urtss':[
// ],
// // 微机联锁
// 'wjls':[
// {label:'设备视图', name:'jlmap3dmodel', click:this.jlmap3dmodel, isShow:true},
// {label:'经典案例分析', name:'caseAnalysis ', click:this.caseAnalysis, isShow:true},
// {label:'规范学习', name:'normativeStudy', click:this.normativeStudy, isShow:true},
// {label:'占线板', name:'lineBoard', click:this.lineBoard, isShow:true},
// {label:this.$store.state.socket.simulationPause ? '开始' : '暂停', name:'startOrPause', click:this.startOrPause, isShow:true}, // 开始/暂停
// {label:'初始化', name:'initialize', click:this.end, isShow:true},
// {label:'返回', name:'backWJLS', click:this.backWJLS, isShow:true}
// ],
// 'login':[
// {label:'路票', name:'trainTicket ', click:this.trainTicket, isShow:true},
// {label:'簿册', name:'registerBook ', click:this.registerBook, isShow:true},
// // {label:'数字沙盘', name:'digitalStand ', click:this.digitalStand, isShow:true},
// {label:'派班计划加载', name:'schedulingLoad', click:this.schedulingLoad, isShow:true},
// {label:'派班计划预览', name:'schedulingView', click:this.schedulingView, isShow:true},
// {label:'设备视图', name:'jlmap3dmodel', click:this.jlmap3dmodel, isShow:true},
// {label:'联系方式', name:'contectUs', click:this.contectUs, isShow:true},
// {label:['16', '19'].includes(this.$route.query.lineCode) ? '修改系统时间' : '按计划行车', name:'modifyOrDriving', click:this.modifyOrDriving, isShow:true },
// {label:'初始化', name:'initialize', click:this.initialize, isShow:true},
// {label:this.$route.query.projectDevice ? '退出' : '返回', name:'backOrQuit', click:this.back, isShow:true }
// ],
// 'design':[
// {label:'路票', name:'trainTicket ', click:this.trainTicket, isShow:true},
// {label:'簿册', name:'registerBook ', click:this.registerBook, isShow:true},
// {label:'设备视图', name:'jlmap3dmodel', click:this.jlmap3dmodel, isShow:true},
// {label:['16', '19'].includes(this.$route.query.lineCode) ? '修改系统时间' : '按计划行车', name:'modifyOrDriving', click:this.modifyOrDriving, isShow:true },
// {label:'初始化', name:'initialize', click:this.initialize, isShow:true},
// {label:this.$route.query.projectDevice ? '退出' : '返回', name:'backOrQuit', click:this.back, isShow:true }
// ],
// // 调度大赛
// 'drts':[
// {label:'联系方式', name:'contectUs', click:this.contectUs, isShow:true},
// {label:'实操练习', name:'fieldPractice', click:this.fieldPractice, isShow:true},
// {label:'理论考试', name:'theoryQuiz', click:this.theoryQuiz, isShow:true},
// {label:'运行图预览', name:'runPlanView', click:this.runPlanView, isShow:true},
// {label:'按计划行车', name:'drivingPlan', click:this.drivingPlan, isShow:true},
// {label:'初始化', name:'initialize', click:this.end, isShow:true},
// {label:'返回', name:'backBJD', click:this.backBJD, isShow:true}
// ],
// // 郑州共赢
// 'zzww':[
// ]
// // <el-button v-if="isContest" size="small" :disabled="practiceDisabled" @click="fieldPractice">实操练习</el-button>
// // <el-button v-if="isContest" size="small" @click="goTheoryQuiz">理论考试</el-button>
// // showRegisterBookBtn() {
// // const roleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_SIGNALER', 'STATION_SWITCH_MAN', 'STATION_MASTER', 'STATION_WORKER', 'DEVICE_MANAGER'];
// // return this.$route.query.lineCode === '16' && roleList.includes(this.$store.state.training.userRole);
// // }
// // srsandbox jxgm ===> noChat
// // 'say':{}, // 苏安院
// // 'teaching':{} // 教学通用
// },
allMenuList: [
{ label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isShow: true },
{
label: ['16', '19'].includes(this.$route.query.lineCode) ? '修改系统时间' : '按计划行车',
name: 'modifyOrDriving',
click: this.modifyOrDriving,
isShow: true
},
{ label: '初始化', name: 'initialize', click: this.end, isShow: true },
{ label: '考试', name: 'exam', click: this.goExam, isShow: true },
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isShow: true },
{label:'成员管理', name:'memberManage', click:this.memberManage, isShow:true},
{label:'实训', name:'trainingPane', click:this.trainingPane, isShow:true},
{label:'切换客流数据', name:'changeFlowData', click:this.changeFlowData, isShow:true},
// { label: '权限分发', name: 'distribute', click: this.distribute, isShow: true },
{
label: this.$route.query.projectDevice ? '退出' : '返回',
name: 'backOrQuit',
click: this.back,
isShow: true
}
],
deviceif: false,
deviceShow: true
};
},
computed: {
// 当前的所属项目
project() {
return getSessionStorage('project');
},
isLocal() {
// 是否为本地项目
return process.env.VUE_APP_PRO === 'local';
},
// 当前为派班工作站
isShowScheduling() {
return this.$route.query.prdType == '05';
},
// 当前为司机驾驶
isDrive() {
return this.$route.query.prdType == '04';
},
// 线路类型
lineCode() {
return this.$route.query.lineCode;
},
// 仿真group
group() {
return this.$route.query.group;
},
// 设备数据
projectDevice() {
return this.$route.query.projectDevice;
},
datie() {
return ['16', '19'].includes(this.$route.query.lineCode);
},
mapId() {
return this.$route.query.mapId;
}
},
mounted() {
// jl3dmodel
// const dataMap = {
// 'messageBoard':this.judgeMessageBoard(),
// 'contectUs':this.judgeContectUs(),
// 'jlmap3dmodel':this.judgeJlmap3dmodel(),
// 'modifySysTime':this.judgeModifySysTime(),
// 'cctvView':this.judgeCctvView(),
// 'digitalStand':this.judgeDigitalStand()
// };
// const list = ['messageBoard', 'contectUs', 'jlmap3dmodel', 'modifySysTime', 'cctvView', 'digitalStand'];
// this.menuList = this.menuMap[this.mode];
// this.menuList.map(each=>{
// each.children && each.children.map(menu=>{
// if (list.includes(menu.name)) {
// menu.isShow = dataMap[menu.name];
// }
// });
// });
// this.menuList = this.projectMenuMap[this.project];
this.menuList = this.allMenuList;
window.addEventListener('click', this.close, false);
},
beforeDestroy() {
window.removeEventListener('click', this.close);
},
methods: {
showChidren(data, index) {
event.stopPropagation();
this.active = index;
},
modifyOrDriving() {
if (this.datie) {
this.modifySysTime();
} else {
this.drivingPlan();
}
},
close() {
this.hideMenuList();
},
judgeModifySysTime() {
return this.datie;
},
judgeDigitalStand() {
// demon
const ignoreProject = ['bjd', 'teaching', 'drts'];
const includejlmap3dmodel = ['demon', 'joint'];
return (
includejlmap3dmodel.includes(this.mode) &&
!ignoreProject.includes(this.project) &&
this.lineCode != '16' &&
!this.isShowScheduling &&
!this.isDrive
);
},
// cctv 视图
judgeCctvView() {
// demon
const ignoreProject = ['bjd', 'teaching', 'drts'];
const includejlmap3dmodel = ['demon', 'joint'];
return (
includejlmap3dmodel.includes(this.mode) &&
!ignoreProject.includes(this.project) &&
this.lineCode != '16' &&
!this.isShowScheduling &&
!this.isDrive
);
// !isContest && project !== 'bjd' && $route.query.lineCode !== '16' && project !== 'teaching'
},
// 判断设备视图按钮是否显示
judgeJlmap3dmodel() {
// demon
const ignoreProject = ['bjd', 'teaching', 'drts'];
const includejlmap3dmodel = ['demon', 'joint'];
return (
includejlmap3dmodel.includes(this.mode) &&
!ignoreProject.includes(this.project) &&
this.lineCode != '16' &&
!this.isShowScheduling &&
!this.isDrive
);
// displayCity----微机联锁
},
// 判断联系方式按钮是否显示
judgeContectUs() {
// practiceDisplay----大客流
const includeContectUs = ['demon', 'joint'];
return includeContectUs.includes(this.mode) && !this.isLocal;
},
// 判断留言板按钮是否显示
judgeMessageBoard() {
// practiceDisplay----大客流
const includeMessageBoard = ['demon', 'teach', 'manage', 'joint'];
if (includeMessageBoard.includes(this.mode) && this.project) {
getPostByProjectCode(ProjectCode[this.project])
.then(resp => {
if (resp.data) {
this.messageBoardShow = true;
return true;
}
})
.catch(() => {
console.log('获取留言板信息失败');
return false;
});
} else {
return false;
}
},
// 返回 或者退出 按钮
// 菜单显示
showMenuList(event) {
event.stopPropagation();
this.isShowMenuList = !this.isShowMenuList;
this.active = -1;
},
hideMenuList() {
this.isShowMenuList = false;
this.active = -1;
},
// 返回或者退出
back() {
this.hideMenuList();
if (this.projectDevice) {
if (this.$route.query.type == 'IM') {
clearSimulation(this.group).then(res => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
});
});
} else {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
});
}
} else {
// || this.isCtc
if (this.project === 'bjd') {
window.close();
} else {
// this.$store.dispatch('map/setShowCentralizedStationCode', '');
history.go(-1);
Notification.closeAll();
}
}
},
// 数字沙盘
digitalStand() {
this.hideMenuList();
const routeData = this.$router.resolve({
path: '/jlmap3d/sandbox',
query: {
mapid: this.mapId,
group: this.group,
token: getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank');
},
// 打开考试选择列表
goExam() {
// this.$refs.selectExam.doShow()
this.examStart({
composition: {
id: '19',
name: 'test_yly',
profile: '刻录机奥斯卡及安德森临渴掘井卡拉的参量空间安德森',
orgId: '178',
startTime: '2022-10-19 18:05:24',
endTime: '2029-07-05 00:00:00',
validDuration: 30,
passScore: 6,
fullScore: 10,
creatorId: 3826,
createTime: '2022-10-19 18:05:48',
updateTime: '2022-10-19 18:05:48',
state: 3,
ruleList: [
{
id: '23',
pcId: '19',
type: 1,
subtype: 1,
tags: [],
amount: 1,
score: 2
},
{
id: '24',
pcId: '19',
type: 1,
subtype: 2,
tags: [],
amount: 1,
score: 2
},
{
id: '25',
pcId: '19',
type: 1,
subtype: 3,
tags: [],
amount: 2,
score: 1
},
{
id: '26',
pcId: '19',
type: 2,
subtype: 4,
tags: [],
amount: 1,
score: 2
},
{
id: '27',
pcId: '19',
type: 2,
subtype: 5,
tags: [],
amount: 1,
score: 2
}
]
},
paper: {
id: '14',
userId: '3826',
pcId: '19',
orgId: '178',
createTime: '2022-10-20 15:58:08'
},
questionList: [
{
id: '175',
puId: '14',
orgId: '178',
type: 1,
questionId: '3970',
state: 1
},
{
id: '176',
puId: '14',
orgId: '178',
type: 1,
questionId: '2731',
state: 1
},
{
id: '177',
puId: '14',
orgId: '178',
type: 1,
questionId: '4202',
state: 1
},
{
id: '178',
puId: '14',
orgId: '178',
type: 1,
questionId: '2677',
state: 1
},
{
id: '179',
puId: '14',
orgId: '178',
type: 2,
questionId: '63',
state: 1
},
{
id: '180',
puId: '14',
orgId: '178',
type: 2,
questionId: '22',
state: 1
}
]
});
},
// 开始考试
examStart(data) {
console.log(data);
this.$refs.examPanel.init(data);
},
// 联系我们弹窗
contectUs() {
this.hideMenuList();
this.$refs.contectUs.doShow();
},
// 打开留言板
messageBoard() {
this.hideMenuList();
const routeData = this.$router.resolve({
path: '/messageBoard',
query: {
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href, '_blank');
},
// 设备视图
jlmap3dmodel() {
if (this.deviceif == false) {
this.hideMenuList();
this.deviceif = true;
} else {
if (this.deviceShow == false) {
this.hideMenuList();
this.deviceShow = true;
} else {
this.deviceShow = false;
}
}
},
// 修改系统时间
modifySysTime() {
this.hideMenuList();
this.$refs.modifySysTime.doShow();
},
// 退出剧本
quitScript() {
this.hideMenuList();
},
// 开始、暂停
startSimulation() {
this.hideMenuList();
},
// 按计划行车
drivingPlan() {
this.hideMenuList();
this.$refs.setTime.doShow();
},
// 实操练习
fieldPractice() {
this.hideMenuList();
this.$refs.sceneList.doShow();
},
// 理论考试
theoryQuiz() {
this.hideMenuList();
this.$refs.theoryExamSelect.doShow();
},
// 选中场景
selectScript({ playerList, mapLocation }) {
this.changeScriptMode(this.scriptMode);
this.isScriptLoad = true;
this.playerList = playerList;
this.mapLocation = mapLocation;
this.userRole = 'AUDIENCE';
this.$store.dispatch('training/setRoles', 'AUDIENCE');
},
// 切换模式
changeScriptMode(scriptMode) {
const ScriptModeList = {
TEACHING_MODE: 'teach',
PRACTICE_MODE: 'practice',
TEST_MODE: 'test'
};
this.$store.dispatch('training/setScriptOperationType', ScriptModeList[scriptMode]);
},
// 购买
goToPay() {
this.$refs.payPage.doShow();
},
// 开始理论考试
startTheoryExam(mode) {
this.$refs.theoryExam.doShow(mode);
},
// 初始化
initialize() {
this.hideMenuList();
exitRunPlan(this.group)
.then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/resetActiveTrainList', false);
this.$store.dispatch('map/setTrainWindowShow', false);
});
});
})
.catch(() => {
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
// cctv视图
cctvView() {
this.hideMenuList();
const routeData = this.$router.resolve({
path: '/jlmap3d/passengerflow',
query: {
mapid: this.mapId,
group: this.group,
project: this.project,
noPreLogout: true,
lineCode: this.lineCode
}
});
window.open(routeData.href, '_blank');
},
// ibp盘
IBP() {
this.hideMenuList();
},
// 派班计划加载
schedulingLoad() {
this.$refs.scheduling.doShow();
},
// 派班计划预览
schedulingView() {
this.$refs.schedulingView.doShow();
},
// 故障设备
jlmap3dFault() {
this.hideMenuList();
const routeData = this.$router.resolve({
path: '/jlmap3d/maintainer',
query: {
mapid: this.mapId,
group: this.group,
token: getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href);
},
// 司机视角
jlmap3dDriver() {
this.hideMenuList();
},
start(model) {
// 开始仿真
this.hideMenuList();
const data = {
time: model.initTime
};
if (this.$route.query.prdType === '04') {
data.loadNumber = model.loadNum;
}
ranAsPlan(data, this.group)
.then(res => {
this.$store.dispatch(
'training/setInitTime',
+new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)
);
})
.catch(error => {
let message = '';
switch (error.code) {
case '5001':
message = this.$t('error.mapDataError');
break;
case '5002':
message = this.$t('error.runningChartDataError');
break;
case '5003':
message = this.$t('error.runningChartIsNotLoaded');
break;
case '5004':
message = this.$t('error.runningDataError');
break;
case '5000':
message = this.$t('error.systemError');
break;
case '4000':
message = this.$t('error.simulationDoesNotExist');
break;
case '4001':
message = this.$t('error.simulationOperationIsNotDefined');
break;
case '4002':
message = this.$t('error.simulationOperationProcessingMethodNotFound');
break;
case '4003':
message = this.$t('error.simulationOperationFailed');
break;
case '4004':
message = this.$t('error.operationConflict');
break;
default:
message = '按计划行车异常,请退出重试!';
// this.$messageBox('按计划行车异常,请退出重试!');
break;
}
this.$messageBox(message + '' + this.$t('error.startSimulationFailed'));
});
},
/** 大客流策略 */
bigLPFStrategy() {
this.hideMenuList();
if (this.openBigLPF) {
this.openBigLPF.close();
}
const routeData = this.$router.resolve({
path: '/bigLPFStrategy',
query: {
mapId: this.$route.query.mapId,
group: this.$route.query.group,
project: this.$route.query.project,
noPreLogout: true
}
});
this.openBigLPF = window.open(routeData.href);
},
/** 权限分发 */
// distribute() {
// if (this.$refs) {
// this.hideMenuList();
// this.$refs.distribute.doShow({
// PermissionType: PermissionType.SIMULATION,
// mapId: this.$route.query.mapId,
// prdType: this.$route.query.prdType
// });
// }
// },
// QrCodeShow() {},
// 成员管理
memberManage() {
this.$refs.memberManage.doShow();
},
trainingPane() {
this.$refs.trainingList.doShow();
},
changeFlowData() {
this.hideMenuList();
this.$refs.flowData.doShow();
},
async backWJLS() {
destroySimulation(this.group).then(res => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
});
});
},
async backBJD() {
clearSimulation(this.group).then(res => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
// this.$store.dispatch('training/reset');
// this.$store.dispatch('map/mapClear');
location.reload();
});
});
});
},
trainTicket() {
this.hideMenuList();
const stationSupervisorList = [];
for (const memberId in this.$store.state.training.memberData) {
const item = this.$store.state.training.memberData[memberId];
if (item.type === 'STATION_SUPERVISOR') {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
const memberData = {
labelName: '值班员-' + device.name + (item.name ? `-${item.name}` : ''),
id: item.id,
userId: item.userId
};
stationSupervisorList.push(memberData);
}
}
EventBus.$emit('trainTicketMember', stationSupervisorList);
this.$refs.trainTicket.doShow();
},
registerBook() {
this.hideMenuList();
this.$refs.registerBook.doShow();
},
caseAnalysis() {
this.hideMenuList();
this.$refs.drawSelect.doShow(null, 'clCaAn');
},
normativeStudy() {
this.hideMenuList();
this.$refs.drawSelect.doShow(null, 'normStudy');
},
startOrPause() {
this.hideMenuList();
// this.pauseLoading = true;
if (this.$store.state.socket.simulationPause) {
simulationStart(this.$route.query.group)
.then(resp => {
// this.pauseLoading = false;
})
.catch(e => {
this.$message.error('仿真开始失败!');
});
} else {
simulationPause(this.$route.query.group)
.then(resp => {
// this.pauseLoading = false;
})
.catch(e => {
// this.pauseLoading = false;
this.$message.error('仿真暂停失败!');
});
}
},
lineBoard() {
this.hideMenuList();
this.$refs.lineBoard.doShow();
},
runPlanView() {
this.hideMenuList();
this.$refs.runPlanView.doShow();
},
end() {
// this.loading = true;
initSimulation(this.group)
.then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/resetActiveTrainList', false);
this.$store.dispatch('map/setTrainWindowShow', false);
this.$store.dispatch('map/initSimulationButton');
});
});
// setTimeout(() => {
// this.loading = false;
// }, 1500);
})
.catch(() => {
this.loading = false;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
noEvent() {
this.hideMenuList();
}
}
};
</script>
<style lang="scss" scoped>
.allSimulationMenu {
position: absolute;
// width: 200px;
height: 200px;
right: 0px;
bottom: 0px;
}
.simulationMenu {
position: absolute;
width: 60px;
right: 10px;
padding: 9px 0px;
background: #fff;
text-align: center;
bottom: 10px;
border-radius: 2px;
font-size: 14px;
cursor: pointer;
}
.simulationMenuList {
position: absolute;
right: 71px;
width: 95px;
bottom: 10px;
background: #fff;
// min-height: 100px;
border-radius: 2px;
font-size: 14px;
}
.eachSimulationMenu {
padding: 9px 0px;
// border-bottom:1px #dedede solid;
text-align: center;
cursor: pointer;
position: relative;
white-space: nowrap;
}
.eachSimulationMenu:hover {
background: #dedede;
}
.simulationMenuGroup {
position: absolute;
right: 96px;
top: 0px;
background: #fff;
display: inline-block;
border-radius: 4px;
width: 95px;
border-right: 1px #000 solid;
}
</style>