设备登录调整&成员管理调整

This commit is contained in:
fan 2020-07-10 18:30:37 +08:00
parent 31c8e8828f
commit b10f08df67
16 changed files with 104 additions and 62 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

@ -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

@ -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

@ -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);