代码调整

This commit is contained in:
joylink_cuiweidong 2022-08-02 11:00:18 +08:00
parent 3131edd93b
commit 91e572ca1e
4 changed files with 24 additions and 5 deletions

View File

@ -380,6 +380,7 @@ export default {
}); });
}, },
'$store.state.training.memberList': function (val) { '$store.state.training.memberList': function (val) {
debugger;
if (val && val.length) { if (val && val.length) {
this.memberData = this.$store.state.training.memberData; this.memberData = this.$store.state.training.memberData;
const dispatcherList = {}; const dispatcherList = {};
@ -398,6 +399,7 @@ export default {
const stationFacilitator = {}; const stationFacilitator = {};
const stationWorker = {}; const stationWorker = {};
const deviceManager = {}; const deviceManager = {};
const trainMaster = {};
val.forEach(item => { val.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode); const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
this.memberData[item.id]['active'] = false; this.memberData[item.id]['active'] = false;
@ -491,7 +493,7 @@ export default {
// + device.name // + device.name
this.memberData[item.id].label = '车务段段长-' + (item.name || ''); this.memberData[item.id].label = '车务段段长-' + (item.name || '');
this.memberData[item.id].labelName = '车务段段长-' + (item.name || ''); this.memberData[item.id].labelName = '车务段段长-' + (item.name || '');
deviceManager[item.id] = this.memberData[item.id]; trainMaster[item.id] = this.memberData[item.id];
break; break;
} }
}); });
@ -589,6 +591,12 @@ export default {
id: 'deviceManager', id: 'deviceManager',
type: 'role', type: 'role',
children: deviceManager children: deviceManager
},
{
label: '车务段段长',
id: 'trainMaster',
type: 'role',
children: trainMaster
} }
]; ];
this.initCommonMemberList(); this.initCommonMemberList();
@ -1181,7 +1189,7 @@ export default {
}); });
this.commonMemberList = [...temDispatcherList, ...temStationSupervisorList, ...temMaintainerList, ...temDriverList, ...temDepotDispatcherList, this.commonMemberList = [...temDispatcherList, ...temStationSupervisorList, ...temMaintainerList, ...temDriverList, ...temDepotDispatcherList,
...temStationAssistList, ...temStationMasterList, ...temStationSignalerList, ...temStationPassengerList, ...temStationSwitchManList, ...temStationAssistList, ...temStationMasterList, ...temStationSignalerList, ...temStationPassengerList, ...temStationSwitchManList,
...temStationFacilitatorList, temStationWorkerList, temDeviceManagerList]; ...temStationFacilitatorList, ...temStationWorkerList, ...temDeviceManagerList, ...temTrainMasterList];
if (this.userRole == 'AUDIENCE' || this.commonConversation) { if (this.userRole == 'AUDIENCE' || this.commonConversation) {
this.conversitionMemberList = []; this.conversitionMemberList = [];
this.messageList = [...this.commonMessageList]; this.messageList = [...this.commonMessageList];

View File

@ -15,7 +15,7 @@ export function covertMemberData (activeTrainList, resp) {
lastData = JSON.parse(lastData); lastData = JSON.parse(lastData);
const lastMemberList = []; const lastMemberList = [];
// const electricDispatcherList = []; // const electricDispatcherList = [];
const deviceListData = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]; const deviceListData = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
const driverList = []; const driverList = [];
lastData.forEach((member, index)=>{ lastData.forEach((member, index)=>{
if (member.userId && member.userId == store.state.user.id) { if (member.userId && member.userId == store.state.user.id) {
@ -37,7 +37,7 @@ export function covertMemberData (activeTrainList, resp) {
member.label = member.type + name + userName; member.label = member.type + name + userName;
member.normalName = member.type + name; member.normalName = member.type + name;
} }
const deviceType = ['行调', '通号', '行值', '司机', '车辆段信号楼', '上级部门', '电力调度', '停车场信号楼', '车站助理', '车站站长', '车站信号员', '车站客运员', '车站扳道员', '车站引导员', '车站工务工', '设备管理员']; const deviceType = ['行调', '通号', '行值', '司机', '车辆段信号楼', '上级部门', '电力调度', '停车场信号楼', '车站助理', '车站站长', '车站信号员', '车站客运员', '车站扳道员', '车站引导员', '车站工务工', '设备管理员', '车务段段长 '];
const deviceTypeIndex = deviceType.indexOf(member.type); const deviceTypeIndex = deviceType.indexOf(member.type);
if (deviceTypeIndex >= 0) { if (deviceTypeIndex >= 0) {
if (deviceTypeIndex == 3) { if (deviceTypeIndex == 3) {

View File

@ -330,6 +330,11 @@ export default {
labelName: '设备管理员', labelName: '设备管理员',
id: 'deviceManager', id: 'deviceManager',
children: deviceManagerList children: deviceManagerList
},
{
labelName: '车务段段长 ',
id: 'trainMaster',
children: trainMasterList
} }
]; ];
EventBus.$emit('trainTicketMember', [...stationSupervisorList, ...stationAssistantList]); EventBus.$emit('trainTicketMember', [...stationSupervisorList, ...stationAssistantList]);

View File

@ -276,6 +276,12 @@ export default {
id: 'deviceManager', id: 'deviceManager',
type: 'role', type: 'role',
children: result.deviceListData[15] children: result.deviceListData[15]
},
{
label: '车务段段长',
id: 'trainMaster',
type: 'role',
children: result.deviceListData[16]
} }
]; ];
this.memberList = result.lastMemberList; this.memberList = result.lastMemberList;
@ -332,7 +338,7 @@ export default {
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
const newMember = covertmember[0]; const newMember = covertmember[0];
this.memberList.push(newMember); this.memberList.push(newMember);
const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段信号楼', '上级部门', '电力调度', '停车场信号楼', '车站助理', '车站站长', '车站信号员', '车站客运员', '车站扳道员', '车站引导员', '车站工务工', '设备管理员']; const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段信号楼', '上级部门', '电力调度', '停车场信号楼', '车站助理', '车站站长', '车站信号员', '车站客运员', '车站扳道员', '车站引导员', '车站工务工', '设备管理员', '车务段段长'];
const index = deviceTypeList.indexOf(newMember.type); const index = deviceTypeList.indexOf(newMember.type);
if (index >= 0) { if (index >= 0) {
const treeDataIn = this.treeData[index]; const treeDataIn = this.treeData[index];