Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
b495f542e6
@ -39,7 +39,8 @@ const training = {
|
|||||||
centerStationCode:'', // 当前居中的集中站code
|
centerStationCode:'', // 当前居中的集中站code
|
||||||
memberList: [], // 综合仿真成员列表
|
memberList: [], // 综合仿真成员列表
|
||||||
memberData: {}, // 综合仿真成员列表
|
memberData: {}, // 综合仿真成员列表
|
||||||
simulationUserList: [] // 综合仿真用户列表
|
simulationUserList: [], // 综合仿真用户列表
|
||||||
|
addMemberInScript:{} // 剧本录制新增角色
|
||||||
},
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
@ -253,7 +254,8 @@ const training = {
|
|||||||
|
|
||||||
addMemberListInScript:(state, newMember) => {
|
addMemberListInScript:(state, newMember) => {
|
||||||
if (!state.memberData[newMember.id]) {
|
if (!state.memberData[newMember.id]) {
|
||||||
state.memberData[newMember.id] = newMember;
|
// state.memberData[newMember.id] = newMember;
|
||||||
|
state.addMemberInScript = newMember;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -305,8 +305,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
inviteMember() {
|
inviteMember() {
|
||||||
// this.$refs.chatToolTip.doShow();
|
this.$refs.chatToolTip.doShow();
|
||||||
this.$mesaage(this.inviteMember + '与你开启会话');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -63,6 +63,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
isShow() {
|
isShow() {
|
||||||
|
debugger;
|
||||||
return this.userRole != '' &&
|
return this.userRole != '' &&
|
||||||
this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' &&
|
this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' &&
|
||||||
!this.isHasCoversition && this.createCoversition;
|
!this.isHasCoversition && this.createCoversition;
|
||||||
@ -98,13 +99,16 @@ export default {
|
|||||||
member.disabled = false;
|
member.disabled = false;
|
||||||
} else {
|
} else {
|
||||||
member.disabled = true;
|
member.disabled = true;
|
||||||
|
member.userName = this.$store.state.user.nickname;
|
||||||
}
|
}
|
||||||
|
const userName = member.userName ? '-' + member.userName : '';
|
||||||
const name = member.name == undefined ? '' : '-' + member.name;
|
const name = member.name == undefined ? '' : '-' + member.name;
|
||||||
if (member.deviceCode) {
|
if (member.deviceCode) {
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||||
if (device) {
|
if (device) {
|
||||||
if (device._type == 'Train') {
|
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);
|
lastMemberList.push(member);
|
||||||
if (this.activeTrainList.length > 0) {
|
if (this.activeTrainList.length > 0) {
|
||||||
if (this.activeTrainList.includes(member.deviceCode)) {
|
if (this.activeTrainList.includes(member.deviceCode)) {
|
||||||
@ -114,18 +118,21 @@ export default {
|
|||||||
this.driverList.push(member);
|
this.driverList.push(member);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.label = member.type + device.name + name;
|
member.deviceName = device.name;
|
||||||
|
member.label = member.type + device.name + name + userName;
|
||||||
lastMemberList.push(member);
|
lastMemberList.push(member);
|
||||||
if (device._type == 'Station') {
|
if (device._type == 'Station') {
|
||||||
stationSupervisorList.push(member);
|
stationSupervisorList.push(member);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.label = member.type + member.deviceCode + name;
|
member.deviceName = member.deviceCode;
|
||||||
|
member.label = member.type + member.deviceCode + name + userName;
|
||||||
lastMemberList.push(member);
|
lastMemberList.push(member);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.label = member.type + name;
|
member.label = member.type + name + userName;
|
||||||
|
member.deviceName = '';
|
||||||
if (member.type == '行调') {
|
if (member.type == '行调') {
|
||||||
dispatcherList.push(member);
|
dispatcherList.push(member);
|
||||||
} else if (member.type == '通号') {
|
} else if (member.type == '通号') {
|
||||||
@ -286,7 +293,15 @@ export default {
|
|||||||
member.connect = true;
|
member.connect = true;
|
||||||
member.online = true;
|
member.online = true;
|
||||||
this.inviteUser = member;
|
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() {
|
clearAllData() {
|
||||||
this.resetCoversition();
|
this.resetCoversition();
|
||||||
this.createCoversition = false;
|
this.createCoversition = true;
|
||||||
this.$refs.scriptTip.resetScriptTip();
|
this.$refs.scriptTip.resetScriptTip();
|
||||||
},
|
},
|
||||||
setMembers(roleId) {
|
setMembers(roleId) {
|
||||||
this.memberData.map(member=>{
|
this.memberData.map(member=>{
|
||||||
if (member.userId) {
|
|
||||||
member.userId = '';
|
|
||||||
member.name = '';
|
|
||||||
member.disabled = false;
|
|
||||||
}
|
|
||||||
if (member.id == roleId) {
|
if (member.id == roleId) {
|
||||||
member.userId = this.$store.state.user.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;
|
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() {
|
resetCoversition() {
|
||||||
|
@ -37,11 +37,15 @@ import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
|||||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { getSessionStorage } 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 {
|
export default {
|
||||||
name:'DemonMenu',
|
name:'DemonMenu',
|
||||||
components:{
|
components:{
|
||||||
Jl3dDevice,
|
Jl3dDevice,
|
||||||
Jl3dDrive
|
Jl3dDrive,
|
||||||
|
Scheduling,
|
||||||
|
SchedulingView
|
||||||
},
|
},
|
||||||
props:{
|
props:{
|
||||||
isAllShow:{
|
isAllShow:{
|
||||||
|
@ -358,6 +358,7 @@ export default {
|
|||||||
quitQuest() {
|
quitQuest() {
|
||||||
this.isScriptRun = false;
|
this.isScriptRun = false;
|
||||||
let userRole = '';
|
let userRole = '';
|
||||||
|
debugger;
|
||||||
if (this.$route.query.prdType) {
|
if (this.$route.query.prdType) {
|
||||||
if (this.$route.query.prdType == '02') {
|
if (this.$route.query.prdType == '02') {
|
||||||
userRole = 'DISPATCHER';
|
userRole = 'DISPATCHER';
|
||||||
|
@ -87,14 +87,16 @@ export default {
|
|||||||
member.disabled = false;
|
member.disabled = false;
|
||||||
} else {
|
} else {
|
||||||
member.disabled = true;
|
member.disabled = true;
|
||||||
|
member.userName = this.$store.state.user.nickname;
|
||||||
}
|
}
|
||||||
|
const userName = member.userName ? '-' + member.userName : '';
|
||||||
const name = member.name == undefined ? '' : '-' + member.name;
|
const name = member.name == undefined ? '' : '-' + member.name;
|
||||||
if (member.deviceCode) {
|
if (member.deviceCode) {
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||||
if (device) {
|
if (device) {
|
||||||
if (device._type == 'Train') {
|
if (device._type == 'Train') {
|
||||||
member.label = member.type + device.groupNumber + name;
|
member.deviceName = device.deviceCode;
|
||||||
member.deviceName = member.deviceCode;
|
member.label = member.type + device.groupNumber + name + userName;
|
||||||
lastMemberList.push(member);
|
lastMemberList.push(member);
|
||||||
if (this.activeTrainList.length > 0) {
|
if (this.activeTrainList.length > 0) {
|
||||||
if (this.activeTrainList.includes(member.deviceCode)) {
|
if (this.activeTrainList.includes(member.deviceCode)) {
|
||||||
@ -105,7 +107,7 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.deviceName = device.name;
|
member.deviceName = device.name;
|
||||||
member.label = member.type + device.name + name;
|
member.label = member.type + device.name + name + userName;
|
||||||
lastMemberList.push(member);
|
lastMemberList.push(member);
|
||||||
if (device._type == 'Station') {
|
if (device._type == 'Station') {
|
||||||
stationSupervisorList.push(member);
|
stationSupervisorList.push(member);
|
||||||
@ -113,11 +115,12 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.deviceName = member.deviceCode;
|
member.deviceName = member.deviceCode;
|
||||||
member.label = member.type + member.deviceCode + name;
|
member.label = member.type + member.deviceCode + name + userName;
|
||||||
lastMemberList.push(member);
|
lastMemberList.push(member);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.label = member.type + name;
|
member.label = member.type + name + userName;
|
||||||
|
member.deviceName = '';
|
||||||
if (member.type == '行调') {
|
if (member.type == '行调') {
|
||||||
dispatcherList.push(member);
|
dispatcherList.push(member);
|
||||||
} else if (member.type == '通号') {
|
} else if (member.type == '通号') {
|
||||||
@ -160,6 +163,14 @@ export default {
|
|||||||
this.$messageBox('获取仿真成员列表失败!');
|
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) {
|
'userRole':function(val, oldval) {
|
||||||
// 切换对象
|
// 切换对象
|
||||||
this.changeRole(oldval, val);
|
this.changeRole(oldval, val);
|
||||||
|
@ -28,11 +28,18 @@ export default {
|
|||||||
this.scriptTipMessage = '请说:' + val.content;
|
this.scriptTipMessage = '请说:' + val.content;
|
||||||
} else if (val.type == 'Operation') {
|
} else if (val.type == 'Operation') {
|
||||||
const commandName = val.operationType;
|
const commandName = val.operationType;
|
||||||
let device = val.operationType.split('_')[0];
|
let operateName = {};
|
||||||
if (device == 'CM') {
|
if (commandName == 'Set_Fault') {
|
||||||
device = 'ControlConvertMenu';
|
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 + '】操作';
|
this.scriptTipMessage = '请执行【' + operateName.label + '】操作';
|
||||||
} else if (val.type == 'Over_Conversation') {
|
} else if (val.type == 'Over_Conversation') {
|
||||||
this.scriptTipMessage = '请结束当前会话';
|
this.scriptTipMessage = '请结束当前会话';
|
||||||
|
@ -198,13 +198,31 @@ export default {
|
|||||||
this.memberData.map(member=>{
|
this.memberData.map(member=>{
|
||||||
if (member.id == role.id) {
|
if (member.id == role.id) {
|
||||||
member.userId = this.$store.state.user.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;
|
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 {
|
} else {
|
||||||
this.userRole = 'AUDIENCE';
|
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('');
|
this.switchMode('');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -127,6 +127,7 @@ export default {
|
|||||||
methods:{
|
methods:{
|
||||||
// 加载地图数据
|
// 加载地图数据
|
||||||
async initLoadData() {
|
async initLoadData() {
|
||||||
|
this.$store.dispatch('training/setPrdType', '');
|
||||||
this.setWindowSize();
|
this.setWindowSize();
|
||||||
this.$store.dispatch('training/reset');
|
this.$store.dispatch('training/reset');
|
||||||
try {
|
try {
|
||||||
@ -217,28 +218,40 @@ export default {
|
|||||||
const maintainerList = [];
|
const maintainerList = [];
|
||||||
this.treeData = [];
|
this.treeData = [];
|
||||||
lastData.forEach((member, index)=>{
|
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 != '观众') {
|
if (member.type != '观众') {
|
||||||
|
const userName = member.userName ? '-' + member.userName : '';
|
||||||
const name = member.name == undefined ? '' : '-' + member.name;
|
const name = member.name == undefined ? '' : '-' + member.name;
|
||||||
if (member.deviceCode) {
|
if (member.deviceCode) {
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||||
if (device) {
|
if (device) {
|
||||||
if (device._type == 'Train') {
|
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);
|
lastMemberList.push(member);
|
||||||
driverList.push(member);
|
driverList.push(member);
|
||||||
} else {
|
} else {
|
||||||
member.label = member.type + device.name + name;
|
member.deviceName = device.name;
|
||||||
|
member.label = member.type + device.name + name + userName;
|
||||||
lastMemberList.push(member);
|
lastMemberList.push(member);
|
||||||
if (device._type == 'Station') {
|
if (device._type == 'Station') {
|
||||||
stationSupervisorList.push(member);
|
stationSupervisorList.push(member);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.label = member.type + member.deviceCode + name;
|
member.deviceName = member.deviceCode;
|
||||||
|
member.label = member.type + member.deviceCode + name + userName;
|
||||||
lastMemberList.push(member);
|
lastMemberList.push(member);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
member.label = member.type + name;
|
member.label = member.type + name + userName;
|
||||||
|
member.deviceName = '';
|
||||||
if (member.type == '行调') {
|
if (member.type == '行调') {
|
||||||
dispatcherList.push(member);
|
dispatcherList.push(member);
|
||||||
} else if (member.type == '通号') {
|
} else if (member.type == '通号') {
|
||||||
@ -354,7 +367,9 @@ export default {
|
|||||||
this.isscriptRun = false;
|
this.isscriptRun = false;
|
||||||
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
|
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
|
||||||
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
||||||
this.userRole = '';
|
// this.userRole = '';
|
||||||
|
this.$store.dispatch('training/setRoles', '');
|
||||||
|
this.$store.dispatch('training/setPrdType', '');
|
||||||
this.$emit('clearAllData');
|
this.$emit('clearAllData');
|
||||||
// if (resp.data.planRunning) {
|
// if (resp.data.planRunning) {
|
||||||
// this.$store.dispatch('training/start');// 仿真开始按计划行车
|
// this.$store.dispatch('training/start');// 仿真开始按计划行车
|
||||||
|
@ -70,7 +70,6 @@ export default {
|
|||||||
watch:{
|
watch:{
|
||||||
// 创建会话
|
// 创建会话
|
||||||
'$store.state.socket.createConversition':function(val) {
|
'$store.state.socket.createConversition':function(val) {
|
||||||
// debugger;
|
|
||||||
if (this.memberData.length > 0) {
|
if (this.memberData.length > 0) {
|
||||||
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
|
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
|
||||||
if (member && member.userId == this.$store.state.user.id) {
|
if (member && member.userId == this.$store.state.user.id) {
|
||||||
@ -86,7 +85,8 @@ export default {
|
|||||||
memberList.push(member);
|
memberList.push(member);
|
||||||
} else {
|
} else {
|
||||||
const member = this.memberData.find(member=>{ return member.id == id; });
|
const member = this.memberData.find(member=>{ return member.id == id; });
|
||||||
member.connect = false;
|
// member.connect = false;
|
||||||
|
member.connect = true;
|
||||||
member && memberList.push(member);
|
member && memberList.push(member);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -160,13 +160,22 @@ export default {
|
|||||||
},
|
},
|
||||||
// 邀请会话的消息
|
// 邀请会话的消息
|
||||||
'$store.state.socket.inviteSimulationConversition':function(val) {
|
'$store.state.socket.inviteSimulationConversition':function(val) {
|
||||||
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
|
const invitemember = this.memberData.find(member=>{ return member.id == val.creatorId; });
|
||||||
if (member) {
|
if (invitemember) {
|
||||||
this.inviteUserName = member.label;
|
this.inviteUserName = invitemember.label;
|
||||||
this.conversitionId = val.id;
|
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;
|
member.connect = true;
|
||||||
this.inviteUser = member;
|
const userName = member.userName ? '-' + member.userName : '';
|
||||||
this.$refs.chatbox.inviteMember();
|
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 + '与你开启会话');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -41,7 +41,7 @@ export default {
|
|||||||
this.userName = this.coverName(val);
|
this.userName = this.coverName(val);
|
||||||
// this.dialogVisible = true;
|
// this.dialogVisible = true;
|
||||||
// this.conversationId = val.id;
|
// this.conversationId = val.id;
|
||||||
this.$mesaage(this.userName + '与你开启会话');
|
this.$message.success(this.userName + '与你开启会话');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
@ -19,9 +19,12 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="仿真成员名称:" prop="name">
|
||||||
|
<el-input v-model="formModel.name" placeholder="请输入成员名称" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<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>
|
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -34,13 +37,18 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
lodaing:false,
|
||||||
formModel: {
|
formModel: {
|
||||||
type: ''
|
type: '',
|
||||||
|
name:''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
type: [
|
type: [
|
||||||
{ required: true, message: '请选择显示位置', trigger: 'change' }
|
{ required: true, message: '请选择成员类型', trigger: 'change' }
|
||||||
]
|
]
|
||||||
|
// name:[
|
||||||
|
// { required: true, message: '请输入成员名称', trigger: 'blur' }
|
||||||
|
// ]
|
||||||
},
|
},
|
||||||
typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}]
|
typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}]
|
||||||
};
|
};
|
||||||
@ -59,20 +67,26 @@ export default {
|
|||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
doSave() {
|
doSave() {
|
||||||
this.$refs.form.validate(() => {
|
this.$refs.form.validate((valid) => {
|
||||||
addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
|
if (valid) {
|
||||||
this.$message.success('添加仿真角色成员成功!');
|
this.lodaing = true;
|
||||||
this.$emit('addScriptMember', res.data);
|
addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
|
||||||
this.handleClose();
|
this.lodaing = false;
|
||||||
}).catch(() => {
|
this.$message.success('添加仿真角色成员成功!');
|
||||||
this.$message.error('添加仿真角色成员失败!');
|
this.$emit('addScriptMember', res.data);
|
||||||
});
|
this.handleClose();
|
||||||
|
}).catch(() => {
|
||||||
|
this.lodaing = false;
|
||||||
|
this.$message.error('添加仿真角色成员失败!');
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
type: ''
|
type: '',
|
||||||
|
name:''
|
||||||
};
|
};
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ export default {
|
|||||||
{
|
{
|
||||||
// const command = CommandHandler.getScriptDefinition(element.operationType);
|
// const command = CommandHandler.getScriptDefinition(element.operationType);
|
||||||
const commandName = element.operationType;
|
const commandName = element.operationType;
|
||||||
if (commandName != 'Set_Fault') {
|
if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) {
|
||||||
let operateType = commandName.split('_')[0];
|
let operateType = commandName.split('_')[0];
|
||||||
if (operateType == 'CM') {
|
if (operateType == 'CM') {
|
||||||
operateType = 'ControlConvertMenu';
|
operateType = 'ControlConvertMenu';
|
||||||
@ -158,7 +158,11 @@ export default {
|
|||||||
// deviceFaultType
|
// deviceFaultType
|
||||||
// element.operationParamMap.faultType;
|
// element.operationParamMap.faultType;
|
||||||
// '(' + operateName.label + ')'
|
// '(' + 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;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -167,13 +167,12 @@ export default {
|
|||||||
},
|
},
|
||||||
addScriptMember(member) {
|
addScriptMember(member) {
|
||||||
member.userId = '';
|
member.userId = '';
|
||||||
member.name = '';
|
|
||||||
member.disabled = false;
|
member.disabled = false;
|
||||||
this.$store.dispatch('training/addMemberListInScript', member);
|
|
||||||
const lastData = JSON.stringify([member]);
|
const lastData = JSON.stringify([member]);
|
||||||
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||||
covertmember.forEach(each=>{
|
covertmember.forEach(each=>{
|
||||||
this.memberList.push(each);
|
this.memberList.push(each);
|
||||||
|
this.$store.dispatch('training/addMemberListInScript', each);
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -249,7 +248,7 @@ export default {
|
|||||||
deviceName = each.deviceCode;
|
deviceName = each.deviceCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
each.name = each.type + deviceName;
|
each.name = each.type + deviceName + (each.name ? '' + each.name : '');
|
||||||
each.label = each.name;
|
each.label = each.name;
|
||||||
});
|
});
|
||||||
return lastData;
|
return lastData;
|
||||||
|
Loading…
Reference in New Issue
Block a user