This commit is contained in:
fan 2020-05-19 15:44:13 +08:00
commit 247bc7ef30
12 changed files with 124 additions and 40 deletions

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // 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.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.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张S赛 // BASE_API = 'http://192.168.3.41:9000'; // 张S赛
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -140,6 +140,7 @@ export default {
if (this.recordSending) { if (this.recordSending) {
this.cancleRecording(); this.cancleRecording();
} }
this.$refs.chatContent.scrollTop();
}, },
setHeadTitle(headerTitle) { setHeadTitle(headerTitle) {
this.headerTitle = headerTitle; this.headerTitle = headerTitle;

View File

@ -1,18 +1,20 @@
<template> <template>
<div class="chatcontentIn"> <div class="chatcontentIn">
<div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass"> <div class="chatcontentInner">
<div :class="chatContent.self?'rightUser':'leftUser'"> <div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass">
<div class="userHeader"> <div :class="chatContent.self?'rightUser':'leftUser'">
<div v-if="chatContent.group&& !chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div> <div class="userHeader">
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div> <div v-if="chatContent.group&& !chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div>
</div> <div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div>
<div class="userBubble" @click="playAudio('audio'+index)"> </div>
<div class="userMessage"> <div class="userBubble" @click="playAudio('audio'+index)">
<!-- &&!(chatContent.self) --> <div class="userMessage">
<span v-if="chatContent.group">@{{ covertName(chatContent.targetName) }}</span> <!-- &&!(chatContent.self) -->
<span class="el-icon-video-play playicon" /> <span v-if="chatContent.group">@{{ covertName(chatContent.targetName) }}</span>
<span class="messageText">{{ chatContent.message }}</span> <span class="el-icon-video-play playicon" />
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" /> <span class="messageText">{{ chatContent.message }}</span>
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" />
</div>
</div> </div>
</div> </div>
</div> </div>
@ -42,6 +44,7 @@ export default {
const simulationText = this.$store.state.socket.simulationText; const simulationText = this.$store.state.socket.simulationText;
if (this.currentCoversition.id == val.id) { if (this.currentCoversition.id == val.id) {
this.chatContentList.push(simulationText); this.chatContentList.push(simulationText);
this.scrollTop();
} else { } else {
if (!simulationText.group) { if (!simulationText.group) {
this.$emit('changeCoversition', simulationText); this.$emit('changeCoversition', simulationText);
@ -79,6 +82,7 @@ export default {
return coversition; return coversition;
}); });
this.chatContentList = coversitionList; this.chatContentList = coversitionList;
this.scrollTop();
}); });
// const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList); // const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList);
// const coversitionList = coversitionListAll[this.coversition.id] || []; // const coversitionList = coversitionListAll[this.coversition.id] || [];
@ -88,6 +92,12 @@ export default {
clearData() { clearData() {
this.chatContentList = []; this.chatContentList = [];
}, },
scrollTop() {
this.$nextTick(function() {
const scrollTop = document.querySelector('.chatcontentInner').offsetHeight - document.querySelector('.chatcontentIn').offsetHeight + 30;
document.querySelector('.chatcontentIn').scrollTop = scrollTop;
});
},
formatTime(time) { formatTime(time) {
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time; return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
}, },

View File

@ -67,7 +67,10 @@ export default {
const objectCover = this.handleMemberName(coversition); const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName; coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline; coversition.isOnline = objectCover.isOnline;
this.coversitionList.push(coversition); const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
if (index < 0) {
this.coversitionList.push(coversition);
}
this.changeCoversition(coversition); this.changeCoversition(coversition);
}, },
handleMemberName(conversition) { handleMemberName(conversition) {

View File

@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="chat-box-content"> <div class="chat-box-content">
<chat-content ref="chatContent" :current-coversition="currentCoversition" /> <chat-content ref="chatContent" :current-coversition="currentCoversition" @changeCoversition="changeCoversition" />
<div v-if="recordSending" class="chat_record_tip"> <div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" /> <div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" /> <div class="record_icon" />
@ -110,6 +110,13 @@ export default {
}, },
setCurrentCoversition(coversition) { setCurrentCoversition(coversition) {
this.currentCoversition = coversition; this.currentCoversition = coversition;
if (coversition.group) {
this.headerTitle = coversition.name;
}
if (this.recordSending) {
this.cancleRecording();
}
this.$refs.chatContent.scrollTop();
}, },
setHeadTitle(headerTitle) { setHeadTitle(headerTitle) {
this.headerTitle = headerTitle; this.headerTitle = headerTitle;
@ -216,6 +223,9 @@ export default {
} }
}); });
}, },
changeCoversition(data) {
this.$refs.chatCoversitionList.changeCoversitionOther(data);
},
handleSetting() { handleSetting() {
this.$refs.chatSetting.doShow(); this.$refs.chatSetting.doShow();
}, },

View File

@ -1,17 +1,19 @@
<template> <template>
<div class="chatcontentIn"> <div class="chatcontentIn">
<div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass"> <div class="chatcontentInner">
<div :class="chatContent.self?'rightUser':'leftUser'"> <div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass">
<div class="userHeader"> <div :class="chatContent.self?'rightUser':'leftUser'">
<div v-if="chatContent.group&& !chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div> <div class="userHeader">
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div> <div v-if="chatContent.group&& !chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div>
</div> <div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div>
<div class="userBubble" @click="playAudio('audio'+index)"> </div>
<div class="userMessage"> <div class="userBubble" @click="playAudio('audio'+index)">
<span v-if="chatContent.group&&!chatContent.member.robot">@{{ covertName(chatContent.targetName) }}</span> <div class="userMessage">
<span class="el-icon-video-play playicon" /> <span v-if="chatContent.group&&!chatContent.member.robot">@{{ covertName(chatContent.targetName) }}</span>
<span class="messageText">{{ chatContent.message }}</span> <span class="el-icon-video-play playicon" />
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" /> <span class="messageText">{{ chatContent.message }}</span>
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" />
</div>
</div> </div>
</div> </div>
</div> </div>
@ -38,9 +40,20 @@ export default {
}, },
watch:{ watch:{
'$store.state.socket.simulationText':function (val, old) { // 仿 '$store.state.socket.simulationText':function (val, old) { // 仿
if (this.currentCoversition.id == val.conversationId) { // if (this.currentCoversition.id == val.conversationId) {
const simulationText = this.$store.state.socket.simulationText; // const simulationText = this.$store.state.socket.simulationText;
// this.chatContentList.push(simulationText);
// }
const simulationText = this.$store.state.socket.simulationText;
if (this.currentCoversition.id == val.id) {
this.chatContentList.push(simulationText); this.chatContentList.push(simulationText);
this.scrollTop();
} else {
if (!simulationText.group) {
this.$emit('changeCoversition', simulationText);
// this.$emit('addCoversition', {data:simulationText, headerTitle:''});
this.chatContentList.push(simulationText);
}
} }
}, },
$route() { $route() {
@ -72,12 +85,19 @@ export default {
return coversition; return coversition;
}); });
this.chatContentList = coversitionList; this.chatContentList = coversitionList;
this.scrollTop();
}); });
// const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList); // const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList);
// const coversitionList = coversitionListAll[this.coversition.id] || []; // const coversitionList = coversitionListAll[this.coversition.id] || [];
// // console.log('inintData---coversitionList' + JSON.stringify(this.$store.state.socket.coversitionList[this.coversition.id])); // // console.log('inintData---coversitionList' + JSON.stringify(this.$store.state.socket.coversitionList[this.coversition.id]));
// this.chatContentList = coversitionList; // this.chatContentList = coversitionList;
}, },
scrollTop() {
this.$nextTick(function() {
const scrollTop = document.querySelector('.chatcontentInner').offsetHeight - document.querySelector('.chatcontentIn').offsetHeight + 30;
document.querySelector('.chatcontentIn').scrollTop = scrollTop;
});
},
formatTime(time) { formatTime(time) {
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time; return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
}, },

View File

@ -61,6 +61,16 @@ export default {
this.$emit('setCurrentCoversition', coversition); this.$emit('setCurrentCoversition', coversition);
// this.$refs.chatContent.reloadData(this.currentCoversition); // this.$refs.chatContent.reloadData(this.currentCoversition);
}, },
changeCoversitionOther(coversition) {
const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline;
const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
if (index < 0) {
this.coversitionList.push(coversition);
}
this.changeCoversition(coversition);
},
handleMemberName(conversition) { handleMemberName(conversition) {
if (conversition.group) { if (conversition.group) {
return {coversitionName:conversition.name, isOnline:true}; return {coversitionName:conversition.name, isOnline:true};
@ -86,6 +96,22 @@ export default {
coversitionName = data + deviceName + memberName; coversitionName = data + deviceName + memberName;
} }
}); });
} else if (conversition.member) {
const member = conversition.member;
let data = member.role;
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.enLabel);
} else {
data = data.replace(rolename, element.label);
}
});
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
isOnline = member.online;
coversitionName = data + deviceName + memberName;
} else { } else {
coversitionName = conversition.name; coversitionName = conversition.name;
} }

View File

@ -25,6 +25,8 @@
<join-run-plan-Load ref="runPlanLoad" :group="group" /> <join-run-plan-Load ref="runPlanLoad" :group="group" />
<join-run-plan-view ref="runPlanView" :group="group" /> <join-run-plan-view ref="runPlanView" :group="group" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" /> <menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
</div> </div>
</div> </div>
@ -39,6 +41,7 @@ import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView'; import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
import menuSystemTime from '@/views/newMap/displayNew/menuSystemTime'; import menuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import IbpPlate from '@/views/ibp/ibpsystem/index'; import IbpPlate from '@/views/ibp/ibpsystem/index';
import MenuTrainList from './menuTrainList';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic'; import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
@ -61,6 +64,7 @@ export default {
JoinFaultChoose, JoinFaultChoose,
JoinRunPlanLoad, JoinRunPlanLoad,
JoinRunPlanView, JoinRunPlanView,
MenuTrainList,
menuSystemTime, menuSystemTime,
Jl3dDrive, Jl3dDrive,
IbpPlate IbpPlate
@ -117,6 +121,9 @@ export default {
}, },
userId() { userId() {
return this.$store.state.user ? this.$store.state.user.id : ''; return this.$store.state.user ? this.$store.state.user.id : '';
},
prdType() {
return this.$store.state.training.prdType;
} }
}, },
watch: { watch: {
@ -288,6 +295,9 @@ export default {
EventBus.$emit('viewLoading', false); EventBus.$emit('viewLoading', false);
}); });
}, },
setCenter(code) {
this.$refs.mapCanvas.setCenter(code);
},
// //
initLoadData() { initLoadData() {
const width = document.documentElement.clientWidth; const width = document.documentElement.clientWidth;
@ -315,11 +325,11 @@ export default {
} else { } else {
this.$store.dispatch('training/over'); this.$store.dispatch('training/over');
} }
if (this.isDemon) { // if (this.isDemon) {
this.$refs.menuDemon.initPlannedDriving(resp.data.planRunning); // this.$refs.menuDemon.initPlannedDriving(resp.data.planRunning);
} else if (this.isScript) { // } else if (this.isScript) {
this.$refs.menuScript.initPlannedDriving(resp.data.planRunning); // this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
} // }
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) { } else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true; this.dataError = true;
this.$messageBox('此地图数据正在维护中,无法运行!'); this.$messageBox('此地图数据正在维护中,无法运行!');

View File

@ -220,6 +220,7 @@ export default {
}; };
ranAsPlan(data, this.group).then(res => { ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/simulationStart').then(() => { this.$store.dispatch('training/simulationStart').then(() => {
this.$store.dispatch('map/setRunPlanStatus', true);
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`)); this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
}); });
}).catch((error) => { }).catch((error) => {
@ -250,7 +251,9 @@ export default {
end() { end() {
this.isDisable = false; this.isDisable = false;
EventBus.$emit('trainView'); EventBus.$emit('trainView');
exitRunPlan(this.group).catch(() => { exitRunPlan(this.group).then(()=>{
this.$store.dispatch('map/setRunPlanStatus', false);
}).catch(() => {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
this.isDisable = true; this.isDisable = true;
this.$messageBox(this.$t('error.endSimulationFailed')); this.$messageBox(this.$t('error.endSimulationFailed'));

View File

@ -98,6 +98,7 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
this.clearAutoSave(); this.clearAutoSave();
this.$store.dispatch('scriptRecord/updateBgSet', false);
}, },
methods: { methods: {
setIsParse(isPause) { setIsParse(isPause) {

View File

@ -60,7 +60,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('scriptRecord.executeCommand')" class="conditionVO"> <el-form-item :label="$t('scriptRecord.executeCommand')" class="conditionVO">
<el-input v-model="executeCommandName" disabled style="width:130px" /> <el-input v-model="executeCommandName" disabled style="width:130px" />
<el-button :type="field === 'commandActive' ? 'danger' : 'primary'" size="small" @click="hover('commandActive')">{{ $t('map.activate') }}</el-button> <!-- <el-button :type="field === 'commandActive' ? 'danger' : 'primary'" size="small" @click="hover('commandActive')">{{ $t('map.activate') }}</el-button> -->
<div class="el-form-item__error">{{ messageTips2 }}</div> <div class="el-form-item__error">{{ messageTips2 }}</div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>

View File

@ -33,7 +33,7 @@
@changeUser="handleUpdUser" @changeUser="handleUpdUser"
@delUser="handleDelUser" @delUser="handleDelUser"
/> />
<e-role <!-- <e-role
class="role" class="role"
title-i18n="trainRoom.teacher" title-i18n="trainRoom.teacher"
role-type="Instructor" role-type="Instructor"
@ -42,7 +42,7 @@
@addUser="handleAddUser" @addUser="handleAddUser"
@changeUser="handleUpdUser" @changeUser="handleUpdUser"
@delUser="handleDelUser" @delUser="handleDelUser"
/> /> -->
<e-role <e-role
class="role" class="role"
title-i18n="trainRoom.universalAccount" title-i18n="trainRoom.universalAccount"