剧本预览代码调整

This commit is contained in:
joylink_cuiweidong 2020-07-20 10:28:31 +08:00
parent 3673eb1015
commit 39eace3b40
2 changed files with 17 additions and 35 deletions

View File

@ -104,7 +104,6 @@ export default {
panelShow: true,
simulationShow: false,
drivingShow: false,
scriptId:0, // Id
isscriptRun:false, //
showStation: '',
stationList: [],
@ -297,7 +296,6 @@ export default {
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.scriptId = Number(resp.data.scriptId) || 0;
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;
@ -344,6 +342,7 @@ export default {
},
//
async selectQuest(data) {
this.isscriptRun = true;
if (data.roleName) {
const typeList = ConstConfig.ConstSelect.roleTypeNew;
typeList.forEach(type=>{
@ -360,7 +359,7 @@ export default {
quitScriptNew(this.group).then(resp => {
scriptRePreview(this.group).then(resp=>{
getSimulationInfoNew(this.group).then(()=>{
this.scriptId = 0;
this.isscriptRun = false;
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
this.$refs.chatbox.clearAllData();
}).catch(()=>{

View File

@ -43,7 +43,7 @@
</div>
<div v-else class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
<!-- <div class="chat-box-header-title">{{ headerTitle }}</div> -->
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
@ -124,20 +124,17 @@ export default {
minimize:true,
bottom:15,
recordSending:false,
currentCoversition:{},
conversitionId: '',
commonConversation: true,
seconds:0,
inter:null,
recorders: null,
microphone:null,
isHasCoversition:false,
createLoading:false,
form:{
language:'zh',
sex:'1'
},
headerTitle:'',
treeData: [],
defaultProps: {
children: 'children',
@ -157,9 +154,6 @@ export default {
};
},
computed:{
isShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
},
isButtonShow() {
return this.userRole != 'AUDIENCE';
},
@ -212,6 +206,9 @@ export default {
this.conversitionMemberList = memberList;
}
},
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
},
'$store.state.map.activeTrainListChange': function (val) { //
this.activeTrains = [];
const activeTrainList = this.$store.state.map.activeTrainList;
@ -236,7 +233,7 @@ export default {
deep: true
},
'$store.state.socket.overConversition': function (val) {
if (val.id === this.conversitionId) {
if (val.id === this.conversitionId) {
this.conversitionId = '';
this.conversitionMemberList = [];
this.messageList = [];
@ -324,24 +321,6 @@ export default {
setSetting(data) {
this.form = data;
},
setCurrentCoversition(coversition) {
if (coversition && coversition.id) {
this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
this.headerTitle = '';
}
if (this.recordSending) {
this.cancleRecording();
}
this.$refs.chatContent.scrollTop();
},
setHeadTitle(headerTitle) {
this.headerTitle = headerTitle;
},
hideAddCoversition() {
this.isHasCoversition = true;
},
createCoversition() {
this.createLoading = true;
startConversition(this.group, this.memberIdList).then(resp => {
@ -357,12 +336,6 @@ export default {
this.createLoading = false;
});
},
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data);
this.isHasCoversition = true;
this.currentCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle;
},
//
startRecording() {
const that = this;
@ -601,6 +574,16 @@ export default {
},
changeMessageList(data) {
this.messageList.push(data);
},
clearAllData() {
this.recordSending = false;
this.conversitionId = '';
this.inter = null;
this.recorders = null;
this.microphone = null;
this.treeData = [];
this.conversitionMemberList = [];
this.messageList = [];
}
// goCommonConversation() {
// this.commonConversation = true;