剧本编制代码调整

This commit is contained in:
joylink_cuiweidong 2020-06-22 18:37:09 +08:00
parent d3d17f7bf6
commit d789a30333
7 changed files with 38 additions and 12 deletions

View File

@ -9,7 +9,9 @@ const scriptRecord = {
scriptId: '',
bgSet: false,
isScriptCommand:false, // 当前是否为添加剧本动作指令状态
scriptCommand:{} // 剧本动作添加的指令
scriptCommand:{}, // 剧本动作添加的指令
updateRoleStatus:0, // 剧本更新角色标志
userRole:null // 剧本更新的角色
},
getters: {
mapLocation: (state)=>{
@ -29,6 +31,9 @@ const scriptRecord = {
},
scriptCommand:(state)=>{
return state.scriptCommand;
},
updateRoleStatus:(state)=>{
return state.updateRoleStatus;
}
},
mutations: {
@ -49,6 +54,10 @@ const scriptRecord = {
},
setScriptCommand:(state, scriptCommand) => {
state.scriptCommand = scriptCommand;
},
updateRole:(state, userRole) => {
state.updateRoleStatus += 1;
state.userRole = userRole;
}
},
actions: {
@ -72,6 +81,9 @@ const scriptRecord = {
},
updateScriptCommand:({ commit }, scriptCommand) => {
commit('setScriptCommand', scriptCommand);
},
updateRole:({ commit }, userRole) => {
commit('updateRole', userRole);
}
}
};

View File

@ -11,7 +11,7 @@
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
<div v-show="currentCoversition.all==undefined?true&&isShow:currentCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
<div v-show="memberListCoversition.all==undefined?true&&isShow:memberListCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
<i class="el-icon-plus" style="font-weight: bolder;" />
</div>
<div class="chat-setting" @click="handleSetting()">
@ -19,7 +19,7 @@
</div>
</div>
<div class="chat-box-content">
<chat-content ref="chatContent" :current-coversition="currentCoversition" @changeCoversition="changeCoversition" />
<chat-content ref="chatContent" :current-coversition="memberListCoversition" @changeCoversition="changeCoversition" />
<div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" />
@ -31,7 +31,7 @@
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<el-button v-if="isButtonShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitCoversition()">退出群聊</el-button>
<el-button v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<el-button v-if="memberListCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
</div>
@ -83,7 +83,6 @@ export default {
minimize:true,
bottom:15,
recordSending:false,
currentCoversition:{},
memberListCoversition:{},
seconds:0,
inter:null,
@ -132,6 +131,9 @@ export default {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
},
'userRole':function(val) {
this.isHasCoversition = false;
}
},
@ -159,7 +161,7 @@ export default {
},
setCurrentCoversition(coversition) {
if (coversition && coversition.id) {
this.currentCoversition = coversition;
// this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
this.headerTitle = '';
@ -175,9 +177,9 @@ export default {
},
quitCoversition() {
this.quitLoading = true;
quitCoversition(this.group, this.currentCoversition.id).then(res=>{
quitCoversition(this.group, this.memberListCoversition.id).then(res=>{
this.quitLoading = false;
this.currentCoversition = {all:undefined, id:null};
this.memberListCoversition = {all:undefined, id:null};
this.$refs.chatCoversitionList.initPage(true);
this.isHasCoversition = false;
}).catch(error=>{
@ -191,7 +193,7 @@ export default {
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
this.isHasCoversition = true;
this.currentCoversition = {id:data.id, all:data.all};
// this.currentCoversition = {id:data.id, all:data.all};
this.memberListCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle;
},
@ -290,7 +292,7 @@ export default {
const blob = that.recorders.getBlob();
const fd = new FormData();
fd.append('file', blob);
uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.currentCoversition.id, fd)
uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.memberListCoversition.id, fd)
.then((data) => {
})
.catch(error => {

View File

@ -31,6 +31,9 @@ export default {
'userRole':function(val) {
this.initPage(true);
}
// '$store.state.scriptRecord.updateRoleStatus':function(val) {
// this.initPage(true);
// }
},
mounted() {
},

View File

@ -49,6 +49,9 @@ export default {
if (val) {
this.getSimulationMembers();
}
},
'$store.state.scriptRecord.updateRoleStatus':function(val) {
this.getSimulationMembers();
}
},
mounted() {

View File

@ -88,7 +88,7 @@ export default {
} else if (this.$store.state.training.prdType == null) {
return '';
} else {
return 'AUDIENCE';
return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'AUDIENCE';
}
}
},

View File

@ -98,6 +98,7 @@ export default {
beforeDestroy() {
this.clearAutoSave();
this.$store.dispatch('scriptRecord/updateBgSet', false);
this.$store.dispatch('scriptRecord/updateRole', null);
},
mounted() {
this.initData();
@ -149,6 +150,11 @@ export default {
}
}
this.$store.dispatch('training/setPrdType', prdType);
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{
if (each.label == memberInfo.role) {
this.$store.dispatch('scriptRecord/updateRole', each.value);
}
});
}).catch(()=>{
this.$messageBox('切换角色失败');
});

View File

@ -10,6 +10,7 @@
<span class="roleClass">{{ actionInfo.memberName }}</span>
<span>邀请</span>
<span class="roleClass">{{ actionInfo.targetName }}</span>
<span>开始会话</span>
</span>
<span v-else-if="actionInfo.isDrive">
<span class="roleClass">{{ actionInfo.memberName }}</span>
@ -110,7 +111,6 @@ export default {
return lastData;
},
covertData(memberVOList, element) {
debugger;
const member = memberVOList.find(elem=>{ return elem.id == element.memberId; });
const memberName = member.name;
switch (element.type) {