Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
e5d4a31dce
@ -336,3 +336,12 @@ export function getSimulationContextListNew(group, conversationId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取仿真会话消息列表(新版地图)
|
||||
export function getSimulationChatMemberNew(group, conversationId) {
|
||||
return request({
|
||||
url: `/simulation/${group}/${conversationId}/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<!-- v-quickMenuDrag -->
|
||||
<div class="chatBox">
|
||||
<div v-show="!minimize" class="chat-box">
|
||||
<chat-member-list ref="chatMemberList" :group="group" @addCoversition="addCoversition" />
|
||||
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
|
||||
<div class="chat-box-main">
|
||||
<chat-coversition-list ref="chatCoversitionList" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
|
||||
<div class="chat-window">
|
||||
@ -11,9 +11,6 @@
|
||||
<div class="minimality" @click="handleMinimality('min')">
|
||||
<i class="el-icon-remove" />
|
||||
</div>
|
||||
<!-- <div v-show="currentCoversition.group==undefined?true:currentCoversition.group" class="showMembers" @click="handleMembers()">
|
||||
<i class="el-icon-user-solid" />
|
||||
</div> -->
|
||||
<div v-show="currentCoversition.all==undefined?true&&isShow:currentCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
|
||||
<i class="el-icon-plus" style="font-weight: bolder;" />
|
||||
</div>
|
||||
@ -96,16 +93,6 @@ export default {
|
||||
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.simulationRoleList': function (val) {
|
||||
if (val && val.length) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.chatMemberList.setMemberStatus(val);
|
||||
this.$refs.chatCoversitionList.setCoversitionStatus(val);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initPage();
|
||||
},
|
||||
@ -244,10 +231,6 @@ export default {
|
||||
handleSetting() {
|
||||
this.$refs.chatSetting.doShow();
|
||||
},
|
||||
// handleMembers() {
|
||||
// this.$refs.chatSetting.doClose();
|
||||
// this.$refs.chatMemberList.doShow();
|
||||
// },
|
||||
handleCreateGroup() {
|
||||
this.$refs.createGroup.doShow();
|
||||
}
|
||||
@ -278,6 +261,10 @@ export default {
|
||||
margin-left: 15px;
|
||||
display: inline-block;
|
||||
margin-top: 10px;
|
||||
width: 70%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.chat-box-content{
|
||||
width: 100%;
|
||||
|
@ -4,17 +4,19 @@
|
||||
<div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass">
|
||||
<div :class="chatContent.self?'rightUser':'leftUser'">
|
||||
<div class="userHeader">
|
||||
<div v-if="chatContent.all&& !chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div>
|
||||
<!-- chatContent.all&& -->
|
||||
<div v-if="!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="userBubble" @click="playAudio(baseUrl+chatContent.src)">
|
||||
<div class="userMessage">
|
||||
<span v-if="chatContent.all&&!chatContent.member.robot">@{{ covertName(chatContent.targetName) }}</span>
|
||||
<!-- chatContent.all&& -->
|
||||
<span v-if="!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>
|
||||
<audio id="audioPlay" style="display:none" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -37,7 +39,6 @@ export default {
|
||||
coversition:{},
|
||||
currentAudioList:[],
|
||||
isPlay:false,
|
||||
currentAudioIndex:0,
|
||||
baseUrl:process.env.VUE_APP_VOICE_API
|
||||
};
|
||||
},
|
||||
@ -51,7 +52,7 @@ export default {
|
||||
if (this.currentCoversition.id == val.id) {
|
||||
this.chatContentList.push(simulationText);
|
||||
if (simulationText.member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push(this.chatContentList.length - 1);
|
||||
this.currentAudioList.push(this.baseUrl + simulationText.src);
|
||||
if (!this.isPlay) {
|
||||
this.isPlay = true;
|
||||
this.playAllAudio();
|
||||
@ -59,12 +60,13 @@ export default {
|
||||
}
|
||||
this.scrollTop();
|
||||
} else {
|
||||
debugger;
|
||||
if (!simulationText.all) {
|
||||
this.$emit('changeCoversition', simulationText);
|
||||
// this.$emit('addCoversition', {data:simulationText, headerTitle:''});
|
||||
this.chatContentList.push(simulationText);
|
||||
if (simulationText.member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push(this.chatContentList.length - 1);
|
||||
this.currentAudioList.push(this.baseUrl + simulationText.src);
|
||||
if (!this.isPlay) {
|
||||
this.isPlay = true;
|
||||
this.playAllAudio();
|
||||
@ -120,7 +122,7 @@ export default {
|
||||
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
|
||||
},
|
||||
playAllAudio() {
|
||||
this.playEachAudio(this.currentAudioList[this.currentAudioIndex]);
|
||||
// this.playEachAudio(this.currentAudioList[this.currentAudioIndex]);
|
||||
},
|
||||
playEachAudio(index) {
|
||||
this.$nextTick(function() {
|
||||
@ -129,8 +131,8 @@ export default {
|
||||
document.querySelector('#audio' + index).onended = function() {
|
||||
that.currentAudioList.shift();
|
||||
if (that.currentAudioList.length > 0) {
|
||||
that.currentAudioIndex++;
|
||||
that.playEachAudio(that.currentAudioList[that.currentAudioIndex]);
|
||||
// that.currentAudioIndex++;
|
||||
// that.playEachAudio(that.currentAudioList[that.currentAudioIndex]);
|
||||
} else {
|
||||
that.isPlay = false;
|
||||
}
|
||||
@ -159,8 +161,9 @@ export default {
|
||||
return 'All';
|
||||
}
|
||||
},
|
||||
playAudio(id) {
|
||||
document.querySelector('#' + id).play();
|
||||
playAudio(audioUrl) {
|
||||
document.querySelector('#audioPlay').src = audioUrl;
|
||||
document.querySelector('#audioPlay').play();
|
||||
}
|
||||
// reloadData(currentCoversition) {
|
||||
// this.chatContentList = [];
|
||||
|
@ -129,11 +129,6 @@ export default {
|
||||
}
|
||||
return {coversitionName:coversitionName, isOnline:isOnline};
|
||||
}
|
||||
},
|
||||
setCoversitionStatus(data) {
|
||||
this.initPage(false);
|
||||
this.$emit('setHeadTitle', !this.currentCoversition.isOnline ? this.currentCoversition.coverName + ' (离线)' : this.currentCoversition.coverName);
|
||||
// this.changeCoversition(this.currentCoversition);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -101,6 +101,11 @@ export default {
|
||||
this.dialogVisible = false;
|
||||
this.checkList = [];
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.$messageBox('创建会话失败: ' + error.messagfe);
|
||||
this.loading = false;
|
||||
this.dialogVisible = false;
|
||||
this.checkList = [];
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -5,14 +5,17 @@
|
||||
<div
|
||||
v-for="member in memberList"
|
||||
:key="member.id"
|
||||
:class="member.online?'each-chat-member':'each-chat-member each-chat-member-outline'"
|
||||
class="each-chat-member"
|
||||
:style="member.userId === userId ?'color:red':''"
|
||||
:title="member.memberName"
|
||||
>{{ member.memberName }}</div>
|
||||
<!-- :class="member.online?'each-chat-member':'each-chat-member each-chat-member-outline'" -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getSimulationMembersNew} from '@/api/chat';
|
||||
// getSimulationMembersNew,
|
||||
import {getSimulationChatMemberNew} from '@/api/chat';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
export default {
|
||||
@ -21,6 +24,10 @@ export default {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
currentCoversition:{
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -34,24 +41,19 @@ export default {
|
||||
return this.$store.state.user.id;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
currentCoversition:function (val, old) {
|
||||
if (val) {
|
||||
this.getSimulationMembers();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getSimulationMembers();
|
||||
},
|
||||
methods:{
|
||||
setMemberStatus(memberInfo) {
|
||||
this.getSimulationMembers();
|
||||
// memberInfo.forEach(member=>{
|
||||
// if (this.coversitionList) {
|
||||
// this.coversitionList.forEach(item=>{
|
||||
// if (item.id == member.id) {
|
||||
// item.online = member.online;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
getSimulationMembers() {
|
||||
getSimulationMembersNew(this.$route.query.group).then(resp => {
|
||||
this.memberList = [];
|
||||
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
|
||||
let lastData = JSON.stringify(resp.data);
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
roleTypeList.forEach(function(element) {
|
||||
|
Loading…
Reference in New Issue
Block a user