录制剧本模块修改
This commit is contained in:
parent
2e53745790
commit
f722a0bc27
@ -44,14 +44,6 @@ export function updateQuest(id, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 更新任务地图定位信息 */
|
||||
export function updateMapLocation(id, data) {
|
||||
return request({
|
||||
url: `/api/quest/${id}/mapLocation`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查找上线的仿真任务*/
|
||||
export function getQuestPageListOnline(params) {
|
||||
|
@ -179,16 +179,33 @@ export function scriptRecordNotify(scriptId) {
|
||||
/** 保存剧本背景*/
|
||||
export function saveScriptScenes(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/scenes`,
|
||||
method: 'post'
|
||||
url: `/api/simulation/${group}/scriptWrite/scenes`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存录制任务数据*/
|
||||
export function saveScriptData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord`,
|
||||
method: 'post'
|
||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新任务地图定位信息*/
|
||||
export function updateMapLocation(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/mapLocation`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取剧本编制的所有成员角色*/
|
||||
export function getScriptMemberData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
@ -216,85 +233,110 @@ export function getDesignatedTimeTrainNum(params, group) {
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 根据成员角色查询设备列表*/
|
||||
export function getDevicesByRole(group, params) {
|
||||
/** 添加剧本动作 */
|
||||
export function addScriptAction(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/role/devices`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 获取任务录制的成员角色列表 */
|
||||
export function getMembersByGroup(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加任务角色成员 */
|
||||
export function postQuestMember(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/member`,
|
||||
url: `/api/simulation/${group}/scriptWrite/action`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除任务角色成员 */
|
||||
export function deleteQuestMember(group, memberId) {
|
||||
/** 删除剧本动作 */
|
||||
export function deleteScriptAction(group, actionId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/member/${memberId}`,
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// /** 添加/修改任务角色行为 */
|
||||
export function postMemberBehavior(group, memberId, data) {
|
||||
/** 修改剧本动作 */
|
||||
export function modifyScriptAction(group, actionId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
|
||||
method: 'post',
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 删除任务角色行为 */
|
||||
export function deleteMemberBehavior(group, memberId, behaviorId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 删除任务角色行为动作 */
|
||||
export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 添加/修改任务角色行为动作 */
|
||||
export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 添加/修改任务目标条件*/
|
||||
export function postTargetConditionAction(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/targetCondition`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 删除任务目标条件*/
|
||||
export function deleteTargetConditionAction(group, tcId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// /** 根据成员角色查询设备列表*/
|
||||
// export function getDevicesByRole(group, params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/role/devices`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
// /** 获取任务录制的成员角色列表 */
|
||||
// export function getMembersByGroup(group) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/members`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 添加任务角色成员 */
|
||||
// export function postQuestMember(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 删除任务角色成员 */
|
||||
// export function deleteQuestMember(group, memberId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member/${memberId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
// // /** 添加/修改任务角色行为 */
|
||||
// export function postMemberBehavior(group, memberId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为 */
|
||||
// export function deleteMemberBehavior(group, memberId, behaviorId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为动作 */
|
||||
// export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务角色行为动作 */
|
||||
// export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务目标条件*/
|
||||
// export function postTargetConditionAction(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务目标条件*/
|
||||
// export function deleteTargetConditionAction(group, tcId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 分页查询存在的仿真 */
|
||||
export function getExistingSimulation(params) {
|
||||
@ -320,18 +362,19 @@ export function getDeviceCodeByDeviceType(group, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 根据设备类型获取设备条件列表 */
|
||||
export function getDeviceCoditionByDeviceType(params) {
|
||||
// /** 根据设备类型获取设备条件列表 */
|
||||
// export function getDeviceCoditionByDeviceType(params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/deviceType/conditions`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 获取任务录制的数据 */
|
||||
export function getScriptRecord(group) {
|
||||
return request({
|
||||
url: `/api/simulation/deviceType/conditions`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 获取任务录制的数据*/
|
||||
export function getQuestRecord(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord`,
|
||||
url: `/api/simulation/${group}/scriptWrite`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -1,19 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="80px" class="actionInfo" label-position="right">
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="action.type">
|
||||
<el-select v-model="modalData.action.type " placeholder="请选择动作类型" @change="changeType" class="inputStyle">
|
||||
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
|
||||
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="actionInfo" label-position="right">
|
||||
<el-form-item label="主体角色" class="conditionVO" prop="actionVO.memberId">
|
||||
<el-select v-model="modalData.actionVO.memberId" placeholder="请选择主体角色">
|
||||
<el-option v-for="member in memberList" :key="member.id" :label="member.name" :value="member.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成时间" class="conditionVO">
|
||||
<el-input-number v-model="modalData.action.time " class="inputStyle" :min="0"></el-input-number>
|
||||
<el-input-number v-model="modalData.actionVO.time " class="inputStyle" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="回复消息" class="conditionVO" prop="action.reply" v-if="isConversitionAdd">
|
||||
<el-input v-model="modalData.action.reply" type="textarea" class="textareaStyle" rows="3"></el-input>
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="actionVO.type">
|
||||
<el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType">
|
||||
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备指令" class="conditionVO" prop="action.deviceCommand" v-if="isCommandAdd">
|
||||
<el-select v-model="modalData.action.deviceCommand " placeholder="请选择设备指令" @change="changeCommand" class="inputStyle">
|
||||
<el-form-item label="目标角色" class="conditionVO" prop="actionVO.targetId" v-if="isConversitionAdd">
|
||||
<el-select v-model="modalData.actionVO.targetId" placeholder="请选择目标角色">
|
||||
<el-option v-for="member in memberList" :key="member.id" :label="member.name" :value="member.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="回复消息" class="conditionVO" prop="actionVO.reply" v-if="isConversitionAdd">
|
||||
<el-input v-model="modalData.actionVO.reply" type="textarea" class="textareaStyle" rows="3"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备指令" class="conditionVO" prop="actionVO.type" v-if="isCommandAdd">
|
||||
<el-select v-model="modalData.actionVO.deviceCommand " placeholder="请选择设备指令" @change="changeCommand" class="inputStyle">
|
||||
<el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -27,10 +37,8 @@
|
||||
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <command-Form :commandParam="form" :commandParamModal="formModel" :rules="commandRules"></command-Form> -->
|
||||
<!-- <div id="commandParam"></div> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addQuestAction('modalData')">{{buttonName}}</el-button>
|
||||
<el-button type="primary" @click="addScriptActionInfo('modalData')">{{buttonName}}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -39,7 +47,7 @@
|
||||
import Vue from 'vue';
|
||||
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
||||
// import CommandForm from "./commandForm";
|
||||
import {postMemberBehaviorAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType} from '@/api/simulation';
|
||||
import {addScriptAction,modifyScriptAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType,getScriptMemberData} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'addAction',
|
||||
props: {
|
||||
@ -47,14 +55,6 @@
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
memberId:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
behaviorId:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
buttonName:{
|
||||
type:String,
|
||||
required: true
|
||||
@ -70,33 +70,37 @@
|
||||
data() {
|
||||
return {
|
||||
modalData:{
|
||||
action:{
|
||||
reply:"",
|
||||
actionVO:{
|
||||
memberId:"",
|
||||
targetId:"",
|
||||
time:0,
|
||||
reply:"",
|
||||
type:"Conversation",
|
||||
deviceCommand:null,
|
||||
// deviceCommand:"",
|
||||
commandParamList:[]
|
||||
},
|
||||
param:{
|
||||
startStation:"",
|
||||
endStation:"",
|
||||
},
|
||||
}
|
||||
},
|
||||
actionTypeList:DeviceTypeDic.ConstSelect.actionType,
|
||||
isConversitionAdd:true,
|
||||
isCommandAdd:false,
|
||||
deviceCommandList:[],
|
||||
actionTypeList:DeviceTypeDic.ConstSelect.actionType,
|
||||
isJinLu:false,
|
||||
stationList:[],
|
||||
memberList:[],
|
||||
deviceCommandList:[],
|
||||
rules:{
|
||||
action:{
|
||||
reply: [
|
||||
{ required: true, message: '请输入回复消息', trigger: 'blur' }
|
||||
actionVO:{
|
||||
memberId:[
|
||||
{ required: true, message: '请选择主体角色', trigger: 'change' }
|
||||
],
|
||||
type:[
|
||||
{ required: true, message: '请选择角色类型', trigger: 'change' }
|
||||
reply:[
|
||||
{ required: true, message: '请输入回复消息', trigger: 'blur' }
|
||||
],
|
||||
deviceCommand:[
|
||||
{ required: true, message: '请选择设备指令', trigger: 'change' }
|
||||
targetId:[
|
||||
{ required: true, message: '请选择目标角色', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
param:{
|
||||
@ -107,61 +111,66 @@
|
||||
{ required: true, message: '请选择终点站台', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
},
|
||||
commandRules:{},
|
||||
formModel:{},
|
||||
form:{},
|
||||
isJinLu:false,
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.initData();
|
||||
},
|
||||
methods:{
|
||||
addQuestAction(formName){
|
||||
initData(){
|
||||
getScriptMemberData(this.group).then(resp => {
|
||||
this.memberList=resp.data;
|
||||
getAvailableDeviceCommand().then(response=>{
|
||||
this.deviceCommandList=response.data;
|
||||
this.getDeviceCode();
|
||||
});
|
||||
}).catch(error => {})
|
||||
},
|
||||
getDeviceCode(){
|
||||
let params = {deviceType:"StationStand"};
|
||||
let group=this.group;
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
// debugger;
|
||||
let resultData=response.data;
|
||||
resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));
|
||||
this.stationList=resultData;
|
||||
})
|
||||
},
|
||||
addScriptActionInfo(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behaviorId=this.$props.behaviorId;
|
||||
if(this.modalData.action.deviceCommand==null){
|
||||
delete this.modalData.action.deviceCommand;
|
||||
let group=this.group;
|
||||
if(this.modalData.actionVO.deviceCommand==""){
|
||||
delete this.modalData.actionVO.deviceCommand;
|
||||
}
|
||||
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{this.modalData.action.commandParamList=[this.modalData.param.startStation,this.modalData.param.endStation];}
|
||||
let data=this.modalData.action;
|
||||
if(this.modalData.actionVO.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{this.modalData.actionVO.commandParamList=[this.modalData.param.startStation,this.modalData.param.endStation];}
|
||||
let data=this.modalData.actionVO;
|
||||
let obj=this;
|
||||
postMemberBehaviorAction(group,memberId,behaviorId,data).then(response=>{
|
||||
delete this.modalData.action.id;
|
||||
obj.modalData.action.type="Conversation";
|
||||
obj.modalData.action.time=0;
|
||||
obj.modalData.action.reply="";
|
||||
obj.modalData.param.startStation="";
|
||||
obj.isConversitionAdd=true;
|
||||
obj.isCommandAdd=false;
|
||||
obj.isJinLu=false;
|
||||
obj.modalData.action.deviceCommand=null;
|
||||
this.modalData.param.endStation="";
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
this.$message.success('添加动作成功');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$emit('modifyButtonName');
|
||||
this.$message.success('修改动作成功');
|
||||
}
|
||||
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
addScriptAction(group,data).then(response=>{
|
||||
this.initActionData();
|
||||
this.$message.success('添加动作成功');
|
||||
this.$emit('create');
|
||||
}).catch(error => {
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
this.$messageBox(`添加动作失败: ${error.message}`);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$messageBox(`修改动作失败: ${error.message}`);
|
||||
}
|
||||
this.$messageBox(`添加动作失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
let actionId=this.modalData.actionVO.id;
|
||||
modifyScriptAction(group,actionId,data).then(response=>{
|
||||
this.initActionData();
|
||||
this.$emit('modifyButtonName');
|
||||
this.$message.success('修改动作成功');
|
||||
this.$emit('create');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`修改动作失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('error submit!!');
|
||||
@ -169,44 +178,18 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
initData(){
|
||||
getAvailableDeviceCommand().then(response=>{
|
||||
this.deviceCommandList=response.data;
|
||||
});
|
||||
let params = {deviceType:"StationStand"};
|
||||
let group=this.$props.group;
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
let resultData=response.data;
|
||||
resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));
|
||||
this.stationList=resultData;
|
||||
})
|
||||
},
|
||||
changeCommand(index){
|
||||
switch(index)
|
||||
{
|
||||
case "Train_Manual_Route_Blocking_Drive":{
|
||||
this.isJinLu=true;
|
||||
this.initData();
|
||||
// this.form={
|
||||
// labelWidth:'100px',
|
||||
// items: [
|
||||
// { prop: 'startStation', label: '起始车站', type: 'select', required: false, change: true },
|
||||
// ]
|
||||
// };
|
||||
// this.formModel={
|
||||
// startStation:"",
|
||||
// };
|
||||
// const cfConstructor = Vue.component(CommandForm);
|
||||
// const instance = new cfConstructor({}).$mount('#commandParam');
|
||||
// instance.$mount('#commandParam');
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
this.isJinLu=false;
|
||||
this.initData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
initActionData(){
|
||||
this.modalData.actionVO.memberId="";
|
||||
this.modalData.actionVO.targetId="";
|
||||
this.modalData.actionVO.type="Conversation";
|
||||
this.modalData.actionVO.time=0;
|
||||
this.modalData.actionVO.reply="";
|
||||
this.modalData.param.startStation="";
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.isJinLu=false;
|
||||
this.modalData.actionVO.deviceCommand=null;
|
||||
this.modalData.param.endStation="";
|
||||
},
|
||||
changeType(index){
|
||||
switch(index)
|
||||
@ -214,11 +197,21 @@
|
||||
case "Conversation":{
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.isJinLu=false;
|
||||
break;
|
||||
}
|
||||
case "Command":{
|
||||
this.isConversitionAdd=false;
|
||||
this.isCommandAdd=true;
|
||||
//
|
||||
if(this.modalData.actionVO.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{
|
||||
this.isJinLu=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.isJinLu=false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
@ -226,32 +219,49 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
changeCommand(index){
|
||||
switch(index)
|
||||
{
|
||||
case "Train_Manual_Route_Blocking_Drive":{
|
||||
this.isJinLu=true;
|
||||
this.getDeviceCode();
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
this.isJinLu=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
doShow(data){
|
||||
if(data)
|
||||
{
|
||||
this.initData();
|
||||
this.modalData.action.id=data.id;
|
||||
this.modalData.action.type=data.type;
|
||||
this.modalData.action.time=data.time;
|
||||
if(data.type=="Conversation")
|
||||
{
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.modalData.action.reply=data.reply;
|
||||
}
|
||||
else if(data.type=="Command")
|
||||
{
|
||||
this.isConversitionAdd=false;
|
||||
this.isCommandAdd=true;
|
||||
this.modalData.action.reply="";
|
||||
this.modalData.action.deviceCommand=data.deviceCommand;
|
||||
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
// debugger;
|
||||
this.initData();
|
||||
this.modalData.actionVO.id=data.id;
|
||||
this.modalData.actionVO.memberId=data.memberId;
|
||||
this.modalData.actionVO.type=data.type;
|
||||
this.modalData.actionVO.time=data.time;
|
||||
if(data.type=="Conversation")
|
||||
{
|
||||
this.isJinLu=true;
|
||||
this.modalData.param.startStation=data.commandParamList[0];
|
||||
this.modalData.param.endStation=data.commandParamList[1];
|
||||
this.modalData.actionVO.targetId=data.targetId;
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.modalData.actionVO.reply=data.reply;
|
||||
}
|
||||
else if(data.type=="Command")
|
||||
{
|
||||
this.isConversitionAdd=false;
|
||||
this.isCommandAdd=true;
|
||||
this.modalData.actionVO.reply="";
|
||||
this.modalData.actionVO.deviceCommand=data.deviceCommand;
|
||||
if(this.modalData.actionVO.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{
|
||||
this.isJinLu=true;
|
||||
this.modalData.param.startStation=data.commandParamList[0];
|
||||
this.modalData.param.endStation=data.commandParamList[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="actionList">
|
||||
<i class="el-icon-back" @click="backToMember"></i>
|
||||
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
|
||||
<span class="titleStyle">添加剧本动作</span>
|
||||
</div>
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
|
||||
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
|
||||
<add-action ref="addBehavior" :group="group" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="actionList" border class="actionListTable">
|
||||
@ -32,7 +31,7 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import AddAction from './addAction';
|
||||
import {getQuestRecord,deleteMemberBehaviorAction} from '@/api/simulation';
|
||||
import {getScriptRecord,deleteScriptAction} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'getAction',
|
||||
props: {
|
||||
@ -40,14 +39,6 @@
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
memberId:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
behaviorId:{
|
||||
type:String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -64,29 +55,25 @@
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData(this.$route.query);
|
||||
this.memberName=this.$store.state.scriptRecord.memberName;
|
||||
this.behaviorName=this.$store.state.scriptRecord.behaviorName;
|
||||
// this.memberName=this.$store.state.scriptRecord.memberName;
|
||||
// this.behaviorName=this.$store.state.scriptRecord.behaviorName;
|
||||
},
|
||||
methods:{
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behaviorId=this.$props.behaviorId;
|
||||
getQuestRecord(group).then(response=>{
|
||||
let datalist=response.data.memberVOList;
|
||||
let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
|
||||
this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList;
|
||||
getScriptRecord(group).then(response=>{
|
||||
this.actionList=response.data.actionVOList;
|
||||
if(response.data.mapLocation)
|
||||
{
|
||||
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
|
||||
this.$store.dispatch('scriptRecord/updateMapLocation', mapLocation);
|
||||
}
|
||||
this.loading=false;
|
||||
});
|
||||
},
|
||||
backToMember:function(){
|
||||
this.$emit('backToBehavior');
|
||||
},
|
||||
deleteAction(row){
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behaviorId=this.$props.behaviorId;
|
||||
deleteMemberBehaviorAction(group,memberId,behaviorId,row.id).then(resp => {
|
||||
deleteScriptAction(group,row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success('删除行为动作成功');
|
||||
}).catch(error => {
|
||||
|
@ -10,21 +10,15 @@
|
||||
</div>
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body">
|
||||
<template v-if="displayType=='role'">
|
||||
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
|
||||
</template>
|
||||
<template v-if="displayType=='behavior'">
|
||||
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions"></get-behavior>
|
||||
</template>
|
||||
<template v-if="displayType=='action'">
|
||||
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action>
|
||||
</template>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
|
||||
<el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button>
|
||||
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
|
||||
</el-button-group>
|
||||
<div>
|
||||
<get-action ref="getAction" :group="group"></get-action>
|
||||
</div>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
|
||||
<el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button>
|
||||
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -32,13 +26,9 @@
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import GetBehavior from './scriptRecord/getBehavior';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import RoleConditionScript from './scriptRecord/roleConditionScript';
|
||||
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
|
||||
import {updateMapLocation} from '@/api/quest';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData,updateMapLocation} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
@ -49,17 +39,13 @@
|
||||
},
|
||||
},
|
||||
components: {
|
||||
GetBehavior,
|
||||
GetAction,
|
||||
RoleConditionScript,
|
||||
},
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
title: this.$t('scriptRecord.scriptTitle'),
|
||||
title:"剧本编制",
|
||||
isShrink: false,
|
||||
memberId:null,
|
||||
behaviorId:null,
|
||||
displayType:"role",
|
||||
mapLocation:{},
|
||||
// isSaveStage: true,
|
||||
}
|
||||
@ -90,17 +76,11 @@
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
backToMember(){
|
||||
this.displayType="role";
|
||||
},
|
||||
backToBehavior(){
|
||||
this.displayType="behavior";
|
||||
},
|
||||
getActions(row){
|
||||
this.displayType="action";
|
||||
this.behaviorId=row.id;
|
||||
this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
},
|
||||
// getActions(row){
|
||||
// this.displayType="action";
|
||||
// this.behaviorId=row.id;
|
||||
// this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
// },
|
||||
saveScenesStage() {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
@ -130,16 +110,12 @@
|
||||
})
|
||||
}).catch(error => { })
|
||||
},
|
||||
getBehaviorList(id){
|
||||
this.displayType="behavior";
|
||||
this.memberId=id;
|
||||
},
|
||||
saveMaplocation()
|
||||
{
|
||||
let data=Vue.prototype.$jlmap.$options;
|
||||
let scriptId=this.$route.query.scriptId;
|
||||
let group=this.$route.query.group;
|
||||
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
|
||||
updateMapLocation(scriptId,dataZoom).then(response=>{
|
||||
updateMapLocation(group,dataZoom).then(response=>{
|
||||
this.$message.success('更新定位成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
@ -200,7 +176,21 @@
|
||||
margin-left: 20px;
|
||||
float:right;
|
||||
}
|
||||
|
||||
.actionInfo{
|
||||
margin-top:30px;
|
||||
}
|
||||
.conditionVO{
|
||||
width:400px;
|
||||
}
|
||||
.actionList{
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.titleStyle{
|
||||
margin-left:10px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
@ -107,7 +107,6 @@
|
||||
drawUp() {
|
||||
let data=this.formModel;
|
||||
scriptRecordNotify(data.id).then(resp => {
|
||||
debugger;
|
||||
let query = { mapId: data.mapId, group: resp.data, scriptId: data.id };
|
||||
this.$router.push({ path: `${UrlConfig.display}/script`, query });
|
||||
launchFullscreen();
|
||||
|
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<div id="btnList">
|
||||
<span slot="footer" class="btn-footer">
|
||||
<el-button type="primary" @click="doCreate">确 定</el-button>
|
||||
<el-button type="primary" @click="doCreate" :loading="loading">确 定</el-button>
|
||||
<!-- <el-button @click="doClose">取 消</el-button> -->
|
||||
</span>
|
||||
</div>
|
||||
@ -18,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listPublishMap} from '@/api/jmap/map'
|
||||
import {listPublishMap} from '@/api/jmap/map';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import {createQuest} from '@/api/quest';
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
mixins: [WindowResizeHandler],
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
mapList: [],
|
||||
taskStatusList: [],
|
||||
disabled:null,
|
||||
@ -86,36 +87,25 @@
|
||||
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
|
||||
})
|
||||
},
|
||||
// doShow(questid) {
|
||||
// if(questid)
|
||||
// {
|
||||
// getQuestById(questid).then(resp=>{
|
||||
// let data={'name':resp.data.name,'description':resp.data.description,'mapId':resp.data.mapId};
|
||||
// this.formModel=data;
|
||||
// this.formModel.id=questid;
|
||||
// this.disabled="disabled";
|
||||
// this.dialogVisible = true
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.disabled=null;
|
||||
// this.dialogVisible = true
|
||||
// }
|
||||
// },
|
||||
doCreate() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
//self.$emit('create', Object.assign({}, this.formModel));
|
||||
let data=this.formModel;
|
||||
createQuest(data).then(resp => {
|
||||
this.$emit('refresh');
|
||||
this.formModel={};
|
||||
this.$message.success('创建剧本成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建剧本失败: ${error.message}`);
|
||||
});
|
||||
})
|
||||
if(!this.loading)
|
||||
{
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
//self.$emit('create', Object.assign({}, this.formModel));
|
||||
this.loading=true;
|
||||
let data=this.formModel;
|
||||
createQuest(data).then(resp => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success('创建剧本成功');
|
||||
this.formModel={};
|
||||
this.loading=false;
|
||||
}).catch(error => {
|
||||
this.loading=false;
|
||||
this.$messageBox(`创建剧本失败: ${error.message}`);
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user