This commit is contained in:
zyy 2020-06-23 09:27:10 +08:00
commit 88211cee8f
15 changed files with 111 additions and 146 deletions

View File

@ -423,7 +423,7 @@ class Jlmap {
} else {
if (elem.deviceType === 'TRAIN') {
this.isUpdateShowTrainList = true;
store.dispatch('map/updateTrainList', elem);
store.dispatch('map/updateActiveTrainList', elem);
// store.dispatch('map/updateTrainState', elem);
} else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem);

View File

@ -297,23 +297,6 @@ export default {
this.$refs.speedCmdControl.doShow(operate, this.selected);
}
});
// const step = {
// start: true,
// code: `${this.selected.code}`,
// operation: OperationEvent.Section.cancelSpeed.menu.operation,
// param: {
// Section_Code: `${this.selected.code}`
// }
// };
// this.$store.dispatch('training/next', step).then(({ valid }) => {
// if (valid) {
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
// Handler.execute(CMD.Section.CMD_QUERY, {}).then(resp => {
// const tempData = resp.data;
// this.$refs.speedCmdControl.doShow(step, this.selected, tempData);
// });
// }
// });
}
}
};

View File

@ -19,6 +19,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationMenu',
@ -197,107 +198,47 @@ export default {
},
//
setAutoTrigger() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.setAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
commitOperate(menuOperate.Station.setAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow(error.message);
});
},
//
cancelAutoTrigger() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
}).catch(() => {
this.$refs.noticeInfo.doShow(step);
commitOperate(menuOperate.Station.cancelAutoTrigger, { stationCode: this.selected.code }, 3).then(({valid, operate})=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow(error.message);
});
},
//
powerUnLock() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.powerUnLock.menu.operation,
param: {
Station_Code: `${this.selected.code}`
}
};
this.$store.dispatch('training/next', step).then(({ valid }) => {
commitOperate(menuOperate.Station.powerUnLock, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(step, this.selected);
this.$refs.stationCmdControl.doShow(operate, this.selected);
}
});
},
//
execKeyOperationTest() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.execKeyOperationTest.menu.operation,
param: {
stationCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
commitOperate(menuOperate.Station.execKeyOperationTest, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationCmdControl.doShow(step, this.selected);
this.$refs.stationCmdControl.doShow(operate, this.selected);
}
});
},
//
humanControlALL() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.humanControlALL.menu.operation,
param: {
stationCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
commitOperate(menuOperate.Station.humanControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationHumanControlAll.doShow(step);
this.$refs.stationHumanControlAll.doShow(operate, this.selected);
}
});
},
//
atsAutoControlALL() {
const step = {
start: true,
code: `${this.selected.code}`,
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
param: {
stationCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
commitOperate(menuOperate.Station.atsAutoControlALL, { stationCode: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationSetRouteControlAll.doShow(step, this.selected);
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
}
});
}

View File

@ -206,6 +206,7 @@ const map = {
mousemove: 0, // 实训战场图移动标识
version: '', // 地图版本,
activeTrainListUpdate:0, // 当前按计划行车的列车列表更新标识
activeTrainList:[], // 当前按计划行车的列车列表
runPlanStatus:false, // 是否正处于按计划行车
showCentralizedStationCode: '', // 现地分集中站显示(集中站code)
showCentralizedStationNum: 0, // 现地分集中站显示判断
@ -731,6 +732,7 @@ const map = {
},
resetActiveTrainList:(state) => {
state.activeTrainListUpdate = 0;
state.activeTrainList = [];
},
setDeleteCount: (state) => {
state.deleteCount++;
@ -830,13 +832,14 @@ const map = {
}
});
},
updateTrainList: (state, data)=>{
const trainList = state.map.trainList;
trainList.forEach(elem => {
if (elem.code == data.code) {
elem = deepAssign(elem || {}, data);
updateActiveTrainList: (state, data)=>{
let isExist = false;
state.activeTrainList.forEach(elem => {
if (elem == data.code) {
isExist = true;
}
});
if (!isExist) { state.activeTrainList.push(data.code); }
}
},
@ -911,9 +914,9 @@ const map = {
}
},
// 更新列车信息
updateTrainList:({ commit }, train) => {
commit('updateTrainList', train);
// 更新激活的列车信息
updateActiveTrainList:({ commit }, train) => {
commit('updateActiveTrainList', train);
},
setMapDataIdList: ({ state }, data) => {

View File

@ -9,7 +9,9 @@ const scriptRecord = {
scriptId: '',
bgSet: false,
isScriptCommand:false, // 当前是否为添加剧本动作指令状态
scriptCommand:{} // 剧本动作添加的指令
scriptCommand:{}, // 剧本动作添加的指令
updateRoleStatus:0, // 剧本更新角色标志
userRole:null // 剧本更新的角色
},
getters: {
mapLocation: (state)=>{
@ -29,6 +31,9 @@ const scriptRecord = {
},
scriptCommand:(state)=>{
return state.scriptCommand;
},
updateRoleStatus:(state)=>{
return state.updateRoleStatus;
}
},
mutations: {
@ -49,6 +54,10 @@ const scriptRecord = {
},
setScriptCommand:(state, scriptCommand) => {
state.scriptCommand = scriptCommand;
},
updateRole:(state, userRole) => {
state.updateRoleStatus += 1;
state.userRole = userRole;
}
},
actions: {
@ -72,6 +81,9 @@ const scriptRecord = {
},
updateScriptCommand:({ commit }, scriptCommand) => {
commit('setScriptCommand', scriptCommand);
},
updateRole:({ commit }, userRole) => {
commit('updateRole', userRole);
}
}
};

View File

@ -11,7 +11,7 @@
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
<div v-show="currentCoversition.all==undefined?true&&isShow:currentCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
<div v-show="memberListCoversition.all==undefined?true&&isShow:memberListCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
<i class="el-icon-plus" style="font-weight: bolder;" />
</div>
<div class="chat-setting" @click="handleSetting()">
@ -19,7 +19,7 @@
</div>
</div>
<div class="chat-box-content">
<chat-content ref="chatContent" :current-coversition="currentCoversition" @changeCoversition="changeCoversition" />
<chat-content ref="chatContent" :current-coversition="memberListCoversition" @changeCoversition="changeCoversition" />
<div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" />
@ -31,7 +31,7 @@
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<el-button v-if="isButtonShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitCoversition()">退出群聊</el-button>
<el-button v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<el-button v-if="memberListCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
</div>
@ -83,7 +83,6 @@ export default {
minimize:true,
bottom:15,
recordSending:false,
currentCoversition:{},
memberListCoversition:{},
seconds:0,
inter:null,
@ -132,6 +131,9 @@ export default {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
},
'userRole':function(val) {
this.isHasCoversition = false;
}
},
@ -159,7 +161,7 @@ export default {
},
setCurrentCoversition(coversition) {
if (coversition && coversition.id) {
this.currentCoversition = coversition;
// this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
this.headerTitle = '';
@ -175,9 +177,9 @@ export default {
},
quitCoversition() {
this.quitLoading = true;
quitCoversition(this.group, this.currentCoversition.id).then(res=>{
quitCoversition(this.group, this.memberListCoversition.id).then(res=>{
this.quitLoading = false;
this.currentCoversition = {all:undefined, id:null};
this.memberListCoversition = {all:undefined, id:null};
this.$refs.chatCoversitionList.initPage(true);
this.isHasCoversition = false;
}).catch(error=>{
@ -191,7 +193,7 @@ export default {
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
this.isHasCoversition = true;
this.currentCoversition = {id:data.id, all:data.all};
// this.currentCoversition = {id:data.id, all:data.all};
this.memberListCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle;
},
@ -290,7 +292,7 @@ export default {
const blob = that.recorders.getBlob();
const fd = new FormData();
fd.append('file', blob);
uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.currentCoversition.id, fd)
uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.memberListCoversition.id, fd)
.then((data) => {
})
.catch(error => {

View File

@ -31,6 +31,9 @@ export default {
'userRole':function(val) {
this.initPage(true);
}
// '$store.state.scriptRecord.updateRoleStatus':function(val) {
// this.initPage(true);
// }
},
mounted() {
},

View File

@ -49,6 +49,9 @@ export default {
if (val) {
this.getSimulationMembers();
}
},
'$store.state.scriptRecord.updateRoleStatus':function(val) {
this.getSimulationMembers();
}
},
mounted() {

View File

@ -221,6 +221,7 @@ export default {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('map/setRunPlanStatus', false);
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/clearJlmapTrainView');
this.$store.dispatch('map/setTrainWindowShow', false);
});

View File

@ -88,7 +88,7 @@ export default {
} else if (this.$store.state.training.prdType == null) {
return '';
} else {
return 'AUDIENCE';
return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'AUDIENCE';
}
}
},

View File

@ -71,19 +71,26 @@ export default {
watch:{
'$store.state.map.activeTrainListUpdate': function (val) {
if (val) {
const trainList = this.$store.state.map.map.trainList;
const activeTrainList = this.$store.state.map.activeTrainList;
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{
this.topTrainList = [];
this.bottomTrainList = [];
activeTrainList.forEach((trainCode)=>{
// train.serviceNumber != '' && train.serviceNumber != undefined &&
return !train.right && train.sectionCode;
});
this.bottomTrainList = trainList.filter((train)=>{
// train.serviceNumber != '' && train.serviceNumber != undefined &&
return train.right && train.sectionCode;
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && !train.right && train.sectionCode) {
this.topTrainList.push(train);
} else if (train && train.right && train.sectionCode) {
this.bottomTrainList.push(train);
}
});
} else {
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
this.trainList = [];
activeTrainList.forEach((trainCode)=>{
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && train.sectionCode) {
this.trainList.push(train);
}
});
}
} else {
@ -91,11 +98,6 @@ export default {
this.bottomTrainList = [];
this.trainList = [];
}
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {
this.$store.dispatch('map/resetActiveTrainList');
}
}
},
mounted() {
@ -116,11 +118,14 @@ export default {
this.$emit('setCenter', code);
},
covert(data) {
let min = (Math.abs(data) - Math.abs(data) % 60) / 60;
let seconds = Math.abs(data) % 60;
const absData = Math.abs(data);
const hours = Math.floor(absData / 3600);
let min = Math.floor((absData % 3600) / 60);
let seconds = (absData % 3600) % 60;
min = min > 9 ? min : '0' + min;
seconds = seconds > 9 ? seconds : '0' + seconds;
return data == 0 ? '00:00' : (data > 0 ? min + ':' + seconds + 'E' : min + ':' + seconds + 'L');
const time = hours + ':' + min + ':' + seconds;
return data == 0 ? '00:00:00' : (data > 0 ? time + 'E' : time + 'L');
}
}
};

View File

@ -100,7 +100,7 @@ export default {
return this.userRole == 'STATION_SUPERVISOR';
},
isDriver() {
console.log(this.userRole);
console.log(this.userRole);
return this.userRole == 'DRIVER';
},
isAdmin() {
@ -296,6 +296,7 @@ export default {
}).catch(() => {
this.$store.dispatch('training/over').then(() => {
this.isDisable = true;
this.$store.dispatch('map/resetActiveTrainList');
this.$messageBox(this.$t('error.endSimulationFailed'));
});
});

View File

@ -71,17 +71,26 @@ export default {
watch:{
'$store.state.map.activeTrainListUpdate': function (val) {
if (val) {
const trainList = this.$store.state.map.map.trainList;
const activeTrainList = this.$store.state.map.activeTrainList;
if (this.lineCode == '10' || this.lineCode == '11') {
this.topTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && !train.right && train.sectionCode;
});
this.bottomTrainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.right && train.sectionCode;
this.topTrainList = [];
this.bottomTrainList = [];
activeTrainList.forEach((trainCode)=>{
// train.serviceNumber != '' && train.serviceNumber != undefined &&
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && !train.right && train.sectionCode) {
this.topTrainList.push(train);
} else if (train && train.right && train.sectionCode) {
this.bottomTrainList.push(train);
}
});
} else {
this.trainList = trainList.filter((train)=>{
return train.serviceNumber != '' && train.serviceNumber != undefined && train.sectionCode;
this.trainList = [];
activeTrainList.forEach((trainCode)=>{
const train = this.$store.getters['map/getDeviceByCode'](trainCode);
if (train && train.sectionCode) {
this.trainList.push(train);
}
});
}
} else {
@ -89,11 +98,6 @@ export default {
this.bottomTrainList = [];
this.trainList = [];
}
},
'$store.state.map.runPlanStatus': function (val) {
if (!val) {
this.$store.dispatch('map/resetActiveTrainList');
}
}
},
mounted() {
@ -114,9 +118,10 @@ export default {
this.$emit('setCenter', code);
},
covert(data) {
const hours = Math.floor(data / 3600);
let min = Math.floor((data % 3600) / 60);
let seconds = (data % 3600) % 60;
const absData = Math.abs(data);
const hours = Math.floor(absData / 3600);
let min = Math.floor((absData % 3600) / 60);
let seconds = (absData % 3600) % 60;
min = min > 9 ? min : '0' + min;
seconds = seconds > 9 ? seconds : '0' + seconds;
const time = hours + ':' + min + ':' + seconds;

View File

@ -98,6 +98,7 @@ export default {
beforeDestroy() {
this.clearAutoSave();
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.$store.dispatch('scriptRecord/updateRole', null);
},
mounted() {
this.initData();
@ -149,6 +150,11 @@ export default {
}
}
this.$store.dispatch('training/setPrdType', prdType);
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{
if (each.label == memberInfo.role) {
this.$store.dispatch('scriptRecord/updateRole', each.value);
}
});
}).catch(()=>{
this.$messageBox('切换角色失败');
});

View File

@ -10,6 +10,7 @@
<span class="roleClass">{{ actionInfo.memberName }}</span>
<span>邀请</span>
<span class="roleClass">{{ actionInfo.targetName }}</span>
<span>开始会话</span>
</span>
<span v-else-if="actionInfo.isDrive">
<span class="roleClass">{{ actionInfo.memberName }}</span>
@ -110,7 +111,6 @@ export default {
return lastData;
},
covertData(memberVOList, element) {
debugger;
const member = memberVOList.find(elem=>{ return elem.id == element.memberId; });
const memberName = member.name;
switch (element.type) {