综合演练 仿真聊天代码调整
This commit is contained in:
parent
edcefeab07
commit
7449b6b2a3
@ -29,6 +29,9 @@ function handle(state, data) {
|
|||||||
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
|
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
|
||||||
handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息
|
handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息
|
||||||
break;
|
break;
|
||||||
|
case 'Simulation_Start_Conversation': // 综合演练仿真-聊天界面用户邀请其他人加入群聊
|
||||||
|
state.inviteOtherIntoChat = msg;
|
||||||
|
break;
|
||||||
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
|
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
|
||||||
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
|
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
|
||||||
break;
|
break;
|
||||||
@ -213,7 +216,8 @@ const socket = {
|
|||||||
simulationStart: '', // 仿真-开始消息
|
simulationStart: '', // 仿真-开始消息
|
||||||
simulationOver:0, // 退出仿真推送消息
|
simulationOver:0, // 退出仿真推送消息
|
||||||
simulationReset: '', // 仿真-异常消息
|
simulationReset: '', // 仿真-异常消息
|
||||||
simulationText: {}, // 仿真-用户交互消息(聊天/命令)
|
simulationText: {}, // 仿真-用户交互消息(聊天/命令),
|
||||||
|
inviteOtherIntoChat:{}, // 综合演练仿真-聊天界面用户邀请其他人加入群聊推送信息
|
||||||
// coversitionList:{}, // 历史仿真-用户消息列表
|
// coversitionList:{}, // 历史仿真-用户消息列表
|
||||||
|
|
||||||
message: {}, // 仿真聊天
|
message: {}, // 仿真聊天
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
|
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
|
||||||
<chat-create-group ref="createGroup" :group="group" @addCoversition="addCoversition" />
|
<chat-create-group ref="createGroup" :group="group" @addCoversition="addCoversition" />
|
||||||
|
<chat-tooltip />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -51,6 +52,7 @@ import ChatContent from './chatContent';
|
|||||||
import ChatMemberList from './chatMemberList';
|
import ChatMemberList from './chatMemberList';
|
||||||
import ChatCoversitionList from './chatCoversitionList';
|
import ChatCoversitionList from './chatCoversitionList';
|
||||||
import ChatCreateGroup from './chatCreateGroup';
|
import ChatCreateGroup from './chatCreateGroup';
|
||||||
|
import ChatTooltip from './chatTooltip';
|
||||||
import RecordRTC from 'recordrtc';
|
import RecordRTC from 'recordrtc';
|
||||||
import {uploadAudioFileNew} from '@/api/chat';
|
import {uploadAudioFileNew} from '@/api/chat';
|
||||||
export default {
|
export default {
|
||||||
@ -60,7 +62,8 @@ export default {
|
|||||||
ChatContent,
|
ChatContent,
|
||||||
ChatMemberList,
|
ChatMemberList,
|
||||||
ChatCoversitionList,
|
ChatCoversitionList,
|
||||||
ChatCreateGroup
|
ChatCreateGroup,
|
||||||
|
ChatTooltip
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
group: {
|
group: {
|
@ -12,8 +12,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import ConstConfig from '@/scripts/ConstConfig';
|
// import ConstConfig from '@/scripts/ConstConfig';
|
||||||
import Cookies from 'js-cookie';
|
// import Cookies from 'js-cookie';
|
||||||
import {getSimulationConversationListNew} from '@/api/chat';
|
import {getSimulationConversationListNew} from '@/api/chat';
|
||||||
export default {
|
export default {
|
||||||
name:'ChatCoversitionList',
|
name:'ChatCoversitionList',
|
||||||
@ -32,15 +32,15 @@ export default {
|
|||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
const data = resp.data;
|
const data = resp.data;
|
||||||
data.map(coversition=>{
|
data.map(coversition=>{
|
||||||
if (coversition.name) {
|
// if (coversition.name) {
|
||||||
coversition.coverName = coversition.name;
|
coversition.coverName = coversition.name;
|
||||||
coversition.isOnline = true;
|
coversition.isOnline = true;
|
||||||
} else {
|
// }
|
||||||
const objectCover = this.handleMemberName(coversition);
|
// else {
|
||||||
coversition.coverName = objectCover.coversitionName;
|
// const objectCover = this.handleMemberName(coversition);
|
||||||
coversition.isOnline = objectCover.isOnline;
|
// coversition.coverName = objectCover.coversitionName;
|
||||||
}
|
// coversition.isOnline = objectCover.isOnline;
|
||||||
|
// }
|
||||||
return coversition;
|
return coversition;
|
||||||
});
|
});
|
||||||
this.coversitionList = data;
|
this.coversitionList = data;
|
||||||
@ -54,14 +54,15 @@ export default {
|
|||||||
addCoversition(data) {
|
addCoversition(data) {
|
||||||
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
|
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
const objectCover = this.handleMemberName(data);
|
// const objectCover = this.handleMemberName(data);
|
||||||
if (data.name) {
|
// if (data.name) {
|
||||||
data.coverName = data.name;
|
data.coverName = data.name;
|
||||||
data.isOnline = true;
|
data.isOnline = true;
|
||||||
} else {
|
// }
|
||||||
data.coverName = objectCover.coversitionName;
|
// else {
|
||||||
data.isOnline = objectCover.isOnline;
|
// data.coverName = objectCover.coversitionName;
|
||||||
}
|
// data.isOnline = objectCover.isOnline;
|
||||||
|
// }
|
||||||
|
|
||||||
this.coversitionList.push(data);
|
this.coversitionList.push(data);
|
||||||
this.currentCoversition = data;
|
this.currentCoversition = data;
|
||||||
@ -74,62 +75,64 @@ export default {
|
|||||||
// this.$refs.chatContent.reloadData(this.currentCoversition);
|
// this.$refs.chatContent.reloadData(this.currentCoversition);
|
||||||
},
|
},
|
||||||
changeCoversitionOther(coversition) {
|
changeCoversitionOther(coversition) {
|
||||||
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;
|
||||||
|
coversition.coverName = coversition.name;
|
||||||
|
coversition.isOnline = true;
|
||||||
const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
|
const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
this.coversitionList.push(coversition);
|
this.coversitionList.push(coversition);
|
||||||
}
|
}
|
||||||
this.changeCoversition(coversition);
|
this.changeCoversition(coversition);
|
||||||
},
|
|
||||||
handleMemberName(conversition) {
|
|
||||||
if (conversition.all) {
|
|
||||||
return {coversitionName:conversition.name, isOnline:true};
|
|
||||||
} else {
|
|
||||||
let coversitionName = '';
|
|
||||||
let isOnline = true;
|
|
||||||
if (conversition.memberList) {
|
|
||||||
conversition.memberList.forEach(member=>{
|
|
||||||
if (member.userId != this.$store.state.user.id) {
|
|
||||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
|
||||||
let data = member.role;
|
|
||||||
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 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;
|
|
||||||
}
|
|
||||||
return {coversitionName:coversitionName, isOnline:isOnline};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// handleMemberName(conversition) {
|
||||||
|
// if (conversition.all) {
|
||||||
|
// return {coversitionName:conversition.name, isOnline:true};
|
||||||
|
// } else {
|
||||||
|
// let coversitionName = '';
|
||||||
|
// let isOnline = true;
|
||||||
|
// if (conversition.memberList) {
|
||||||
|
// conversition.memberList.forEach(member=>{
|
||||||
|
// if (member.userId != this.$store.state.user.id) {
|
||||||
|
// const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||||
|
// let data = member.role;
|
||||||
|
// 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 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;
|
||||||
|
// }
|
||||||
|
// return {coversitionName:coversitionName, isOnline:isOnline};
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
@ -1,38 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-show="dialogVisible" class="chat-create-group">
|
<div v-show="dialogVisible" class="chat-create-group-all">
|
||||||
<div class="create-group-header">
|
<div class="chat-create-group">
|
||||||
<div class="create-group-title">添加会话对象</div>
|
<div class="create-group-header">
|
||||||
<div class="create-group-close">
|
<div class="create-group-title">添加会话对象</div>
|
||||||
<i class="el-icon-close" @click="dialogVisible=false" />
|
<div class="create-group-close">
|
||||||
</div>
|
<i class="el-icon-close" @click="dialogVisible=false" />
|
||||||
</div>
|
|
||||||
<div class="create-group-content">
|
|
||||||
<div class="chat-member-list">
|
|
||||||
<el-checkbox-group v-model="checkList">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="member in memberList"
|
|
||||||
:key="member.id"
|
|
||||||
class="each-chat-member"
|
|
||||||
:label="member"
|
|
||||||
:disabled="member.userId === userId"
|
|
||||||
>{{ member.memberName }}</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</div>
|
|
||||||
<div class="currentSelectList">
|
|
||||||
<div
|
|
||||||
v-for="member in checkList"
|
|
||||||
:key="member.id"
|
|
||||||
class="eachSelect"
|
|
||||||
>
|
|
||||||
{{ member.memberName }}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="create-group-content">
|
||||||
|
<div class="chat-member-list">
|
||||||
|
<el-checkbox-group v-model="checkList">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="member in memberList"
|
||||||
|
:key="member.id"
|
||||||
|
class="each-chat-member"
|
||||||
|
:label="member"
|
||||||
|
:disabled="member.userId === userId"
|
||||||
|
>{{ member.memberName }}</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</div>
|
||||||
|
<div class="currentSelectList">
|
||||||
|
<div
|
||||||
|
v-for="member in checkList"
|
||||||
|
:key="member.id"
|
||||||
|
class="eachSelect"
|
||||||
|
>
|
||||||
|
{{ member.memberName }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
<!-- :style="member.userId === userId ?'color:red':''" -->
|
<!-- :style="member.userId === userId ?'color:red':''" -->
|
||||||
</div>
|
</div>
|
||||||
<div class="create-group-bottom">
|
<div class="create-group-bottom">
|
||||||
<el-button :loading="loading" size="small" type="primary" @click="doCreate">创建会话</el-button>
|
<el-button :loading="loading" size="small" type="primary" @click="doCreate">创建会话</el-button>
|
||||||
<el-button size="small" @click="doClose">取消</el-button>
|
<el-button size="small" @click="doClose">取消</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -102,7 +104,7 @@ export default {
|
|||||||
this.checkList = [];
|
this.checkList = [];
|
||||||
}
|
}
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
this.$messageBox('创建会话失败: ' + error.messagfe);
|
this.$messageBox('创建会话失败: ' + error.message);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.checkList = [];
|
this.checkList = [];
|
||||||
@ -118,6 +120,14 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.chat-create-group-all{
|
||||||
|
position:absolute;
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
z-index:10;
|
||||||
|
}
|
||||||
.chat-create-group{
|
.chat-create-group{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 70%;
|
width: 70%;
|
94
src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue
Normal file
94
src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<template>
|
||||||
|
<div v-show="dialogVisible" class="chatTooltipAll">
|
||||||
|
<div class="chatTooltip">
|
||||||
|
<div class="chatTooltipHeader">
|
||||||
|
{{ userName }} 邀请您加入会话!
|
||||||
|
</div>
|
||||||
|
<div class="chatTooltipBootom">
|
||||||
|
<div class="create-group-bottom">
|
||||||
|
<el-button :loading="loading" size="small" type="primary" @click="doCreate">接受</el-button>
|
||||||
|
<el-button size="small" @click="doClose">拒绝</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import ConstConfig from '@/scripts/ConstConfig';
|
||||||
|
import Cookies from 'js-cookie';
|
||||||
|
export default {
|
||||||
|
name:'ChatTooltip',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
userName:'',
|
||||||
|
dialogVisible:false,
|
||||||
|
loading:false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
'$store.state.socket.inviteOtherIntoChat':function(val) {
|
||||||
|
this.userName = this.coverName(val);
|
||||||
|
this.dialogVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {"conversationId":"22e10b17-7a6c-4b1b-8724-f87fb2053b76","from":{"id":"17","userId":"75","name":"赵",
|
||||||
|
// "role":"STATION_SUPERVISOR","deviceType":"STATION","deviceCode":"Station32955","deviceName":"世纪大道","online":true,"robot":false}
|
||||||
|
methods:{
|
||||||
|
coverName(inviteUser) {
|
||||||
|
const member = inviteUser.from;
|
||||||
|
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||||
|
let data = member.role;
|
||||||
|
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 : '';
|
||||||
|
return data + deviceName + memberName;
|
||||||
|
},
|
||||||
|
doCreate() {
|
||||||
|
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.chatTooltip{
|
||||||
|
position: absolute;
|
||||||
|
width: 290px;
|
||||||
|
left: 32%;
|
||||||
|
top: 42%;
|
||||||
|
z-index: 5;
|
||||||
|
background: #fff;
|
||||||
|
padding: 15px;
|
||||||
|
box-shadow: #969090 0px 0px 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
line-height: 20px;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
.chatTooltipHeader{
|
||||||
|
margin-top:10px;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
.chatTooltipBootom{
|
||||||
|
margin-top:10px;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom:10px;
|
||||||
|
}
|
||||||
|
.chatTooltipAll{
|
||||||
|
position:absolute;
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
</style>
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import QrCode from '@/components/QrCode';
|
import QrCode from '@/components/QrCode';
|
||||||
import ChatBox from './chatBox';
|
import ChatBox from './chatView/chatBox';
|
||||||
import SetTime from '@/views/newMap/displayNew/demon/setTime';
|
import SetTime from '@/views/newMap/displayNew/demon/setTime';
|
||||||
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
|
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||||
import { exitFullscreen } from '@/utils/screen';
|
import { exitFullscreen } from '@/utils/screen';
|
||||||
|
Loading…
Reference in New Issue
Block a user