diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js
index 1e6e68458..3e92f331f 100644
--- a/src/jmapNew/map.js
+++ b/src/jmapNew/map.js
@@ -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);
diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue
index fa9bc2dff..728360dcf 100644
--- a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue
+++ b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue
@@ -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);
- // });
- // }
- // });
}
}
};
diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue
index 13178093d..7bc2b434b 100644
--- a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue
+++ b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue
@@ -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);
}
});
}
diff --git a/src/store/modules/map.js b/src/store/modules/map.js
index a3cbc6e43..cd8c99d51 100644
--- a/src/store/modules/map.js
+++ b/src/store/modules/map.js
@@ -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) => {
diff --git a/src/store/modules/scriptRecord.js b/src/store/modules/scriptRecord.js
index eb4f46783..b67204a37 100644
--- a/src/store/modules/scriptRecord.js
+++ b/src/store/modules/scriptRecord.js
@@ -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);
}
}
};
diff --git a/src/views/newMap/displayNew/chatView/chatBox.vue b/src/views/newMap/displayNew/chatView/chatBox.vue
index 866a914d6..5955f57bc 100644
--- a/src/views/newMap/displayNew/chatView/chatBox.vue
+++ b/src/views/newMap/displayNew/chatView/chatBox.vue
@@ -11,7 +11,7 @@
-
-
+
@@ -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 => {
diff --git a/src/views/newMap/displayNew/chatView/chatCoversitionList.vue b/src/views/newMap/displayNew/chatView/chatCoversitionList.vue
index 04f3dfc30..91b3f9b6b 100644
--- a/src/views/newMap/displayNew/chatView/chatCoversitionList.vue
+++ b/src/views/newMap/displayNew/chatView/chatCoversitionList.vue
@@ -31,6 +31,9 @@ export default {
'userRole':function(val) {
this.initPage(true);
}
+ // '$store.state.scriptRecord.updateRoleStatus':function(val) {
+ // this.initPage(true);
+ // }
},
mounted() {
},
diff --git a/src/views/newMap/displayNew/chatView/chatMemberList.vue b/src/views/newMap/displayNew/chatView/chatMemberList.vue
index a58adb699..b191b744e 100644
--- a/src/views/newMap/displayNew/chatView/chatMemberList.vue
+++ b/src/views/newMap/displayNew/chatView/chatMemberList.vue
@@ -49,6 +49,9 @@ export default {
if (val) {
this.getSimulationMembers();
}
+ },
+ '$store.state.scriptRecord.updateRoleStatus':function(val) {
+ this.getSimulationMembers();
}
},
mounted() {
diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue
index bc9c97560..ca523e4b9 100644
--- a/src/views/newMap/displayNew/menuDemon.vue
+++ b/src/views/newMap/displayNew/menuDemon.vue
@@ -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);
});
diff --git a/src/views/newMap/displayNew/menuScript.vue b/src/views/newMap/displayNew/menuScript.vue
index 5cb240510..65a3ea535 100644
--- a/src/views/newMap/displayNew/menuScript.vue
+++ b/src/views/newMap/displayNew/menuScript.vue
@@ -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';
}
}
},
diff --git a/src/views/newMap/displayNew/menuTrainList.vue b/src/views/newMap/displayNew/menuTrainList.vue
index 3e2b95207..3d519871d 100644
--- a/src/views/newMap/displayNew/menuTrainList.vue
+++ b/src/views/newMap/displayNew/menuTrainList.vue
@@ -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');
}
}
};
diff --git a/src/views/newMap/jointTrainingNew/menuDemon.vue b/src/views/newMap/jointTrainingNew/menuDemon.vue
index 6749c3324..b8f0cf4ea 100644
--- a/src/views/newMap/jointTrainingNew/menuDemon.vue
+++ b/src/views/newMap/jointTrainingNew/menuDemon.vue
@@ -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'));
});
});
diff --git a/src/views/newMap/jointTrainingNew/menuTrainList.vue b/src/views/newMap/jointTrainingNew/menuTrainList.vue
index e0ec40550..3d519871d 100644
--- a/src/views/newMap/jointTrainingNew/menuTrainList.vue
+++ b/src/views/newMap/jointTrainingNew/menuTrainList.vue
@@ -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;
diff --git a/src/views/scriptManage/display/tipScriptRecordNew.vue b/src/views/scriptManage/display/tipScriptRecordNew.vue
index 1056d28e4..d1195f505 100644
--- a/src/views/scriptManage/display/tipScriptRecordNew.vue
+++ b/src/views/scriptManage/display/tipScriptRecordNew.vue
@@ -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('切换角色失败');
});
diff --git a/src/views/scriptManage/scriptRecord/getActionNew.vue b/src/views/scriptManage/scriptRecord/getActionNew.vue
index 309828f73..f3ada43a4 100644
--- a/src/views/scriptManage/scriptRecord/getActionNew.vue
+++ b/src/views/scriptManage/scriptRecord/getActionNew.vue
@@ -10,6 +10,7 @@
{{ actionInfo.memberName }}
邀请
{{ actionInfo.targetName }}
+
开始会话
{{ actionInfo.memberName }}
@@ -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) {