This commit is contained in:
fan 2020-08-04 10:42:40 +08:00
commit 9a4591effd

View File

@ -15,14 +15,13 @@
@setScriptTip="setScriptTip"
@resetCoversition="resetCoversition"
/>
<!-- :simulation-users="simulationUsers" -->
</template>
<script>
import ChatBox from '../chatView/chatBox.vue';
import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import Cookies from 'js-cookie';
import { getSimulationMemberList, getAllSimulationUser} from '@/api/simulation';
import { getSimulationMemberList} from '@/api/simulation';
import {getAllConversition} from '@/api/chat';
export default {
name:'DemonChat',
@ -90,7 +89,7 @@ export default {
const lastMemberList = [];
const dispatcherList = [];
// const electricDispatcherList = [];
// const depotDispatcherList = [];
const depotDispatcherList = [];
const stationSupervisorList = [];
this.driverList = [];
const maintainerList = [];
@ -137,6 +136,8 @@ export default {
dispatcherList.push(member);
} else if (member.type == '通号') {
maintainerList.push(member);
} else if (member.type == '车辆段调度') {
depotDispatcherList.push(member);
}
lastMemberList.push(member);
}
@ -162,9 +163,13 @@ export default {
id: 'maintainer',
type: 'role',
children: maintainerList
}, {
label: '车辆段',
id: 'depotDispatcher',
type: 'role',
children: depotDispatcherList
}];
this.memberData = lastMemberList;
this.getSimulationUser();
}).catch(() => {
this.$messageBox('获取仿真成员列表失败!');
});
@ -203,6 +208,7 @@ export default {
},
//
'$store.state.socket.acceptConversionInvite':function(val) {
this.conversitionId = val.id;
if (this.conversitionId) {
let result = false;
//
@ -222,9 +228,14 @@ export default {
//
if (member.userId == this.$store.state.user.id) {
memberList.push(this.inviteUser);
this.inviteUser = {};
this.isStartRecord = true;
this.isQuitShow = true;
if (member.userId != this.inviteUser.userId) {
this.isQuitShow = false;
} else {
this.isQuitShow = true;
}
this.inviteUser = {};
this.isHasCoversition = true;
}
}
}
@ -307,6 +318,7 @@ export default {
this.inviteUserName = member.label;
this.conversitionId = val.id;
member.connect = true;
member.online = true;
this.inviteUser = member;
this.$refs.chatbox.inviteMember();
}
@ -347,18 +359,6 @@ export default {
this.createCoversition = true;
this.inviteUser = {};
this.isQuitShow = false;
},
getSimulationUser() {
getAllSimulationUser(this.$route.query.group).then(resp => {
this.simulationUsers = {};
if (resp.data && resp.data.length) {
resp.data.forEach(user => {
this.simulationUsers[user.userId] = user;
});
}
}).catch(() => {
this.$messageBox('获取所有仿真用户失败!');
});
}
// isAudienceInitData() {
// getAllConversition(this.group).then(resp => {