This commit is contained in:
zyy 2020-07-23 10:33:12 +08:00
commit d313348a41
11 changed files with 382 additions and 243 deletions

View File

@ -230,6 +230,8 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
for(let i=0,leni=stationlist.length;i<leni;i++){
psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code;
psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code;
psdtexturemap[stationlist[i].direction1.name] = stationlist[i].code;
psdtexturemap[stationlist[i].direction2.name] = stationlist[i].code;
}
}
@ -354,16 +356,21 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
if (data._type == "Psd") {
scope.showmodel = scope.modelmanager.standmodel.mesh;
scope.scene.add(scope.showmodel);
if(data.standCode == undefined){
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture["Station18398"];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}else{
if(scope.stationtexture[psdtexturemap[data.standCode]]){
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
if(psdtexturemap[data.code]){
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.code]];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}else{
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture["Station18398"];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
}
if(scope.stationtexture[psdtexturemap[data.standCode]]){
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
}

View File

@ -29,15 +29,6 @@ function handle(state, data) {
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息
break;
case 'Simulation_Start_Conversation': // 综合演练仿真-聊天界面用户邀请其他人加入群聊
state.inviteOtherIntoChat = msg;
break;
case 'Simulation_Accept_Conversation': // 综合演练仿真-聊天界面用户接受被邀请
state.acceptInviteChat = msg;
break;
case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息
state.quitCoversition = msg;
break;
case 'Simulation_PlayBack_Finish': // 竞赛裁判系统裁判员回放结束推送
state.playBackFinish++; // 竞赛裁判系统裁判员回放结束推送
break;
@ -228,9 +219,6 @@ const socket = {
simulationStart: '', // 仿真-开始消息
simulationOver:0, // 退出仿真推送消息
simulationReset: 0, // 仿真-异常消息
inviteOtherIntoChat:{}, // 综合演练仿真-聊天界面用户邀请其他人加入群聊推送信息
acceptInviteChat:{}, // 综合演练仿真-聊天界面用户接受聊天邀请,
quitCoversition:{}, // 综合演练仿真-聊天界面用户退出群聊推送消息,
// coversitionList:{}, // 历史仿真-用户消息列表
inviteSimulationConversition: {}, // 仿真会话邀请消息
acceptConversionInvite:{}, // 仿真会话成员接收邀请

View File

@ -79,6 +79,9 @@ export default {
if (val.length && this.$route.query.group) {
this.statusMessage(val);
}
},
'$store.state.socket.simulationOver':function(val) {
this.backOut();
}
},
async beforeDestroy() {
@ -88,7 +91,7 @@ export default {
await this.setWindowSize();
await this.initLoadData();
this.disPlay = true;
if (this.$route.path.includes('design/bigScreen') || this.$route.query.noPreLogout) {
if (this.$route.path.includes('design/bigScreen') || this.$route.query.noPreLogout || this.$route.query.projectDevice) {
this.disPlay = false;
}
},
@ -173,6 +176,13 @@ export default {
history.go(-1);
});
},
backOut() {
if (this.$route.query.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
}
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };

View File

@ -432,7 +432,12 @@ export default {
};
setSessionStorage('projectDevice', JSON.stringify(res.data.deviceVO));
if (this.$route.query.type == 'LSW') {
this.$router.push({ path: `/bigSplitScreen/${resp.data.map.id}`, query: query });
const config = JSON.parse(res.data.deviceVO.config);
if (config.quadrant == '99') {
this.$router.push({ path: `/displayBigScreen/${resp.data.map.id}`, query: query });
} else {
this.$router.push({ path: `/bigSplitScreen/${resp.data.map.id}`, query: query });
}
} else if (this.$route.query.type === 'ISCS_LW' || this.$route.query.type === 'ISCS_CW') {
this.$router.push({ path: `/displayIscs/system`, query: {
group: res.data.group,

View File

@ -1,5 +1,5 @@
<template>
<div class="chatBox" :style="{'bottom':bottom+'px'}">
<div class="chatBox" :style="{'bottom':offsetBottom+'px'}">
<div v-show="!minimize" class="chat-box">
<div class="chat-box-main">
<div class="chat-window">
@ -54,7 +54,7 @@
</div>
<div v-else>
<div class="chat-box-footer-tool" />
<!-- <el-button v-if="isButtonShow&&isCreate" size="mini" type="danger" class="chat-box-footer-quit" :loading="loading" @click="quitCoversition()">退出群聊</el-button> -->
<el-button v-if="isQuitShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="loading" @click="quitConversition()">退出群聊</el-button>
<el-button v-if="isStartRecord" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
@ -69,6 +69,8 @@
</div>
</div>
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
<!-- @getCoversitionList="getCoversitionList" -->
<chat-tooltip ref="chatToolTip" :group="group" :conversition-id="conversitionId" :invite-user-name="inviteUserName" />
</div>
</template>
<script>
@ -76,14 +78,16 @@ import ChatSetting from './chatSetting';
import ChatMemberList from './chatMemberList';
import ChatContent from './chatContent';
import RecordRTC from 'recordrtc';
// , overSimulationConversition, getAllConversition
import {sendSimulationConversition, startConversition} from '@/api/chat';
import ChatTooltip from './chatTooltip';
// getAllConversition
import {sendSimulationConversition, startConversition, overSimulationConversition} from '@/api/chat';
export default {
name:'ChatBoxDraft',
components:{
ChatSetting,
ChatMemberList,
ChatContent
ChatContent,
ChatTooltip
},
props:{
isShow:{
@ -117,6 +121,18 @@ export default {
isStartRecord:{
type:Boolean,
required:true
},
isQuitShow:{
type:Boolean,
required:true
},
inviteUserName:{
type:String,
required:true
},
offsetBottom:{
type:Number,
required:true
}
},
data() {
@ -144,22 +160,6 @@ export default {
};
},
watch:{
'$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
},
'$store.state.training.prdType': function(val) {
this.$nextTick(() => {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
});
},
queryMember(val) {
if (this.$refs.tree) {
this.$refs.tree.filter(val);
@ -302,7 +302,6 @@ export default {
this.loading = true;
startConversition(this.group, this.memberIdList).then(resp => {
if (resp.data) {
// this.conversitionId = resp.data.id;
this.loading = false;
this.memberIdList = [];
this.userString = '';
@ -313,33 +312,33 @@ export default {
this.dialogVisible = false;
});
}
// this.createLoading = true;
// startConversition(this.group, this.memberIdList).then(resp => {
// this.conversitionId = resp.data.id;
// this.messageList = [];
// this.privateMessageList = [];
// this.userString = '';
// this.isConversitionCreator = true;
// this.$message.success('');
// this.createLoading = false;
// }).catch((error) => {
// this.$message.error(error.code == '3005' ? ':仿线' : '仿');
// this.createLoading = false;
// });
},
quitConversition() {
this.loading = true;
overSimulationConversition(this.group, this.conversitionId).then(resp => {
this.$emit('resetCoversition');
this.loading = false;
}).catch(() => {
this.$message.error('退出会话失败!');
this.loading = false;
});
},
inviteMember() {
this.$refs.chatToolTip.doShow();
}
}
};
</script>
<style lang="scss" scoped>
// .chat-box-footer-quit{
// font-size: 12px;
// padding: 5px 15px;
// color: #fff;
// float: left;
// margin-left: 10px;
// margin-bottom: 10px;
// cursor: pointer;
// }
.chat-box-footer-quit{
font-size: 12px;
padding: 5px 15px;
color: #fff;
float: left;
margin-left: 10px;
margin-bottom: 10px;
cursor: pointer;
}
.chatBox{
width: 503px;
position: absolute;

View File

@ -120,7 +120,7 @@ export default {
display: inline-block;
}
.userHeader{margin-bottom: 2px;}
.userName{font-size: 12px;display:inline-block;}
.userName{font-size: 12px;display:inline-block;margin-right:10px;}
.userChatTime{font-size: 12px;display:inline-block;}
.userBubble{
max-width: 200px;

View File

@ -0,0 +1,95 @@
<template>
<div v-show="dialogVisible" class="chatTooltipAll">
<div class="chatTooltip">
<div class="chatTooltipHeader">
{{ inviteUserName }} 邀请您加入会话
</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 {acceptConversitionInvite} from '@/api/chat';
export default {
name:'ChatTooltip',
props: {
group: {
type: String,
required: true
},
inviteUserName:{
type: String,
required: true
},
conversitionId:{
type: String,
required: true
}
},
data() {
return {
dialogVisible:false,
loading:false
};
},
// {"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:{
doShow() {
this.loading = false;
this.dialogVisible = true;
},
doCreate() {
this.loading = true;
acceptConversitionInvite(this.group, this.conversitionId).then(res=>{
this.loading = false;
this.dialogVisible = false;
this.$emit('getCoversitionList');
}).catch(error=>{
this.$messageBox('接受邀请失败: ' + error.message);
});
},
doClose() {
this.dialogVisible = false;
}
}
};
</script>
<style lang="scss" scoped>
.chatTooltip{
position: absolute;
width: 290px;
left: 23%;
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>

View File

@ -170,10 +170,10 @@ export default {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = object.offsetHeight || 0;
this.bottom = objectBottom + 15;
this.bottom = objectBottom + 15;
} else {
this.bottom = 15;
}
this.bottom = 15;
}
},
queryMember(val) {
if (this.$refs.tree) {

View File

@ -5,12 +5,11 @@
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" />
<script-preview-chat ref="chatbox" :group="group" :user-role="userRole" :member-data="memberData" :tree-data="treeData" :offset-bottom="offsetBottom" />
<div class="display-draft">
<el-button v-if="isscriptRun&&!dataError" type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
<el-button type="primary" @click="back">{{ $t('display.demon.back') }}</el-button>
</div>
<menu-schema
v-if="isDemon"
ref="menuSchema"
@ -23,12 +22,11 @@
@selectQuest="selectQuest"
@switchStationMode="switchStationMode"
/>
<menu-system-time ref="menuSystemTime" :offset="offset" :right="right" :group="group" />
</div>
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<!-- <Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" /> -->
<run-plan-Load ref="runPlanLoad" :group="group" />
<run-plan-view ref="runPlanView" :group="group" />
</div>
@ -68,14 +66,6 @@ export default {
MenuSystemTime,
Jl3dDrive
},
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
mode: '',
@ -165,6 +155,9 @@ export default {
this.showStation = code;
}
},
'$store.state.training.prdType':function(val) {
this.setPosition();
},
// '$store.state.training.prdType': function(val) {
// debugger;
// // this.prdType=val;
@ -184,14 +177,12 @@ export default {
});
}
},
async created() {
created() {
this.mode = this.$route.params.mode;
this.group = this.$route.query.group || '';
},
async mounted() {
await this.setWindowSize();
await this.initLoadData();
this.switchMode('01');
},
async beforeDestroy() {
await this.clearAllTimer();
@ -200,32 +191,98 @@ export default {
await this.$store.dispatch('map/mapClear');
},
methods: {
// 线
clearAllTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
this.ierval = null;
}
if (this.checkLine) {
clearTimeout(this.checkLine);
this.checkLine = null;
//
async initLoadData() {
this.setWindowSize();
this.$store.dispatch('training/reset');
try {
await this.loadSimulationInfo();
if (this.isDemon) {
await this.initLoadDemonData();
}
this.checkLoginLineTimer();
this.checkMouseStatusTimer();
} catch (error) {
this.$messageBox(`初始化失败: ${error.message}`);
this.endViewLoading();
}
},
setWindowSize() {
this.$nextTick(() => {
const width = this.width;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
},
// 仿
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;
this.$messageBox('此地图数据正在维护中,无法运行!');
}
},
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (this.group) {
await this.loadNewMapDataByGroup(this.group);
this.switchMode('01');
} else {
this.endViewLoading();
}
},
// id
async loadNewMapDataByGroup(group) {
try {
await loadNewMapDataByGroup(group);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
//
endViewLoading() {
this.$store.dispatch('map/mapClear');
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
// 线
checkLoginLineTimer() {
if (this.checkLine) {
clearTimeout(this.checkLine);
clearInterval(this.checkLine);
}
this.checkLine = setInterval(() => {
checkLoginLine();
}, 5000 * 60);
},
// 线
clearAllTimer() {
if (this.ierval) {
clearInterval(this.ierval);
this.ierval = null;
}
if (this.checkLine) {
clearInterval(this.checkLine);
this.checkLine = null;
}
},
//
checkMouseStatusTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
clearInterval(this.ierval);
}
this.ierval = setInterval(() => {
if (this.mouseNum) {
@ -249,77 +306,15 @@ export default {
},
setPosition() {
this.$nextTick(() => {
let offset = 15;
let offsetBottom = 15;
this.offset = 15;
this.offsetBottom = 15;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
const menuBottom = document.getElementById('menuButton');
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
if (menuTool) {
offset += (menuTool.offsetHeight || 0);
}
if (menuBottom) {
offsetBottom += (menuBottom.offsetHeight || 0);
}
if (this.offset != offset) {
this.offset = offset;
}
if (this.offsetBottom != offsetBottom) {
this.offsetBottom = offsetBottom;
}
this.offset = this.offset + (menuBar ? menuBar.offsetHeight || 0 : 0) + (menuTool ? menuTool.offsetHeight || 0 : 0);
this.offsetBottom = this.offsetBottom + (menuBottom ? menuBottom.offsetHeight || 0 : 0);
});
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
// 仿
async loadSimulationInfo() {
const resp = await getSimulationInfoNew(this.group);
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;
this.$messageBox('此地图数据正在维护中,无法运行!');
}
},
//
async initLoadData() {
this.$store.dispatch('training/reset');
try {
await this.loadSimulationInfo();
if (this.isDemon) {
await this.initLoadDemonData();
}
this.checkLoginLineTimer();
this.checkMouseStatusTimer();
} catch (error) {
this.$messageBox(`初始化失败: ${error.message}`);
this.endViewLoading();
}
},
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
// this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]);
if (this.group) {
await this.loadNewMapDataByGroup(this.group);
} else {
this.endViewLoading();
}
},
async back() {
await clearSimulation(this.group);
this.$store.dispatch('training/over').then(() => {
@ -340,6 +335,8 @@ export default {
} else {
this.userRole = 'AUDIENCE';
}
//
const memberList = this.$store.state.training.memberData;
if (data.id) {
memberList[data.id].userId = this.$store.state.user.id;
@ -422,7 +419,7 @@ export default {
children: maintainerList
}];
this.memberData = lastMemberList;
//
},
// 退
handleQuitQuest() {
@ -432,7 +429,7 @@ export default {
this.isscriptRun = false;
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.userRole = '';
// this.$refs.chatbox.clearAllData();
this.$refs.chatbox.clearAllData();
}).catch(()=>{
this.$messageBox(this.$t('display.demon.exitTaskFail'));
});
@ -443,18 +440,6 @@ export default {
this.$messageBox(this.$t('display.demon.exitTaskFail'));
});
},
// id
async loadNewMapDataByGroup(group) {
try {
await loadNewMapDataByGroup(group);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
// 仿
async quit() {
await clearSimulation(this.group);
@ -463,39 +448,31 @@ export default {
switchMode(prdType) {
this.$store.dispatch('training/setPrdType', prdType);
},
hidepanel() {
if (this.isDrive) {
this.panelShow = false;
this.drivingShow = true;
this.$refs.Jl3dDrive.show(this.mapId, this.group);
} else {
this.panelShow = false;
this.simulationShow = true;
this.$refs.Jl3dSimulation.show(this.mapId, this.group);
}
},
showpanel() {
this.panelShow = true;
this.simulationShow = false;
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;
},
// hidepanel() {
// if (this.isDrive) {
// this.panelShow = false;
// this.drivingShow = true;
// this.$refs.Jl3dDrive.show(this.mapId, this.group);
// } else {
// this.panelShow = false;
// this.simulationShow = true;
// this.$refs.Jl3dSimulation.show(this.mapId, this.group);
// }
// },
// showpanel() {
// this.panelShow = true;
// this.simulationShow = false;
// },
// showdriving() {
// this.panelShow = true;
// this.drivingShow = false;
// },
runPlanViewShow() {
this.$refs.runPlanView.doShow();
},
runPlanLoadShow() {
this.$refs.runPlanLoad.doShow();
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.width;
const height = this.size ? this.size.height : this.height;
this.$store.dispatch('config/resize', { width, height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
},
switchStationMode(val) {
if (val == null && this.stationList.length > 0) {
this.showStation = this.stationList[0].value;

View File

@ -4,12 +4,16 @@
:group="group"
:is-show="isShow"
:tree-data="treeData"
:offset-bottom="offsetBottom"
:conversition-id="conversitionId"
:current-member-list="currentMemberList"
:chat-content-list="chatContentList"
:script-tip="scriptTip"
:is-start-record="isStartRecord"
:invite-user-name="inviteUserName"
:is-quit-show="isQuitShow"
@setScriptTip="setScriptTip"
@resetCoversition="resetCoversition"
/>
</template>
<script>
@ -36,6 +40,10 @@ export default {
treeData:{
type: Array,
required: true
},
offsetBottom:{
type: Number,
required: true
}
},
data() {
@ -45,22 +53,31 @@ export default {
conversitionId:'',
currentMemberList:[],
chatContentList:[],
isStartRecord:false
isStartRecord:false,
inviteUserName:'',
createCoversition:false,
inviteUser:{},
isQuitShow:false
};
},
computed:{
isShow() {
return this.userRole != '' && this.userRole != 'ADMIN' && !this.isHasCoversition;
return this.userRole != '' &&
this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' &&
!this.isHasCoversition && this.createCoversition;
}
},
watch:{
//
'$store.state.socket.createConversition':function(val) {
this.scriptTip = '';
if (this.memberData.length > 0) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member && member.userId == this.$store.state.user.id) {
//
this.isHasCoversition = true;
this.isStartRecord = true;
this.isQuitShow = true;
this.conversitionId = val.id;
const memberList = [];
val.memberIds.forEach(id=>{
@ -75,34 +92,45 @@ export default {
});
this.currentMemberList = memberList;
} else {
this.currentMemberList = this.memberData;
//
if (this.userRole == 'AUDIENCE') {
this.isHasCoversition = true;
this.currentMemberList = this.memberData;
}
}
}
//
// if (member.userId == this.$store.state.user.id) {
// const memberList = [];
// val.memberIds.forEach(id=>{
// if (val.creatorId == id) {
// memberList.push({memberId:id, connect:true});
// } else {
// memberList.push({memberId:id, connect:false});
// }
// });
// this.conversitionMemberList = memberList;
// this.privateMemberList = memberList;
// this.commonConversation = false;
// }
// this.conversitionId = val.id;
},
//
'$store.state.socket.acceptConversionInvite':function(val) {
const memberList = this.currentMemberList.map(member => {
if (member.id == val.memberId) {
member.connect = true;
if (this.conversitionId) {
let result = false;
//
const memberList = this.currentMemberList.map(member => {
if (member.id == val.memberId) {
member.connect = true;
result = true;
}
return member;
});
//
if (!result && this.conversitionId) {
const member = this.memberData.find(member=>{ return member.id == val.memberId; });
if (member) {
member.connect = true;
memberList.push(member);
//
if (member.userId == this.$store.state.user.id) {
memberList.push(this.inviteUser);
this.inviteUser = {};
this.isStartRecord = true;
this.isQuitShow = true;
}
}
}
return member;
});
this.currentMemberList = memberList;
this.currentMemberList = memberList;
}
},
//
'$store.state.socket.simulationScriptTip':function(val, old) {
if (val) {
if (val.type == 'Conversation') {
@ -119,6 +147,7 @@ export default {
this.scriptTip = '请结束当前会话';
} else if (val.type == 'Start_Conversation' ) {
const inviteMember = [];
this.createCoversition = true;
val.conversationMemberIds.forEach(id=>{
if (val.memberId != id) {
inviteMember.push((this.memberData.find(member=>{ return member.id == id; }) || {label:''}).label );
@ -128,20 +157,18 @@ export default {
}
}
},
//
'$store.state.socket.conversationInfo':function (val, old) { // 仿
const simulationText = this.$store.state.socket.conversationInfo;
if (this.conversitionId == val.id && val.messageType == 'MESSAGE') {
if (val.messageType == 'MESSAGE' && (this.conversitionId == val.id || this.userRole == 'AUDIENCE')) {
this.chatContentList.push(this.addContent(simulationText.message));
// this.scrollTop();
} else {
if (!simulationText.all && val.messageType == 'MESSAGE') {
this.chatContentList.push(this.addContent(simulationText.message));
}
}
},
//
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
},
// 退
'$store.state.socket.overConversition': function (val) {
if (val.id === this.conversitionId) {
this.conversitionId = '';
@ -151,6 +178,17 @@ export default {
this.isHasCoversition = false;
this.isStartRecord = false;
}
},
//
'$store.state.socket.inviteSimulationConversition':function(val) {
const member = this.memberData.find(member=>{ return member.id == val.creatorId; });
if (member) {
this.inviteUserName = member.label;
this.conversitionId = val.id;
member.connect = true;
this.inviteUser = member;
this.$refs.chatbox.inviteMember();
}
}
},
methods:{
@ -170,6 +208,21 @@ export default {
text.message = simulationText.content;
}
return text;
},
clearAllData() {
this.resetCoversition();
},
resetCoversition() {
this.conversitionId = '';
this.scriptTip = '';
this.isHasCoversition = false;
this.currentMemberList = [];
this.chatContentList = [];
this.isStartRecord = false;
this.inviteUserName = '';
this.createCoversition = false;
this.inviteUser = {};
this.isQuitShow = false;
}
}

View File

@ -83,7 +83,10 @@ export default {
{ label: '第一屏', value: 1 },
{ label: '第二屏', value: 2 },
{ label: '第三屏', value: 3 },
{ label: '第四屏', value: 4 }
{ label: '第四屏', value: 4 },
{ label: '第五屏', value: 5 },
{ label: '第六屏', value: 6 },
{ label: '全部', value: 99 }
],
deviceList: [],
formData: {
@ -136,15 +139,17 @@ export default {
psdCode: data.psdCode
};
});
getAllMapOnline().then(resp => {
if (resp.data && resp.data.length) {
this.mapList = resp.data;
this.mapId = this.mapList[0].id;
this.mapIdChange(this.mapList[0].id);
}
}).catch(() => {
this.$message.error('获取地图列表失败');
});
if (row.type === 'VR_PSD') {
getAllMapOnline().then(resp => {
if (resp.data && resp.data.length) {
this.mapList = resp.data;
this.mapId = this.mapList[0].id;
this.mapIdChange(this.mapList[0].id);
}
}).catch(() => {
this.$message.error('获取地图列表失败');
});
}
},
mapIdChange(mapId) {
this.stationList = [];