This commit is contained in:
zyy 2020-07-10 18:42:05 +08:00
commit fccbc9ecd0
19 changed files with 181 additions and 130 deletions

View File

@ -77,9 +77,9 @@ export function getAllDeviceInProject(params) {
});
}
/** 添加/修改ibp设备配置 */
export function setIbpConfig(id, data) {
export function setVrIbpConfig(id, data) {
return request({
url: `/api/device/${id}/config/ibp`,
url: `/api/device/${id}/config/vribp`,
method: 'put',
data: data
});

View File

@ -757,13 +757,6 @@ export function getTrainDetailBytripNumber(group, params) {
params: params
});
}
/** 根据memberId获取综合演练角色信息 */
export function getMemberInfo(group, memberId) {
return request({
url: `/simulation/${group}/${memberId}/memberInfo`,
method: 'get'
});
}
/** 获取新版综合仿真仿真成员列表 */
export function getSimulationMemberList(group) {
return request({

View File

@ -62,7 +62,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {getMemberInfo} from '@/api/simulation';
import {SimulationType} from '@/scripts/ConstDic';
export default {
name: 'RequestControl',
@ -191,11 +191,23 @@ export default {
});
},
doShow(msgHead) {
getMemberInfo(this.$route.query.group, msgHead.sourceMemberId).then(resp => {
if (resp.data && resp.data.deviceName && resp.data.name) {
this.requestInfo = `${ resp.data.deviceName}(${resp.data.name})`;
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
const simulationUserList = this.$store.state.training.simulationUserList;
if (member) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
});
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
this.requestInfo = info;
}
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();

View File

@ -62,7 +62,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {getMemberInfo} from '@/api/simulation';
import {SimulationType} from '@/scripts/ConstDic';
export default {
name: 'RequestControl',
@ -190,11 +190,23 @@ export default {
});
},
doShow(msgHead) {
getMemberInfo(this.$route.query.group, msgHead.sourceMemberId).then(resp => {
if (resp.data && resp.data.deviceName && resp.data.name) {
this.requestInfo = `${ resp.data.deviceName}(${resp.data.name})`;
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
const simulationUserList = this.$store.state.training.simulationUserList;
if (member) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
});
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
this.requestInfo = info;
}
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();

View File

@ -62,7 +62,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {getMemberInfo} from '@/api/simulation';
import {SimulationType} from '@/scripts/ConstDic';
export default {
name: 'RequestControl',
@ -190,11 +190,23 @@ export default {
});
},
doShow(msgHead) {
getMemberInfo(this.$route.query.group, msgHead.sourceMemberId).then(resp => {
if (resp.data && resp.data.deviceName && resp.data.name) {
this.requestInfo = `${ resp.data.deviceName}(${resp.data.name})`;
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
const simulationUserList = this.$store.state.training.simulationUserList;
if (member) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
});
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
this.requestInfo = info;
}
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();

View File

@ -62,7 +62,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {getMemberInfo} from '@/api/simulation';
import {SimulationType} from '@/scripts/ConstDic';
export default {
name: 'RequestControl',
@ -190,11 +190,23 @@ export default {
});
},
doShow(msgHead) {
getMemberInfo(this.$route.query.group, msgHead.sourceMemberId).then(resp => {
if (resp.data && resp.data.deviceName && resp.data.name) {
this.requestInfo = `${ resp.data.deviceName}(${resp.data.name})`;
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
const simulationUserList = this.$store.state.training.simulationUserList;
if (member) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
});
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
this.requestInfo = info;
}
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();

View File

@ -218,6 +218,7 @@ export default {
{label: '信号机', value:'SIGNAL'},
{label: '屏蔽门', value: 'PSD'},
{label: 'IBP盘', value: 'IBP'},
{label: '虚拟IBP盘', value: 'VR_IBP'},
{label: '教员机', value: 'IM'},
{label: '行调工作站', value: 'CW'},
{label: '现地工作站', value: 'LW'},
@ -227,7 +228,8 @@ export default {
{label: '现地综合监控', value: 'ISCS_LW'},
{label: '中心综合监控', value: 'ISCS_CW'},
{label: '车辆段终端', value: 'DEPOT'},
{label: '虚拟CCTV', value: 'CCTV'}
{label: '虚拟CCTV', value: 'CCTV'},
{label: 'PLC网关', value: 'PLC_GATEWAY'}
]
}
};

View File

@ -2218,6 +2218,13 @@ export const TrainType = {
HEAD: '头码车',
MANUAL: '人工车'
};
/** 仿真成员类型 */
export const SimulationType = {
DISPATCHER: '行调',
STATION_SUPERVISOR: '车站值班员',
DRIVER: '司机',
MAINTAINER: '通号'
};
export const UrlConfig = {
display: '/display',
displayNew: '/displayNew',

View File

@ -228,15 +228,17 @@ const training = {
setSimulationUserList: (state, simulationUserList) => {
state.simulationUserList = simulationUserList;
},
updateMemberListInScript:(state, {oldMemberId, newMemberId, userId}) => {
updateMemberListInScript:(state, {oldMemberId, newMemberId, userId, name}) => {
if (oldMemberId) {
// 重置旧数据
state.memberData[oldMemberId].trust = false;
delete state.memberData[oldMemberId].userId;
delete state.memberData[oldMemberId].name;
state.memberData[oldMemberId].disabled = false;
}
// 更新新数据
state.memberData[newMemberId].userId = userId;
state.memberData[newMemberId].name = name;
state.memberData[newMemberId].disabled = true;
state.memberData[newMemberId].trust = true;
},

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -215,11 +215,11 @@ export default {
},
bgImg() {
const bgImgAll = process.env.VUE_APP_PRO === 'local' || this.$route.query.project == 'heb' ? '' : bgImg;
const synchronousLogin = ['IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
const imgMap = {
ISCS_LW: bgIscsImg,
ISCS_CW: bgIscsImg,
IBP: bgIbpImg,
VR_IBP: bgIbpImg,
CCTV: bgCctvImg,
VR_PSD: bgPsdImg,
LSW: bgLswImg
@ -227,14 +227,14 @@ export default {
return synchronousLogin.includes(this.$route.query.type) ? imgMap[this.$route.query.type] : bgImgAll;
},
syncLogin() {
const synchronousLogin = ['IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
return this.$route.query.type ? synchronousLogin.includes(this.$route.query.type) : false;
},
loadingText() {
const textMap = {
ISCS_LW: '检测现地工作站登录中',
ISCS_CW: '检测行调工作站登录中',
IBP: '检测现地工作站登陆中',
VR_IBP: '检测现地工作站登陆中',
CCTV: '检测教员机登录中',
VR_PSD: '检测教员机登录中',
LSW: '检测教员机登录中'

View File

@ -55,7 +55,7 @@ import ChatCreateGroup from './chatCreateGroup';
import ChatMemberList from './chatMemberList';
import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc';
import {sendSimulationConversition, overSimulationConversition, getSimulationMembersNew, getAllConversition, getSimulationConversition} from '@/api/chat';
import {sendSimulationConversition, overSimulationConversition, getAllConversition, getSimulationConversition} from '@/api/chat';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
export default {
@ -135,7 +135,6 @@ export default {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
this.getSimulationMembers();
},
'userRole':function(val) {
this.isHasCoversition = false;
@ -196,77 +195,78 @@ export default {
},
//
getSimulationMembers() {
getSimulationMembersNew(this.$route.query.group).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
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);
const activeList = this.$store.state.map.activeTrainList;
const memberList = [];
// lastData = lastData.filter(memberIn=>{ return memberIn.role != ''; });
lastData.forEach((member, index)=>{
if (member.type != '观众') {
const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
member.memberName = member.type + device.groupNumber + name;
if (activeList.length > 0 && activeList.includes(device.groupNumber)) {
memberList.push(member);
}
} else {
member.memberName = member.type + device.name + name;
memberList.push(member);
const memberList = this.$store.state.training.memberData;
let lastData = JSON.stringify(memberList);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
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);
const activeList = this.$store.state.map.activeTrainList;
lastData = Object.values(lastData);
const lastMemberList = [];
lastData.forEach((member, index)=>{
if (member.type != '观众') {
const name = member.name == undefined ? '' : '-' + member.name;
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (device) {
if (device._type == 'Train') {
member.memberName = member.type + device.groupNumber + name;
if (activeList.length > 0 && activeList.includes(device.groupNumber)) {
lastMemberList.push(member);
}
} else {
member.memberName = member.type + member.deviceCode + name;
memberList.push(member);
member.memberName = member.type + device.name + name;
lastMemberList.push(member);
}
} else {
member.memberName = member.type + name;
memberList.push(member);
member.memberName = member.type + member.deviceCode + name;
lastMemberList.push(member);
}
}
});
this.memberList = memberList;
if (this.recordSending) {
this.cancleRecording();
}
//
getAllConversition(this.$route.query.group).then(resp=>{
if (resp.data && resp.data.length && resp.data.length > 0) {
this.isCreate = false;
const coversitionList = resp.data;
let memberListCoversition = {};
coversitionList.forEach(coversition=>{
if (!coversition.over) {
const memberList = coversition.memberList;
memberList.forEach(member=>{
if (member.memberId == this.$store.state.scriptRecord.updateRoleId) {
memberListCoversition = {id:coversition.id, all:null};
if (member.memberId == coversition.creatorId) {
this.isCreate = true;
}
}
});
}
});
this.memberListCoversition = memberListCoversition;
} else {
this.isCreate = false;
this.memberListCoversition = {};
member.memberName = member.type + name;
lastMemberList.push(member);
}
this.getSimulationConverMembers();
});
}
});
this.memberList = lastMemberList;
this.getAllConversition();
},
getAllConversition() {
if (this.recordSending) {
this.cancleRecording();
}
//
getAllConversition(this.$route.query.group).then(resp=>{
if (resp.data && resp.data.length && resp.data.length > 0) {
this.isCreate = false;
const coversitionList = resp.data;
let memberListCoversition = {};
coversitionList.forEach(coversition=>{
if (!coversition.over) {
const memberList = coversition.memberList;
memberList.forEach(member=>{
if (member.memberId == this.$store.state.scriptRecord.updateRoleId) {
memberListCoversition = {id:coversition.id, all:null};
if (member.memberId == coversition.creatorId) {
this.isCreate = true;
}
}
});
}
});
this.memberListCoversition = memberListCoversition;
} else {
this.isCreate = false;
this.memberListCoversition = {};
}
this.getSimulationConverMembers();
});
},
//

View File

@ -413,7 +413,7 @@ export default {
this.isAdmin = data.admin;
const deviceVO = this.$store.state.user.projectDevice;
if (deviceVO && deviceVO.type === 'IBP') {
if (deviceVO && deviceVO.type === 'VR_IBP') {
this.showIbp(this.deviceCode);
const config = JSON.parse(deviceVO.config);
this.ibpPart = config.part.toLowerCase();

View File

@ -6,7 +6,7 @@
</div>
<div class="member__container">
<el-input v-model="filterText" :placeholder="this.$t('global.enterNameToFilter')" clearable />
<el-scrollbar class="member__container--list" wrap-class="scrollbar-wrapper" :style="{height: treeHeight+'px'}">
<el-scrollbar class="member__container--list" wrap-class="scrollbar-wrapper" style="{height: calc(100% - 64px)}">
<el-tree
ref="tree"
:data="filterMembers"
@ -43,10 +43,6 @@ export default {
type: Array,
required: true
},
height: {
type: Number,
required: true
},
isAdmin: {
type: Boolean,
default() {
@ -66,9 +62,6 @@ export default {
defaultProps() {
return { label: 'nickName' };
},
treeHeight() {
return this.height - 64;
},
filterMembers() {
return this.members.filter(e =>{ return e.nickName.includes(this.filterText); });
},
@ -144,11 +137,10 @@ export default {
&__container {
flex-grow: 1;
height: 520px;
&--list {
background: #fff;
height: auto;
min-height: calc(100% - 200px);
max-height: calc(100% - 200px);
height: 490px;
border-bottom: 1px #ccc solid;
&::-webkit-scrollbar {

View File

@ -3,11 +3,10 @@
v-dialogDrag
title="仿真成员管理"
:visible.sync="show"
width="100%"
width="75%"
:before-close="doClose"
:z-index="2000"
:modal="false"
fullscreen
:close-on-click-modal="false"
center
>
@ -25,8 +24,7 @@
:data="treeData"
:props="defaultProps"
default-expand-all
style="margin: 10px;margin-bottom: 0;border: 1px solid #ccc;overflow-y: auto;"
:style="{height: height - 35 + 'px'}"
style="margin: 10px;margin-bottom: 0;border: 1px solid #ccc;overflow-y: auto;height: 520px;"
:filter-node-method="filterNode"
@node-click="handleNodeClick"
>
@ -50,7 +48,7 @@
:room="room"
:members="simulationUserList"
:is-admin="isAdmin"
:height="height"
style="height:570px"
@message="messageInfo"
/>
</div>
@ -291,7 +289,7 @@ export default {
}
.room {
width: 100%;
height: 100%;
height: 600px;
display: flex;
flex-direction: column;
box-sizing: border-box;

View File

@ -316,6 +316,8 @@ export default {
if (this.isAdmin) {
await clearSimulation(this.group);
}
this.$store.dispatch('training/setMemberList', {memberList:[], userId: this.$store.state.user.id});
this.$store.dispatch('training/setSimulationUserList', []);
this.$store.dispatch('training/over').then(() => {
this.backLoading = true;
this.$store.dispatch('map/resetActiveTrainList');

View File

@ -176,7 +176,14 @@ export default {
prdType = '';
}
}
this.$store.dispatch('training/updateMemberListInScript', {oldMemberId:this.oldMemberId, newMemberId:role, userId:this.$store.state.user.id});
this.$store.dispatch('training/updateMemberListInScript',
{
oldMemberId:this.oldMemberId,
newMemberId:role,
userId:this.$store.state.user.id,
name:this.$store.state.user.nickname
}
);
this.oldMemberId = role;
this.$store.dispatch('training/setPrdType', prdType);
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{

View File

@ -1,6 +1,6 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
<el-form v-show="data.type === 'IBP'" ref="formIbp" :model="formIbp" label-width="100px" :rules="rulesIbp">
<el-form v-show="data.type === 'VR_IBP'" ref="formIbp" :model="formIbp" label-width="100px" :rules="rulesIbp">
<el-form-item label="显示位置:" prop="part">
<el-select v-model="formIbp.part" placeholder="请选择" size="small">
<el-option
@ -64,7 +64,7 @@
</template>
<script>
import { getDeviceDetail, setIbpConfig, setLwConfig, getDevicesByType, setIscsLwConfig, setIscsCwConfig } from '@/api/project';
import { getDeviceDetail, setVrIbpConfig, setLwConfig, getDevicesByType, setIscsLwConfig, setIscsCwConfig } from '@/api/project';
import { getAllMapOnline, getStationListNeedAttendant } from '@/api/jmap/map';
export default {
@ -122,7 +122,7 @@ export default {
methods: {
initData(row) {
getDeviceDetail(row.id).then(resp => {
if (resp.data.config && resp.data.type === 'IBP') {
if (resp.data.config && resp.data.type === 'VR_IBP') {
this.formIbp = JSON.parse(resp.data.config);
} else if (resp.data.config && resp.data.type === 'LW') {
this.formLw = JSON.parse(resp.data.config);
@ -139,7 +139,7 @@ export default {
this.data = row;
this.mapList = [];
this.stationList = [];
if (this.data.type === 'IBP' || this.data.type === 'ISCS_LW') {
if (this.data.type === 'VR_IBP' || this.data.type === 'ISCS_LW') {
getDevicesByType('LW').then(res => {
if (res.data && res.data.length) {
this.lwList = res.data;
@ -170,10 +170,10 @@ export default {
},
doSave() {
const self = this;
if (this.data.type === 'IBP') {
if (this.data.type === 'VR_IBP') {
this.$refs.formIbp.validate(() => {
setIbpConfig(this.data.id, this.formIbp).then(response => {
self.$message.success('设置IBP设备配置成功');
setVrIbpConfig(this.data.id, this.formIbp).then(response => {
self.$message.success('设置虚拟IBP设备配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {

View File

@ -175,7 +175,7 @@ export default {
});
},
editConfig(index, row) {
if (row.type === 'LW' || row.type === 'IBP' || row.type === 'ISCS_LW' || row.type === 'ISCS_CW') {
if (row.type === 'LW' || row.type === 'VR_IBP' || row.type === 'ISCS_LW' || row.type === 'ISCS_CW') {
this.$refs.editConfig.doShow(row);
} else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD') {
this.$refs.editConfigGateway.doShow(row);