仿真角色统一

This commit is contained in:
dong 2023-05-24 18:34:38 +08:00
parent 8256758a7a
commit 9426ece04f
5 changed files with 144 additions and 253 deletions

View File

@ -77,29 +77,29 @@ export default {
{ label: '车务段段长', value: 'TRAIN_MASTER', enLabel: 'Train_Master' }
],
roleTypeList: [
{label: '行调', value: 'DISPATCHER'},
{label: 'NCC调度', value: 'NCC_DISPATCHER'},
{label: '信息调度', value: 'OCC_DISPATCHER'},
{label: '行值', value: 'STATION_SUPERVISOR'},
{label: '司机', value: 'DRIVER'},
{label: '通号', value: 'MAINTAINER'},
{label: '车辆段/停车场调度', value: 'DEPOT_DISPATCHER'},
{label: '车辆段/停车场信号楼', value: 'SIGNAL_BUILDING'},
{label: '车站助理', value: 'STATION_ASSISTANT'},
{label: '车站站长', value: 'STATION_MASTER'},
{label: '车站信号员', value: 'STATION_SIGNALER'},
{label: '车站客运员', value: 'STATION_PASSENGER'},
{label: '车站扳道员', value: 'STATION_SWITCH_MAN'},
{label: '车站引导员', value: 'STATION_FACILITATOR'},
{label: '车站工务工', value: 'STATION_WORKER'},
{label: '车务段段长', value: 'TRAIN_MASTER'},
{label: '工电调度', value: 'ELECTRIC_DISPATCHER'},
{ label: '电力工务', value: 'STATION_ELECTRIC_WORKER'},
{label: '上级部分', value: 'PARENT_DEPARTMENT'},
{label: '派班员', value: 'SCHEDULING'},
{label: '设备管理员', value: 'DEVICE_MANAGER'},
{label: '值班主任', value: 'SHIFT_MANAGER'},
{label: '环控调度', value: 'ENVIRONMENT_DISPATCHER'}
{label: 'NCC调度', value: 'NCC_DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '信息调度', value: 'OCC_DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '行调', value: 'DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '行值', value: 'STATION_SUPERVISOR', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '司机', value: 'DRIVER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '通号', value: 'MAINTAINER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '车辆段/停车场调度', value: 'DEPOT_DISPATCHER', simTypeList: ['METRO']},
{label: '车辆段/停车场信号楼', value: 'SIGNAL_BUILDING', simTypeList: ['METRO']},
{label: '车站助理', value: 'STATION_ASSISTANT', simTypeList: ['RAILWAY']},
{label: '车站站长', value: 'STATION_MASTER', simTypeList: ['RAILWAY']},
{label: '车站信号员', value: 'STATION_SIGNALER', simTypeList: ['RAILWAY']},
{label: '车站客运员', value: 'STATION_PASSENGER', simTypeList: ['RAILWAY']},
{label: '车站扳道员', value: 'STATION_SWITCH_MAN', simTypeList: ['RAILWAY']},
{label: '车站引导员', value: 'STATION_FACILITATOR', simTypeList: ['RAILWAY']},
{label: '车站工务工', value: 'STATION_WORKER', simTypeList: ['RAILWAY']},
{label: '车务段段长', value: 'TRAIN_MASTER', simTypeList: ['METRO']},
{label: '工电调度', value: 'ELECTRIC_DISPATCHER', simTypeList: ['METRO']},
{label: '电力工务', value: 'STATION_ELECTRIC_WORKER', simTypeList: ['METRO']},
{label: '上级部分', value: 'PARENT_DEPARTMENT', simTypeList: ['METRO']},
{label: '派班员', value: 'SCHEDULING', simTypeList: ['METRO']},
{label: '设备管理员', value: 'DEVICE_MANAGER', simTypeList: ['RAILWAY']},
{label: '值班主任', value: 'SHIFT_MANAGER', simTypeList: ['METRO']},
{label: '环控调度', value: 'ENVIRONMENT_DISPATCHER', simTypeList: ['METRO']}
],
releaseReview: [
{ enlabel: 'Unpublished', label: '未发布', value: '0' },

View File

@ -49,7 +49,8 @@ const training = {
domConfig: {}, // 线路功能前端配置项
simulationUserType: '', // 仿真用户角色
simulationCreator: false,
chatBoxMin: true // 聊天框最小化
chatBoxMin: true, // 聊天框最小化
memberTreeData: [] // 仿真成员树数据
},
getters: {
@ -324,6 +325,9 @@ const training = {
},
setChatBoxMin: (state, chatBoxMin) => {
state.chatBoxMin = chatBoxMin;
},
setMemberTreeData: (state, memberTreeData) => {
state.memberTreeData = memberTreeData;
}
},
@ -660,6 +664,9 @@ const training = {
},
setChatBoxMin: ({ commit }, chatBoxMin) => {
commit('setChatBoxMin', chatBoxMin);
},
setMemberTreeData: ({ commit }, memberTreeData) => {
commit('setMemberTreeData', memberTreeData);
}
}
};

View File

@ -43,6 +43,7 @@
<script>
import { addSimulationMember } from '@/api/jointSimulation';
import ConstConfig from '@/scripts/ConstConfig';
export default {
name: 'AddMember',
props: {
@ -78,28 +79,30 @@ export default {
'STATION_FACILITATOR',
'STATION_WORKER',
'DEVICE_MANAGER'
],
typeList: [
{label: 'NCC调度', value: 'NCC_DISPATCHER'},
{label: '信息调度', value: 'OCC_DISPATCHER'},
{label: '行调', value: 'DISPATCHER'},
{label: '通号', value: 'MAINTAINER'},
{label: '车站值班员', value: 'STATION_SUPERVISOR'},
{label: '车站助理', value: 'STATION_ASSISTANT'},
{label: '车站站长', value: 'STATION_MASTER'},
{label: '车站信号员', value: 'STATION_SIGNALER'},
{label: '车站客运员', value: 'STATION_PASSENGER'},
{label: '车站扳道员', value: 'STATION_SWITCH_MAN'},
{label: '车站引导员', value: 'STATION_FACILITATOR'},
{label: '车站工务工', value: 'STATION_WORKER'},
{label: '设备管理员', value: 'DEVICE_MANAGER'},
{label: '车务段段长', value: 'TRAIN_MASTER'}
]
};
},
computed: {
title() {
return '添加仿真角色成员';
},
simType() {
return this.$route.query.simType || 'METRO';
},
typeList() {
const list = [];
ConstConfig.ConstSelect.roleTypeList.forEach(item => {
if (item.simTypeList.includes(this.simType)) {
const obj = {
...item
};
if (item.value == 'STATION_SUPERVISOR' && this.simType == 'RAILWAY') {
obj.label = '车站值班员';
}
list.push(obj);
}
});
return list;
}
},
methods: {

View File

@ -58,6 +58,7 @@ import eMembers from './e-members';
import { EventBus } from '@/scripts/event-bus';
import { assignUsersPlayRoles } from '@/api/jointSimulation';
import AddMember from './addMember';
import ConstConfig from '@/scripts/ConstConfig';
export default {
name: 'MembersManage',
components: {
@ -159,6 +160,9 @@ export default {
group() {
return this.$route.query.group;
},
simType() {
return this.$route.query.simType || 'METRO';
},
userId() {
return this.$store.state.user ? this.$store.state.user.id : '';
},
@ -198,6 +202,12 @@ export default {
const deviceManagerList = [];
const trainMasterList = [];
const stationElectricWorkerList = [];
const signalBuildingList = [];
const shiftManagerList = [];
const environmentDispatherList = [];
const parentDepartmentList = [];
const schedulingList = [];
const t = this.simType == 'METRO' ? '行值-' : '值班员-';
val.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
switch (item.type) {
@ -214,15 +224,19 @@ export default {
dispatcherList.push(this.memberData[item.id]);
break;
case 'ELECTRIC_DISPATCHER':
this.memberData[item.id].labelName = '调度' + (item.name || '');
this.memberData[item.id].labelName = '电调度' + (item.name || '');
electricDispatcherList.push(this.memberData[item.id]);
break;
case 'DEPOT_DISPATCHER':
this.memberData[item.id].labelName = '信号楼-' + device.name + (item.name || '');
this.memberData[item.id].labelName = '车辆段调度-' + device.name + (item.name || '');
depotDispatcherList.push(this.memberData[item.id]);
break;
case 'SIGNAL_BUILDING':
this.memberData[item.id].labelName = '信号楼-' + device.name + (item.name || '');
signalBuildingList.push(this.memberData[item.id]);
break;
case 'STATION_SUPERVISOR':
this.memberData[item.id].labelName = '值班员-' + device.name + (item.name ? `-${item.name }` : '');
this.memberData[item.id].labelName = t + device.name + (item.name ? `-${item.name }` : '');
stationSupervisorList.push(this.memberData[item.id]);
break;
case 'DRIVER':
@ -270,107 +284,176 @@ export default {
deviceManagerList.push(this.memberData[item.id]);
break;
case 'TRAIN_MASTER':
// device.name;
this.memberData[item.id].labelName = '车务段段长-' + (item.name ? `-${item.name }` : '');
trainMasterList.push(this.memberData[item.id]);
break;
case 'SHIFT_MANAGER':
this.memberData[item.id].labelName = '值班主任-' + (item.name ? `-${item.name }` : '');
shiftManagerList.push(this.memberData[item.id]);
break;
case 'ENVIRONMENT_DISPATCHER':
this.memberData[item.id].labelName = '环控调度-' + (item.name ? `-${item.name }` : '');
environmentDispatherList.push(this.memberData[item.id]);
break;
case 'PARENT_DEPARTMENT':
this.memberData[item.id].labelName = '上级部门' + (item.name ? `-${item.name }` : '');
parentDepartmentList.push(this.memberData[item.id]);
break;
case 'SCHEDULING':
this.memberData[item.id].labelName = '派班员' + (item.name ? `-${item.name }` : '');
schedulingList.push(this.memberData[item.id]);
break;
case 'STATION_ELECTRIC_WORKER':
this.memberData[item.id].labelName = '电力工务' + (item.name || '');
stationElectricWorkerList.push(this.memberData[item.id]);
break;
// DEVICE_MANAGER:'' deviceManager
}
});
this.treeData = [{
labelName: 'NCC调度',
id: 'nccDispatcher',
memberType: 'NCC_DISPATCHER',
children: nccDispatcherList
}, {
labelName: '信息调度',
id: 'occDispatcher',
memberType: 'OCC_DISPATCHER',
children: occDispatcherList
}, {
labelName: '行调',
id: 'dispatcher',
memberType: 'DISPATCHER',
children: dispatcherList
}, {
labelName: '车站值班员',
labelName: this.simType == 'METRO' ? '行值' : '车站值班员',
id: 'stationSupervisor',
memberType: 'STATION_SUPERVISOR',
children: stationSupervisorList
}, {
labelName: '司机',
id: 'driver',
memberType: 'DRIVER',
children: driverList
}, {
labelName: '通号',
id: 'maintainer',
memberType: 'MAINTAINER',
children: maintainerList
}, {
labelName: '车辆段信号楼',
labelName: '车辆段调度',
id: 'depotDispatcher',
memberType: 'DEPOT_DISPATCHER',
children: depotDispatcherList
}, {
labelName: '电力调度',
labelName: '车辆段信号楼',
id: 'signalBuilding',
memberType: 'SIGNAL_BUILDING',
children: signalBuildingList
}, {
labelName: '工电调度',
id: 'electricDispatcher',
memberType: 'ELECTRIC_DISPATCHER',
children: electricDispatcherList
}, {
labelName: 'CTC操作员',
id: 'ctcOperator',
memberType: 'RAIL_CTC',
children: ctcOperatorList
}, {
labelName: '车站助理',
id: 'stationAssistant',
memberType: 'STATION_ASSISTANT',
children: stationAssistantList
},
{
labelName: '车站站长',
id: 'stationMaster',
memberType: 'STATION_MASTER',
children: stationMasterList
},
{
labelName: '车站信号员',
id: 'stationSignaler',
memberType: 'STATION_SIGNALER',
children: stationSignalerList
},
{
labelName: '车站客运员',
id: 'stationPassenger',
memberType: 'STATION_PASSENGER',
children: stationPassengerList
},
{
labelName: '车站扳道员',
id: 'stationSwitchMan',
memberType: 'STATION_SWITCH_MAN',
children: stationSwitchManList
},
{
labelName: '车站引导员',
id: 'stationFacilitator',
memberType: 'STATION_FACILITATOR',
children: stationFacilitatorList
},
{
labelName: '车站工务工',
id: 'stationWorker',
memberType: 'STATION_WORKER',
children: stationWorkerList
},
{
labelName: '设备管理员',
id: 'deviceManager',
memberType: 'DEVICE_MANAGER',
children: deviceManagerList
},
{
labelName: '车务段段长 ',
id: 'trainMaster',
memberType: 'TRAIN_MASTER',
children: trainMasterList
},
{
labelName: '值班主任 ',
id: 'shiftManager',
memberType: 'SHIFT_MANAGER',
children: shiftManagerList
},
{
labelName: '环控调度 ',
id: 'environmentDispather',
memberType: 'ENVIRONMENT_DISPATCHER',
children: environmentDispatherList
},
{
labelName: '电力工务 ',
id: 'stationElectricWorker',
memberType: 'STATION_ELECTRIC_WORKER',
children: stationElectricWorkerList
},
{
labelName: '上级部门 ',
id: 'parentDepartment',
memberType: 'PARENT_DEPARTMENT',
children: parentDepartmentList
},
{
labelName: '派班员 ',
id: 'scheduling',
memberType: 'SCHEDULING',
children: schedulingList
}
];
const sType = [];
ConstConfig.ConstSelect.roleTypeList.forEach(ii => {
if (ii.simTypeList.includes(this.simType)) {
sType.push(ii.value);
}
});
this.treeData = this.treeData.filter(ii => {
return sType.includes(ii.memberType);
});
this.$store.dispatch('training/setMemberTreeData', this.treeData);
EventBus.$emit('trainTicketMember', [...stationSupervisorList, ...stationAssistantList]);
this.$nextTick(() => {
if (this.$refs.tree) {

View File

@ -111,7 +111,6 @@ export default {
groupList: [],
id: 0, // id
privateChatId: '', // id
memberTreeData: [],
menu: [] //
};
},
@ -162,6 +161,9 @@ export default {
}
}
return name;
},
memberTreeData() {
return this.$store.state.training.memberTreeData;
}
},
watch: {
@ -249,15 +251,11 @@ export default {
}
},
immediate: true
},
memberList () {
this.getTreeData();
}
},
mounted() {
},
created() {
this.getTreeData();
this.getBaseInfo();
},
beforeDestroy() {
@ -399,206 +397,6 @@ export default {
this.$store.dispatch('socket/resetConversationGroup');
this.groupList = [];
},
getTreeData() {
const val = this.memberList;
if (val && val.length) {
const dispatcherList = [];
const nccDispatcherList = [];
const occDispatcherList = [];
const electricDispatcherList = [];
const depotDispatcherList = [];
const stationSupervisorList = [];
const driverList = [];
const maintainerList = [];
const ctcOperatorList = [];
const stationAssistantList = [];
const stationMasterList = [];
const stationSignalerList = [];
const stationPassengerList = [];
const stationSwitchManList = [];
const stationFacilitatorList = [];
const stationWorkerList = [];
const deviceManagerList = [];
const trainMasterList = [];
const stationElectricWorkerList = [];
val.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
switch (item.type) {
case 'NCC_DISPATCHER':
this.memberData[item.id].labelName = 'NCC调度' + (item.name || '');
nccDispatcherList.push(this.memberData[item.id]);
break;
case 'OCC_DISPATCHER':
this.memberData[item.id].labelName = item.name || '';
occDispatcherList.push(this.memberData[item.id]);
break;
case 'DISPATCHER':
this.memberData[item.id].labelName = '行调' + (item.name || '');
dispatcherList.push(this.memberData[item.id]);
break;
case 'ELECTRIC_DISPATCHER':
this.memberData[item.id].labelName = '电力调度' + (item.name || '');
electricDispatcherList.push(this.memberData[item.id]);
break;
case 'DEPOT_DISPATCHER':
this.memberData[item.id].labelName = '信号楼-' + `${ device ? device.name : '' }` + (item.name || '');
depotDispatcherList.push(this.memberData[item.id]);
break;
case 'STATION_SUPERVISOR':
this.memberData[item.id].labelName = '值班员-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationSupervisorList.push(this.memberData[item.id]);
break;
case 'DRIVER':
this.memberData[item.id].labelName = '司机-列车' + item.deviceCode;
driverList.push(this.memberData[item.id]);
break;
case 'MAINTAINER':
this.memberData[item.id].labelName = '通号' + (item.name || '');
maintainerList.push(this.memberData[item.id]);
break;
case 'RAIL_CTC':
this.memberData[item.id].labelName = 'CTC操作员' + `${ device ? device.name : '' }`;
ctcOperatorList.push(this.memberData[item.id]);
break;
case 'STATION_ASSISTANT':
this.memberData[item.id].labelName = '车站助理-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationAssistantList.push(this.memberData[item.id]);
break;
case 'STATION_MASTER':
this.memberData[item.id].labelName = '车站站长-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationMasterList.push(this.memberData[item.id]);
break;
case 'STATION_SIGNALER':
this.memberData[item.id].labelName = '车站信号员-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationSignalerList.push(this.memberData[item.id]);
break;
case 'STATION_PASSENGER':
this.memberData[item.id].labelName = '车站客运员-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationPassengerList.push(this.memberData[item.id]);
break;
case 'STATION_SWITCH_MAN':
this.memberData[item.id].labelName = '车站扳道员-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationSwitchManList.push(this.memberData[item.id]);
break;
case 'STATION_FACILITATOR':
this.memberData[item.id].labelName = '车站引导员-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationFacilitatorList.push(this.memberData[item.id]);
break;
case 'STATION_WORKER':
this.memberData[item.id].labelName = '车站工务工-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
stationWorkerList.push(this.memberData[item.id]);
break;
case 'DEVICE_MANAGER':
this.memberData[item.id].labelName = '设备管理员-' + `${ device ? device.name : '' }` + (item.name ? `-${item.name }` : '');
deviceManagerList.push(this.memberData[item.id]);
break;
case 'TRAIN_MASTER':
this.memberData[item.id].labelName = '车务段段长-' + (item.name ? `-${item.name }` : '');
trainMasterList.push(this.memberData[item.id]);
break;
case 'PARENT_DEPARTMENT':
this.memberData[item.id].labelName = '上级部门' + (item.name ? `-${item.name }` : '');
break;
case 'STATION_ELECTRIC_WORKER':
this.memberData[item.id].labelName = '电力工务' + (item.name || '');
stationElectricWorkerList.push(this.memberData[item.id]);
break;
}
});
this.memberTreeData = [{
labelName: 'NCC调度',
id: 'nccDispatcher',
children: nccDispatcherList
}, {
labelName: '信息调度',
id: 'occDispatcher',
children: occDispatcherList
}, {
labelName: '行调',
id: 'dispatcher',
children: dispatcherList
}, {
labelName: '车站值班员',
id: 'stationSupervisor',
children: stationSupervisorList
}, {
labelName: '司机',
id: 'driver',
children: driverList
}, {
labelName: '通号',
id: 'maintainer',
children: maintainerList
}, {
labelName: '车辆段信号楼',
id: 'depotDispatcher',
children: depotDispatcherList
}, {
labelName: '电力调度',
id: 'electricDispatcher',
children: electricDispatcherList
}, {
labelName: 'CTC操作员',
id: 'ctcOperator',
children: ctcOperatorList
}, {
labelName: '车站助理',
id: 'stationAssistant',
children: stationAssistantList
},
{
labelName: '车站站长',
id: 'stationMaster',
children: stationMasterList
},
{
labelName: '车站信号员',
id: 'stationSignaler',
children: stationSignalerList
},
{
labelName: '车站客运员',
id: 'stationPassenger',
children: stationPassengerList
},
{
labelName: '车站扳道员',
id: 'stationSwitchMan',
children: stationSwitchManList
},
{
labelName: '车站引导员',
id: 'stationFacilitator',
children: stationFacilitatorList
},
{
labelName: '车站工务工',
id: 'stationWorker',
children: stationWorkerList
},
{
labelName: '设备管理员',
id: 'deviceManager',
children: deviceManagerList
},
{
labelName: '车务段段长 ',
id: 'trainMaster',
children: trainMasterList
},
{
labelName: '电力工务 ',
id: 'stationElectricWorker',
children: stationElectricWorkerList
}
];
this.$nextTick(() => {
if (this.$refs.tree) {
this.$refs.tree.filter(this.queryMember);
}
});
}
},
getMessageStatus(val) {
const find = this.groupList.find(item => {
return item.id == val.id;