This commit is contained in:
fan 2020-08-21 15:31:51 +08:00
commit b495f542e6
14 changed files with 157 additions and 57 deletions

View File

@ -39,7 +39,8 @@ const training = {
centerStationCode:'', // 当前居中的集中站code
memberList: [], // 综合仿真成员列表
memberData: {}, // 综合仿真成员列表
simulationUserList: [] // 综合仿真用户列表
simulationUserList: [], // 综合仿真用户列表
addMemberInScript:{} // 剧本录制新增角色
},
getters: {
@ -253,7 +254,8 @@ const training = {
addMemberListInScript:(state, newMember) => {
if (!state.memberData[newMember.id]) {
state.memberData[newMember.id] = newMember;
// state.memberData[newMember.id] = newMember;
state.addMemberInScript = newMember;
}
},

View File

@ -305,8 +305,7 @@ export default {
});
},
inviteMember() {
// this.$refs.chatToolTip.doShow();
this.$mesaage(this.inviteMember + '与你开启会话');
this.$refs.chatToolTip.doShow();
}
}
};

View File

@ -63,6 +63,7 @@ export default {
},
computed:{
isShow() {
debugger;
return this.userRole != '' &&
this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' &&
!this.isHasCoversition && this.createCoversition;
@ -98,13 +99,16 @@ export default {
member.disabled = false;
} else {
member.disabled = true;
member.userName = this.$store.state.user.nickname;
}
const userName = member.userName ? '-' + member.userName : '';
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.label = member.type + device.groupNumber + name;
member.deviceName = device.groupNumber;
member.label = member.type + device.groupNumber + name + userName;
lastMemberList.push(member);
if (this.activeTrainList.length > 0) {
if (this.activeTrainList.includes(member.deviceCode)) {
@ -114,18 +118,21 @@ export default {
this.driverList.push(member);
}
} else {
member.label = member.type + device.name + name;
member.deviceName = device.name;
member.label = member.type + device.name + name + userName;
lastMemberList.push(member);
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
}
} else {
member.label = member.type + member.deviceCode + name;
member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name + userName;
lastMemberList.push(member);
}
} else {
member.label = member.type + name;
member.label = member.type + name + userName;
member.deviceName = '';
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
@ -286,7 +293,15 @@ export default {
member.connect = true;
member.online = true;
this.inviteUser = member;
this.$refs.chatbox.inviteMember();
this.currentMemberList.push(member);
const member = this.memberData.find(member=>{ return member.id == val.memberId; });
member.connect = true;
this.currentMemberList.push(member);
this.isStartRecord = true;
// this.$refs.chatbox.inviteMember();
this.$message.success(this.inviteUserName + '与你开启会话');
}
}
@ -310,21 +325,23 @@ export default {
},
clearAllData() {
this.resetCoversition();
this.createCoversition = false;
this.createCoversition = true;
this.$refs.scriptTip.resetScriptTip();
},
setMembers(roleId) {
this.memberData.map(member=>{
if (member.userId) {
member.userId = '';
member.name = '';
member.disabled = false;
}
if (member.id == roleId) {
member.userId = this.$store.state.user.id;
member.name = this.$store.state.user.nickname;
member.userName = this.$store.state.user.nickname;
member.disabled = true;
} else {
member.userId = '';
member.userName = '';
member.disabled = false;
}
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
});
},
resetCoversition() {

View File

@ -37,11 +37,15 @@ import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import { getToken } from '@/utils/auth';
import { getSessionStorage } from '@/utils/auth';
import Scheduling from '@/views/newMap/displayNew/demon/scheduling';
import SchedulingView from '@/views/newMap/displayNew/demon/schedulingView';
export default {
name:'DemonMenu',
components:{
Jl3dDevice,
Jl3dDrive
Jl3dDrive,
Scheduling,
SchedulingView
},
props:{
isAllShow:{

View File

@ -358,6 +358,7 @@ export default {
quitQuest() {
this.isScriptRun = false;
let userRole = '';
debugger;
if (this.$route.query.prdType) {
if (this.$route.query.prdType == '02') {
userRole = 'DISPATCHER';

View File

@ -87,14 +87,16 @@ export default {
member.disabled = false;
} else {
member.disabled = true;
member.userName = this.$store.state.user.nickname;
}
const userName = member.userName ? '-' + member.userName : '';
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.label = member.type + device.groupNumber + name;
member.deviceName = member.deviceCode;
member.deviceName = device.deviceCode;
member.label = member.type + device.groupNumber + name + userName;
lastMemberList.push(member);
if (this.activeTrainList.length > 0) {
if (this.activeTrainList.includes(member.deviceCode)) {
@ -105,7 +107,7 @@ export default {
}
} else {
member.deviceName = device.name;
member.label = member.type + device.name + name;
member.label = member.type + device.name + name + userName;
lastMemberList.push(member);
if (device._type == 'Station') {
stationSupervisorList.push(member);
@ -113,11 +115,12 @@ export default {
}
} else {
member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name;
member.label = member.type + member.deviceCode + name + userName;
lastMemberList.push(member);
}
} else {
member.label = member.type + name;
member.label = member.type + name + userName;
member.deviceName = '';
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
@ -160,6 +163,14 @@ export default {
this.$messageBox('获取仿真成员列表失败!');
});
},
'$store.state.training.addMemberInScript':function(val, oldval) {
this.memberData.push(val);
const roleList = ['行调', '车站值班员', '司机', '通号', '车辆段'];
const roleIndex = roleList.indexOf(val.type);
if (roleIndex >= 0) {
this.treeData[roleIndex].children.push(val);
}
},
'userRole':function(val, oldval) {
//
this.changeRole(oldval, val);

View File

@ -28,11 +28,18 @@ export default {
this.scriptTipMessage = '请说:' + val.content;
} else if (val.type == 'Operation') {
const commandName = val.operationType;
let device = val.operationType.split('_')[0];
if (device == 'CM') {
device = 'ControlConvertMenu';
let operateName = {};
if (commandName == 'Set_Fault') {
operateName.label = '设置故障';
} else if (commandName == 'Cancel_Fault') {
operateName.label = '取消故障';
} else {
let device = val.operationType.split('_')[0];
if (device == 'CM') {
device = 'ControlConvertMenu';
}
operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; });
}
const operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; });
this.scriptTipMessage = '请执行【' + operateName.label + '】操作';
} else if (val.type == 'Over_Conversation') {
this.scriptTipMessage = '请结束当前会话';

View File

@ -198,13 +198,31 @@ export default {
this.memberData.map(member=>{
if (member.id == role.id) {
member.userId = this.$store.state.user.id;
member.name = this.$store.state.user.nickname;
member.userName = this.$store.state.user.nickname;
member.disabled = true;
} else {
member.userId = '';
member.userName = '';
member.disabled = false;
}
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
});
} else {
this.userRole = 'AUDIENCE';
this.$store.dispatch('training/setRoles', 'AUDIENCE');
this.memberData.map(member=>{
if (member.userId) {
member.userId = '';
member.userName = '';
member.disabled = false;
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
}
});
this.switchMode('');
}
} catch (error) {

View File

@ -127,6 +127,7 @@ export default {
methods:{
//
async initLoadData() {
this.$store.dispatch('training/setPrdType', '');
this.setWindowSize();
this.$store.dispatch('training/reset');
try {
@ -217,28 +218,40 @@ export default {
const maintainerList = [];
this.treeData = [];
lastData.forEach((member, index)=>{
if (!member.userId) {
member.userId = '';
member.disabled = false;
} else {
member.disabled = true;
member.userName = this.$store.state.user.nickname;
}
if (member.type != '观众') {
const userName = member.userName ? '-' + member.userName : '';
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.label = member.type + device.groupNumber + name;
member.deviceName = device.groupNumber;
member.label = member.type + device.groupNumber + name + userName;
lastMemberList.push(member);
driverList.push(member);
} else {
member.label = member.type + device.name + name;
member.deviceName = device.name;
member.label = member.type + device.name + name + userName;
lastMemberList.push(member);
if (device._type == 'Station') {
stationSupervisorList.push(member);
}
}
} else {
member.label = member.type + member.deviceCode + name;
member.deviceName = member.deviceCode;
member.label = member.type + member.deviceCode + name + userName;
lastMemberList.push(member);
}
} else {
member.label = member.type + name;
member.label = member.type + name + userName;
member.deviceName = '';
if (member.type == '行调') {
dispatcherList.push(member);
} else if (member.type == '通号') {
@ -354,7 +367,9 @@ export default {
this.isscriptRun = false;
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.userRole = '';
// this.userRole = '';
this.$store.dispatch('training/setRoles', '');
this.$store.dispatch('training/setPrdType', '');
this.$emit('clearAllData');
// if (resp.data.planRunning) {
// this.$store.dispatch('training/start');// 仿

View File

@ -70,7 +70,6 @@ export default {
watch:{
//
'$store.state.socket.createConversition':function(val) {
// debugger;
if (this.memberData.length > 0) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member && member.userId == this.$store.state.user.id) {
@ -86,7 +85,8 @@ export default {
memberList.push(member);
} else {
const member = this.memberData.find(member=>{ return member.id == id; });
member.connect = false;
// member.connect = false;
member.connect = true;
member && memberList.push(member);
}
});
@ -160,13 +160,22 @@ export default {
},
//
'$store.state.socket.inviteSimulationConversition':function(val) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member) {
this.inviteUserName = member.label;
const invitemember = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (invitemember) {
this.inviteUserName = invitemember.label;
this.conversitionId = val.id;
invitemember.connect = true;
this.inviteUser = invitemember;
this.currentMemberList.push(invitemember);
const member = this.memberData.find(member=>{ return member.id == val.memberId; });
member.connect = true;
this.inviteUser = member;
this.$refs.chatbox.inviteMember();
const userName = member.userName ? '-' + member.userName : '';
const name = member.name == undefined ? '' : '-' + member.name;
member.label = member.type + member.deviceName + name + userName;
this.currentMemberList.push(member);
this.isStartRecord = true;
// this.$refs.chatbox.inviteMember();
this.$message.success(this.inviteUserName + '与你开启会话');
}
}
},

View File

@ -41,7 +41,7 @@ export default {
this.userName = this.coverName(val);
// this.dialogVisible = true;
// this.conversationId = val.id;
this.$mesaage(this.userName + '与你开启会话');
this.$message.success(this.userName + '与你开启会话');
}
},
methods:{

View File

@ -19,9 +19,12 @@
/>
</el-select>
</el-form-item>
<el-form-item label="仿真成员名称:" prop="name">
<el-input v-model="formModel.name" placeholder="请输入成员名称" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button type="primary" :lodaing="lodaing" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
@ -34,13 +37,18 @@ export default {
data() {
return {
dialogVisible: false,
lodaing:false,
formModel: {
type: ''
type: '',
name:''
},
rules: {
type: [
{ required: true, message: '请选择显示位置', trigger: 'change' }
{ required: true, message: '请选择成员类型', trigger: 'change' }
]
// name:[
// { required: true, message: '', trigger: 'blur' }
// ]
},
typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}]
};
@ -59,20 +67,26 @@ export default {
this.dialogVisible = true;
},
doSave() {
this.$refs.form.validate(() => {
addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
this.$message.success('添加仿真角色成员成功!');
this.$emit('addScriptMember', res.data);
this.handleClose();
}).catch(() => {
this.$message.error('添加仿真角色成员失败!');
});
this.$refs.form.validate((valid) => {
if (valid) {
this.lodaing = true;
addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
this.lodaing = false;
this.$message.success('添加仿真角色成员成功!');
this.$emit('addScriptMember', res.data);
this.handleClose();
}).catch(() => {
this.lodaing = false;
this.$message.error('添加仿真角色成员失败!');
});
}
});
},
handleClose() {
this.dialogVisible = false;
this.formModel = {
type: ''
type: '',
name:''
};
this.$refs.form.resetFields();
}

View File

@ -145,7 +145,7 @@ export default {
{
// const command = CommandHandler.getScriptDefinition(element.operationType);
const commandName = element.operationType;
if (commandName != 'Set_Fault') {
if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) {
let operateType = commandName.split('_')[0];
if (operateType == 'CM') {
operateType = 'ControlConvertMenu';
@ -158,7 +158,11 @@ export default {
// deviceFaultType
// element.operationParamMap.faultType;
// '(' + operateName.label + ')'
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '设置故障', row: element, visible: false});
if (commandName == 'Set_Fault') {
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '设置故障', row: element, visible: false});
} else if (commandName == 'Cancel_Fault') {
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '取消故障', row: element, visible: false});
}
}
break;
}

View File

@ -167,13 +167,12 @@ export default {
},
addScriptMember(member) {
member.userId = '';
member.name = '';
member.disabled = false;
this.$store.dispatch('training/addMemberListInScript', member);
const lastData = JSON.stringify([member]);
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
covertmember.forEach(each=>{
this.memberList.push(each);
this.$store.dispatch('training/addMemberListInScript', each);
});
},
@ -249,7 +248,7 @@ export default {
deviceName = each.deviceCode;
}
}
each.name = each.type + deviceName;
each.name = each.type + deviceName + (each.name ? '' + each.name : '');
each.label = each.name;
});
return lastData;