剧本编制修改会话代码调整

This commit is contained in:
joylink_cuiweidong 2020-06-23 14:17:35 +08:00
parent 2462ba7413
commit df475ab28a

View File

@ -22,8 +22,8 @@
<!-- <span>{{ $t('scriptRecord.speakTo') }}</span> --> <!-- <span>{{ $t('scriptRecord.speakTo') }}</span> -->
<!-- <span class="roleClass">{{ actionInfo.targetName }}</span> --> <!-- <span class="roleClass">{{ actionInfo.targetName }}</span> -->
<span>: </span> <span>: </span>
<span v-if="!isModify">{{ actionInfo.reply }}</span> <span v-if="!actionInfo.isModify">{{ actionInfo.reply }}</span>
<textarea v-else v-model="modifyText" type="text" class="modifyText" /> <textarea v-else v-model="actionInfo.modifyText" type="text" class="modifyText" />
</span> </span>
<span v-else> <span v-else>
<span class="roleClass">{{ actionInfo.memberName }}</span> <span class="roleClass">{{ actionInfo.memberName }}</span>
@ -32,9 +32,9 @@
</span> </span>
</div> </div>
<div class="btnGroup"> <div class="btnGroup">
<el-button v-if="actionInfo.visible && !isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button> <el-button v-if="actionInfo.visible && !actionInfo.isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible && isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo.row)">确定</el-button> <el-button v-if="actionInfo.visible && actionInfo.isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo)">确定</el-button>
<el-button v-if="actionInfo.visible && isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify">取消</el-button> <el-button v-if="actionInfo.visible && actionInfo.isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify(actionInfo)">取消</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> --> <!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div> </div>
</el-card> </el-card>
@ -67,8 +67,8 @@ export default {
memberVOList:[], memberVOList:[],
reverse: false, reverse: false,
loading: true, loading: true,
isModify:false, // isModify:false,
modifyText:'', // modifyText:'',
modifyTextLoading:false, modifyTextLoading:false,
// behaviorName:"", // behaviorName:"",
memberName: '' memberName: ''
@ -138,7 +138,7 @@ export default {
} }
case 'Conversation': case 'Conversation':
{ {
this.actionInfoList.push({id: element.id, isCoversition: true, memberName: memberName, reply: element.content, row: element, visible: true}); this.actionInfoList.push({id: element.id, isCoversition: true, memberName: memberName, reply: element.content, row: element, visible: true, isModify:false, modifyText:''});
break; break;
} }
case 'Command': case 'Command':
@ -187,33 +187,34 @@ export default {
reloadTable() { reloadTable() {
this.loadInitData(); this.loadInitData();
}, },
modifyAction(row) { modifyAction(actionInfo) {
this.modifyText = row.content; actionInfo.modifyText = actionInfo.row.content;
this.isModify = true; actionInfo.isModify = true;
}, },
cancleModify() { cancleModify(actionInfo) {
this.modifyText = ''; actionInfo.modifyText = '';
this.isModify = false; actionInfo.isModify = false;
this.modifyTextLoading = false; this.modifyTextLoading = false;
}, },
confirmModify(row) { confirmModify(actionInfo) {
if (this.modifyText != row.content) { const row = actionInfo.row;
if (actionInfo.modifyText != row.content) {
const data = {id:row.id}; const data = {id:row.id};
data.content = this.modifyText; data.content = actionInfo.modifyText;
this.modifyTextLoading = true; this.modifyTextLoading = true;
modifyScriptActionNew(this.group, data).then(response=>{ modifyScriptActionNew(this.group, data).then(response=>{
this.modifyText = ''; actionInfo.modifyText = '';
this.isModify = false; actionInfo.isModify = false;
this.modifyTextLoading = false; this.modifyTextLoading = false;
this.reloadTable(); this.reloadTable();
this.$store.dispatch('scriptRecord/updateCoversitionInfo'); this.$store.dispatch('scriptRecord/updateCoversitionInfo');
}); });
} else { } else {
if (!this.modifyText) { if (!actionInfo.modifyText) {
this.$messageBox('请输入修改的会话'); this.$messageBox('请输入修改的会话');
} else { } else {
this.modifyText = ''; actionInfo.modifyText = '';
this.isModify = false; actionInfo.isModify = false;
} }
} }
} }