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;
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.41:9000'; // 张赛
BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张S赛
// BASE_API = 'http://b29z135112.zicp.vip';

View File

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

View File

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

View File

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

View File

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

View File

@ -61,6 +61,16 @@ export default {
this.$emit('setCurrentCoversition', coversition);
// 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) {
if (conversition.group) {
return {coversitionName:conversition.name, isOnline:true};
@ -86,6 +96,22 @@ export default {
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 {
coversitionName = conversition.name;
}

View File

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

View File

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

View File

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

View File

@ -60,7 +60,7 @@
</el-form-item>
<el-form-item :label="$t('scriptRecord.executeCommand')" class="conditionVO">
<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>
</el-form-item>
<el-form-item>

View File

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