This commit is contained in:
zyy 2020-08-19 13:43:22 +08:00
commit 7caac2f5f3
9 changed files with 454 additions and 391 deletions

View File

@ -23,7 +23,7 @@ const Jlmap3dMaintainerVr = () => import('@/views/jlmap3d/maintainer/jl3dmaintai
const Display = () => import('@/views/oldMap/display/index');
const DisplayNew = () => import('@/views/newMap/displayNew/index');
const DesignDisplay = () => import('@/views/oldMap/display/designIndex');
const DesignDisplayNew = () => import('@/views/newMap/displayNew/designIndex');
const DesignDisplayNew = () => import('@/views/newMap/displayNew/scriptDisplay/scriptPreview/index');
const TrainRoom = () => import('@/views/trainRoom/index');
const JointTraining = () => import('@/views/oldMap/jointTraining/index');

View File

@ -50,7 +50,6 @@ export default {
acceptConversitionInvite(this.group, this.conversitionId).then(res=>{
this.loading = false;
this.dialogVisible = false;
this.$emit('getCoversitionList');
}).catch(error=>{
this.$messageBox('接受邀请失败: ' + error.message);
});

View File

@ -94,7 +94,7 @@ export default {
return this.$route.query.group;
},
userRole() {
return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'ADMIN';
return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'DISPATCHER';
},
isDriver() {
return this.$store.state.scriptRecord.userRole == 'DRIVER';

View File

@ -0,0 +1,323 @@
<template>
<div class="main" :style="{width: canvasWidth+'px'}">
<div v-show="panelShow" :panelShow="panelShow">
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<script-button-group
ref="scriptButtonGroup"
:offset="offset"
:group="group"
@viewScriptRoles="viewScriptRoles"
@viewRunPlan="viewRunPlan"
@loadRunPlan="loadRunPlan"
@setFault="setFault"
@setMemberData="setMemberData"
@setMemberList="setMemberList"
@clearAllData="clearAllData"
@setTreeData="setTreeData"
/>
<script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" :offset="offset" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
</div>
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<!-- <Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" /> -->
<select-role ref="selectRole" :member-list="memberList" @selectRole="selectRole" />
<run-plan-Load ref="runPlanLoad" :group="group" />
<run-plan-view ref="runPlanView" :group="group" />
<fault-choose ref="faultChoose" :group="group" :offset="offset" />
</div>
</template>
<script>
// 稿
import { getToken } from '@/utils/auth';
import RunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
import RunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
import SelectRole from './selectRole';
import ScriptPreviewChat from './scriptPreviewChat.vue';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import ScriptButtonGroup from './scriptButtonGroup';
import FaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { mapGetters } from 'vuex';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
import Vue from 'vue';
import ConstConfig from '@/scripts/ConstConfig';
//
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
// import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
export default {
name: 'DisplayDraft',
components: {
RunPlanLoad,
RunPlanView,
ScriptPreviewChat,
MapSystemDraft,
FaultChoose,
MenuSystemTime,
SelectRole,
ScriptButtonGroup
// Jl3dDrive
},
data() {
return {
trainingObj: {},
timeDemonNum: 0,
offset: 15,
panelShow: true,
memberData:[],
mapLocation:{},
// firstLoad: true,
// simulationShow: false,
// drivingShow: false,
showStation: '',
// stationListMode: [],
// showSelectStation: false, // select
group: '',
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
},
userRole:'',
isDrive: this.prdType == '04',
treeData:[],
memberList:[]
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
...mapGetters('map', [
'map',
'stationList'
]),
// ...mapGetters('training', [
// 'offsetStationCode'
// ]),
...mapGetters('config', [
'canvasId'
]),
mapId() {
return this.$route.query.mapId;
},
prdType() {
return this.$store.state.training.prdType;
},
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
// isDrive() {
// return this.prdType == '04';
// },
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) {
this.switchStationMode(this.showStation);
},
'$store.state.training.centerStationCode': function(code) {
if (code) {
this.showStation = code;
}
},
'$store.state.training.prdType':function(val) {
this.setPosition();
// this.setMode();
}
// 'stationList': function () {
// debugger;
// this.setStationList();
// }
},
created() {
this.group = this.$route.query.group || '';
},
methods: {
back() {
this.$refs.scriptButtonGroup.back();
},
async selectRole(role) {
try {
const res = this.drawWay ? await loadDraftScriptNew(role.id, this.group) : await loadDraftScript(this.$route.query.scriptId, role.id, this.group);
if (res && res.code == 200) {
if (this.querymapLocation) {
const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
}
this.$store.dispatch('scriptRecord/updateBgSet', true);
this.$refs.scriptButtonGroup.setIsscriptRun(true);
if (role.type) {
const typeList = ConstConfig.ConstSelect.roleTypeNew;
typeList.forEach(type=>{
if (role.type == type.label) {
this.userRole = type.value;
}
});
let prdType;
if (role.type == '行值') {
prdType = '01';
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.$store.dispatch('training/setRoleDeviceCode', role.deviceCode);
} else if (role.type == '行调') {
prdType = '02';
this.$store.dispatch('training/setRoles', 'DISPATCHER');
} else if (role.type == '司机') {
prdType = '04';
} else if (role.type == '通号') {
prdType = '';
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer',
query:{
mapid:this.$route.query.mapId,
group:this.group,
token:getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href);
} else {
prdType = '';
}
this.switchMode(prdType);
this.memberData.map(member=>{
if (member.id == role.id) {
member.userId = this.$store.state.user.id;
member.name = this.$store.state.user.nickname;
member.disabled = true;
}
});
} else {
this.userRole = 'AUDIENCE';
this.switchMode('');
}
} catch (error) {
this.$messageBox(error.message);
}
},
setPosition() {
this.$nextTick(() => {
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
this.offset = 15 + (menuBar ? menuBar.offsetHeight || 0 : 0) + (menuTool ? menuTool.offsetHeight || 0 : 0);
});
},
switchMode(prdType) {
this.$store.dispatch('training/setPrdType', prdType);
},
// setMode() {
// this.showSelectStation = this.$store.state.map.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
// },
viewScriptRoles() {
this.$refs.selectRole.doShow();
},
viewRunPlan() {
this.$refs.runPlanView.doShow();
},
loadRunPlan() {
this.$refs.runPlanLoad.doShow();
},
setFault() {
this.$refs.faultChoose.doShow();
},
setMemberData(lastMemberList) {
this.memberData = lastMemberList;
},
setMemberList(memberList) {
this.memberList = memberList;
},
setTreeData(treeData) {
this.treeData = treeData;
},
clearAllData() {
this.$refs.chatbox.clearAllData();
},
// hidepanel() {
// if (this.isDrive) {
// this.panelShow = false;
// this.drivingShow = true;
// this.$refs.Jl3dDrive.show(this.mapId, this.group);
// } else {
// this.panelShow = false;
// this.simulationShow = true;
// this.$refs.Jl3dSimulation.show(this.mapId, this.group);
// }
// },
// showpanel() {
// this.panelShow = true;
// this.simulationShow = false;
// },
// showdriving() {
// this.panelShow = true;
// this.drivingShow = false;
// },
switchStationMode(val) {
if (val == null && this.stationListMode.length > 0) {
this.showStation = this.stationListMode[0].value;
} else {
this.showStation = val;
}
this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
this.$store.dispatch('map/setShowCentralizedStationNum');
}
// setStationList() {
// this.stationListMode = [];
// (this.stationList || []).forEach(item => {
// if (item.centralized) {
// this.stationListMode.push({value: item.code, name: item.name});
// }
// });
// if (this.stationListMode.length) {
// this.showStation = this.stationListMode[0].value;
// }
// }
}
};
</script>
<style>
.main {
z-index: 10;
display: block;
width: 100%;
height: 100%;
overflow: hidden;
-moz-user-select: none;
-o-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.display-draft {
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.schema {
z-index: 36;
display: inline;
position: absolute;
right: 5px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-button+.el-button {
margin-left: 0px;
}
</style>

View File

@ -1,202 +1,93 @@
<template>
<div class="main" :style="{width: canvasWidth+'px'}">
<div v-show="panelShow" :panelShow="panelShow">
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" :offset="offset" />
<div class="display-draft">
<el-button v-if="isscriptRun&&!dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
<el-button type="primary" @click="back">{{ $t('display.demon.back') }}</el-button>
</div>
<div class="schema" :style="{top: offset+'px'}">
<template v-if="!dataError">
<el-button-group>
<el-button size="small" :disabled="viewDisabled || isscriptRun" type="success" @click="viewScriptRoles">{{ $t('display.schema.selectRoles') }}</el-button>
<!-- 运行图加载 -->
<el-button v-if="running" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="faultMode" size="small" type="danger" @click="setFault">自动故障设置</el-button>
</el-button-group>
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
</template>
</div>
<!-- 菜单按钮 -->
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
<div>
<!-- 左下角按钮列表 -->
<div class="display-draft">
<el-button v-if="isscriptRun&&!dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
<el-button type="primary" @click="back">{{ $t('display.demon.back') }}</el-button>
</div>
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<!-- <Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" /> -->
<select-role ref="selectRole" :member-list="memberList" @selectRole="selectRole" />
<run-plan-Load ref="runPlanLoad" :group="group" />
<run-plan-view ref="runPlanView" :group="group" />
<fault-choose ref="faultChoose" :group="group" :offset="offset" />
<!-- 左上角按钮列表 -->
<div class="schema" :style="{top: offset+'px'}">
<template v-if="!dataError">
<el-button-group>
<el-button size="small" :disabled="viewDisabled || isscriptRun" type="success" @click="viewScriptRoles">{{ $t('display.schema.selectRoles') }}</el-button>
<!-- 运行图加载 -->
<el-button v-if="running" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="faultMode" size="small" type="danger" @click="setFault">自动故障设置</el-button>
</el-button-group>
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
</template>
</div>
<!-- 菜单按钮列表 -->
</div>
</template>
<script>
// 稿
import SelectRole from './selectRole';
import { getToken } from '@/utils/auth';
import RunPlanLoad from './demon/runPlanLoad';
import RunPlanView from './demon/runPlanView';
import ScriptPreviewChat from './scriptPreviewChat.vue';
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import { quitScriptNew, scriptRePreview } from '@/api/simulation';
import FaultChoose from './demon/faultChoose';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { mapGetters } from 'vuex';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { OperateMode } from '@/scripts/ConstDic';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import { Notification } from 'element-ui';
import { timeFormat } from '@/utils/date';
import { OperateMode } from '@/scripts/ConstDic';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { quitScriptNew, scriptRePreview } from '@/api/simulation';
import {getDraftScriptByGroupNew } from '@/api/script';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { getByGroupStationList } from '@/api/jmap/map';
import { getEveryDayRunPlanNew } from '@/api/simulation';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
import {getDraftScriptByGroupNew } from '@/api/script';
import Vue from 'vue';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
//
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
// import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import { timeFormat } from '@/utils/date';
import { Notification } from 'element-ui';
export default {
name: 'DisplayDraft',
components: {
RunPlanLoad,
RunPlanView,
ScriptPreviewChat,
MapSystemDraft,
FaultChoose,
MenuSystemTime,
SelectRole
// Jl3dDrive
name:'ScriptButtonGroup',
props:{
offset: {
type: Number,
required: true
},
group: {
type: String,
required: true
}
},
data() {
return {
mode: '',
trainingObj: {},
timeDemonNum: 0,
offset: 15,
offsetBottom: 15,
dataError: false,
panelShow: true,
memberData:[],
faultMode: false,
viewDisabled: true,
mapLocation:{},
firstLoad: true,
// simulationShow: false,
// drivingShow: false,
isscriptRun:false, //
showStation: '',
stationListMode: [],
showSelectStation: false, // select
group: '',
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
},
userRole:'',
isDrive: this.prdType == '04',
treeData:[],
memberList:[]
isscriptRun:false //
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
...mapGetters('map', [
'map',
'stationList'
]),
// ...mapGetters('training', [
// 'offsetStationCode'
// ]),
...mapGetters('config', [
'canvasId'
]),
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
},
mapId() {
return this.$route.query.mapId;
},
prdType() {
return this.$store.state.training.prdType;
},
isDemon() {
return this.mode === 'demon';
},
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
},
computed:{
running() {
return this.$store.state.training.started;
},
isScheduling() {
return this.$store.state.training.prdType === '05';
},
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
}
// isDrive() {
// return this.prdType == '04';
// },
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) {
this.switchStationMode(this.showStation);
},
'$store.state.training.centerStationCode': function(code) {
if (code) {
this.showStation = code;
}
},
'$store.state.training.prdType':function(val) {
this.setPosition();
this.setMode();
watch:{
$route() {
this.initLoadData();
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'stationList': function () {
this.setStationList();
},
$route() {
// this.$nextTick(() => {
this.initLoadData();
// });
},
'$store.state.training.switchcount': async function () {
if (this.group) {
if (this.$store.state.training.started && !this.firstLoad) {
await this.loadRunData();
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
this.firstLoad = false;
await this.loadRunData();
// if (this.$store.state.training.started && !this.firstLoad) {
// } else if (this.firstLoad) {
// await this.loadRunData(this.$route.query);
// }
// this.firstLoad = false;
}
}
},
created() {
this.mode = this.$route.params.mode;
this.group = this.$route.query.group || '';
},
async mounted() {
await this.initLoadData();
},
@ -206,102 +97,19 @@ export default {
await this.$store.dispatch('map/mapClear');
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
},
methods: {
viewScriptRoles() {
this.$refs.selectRole.doShow();
},
async selectRole(role) {
try {
const res = this.drawWay ? await loadDraftScriptNew(role.id, this.group) : await loadDraftScript(this.$route.query.scriptId, role.id, this.group);
if (res && res.code == 200) {
if (this.querymapLocation) {
const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
}
this.$store.dispatch('scriptRecord/updateBgSet', true);
this.isscriptRun = true;
if (role.type) {
const typeList = ConstConfig.ConstSelect.roleTypeNew;
typeList.forEach(type=>{
if (role.type == type.label) {
this.userRole = type.value;
}
});
let prdType;
if (role.type == '行值') {
prdType = '01';
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.$store.dispatch('training/setRoleDeviceCode', role.deviceCode);
} else if (role.type == '行调') {
prdType = '02';
this.$store.dispatch('training/setRoles', 'DISPATCHER');
} else if (role.type == '司机') {
prdType = '04';
} else if (role.type == '通号') {
prdType = '';
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainer',
query:{
mapid:this.$route.query.mapId,
group:this.group,
token:getToken(),
project: this.project,
noPreLogout: true
}
});
window.open(routeData.href);
} else {
prdType = '';
}
this.switchMode(prdType);
this.memberData.map(member=>{
if (member.id == role.id) {
member.userId = this.$store.state.user.id;
member.name = this.$store.state.user.nickname;
member.disabled = true;
}
});
} else {
this.userRole = 'AUDIENCE';
this.switchMode('');
}
} catch (error) {
this.$messageBox(error.message);
}
},
changeOperateMode() {
this.faultMode = !this.faultMode;
let mode = OperateMode.NORMAL;
if (this.faultMode) {
mode = OperateMode.FAULT;
}
this.$store.dispatch('training/changeOperateMode', { mode: mode });
},
methods:{
//
async initLoadData() {
this.setWindowSize();
this.$store.dispatch('training/reset');
try {
await this.loadSimulationInfo();
if (this.isDemon) {
await this.initLoadDemonData();
}
await this.initLoadDemonData();
} catch (error) {
this.$messageBox(`初始化失败: ${error.message}`);
this.endViewLoading();
}
},
setWindowSize() {
this.$nextTick(() => {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
},
// 仿
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
@ -318,19 +126,37 @@ export default {
this.$messageBox('此地图数据正在维护中,无法运行!');
}
},
// 仿
async initLoadDemonData() {
// this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (this.group) {
await this.loadNewMapDataByGroup(this.group);
await this.getDraftScriptByGroupNew(this.group);
this.switchMode('02');
this.$store.dispatch('training/setPrdType', '02');
} else {
this.endViewLoading();
}
},
//
endViewLoading() {
this.$store.dispatch('map/mapClear');
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
// id
async loadNewMapDataByGroup(group) {
try {
await loadNewMapDataByGroup(group);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
setIsscriptRun(status) {
this.isscriptRun = status;
},
async getDraftScriptByGroupNew(group) {
const resp = await getDraftScriptByGroupNew(group);
if (resp.code == 200) {
@ -395,7 +221,7 @@ export default {
}
}
});
this.treeData = [{
const treeData = [{
label: '行调',
id: 'dispatcher',
type: 'role',
@ -416,7 +242,8 @@ export default {
type: 'role',
children: maintainerList
}];
this.memberData = lastMemberList;
this.$emit('setTreeData', treeData);
this.$emit('setMemberData', lastMemberList);
}
let newMemberList = [];
const activeMemberList = [];
@ -443,41 +270,11 @@ export default {
if (resp.data.mapLocation) {
this.mapLocation = resp.data.mapLocation;
}
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', label: this.$t('display.script.none'), role: 'no', disabled:false });
const memberList = newMemberList || [];
memberList.unshift({ id: '', label: this.$t('display.script.none'), role: 'no', disabled:false });
this.$emit('setMemberList', memberList);
}
},
covert(data, roleTypeList) {
let lastData = data;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.label = each.type + deviceName + name;
each.disabled = false;
});
return lastData;
},
// id
async loadNewMapDataByGroup(group) {
try {
await loadNewMapDataByGroup(group);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
loadRunData() {
this.$store.dispatch('runPlan/clear').then(() => {
if (this.group) {
@ -504,29 +301,24 @@ export default {
}
});
},
//
endViewLoading() {
this.$store.dispatch('map/mapClear');
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
covert(data, roleTypeList) {
let lastData = data;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
},
setPosition() {
this.$nextTick(() => {
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
const menuBottom = document.getElementById('menuButton');
this.offset = 15 + (menuBar ? menuBar.offsetHeight || 0 : 0) + (menuTool ? menuTool.offsetHeight || 0 : 0);
this.offsetBottom = 15 + (menuBottom ? menuBottom.offsetHeight || 0 : 0);
});
},
async back() {
await clearSimulation(this.group);
this.$store.dispatch('training/over').then(() => {
history.go(-1);
Notification.closeAll();
lastData = JSON.parse(lastData);
lastData.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.label = each.type + deviceName + name;
each.disabled = false;
});
return lastData;
},
// 退
handleQuitQuest() {
@ -537,7 +329,7 @@ export default {
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.userRole = '';
this.$refs.chatbox.clearAllData();
this.$emit('clearAllData');
// if (resp.data.planRunning) {
// this.$store.dispatch('training/start');// 仿
// } else {
@ -553,98 +345,46 @@ export default {
this.$messageBox(this.$t('display.demon.exitTaskFail'));
});
},
async back() {
await clearSimulation(this.group);
this.$store.dispatch('training/over').then(() => {
history.go(-1);
Notification.closeAll();
});
},
// 仿
async quit() {
await clearSimulation(this.group);
await this.$store.dispatch('training/over');
},
switchMode(prdType) {
this.$store.dispatch('training/setPrdType', prdType);
viewScriptRoles() {
this.$emit('viewScriptRoles');
},
setMode() {
this.showSelectStation = this.$store.state.map.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
changeOperateMode() {
this.faultMode = !this.faultMode;
let mode = OperateMode.NORMAL;
if (this.faultMode) {
mode = OperateMode.FAULT;
}
this.$store.dispatch('training/changeOperateMode', { mode: mode });
},
// hidepanel() {
// if (this.isDrive) {
// this.panelShow = false;
// this.drivingShow = true;
// this.$refs.Jl3dDrive.show(this.mapId, this.group);
// } else {
// this.panelShow = false;
// this.simulationShow = true;
// this.$refs.Jl3dSimulation.show(this.mapId, this.group);
// }
// },
// showpanel() {
// this.panelShow = true;
// this.simulationShow = false;
// },
// showdriving() {
// this.panelShow = true;
// this.drivingShow = false;
// },
viewRunPlan() {
this.$refs.runPlanView.doShow();
this.$emit('viewRunPlan');
},
loadRunPlan() {
this.$refs.runPlanLoad.doShow();
this.$emit('loadRunPlan');
},
setFault() {
this.$refs.faultChoose.doShow();
this.$emit('setFault');
},
switchStationMode(val) {
if (val == null && this.stationListMode.length > 0) {
this.showStation = this.stationListMode[0].value;
} else {
this.showStation = val;
}
this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
this.$store.dispatch('map/setShowCentralizedStationNum');
},
setStationList() {
this.stationListMode = [];
(this.stationList || []).forEach(item => {
if (item.centralized) {
this.stationListMode.push({value: item.code, name: item.name});
}
setWindowSize() {
this.$nextTick(() => {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
if (this.stationListMode.length) {
this.showStation = this.stationListMode[0].value;
}
}
}
};
</script>
<style>
.main {
z-index: 10;
display: block;
width: 100%;
height: 100%;
overflow: hidden;
-moz-user-select: none;
-o-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.display-draft {
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.schema {
z-index: 36;
display: inline;
position: absolute;
right: 5px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-button+.el-button {
margin-left: 0px;
}
</style>

View File

@ -17,8 +17,8 @@
</div>
</template>
<script>
import ChatBox from '../chatView/chatBox.vue';
import ScriptTip from './scriptTip';
import ChatBox from '@/views/newMap/chatView/chatBox.vue';
import ScriptTip from '../scriptTip';
export default {
name:'ScriptPreviewChat',
components:{

View File

@ -156,6 +156,7 @@ export default {
}
this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('training/setRoles', 'DISPATCHER');
this.$store.dispatch('scriptRecord/updateRole', 'DISPATCHER' + ':' + this.memberId);
getAllSelectedScriptRole(this.group).then(res=>{
const lastData = JSON.stringify(res.data);
this.quickChangeMember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);