剧本编制代码调整

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

View File

@ -11,7 +11,7 @@
<div class="minimality" @click="handleMinimality('min')"> <div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" /> <i class="el-icon-remove" />
</div> </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;" /> <i class="el-icon-plus" style="font-weight: bolder;" />
</div> </div>
<div class="chat-setting" @click="handleSetting()"> <div class="chat-setting" @click="handleSetting()">
@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="chat-box-content"> <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 v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" /> <div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" /> <div class="record_icon" />
@ -31,7 +31,7 @@
<div class="chat-box-footer"> <div class="chat-box-footer">
<div class="chat-box-footer-tool" /> <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="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 v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div> </div>
</div> </div>
@ -83,7 +83,6 @@ export default {
minimize:true, minimize:true,
bottom:15, bottom:15,
recordSending:false, recordSending:false,
currentCoversition:{},
memberListCoversition:{}, memberListCoversition:{},
seconds:0, seconds:0,
inter:null, inter:null,
@ -132,6 +131,9 @@ export default {
const objectBottom = parseInt(object.style.bottom) || 0; const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom; this.bottom = this.bottom + object.offsetHeight + objectBottom;
} }
},
'userRole':function(val) {
this.isHasCoversition = false;
} }
}, },
@ -159,7 +161,7 @@ export default {
}, },
setCurrentCoversition(coversition) { setCurrentCoversition(coversition) {
if (coversition && coversition.id) { if (coversition && coversition.id) {
this.currentCoversition = coversition; // this.currentCoversition = coversition;
this.headerTitle = coversition.name; this.headerTitle = coversition.name;
} else { } else {
this.headerTitle = ''; this.headerTitle = '';
@ -175,9 +177,9 @@ export default {
}, },
quitCoversition() { quitCoversition() {
this.quitLoading = true; this.quitLoading = true;
quitCoversition(this.group, this.currentCoversition.id).then(res=>{ quitCoversition(this.group, this.memberListCoversition.id).then(res=>{
this.quitLoading = false; this.quitLoading = false;
this.currentCoversition = {all:undefined, id:null}; this.memberListCoversition = {all:undefined, id:null};
this.$refs.chatCoversitionList.initPage(true); this.$refs.chatCoversitionList.initPage(true);
this.isHasCoversition = false; this.isHasCoversition = false;
}).catch(error=>{ }).catch(error=>{
@ -191,7 +193,7 @@ export default {
addCoversition({data, headerTitle}) { addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data, headerTitle); this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
this.isHasCoversition = true; 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.memberListCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle; this.headerTitle = headerTitle;
}, },
@ -290,7 +292,7 @@ export default {
const blob = that.recorders.getBlob(); const blob = that.recorders.getBlob();
const fd = new FormData(); const fd = new FormData();
fd.append('file', blob); 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) => { .then((data) => {
}) })
.catch(error => { .catch(error => {

View File

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

View File

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

View File

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

View File

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

View File

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