新版剧本修改对话代码调整

This commit is contained in:
joylink_cuiweidong 2020-06-05 14:12:22 +08:00
parent 767e5cc48a
commit 6f0cc20a42
3 changed files with 48 additions and 21 deletions

View File

@ -385,6 +385,15 @@ export function modifyScriptAction(group, actionId, data) {
});
}
/** 修改剧本动作(新版) */
export function modifyScriptActionNew(group, data) {
return request({
url: `/api/scriptSimulation/${group}/action/update`,
method: 'put',
data
});
}
/** 分页查询存在的仿真 */
export function getExistingSimulation(params) {
return request({
@ -709,3 +718,4 @@ export function getMemberInfo(group, memberId) {
method: 'get'
});
}

View File

@ -75,7 +75,7 @@ import Vue from 'vue';
import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig';
import CommandOperation from './command';
import {addScriptAction, addScriptActionNew, modifyScriptAction, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation';
import {addScriptAction, addScriptActionNew, modifyScriptAction, modifyScriptActionNew, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation';
export default {
name: 'AddAction',
components:{
@ -451,6 +451,23 @@ export default {
} else {
const actionId = this.modalData.actionVO.id;
if (this.drawWay) {
data.id = actionId;
modifyScriptActionNew(group, data).then(response=>{
this.modifying = false;
this.isNotModify = true;
this.$emit('setDisabled', this.isNotModify);
this.buttonName = this.$t('scriptRecord.addConversitionButton');
this.operateType = 'add';
this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess'));
this.$emit('create');
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]);
this.initActionData();
}).catch(error => {
this.modifying = false;
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
});
} else {
modifyScriptAction(group, actionId, data).then(response=>{
this.modifying = false;
this.isNotModify = true;
@ -466,6 +483,8 @@ export default {
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
});
}
}
} else {
console.log('error submit!!');
return false;

View File

@ -20,7 +20,7 @@
</span>
</div>
<div class="btnGroup">
<el-button v-if="actionInfo.visible && !drawWay" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div>
</el-card>
@ -158,8 +158,8 @@ export default {
// memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
// });
// memberVOList = JSON.parse(memberVOList);
const lastData = JSON.stringify(response.data);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
const lastData = JSON.stringify(response.data.memberVOList);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
const actionList = response.data.actionVOList;
@ -218,11 +218,9 @@ export default {
this.loadInitData();
},
modifyAction(row) {
if (!this.drawWay) {
this.$emit('setAction', row);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>