This commit is contained in:
zyy 2020-08-04 10:49:33 +08:00
commit 402a4f48b8
16 changed files with 159 additions and 46 deletions

View File

@ -175,3 +175,11 @@ export function setPlcConfig(id, data) {
data: data
});
}
/** 添加/修改SANDBOX配置 */
export function setSandboxConfig(id, data) {
return request({
url: `/api/device/${id}/config/sandbox`,
method: 'put',
data: data
});
}

View File

@ -232,7 +232,8 @@ export default {
{label: '虚拟CCTV', value: 'CCTV'},
{label: 'PLC网关', value: 'PLC_GATEWAY'},
{label: '端头控制盒', value: 'PSL'},
{label: 'PSC控制柜', value: 'PSC'}
{label: 'PSC控制柜', value: 'PSC'},
{label: '虚拟电子沙盘', value: 'SANDBOX'}
]
}
};

View File

@ -117,7 +117,6 @@ const training = {
},
over: (state) => {
state.started = false;
state.switchcount += 1;
},
updateMapState: (state, deviceStatus) => {
Vue.prototype.$jlmap && Vue.prototype.$jlmap.update(deviceStatus);

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

@ -152,6 +152,7 @@ export default {
// this.faultlistshow = true;
const mapdata = this.$store.getters['map/map'];
const dom = document.getElementById('app');
document.querySelector('.schema').style.zIndex = 34;
const project = this.$route.query.project;
// console.log(project);
@ -165,7 +166,6 @@ export default {
this.jlmap3d.eventon();
},
initVR:function (skinCode, group) {
const routeData = this.$router.resolve({
path:'/jlmap3d/maintainervr',
query:{

View File

@ -218,19 +218,20 @@ export default {
},
bgImg() {
const bgImgAll = process.env.VUE_APP_PRO === 'local' || this.$route.query.project == 'heb' ? '' : bgImg;
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX'];
const imgMap = {
ISCS_LW: bgIscsImg,
ISCS_CW: bgIscsImg,
VR_IBP: bgIbpImg,
CCTV: bgCctvImg,
VR_PSD: bgPsdImg,
LSW: bgLswImg
LSW: bgLswImg,
SANDBOX: bgLswImg
};
return synchronousLogin.includes(this.$route.query.type) ? imgMap[this.$route.query.type] : bgImgAll;
},
syncLogin() {
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX'];
return this.$route.query.type ? synchronousLogin.includes(this.$route.query.type) : false;
},
loadingText() {
@ -469,6 +470,14 @@ export default {
query.psdCode = JSON.parse(res.data.deviceVO.config).psdCode;
}
this.$router.push({ path: `/jointTrainingNew`, query: query });
} else if (this.$route.query.type === 'SANDBOX') {
const sandboxQuery = {
mapid: query.mapId,
group: query.group,
project: getSessionStorage('project'),
token: getToken()
};
this.$router.push({ path: `/jlmap3d/sandbox`, query: sandboxQuery });
} else {
this.$router.push({ path: `/jointTrainingNew`, query: query });
}

View File

@ -70,7 +70,7 @@ export default {
-ms-user-select: none;
user-select: none;
position: absolute;
z-index: 10;
z-index: 36;
top: 0px;
left: 0px;
width: 100%;

View File

@ -22,6 +22,7 @@ import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Cookies from 'js-cookie';
import { getSimulationMemberList} from '@/api/simulation';
import {getAllConversition} from '@/api/chat';
export default {
name:'DemonChat',
components:{
@ -46,13 +47,15 @@ export default {
currentMemberList:[],
memberData:{},
chatContentList:[],
activeTrainList:[],
isStartRecord:false,
inviteUserName:'',
createCoversition:true,
inviteUser:{},
isQuitShow:false,
treeData:[],
driverList:[]
driverList:[],
simulationUsers:{}
};
},
computed:{
@ -86,7 +89,7 @@ export default {
const lastMemberList = [];
const dispatcherList = [];
// const electricDispatcherList = [];
// const depotDispatcherList = [];
const depotDispatcherList = [];
const stationSupervisorList = [];
this.driverList = [];
const maintainerList = [];
@ -107,7 +110,13 @@ export default {
member.memberName = member.type + device.groupNumber + name;
lastMemberList.push(member);
member.label = member.memberName;
this.driverList.push(member);
if (this.activeTrainList.length > 0) {
if (this.activeTrainList.includes(member.deviceCode)) {
this.driverList.push(member);
}
} else {
this.driverList.push(member);
}
} else {
member.memberName = member.type + device.name + name;
lastMemberList.push(member);
@ -127,6 +136,8 @@ export default {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
} else if (member.type == '车辆段调度') {
depotDispatcherList.push(member);
}
lastMemberList.push(member);
}
@ -146,12 +157,17 @@ export default {
label: '司机',
id: 'driver',
type: 'role',
children: []
children: this.driverList
}, {
label: '通号',
id: 'maintainer',
type: 'role',
children: maintainerList
}, {
label: '车辆段',
id: 'depotDispatcher',
type: 'role',
children: depotDispatcherList
}];
this.memberData = lastMemberList;
}).catch(() => {
@ -192,6 +208,7 @@ export default {
},
//
'$store.state.socket.acceptConversionInvite':function(val) {
this.conversitionId = val.id;
if (this.conversitionId) {
let result = false;
//
@ -211,9 +228,14 @@ export default {
//
if (member.userId == this.$store.state.user.id) {
memberList.push(this.inviteUser);
this.inviteUser = {};
this.isStartRecord = true;
this.isQuitShow = true;
if (member.userId != this.inviteUser.userId) {
this.isQuitShow = false;
} else {
this.isQuitShow = true;
}
this.inviteUser = {};
this.isHasCoversition = true;
}
}
}
@ -257,18 +279,22 @@ export default {
// ()
'$store.state.map.activeTrainListChange': function (val) {
const activeTrainList = this.$store.state.map.activeTrainList;
const driverList = [];
if (activeTrainList && activeTrainList.length) {
activeTrainList.forEach(groupNumber => {
const drivers = this.driverList.find(driver=>{
return driver.deviceCode == groupNumber;
if (this.driverList.length > 0) {
const driverList = [];
if (activeTrainList && activeTrainList.length) {
activeTrainList.forEach(groupNumber => {
const drivers = this.driverList.find(driver=>{
return driver.deviceCode == groupNumber;
});
if (drivers) {
driverList.push(drivers);
}
});
if (drivers) {
driverList.push(drivers);
}
});
}
this.treeData[2].children = driverList;
} else {
this.activeTrainList = activeTrainList;
}
this.treeData[2].children = driverList;
},
//
'$store.state.socket.scriptFinish':function(val, old) {
@ -292,6 +318,7 @@ export default {
this.inviteUserName = member.label;
this.conversitionId = val.id;
member.connect = true;
member.online = true;
this.inviteUser = member;
this.$refs.chatbox.inviteMember();
}
@ -333,6 +360,47 @@ export default {
this.inviteUser = {};
this.isQuitShow = false;
}
// isAudienceInitData() {
// getAllConversition(this.group).then(resp => {
// const messages = [];
// if (resp.data && resp.data.length) {
// debugger;
// resp.data.forEach(conversation => {
// (conversation.messageList || []).forEach(message => {
// const member = this.memberData[message.memberId];
// message.src = `/audio/${message.audioPath}`;
// message.members = conversation.memberList;
// if (member) {
// message.self = this.$store.state.userId == member.userId;
// }
// messages.push(message);
// });
// if (this.userRole !== 'AUDIENCE') {
// const user = this.simulationUsers[this.$store.state.user.id];
// this.isConversitionCreator = conversation.creatorId == user.memberId;
// !conversation.over && conversation.memberList.forEach(member =>{
// if (member.memberId == user.memberId && member.connect) {
// this.conversitionMemberList = conversation.memberList;
// this.conversitionId = conversation.id;
// this.messageList = [];
// conversation.messageList.forEach(message => {
// const member = this.memberData[message.memberId];
// message.src = `/audio/${message.audioPath}`;
// if (member) {
// message.self = this.$store.state.userId == member.userId;
// }
// this.privateMessageList.push(message);
// this.messageList.push(message);
// });
// }
// });
// }
// });
// }
// this.commonMessageList = messages.sort(this.sortByMessageTime);
// // this.initCommonMemberList();
// });
// }
}
};
</script>

View File

@ -130,6 +130,8 @@ export default {
return 'STATION_SUPERVISOR';
} else if (this.$route.query.prdType == '04') {
return 'DRIVER';
} else if (this.$route.query.prdType == '05') {
return 'DEPOT_DISPATCHER';
} else {
return 'AUDIENCE';
}
@ -411,7 +413,7 @@ export default {
height: 32px;
overflow: hidden;
padding-left: 44px;
z-index: 360;
z-index: 35;
.btn_hover{
position: absolute;
left: 0;

View File

@ -91,7 +91,8 @@ export default {
swchList: [
{ value: '01', name: '现地' },
{ value: '02', name: '行调' }
]
],
firstLoad: true
};
},
computed: {
@ -129,7 +130,10 @@ export default {
if (this.group) {
if (this.$store.state.training.started) {
await this.loadRunData();
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
this.firstLoad = false;
}
},
'$store.state.scriptRecord.bgSet':function (val) {
@ -146,7 +150,7 @@ export default {
}
},
async mounted() {
await this.loadRunData();
// await this.loadRunData();
},
methods: {
loadRunData() {

View File

@ -261,6 +261,7 @@ export default {
const self = this;
assignUsersPlayRoles(data, this.$route.query.group).then(resp => {
this.$message.success('调整角色成员成功!');
document.querySelector('.schema').style.zIndex = 35;
}).catch(() => {
self.memberData[nodeData.id].userId = '';
this.$message.error('调整角色成员失败!');

View File

@ -533,7 +533,7 @@ export default {
height: 32px;
overflow: hidden;
padding-left: 44px;
z-index: 360;
z-index: 35;
.btn_hover{
position: absolute;
left: 0;

View File

@ -87,7 +87,8 @@ export default {
runing: false,
userId: '',
faultMode: false,
directiveMode: false
directiveMode: false,
firstLoad: true
};
},
computed: {
@ -108,21 +109,21 @@ export default {
'$store.state.training.started': function (val) {
this.setRuning(val);
},
// '$store.state.training.switchcount': async function () {
// if (this.group) {
// const started = this.$store.state.training.started;
// if (started) {
// await this.loadRunData(this.$route.query);
// }
// }
// },
'$store.state.socket.runPlanReloadCount': function (val) {
this.loadRunData(this.$route.query);
'$store.state.training.switchcount': async function () {
if (this.group) {
const started = this.$store.state.training.started;
if (started) {
await this.loadRunData(this.$route.query);
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
this.firstLoad = false;
}
}
},
async mounted() {
this.userId = this.$store.state.user.id;
await this.loadRunData(this.$route.query);
// await this.loadRunData(this.$route.query);
},
methods: {
loadRunData(opt) {

View File

@ -436,9 +436,9 @@ export default {
case 'Axle':
idPrefix = 'axle';
break;
case 'SwitchFault':
idPrefix = 'switchFault';
break;
// case 'SwitchFault':
// idPrefix = '';
// break;
}
return idPrefix;
},

View File

@ -9,7 +9,7 @@
</template>
<script>
import { getDevicesByType, getDeviceDetail, setLswConfig, setCctvConfig, setVrPsdConfig, setPlcConfig } from '@/api/project';
import { getDevicesByType, getDeviceDetail, setLswConfig, setCctvConfig, setVrPsdConfig, setPlcConfig, setSandboxConfig } from '@/api/project';
import { getAllMapOnline, getStationListNeedAttendant, getPsdListByStandCode, getStandListByStationCode } from '@/api/jmap/map';
export default {
@ -101,6 +101,13 @@ export default {
{ prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' }
]
};
} else if ( this.data.type === 'SANDBOX') {
form = {
labelWidth: '150px',
items: [
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'}
]
};
}
return form;
}
@ -232,6 +239,19 @@ export default {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
} else if (this.data.type === 'SANDBOX') {
this.$refs.dataForm.validateForm(() => {
const param = {
deviceCode: this.formData.deviceCode
};
setSandboxConfig(this.data.id, param).then(() => {
self.$message.success('设置电子沙盘配置成员');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
}
},
handleClose() {

View File

@ -183,7 +183,7 @@ export default {
this.$refs.editConfig.doShow(row);
} else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD' || row.type === 'PSL' || row.type === 'PSC') {
this.$refs.editConfigGateway.doShow(row);
} else if (row.type == 'LSW' || row.type == 'CCTV' || row.type == 'VR_PSD' || row.type === 'PLC_GATEWAY') {
} else if (row.type == 'LSW' || row.type == 'CCTV' || row.type == 'VR_PSD' || row.type === 'PLC_GATEWAY' || row.type === 'SANDBOX') {
this.$refs.editConfigScreen.doShow(row);
} else if (row.type === 'IBP') {
this.$refs.editConfigIbp.doShow(row);