@@ -95,6 +95,9 @@ export default {
computed:{
isShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
+ },
+ isButtonShow() {
+ return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
}
},
mounted() {
@@ -118,8 +121,12 @@ export default {
this.$refs.chatCoversitionList.initPage(false);
},
setCurrentCoversition(coversition) {
- this.currentCoversition = coversition;
- this.headerTitle = coversition.name;
+ if (coversition) {
+ this.currentCoversition = coversition;
+ this.headerTitle = coversition.name;
+ } else {
+ this.headerTitle = '';
+ }
if (this.recordSending) {
this.cancleRecording();
}
diff --git a/src/views/newMap/jointTrainingNew/chatView/chatContent.vue b/src/views/newMap/jointTrainingNew/chatView/chatContent.vue
index c524a2950..0186ebc77 100644
--- a/src/views/newMap/jointTrainingNew/chatView/chatContent.vue
+++ b/src/views/newMap/jointTrainingNew/chatView/chatContent.vue
@@ -94,20 +94,22 @@ export default {
},
methods:{
inintData() {
- getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
- const userId = this.$store.state.user.id;
- const coversitionList = res.data.map(coversition=>{
- coversition.self = false;
- if (coversition.member.userId == userId) {
- coversition.self = true;
- }
- coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : '';
- coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
- return coversition;
+ if (this.coversition) {
+ getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
+ const userId = this.$store.state.user.id;
+ const coversitionList = res.data.map(coversition=>{
+ coversition.self = false;
+ if (coversition.member.userId == userId) {
+ coversition.self = true;
+ }
+ coversition.src = coversition.isAudio ? `/audio/${coversition.audioPath}` : '';
+ coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
+ return coversition;
+ });
+ this.chatContentList = coversitionList;
+ this.scrollTop();
});
- 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]));
diff --git a/src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue b/src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue
index a64faae8e..44a67867a 100644
--- a/src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue
+++ b/src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue
@@ -9,7 +9,7 @@
@click="changeCoversition(coversition)"
>
{{ coversition.name }}
-
+
@@ -22,6 +22,10 @@ export default {
group: {
type: String,
required: true
+ },
+ userRole: {
+ type: String,
+ required: true
}
},
data() {
@@ -30,21 +34,40 @@ export default {
currentCoversition:{}
};
},
+ watch:{
+ 'userRole':function(val) {
+ this.initPage(true);
+ }
+ },
mounted() {
- this.initPage(true);
+ // this.initPage(true);
},
methods:{
initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
- this.coversitionList = data;
- if (resp.data.length >= 2) {
- this.$emit('hideAddCoversition');
+ if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
+ this.coversitionList = data;
+ } else {
+ this.coversitionList = data.filter(coversition=>{ return coversition.all == false; });
+ if (this.coversitionList.length >= 1) {
+ this.$emit('hideAddCoversition');
+ }
}
if (resp.data && resp.data.length && resp.data.length > 0 && status) {
- this.currentCoversition = data[0];
- this.$emit('setCurrentCoversition', resp.data[0]);
+ if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
+ this.currentCoversition = data[0];
+ this.$emit('setCurrentCoversition', resp.data[0]);
+ } else {
+ if (this.coversitionList.length >= 1) {
+ this.currentCoversition = data[0];
+ this.$emit('setCurrentCoversition', resp.data[0]);
+ } else {
+ this.currentCoversition = null;
+ this.$emit('setCurrentCoversition', this.currentCoversition);
+ }
+ }
} else if (resp.data && resp.data.length && resp.data.length > 0 && !status) {
const coversition = data.filter(coversition=>{ return coversition.all == false; });
this.currentCoversition = coversition[0];
diff --git a/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue b/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue
index 06a9bb6c1..e33d4e005 100644
--- a/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue
+++ b/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue
@@ -59,27 +59,29 @@ export default {
methods:{
getSimulationMembers() {
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) {
- const rolename = element.value;
- if (Cookies.get('user_lang') == 'en') {
- lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
- } else {
- lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
- }
+ if (this.currentCoversition) {
+ 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) {
+ const rolename = element.value;
+ if (Cookies.get('user_lang') == 'en') {
+ lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
+ } else {
+ lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
+ }
+ });
+ lastData = JSON.parse(lastData);
+ lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
+ lastData.map(member=>{
+ const deviceName = member.deviceName ? '-' + member.deviceName : '';
+ const memberName = member.name ? '-' + member.name : '';
+ member.memberName = member.role + deviceName + memberName;
+ return member;
+ });
+ this.memberList = lastData;
});
- lastData = JSON.parse(lastData);
- lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
- lastData.map(member=>{
- const deviceName = member.deviceName ? '-' + member.deviceName : '';
- const memberName = member.name ? '-' + member.name : '';
- member.memberName = member.role + deviceName + memberName;
- return member;
- });
- this.memberList = lastData;
- });
+ }
}
}
};