From 6f0cc20a42d7f0dca2bdf59f037a57e1c4aef5b0 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 5 Jun 2020 14:12:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=89=A7=E6=9C=AC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AF=B9=E8=AF=9D=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/simulation.js | 10 ++++ .../scriptManage/scriptRecord/addAction.vue | 49 +++++++++++++------ .../scriptManage/scriptRecord/getAction.vue | 10 ++-- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/api/simulation.js b/src/api/simulation.js index 43ecc026c..be1d41e60 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -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' }); } + diff --git a/src/views/scriptManage/scriptRecord/addAction.vue b/src/views/scriptManage/scriptRecord/addAction.vue index 66bb76afc..46d315955 100644 --- a/src/views/scriptManage/scriptRecord/addAction.vue +++ b/src/views/scriptManage/scriptRecord/addAction.vue @@ -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,20 +451,39 @@ export default { } else { const actionId = this.modalData.actionVO.id; - modifyScriptAction(group, actionId, 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}`); - }); + 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; + 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 { console.log('error submit!!'); diff --git a/src/views/scriptManage/scriptRecord/getAction.vue b/src/views/scriptManage/scriptRecord/getAction.vue index 3de960ade..0d78946cd 100644 --- a/src/views/scriptManage/scriptRecord/getAction.vue +++ b/src/views/scriptManage/scriptRecord/getAction.vue @@ -20,7 +20,7 @@