代码调整

This commit is contained in:
joylink_cuiweidong 2019-08-08 15:48:43 +08:00
parent b67a37bc33
commit 66c0939e6c
6 changed files with 91 additions and 79 deletions

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="80px" class="actionInfo" label-position="right" style="margin-top:15px">
<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>

View File

@ -0,0 +1,82 @@
<template>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="角色管理" name="first">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
</el-scrollbar>
</div>
</el-tab-pane>
<el-tab-pane label="任务目标" name="second">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<target-condition ref="targetCondition" :group="group"></target-condition>
</el-scrollbar>
</div>
</el-tab-pane>
<el-tab-pane label="任务剧本" name="third">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<task-script ref="taskScript" :group="group"></task-script>
</el-scrollbar>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import Vue from 'vue';
import RoleSection from './roleSection';
import TargetCondition from './targetCondition';
import TaskScript from './taskScript';
import {getQuestRecord} from '@/api/simulation';
export default {
name: 'roleConditionScript',
props: {
group: {
type: String,
required: true
},
},
components: {
TargetCondition,
TaskScript,
RoleSection,
},
data() {
return {
activeName:"first",
}
},
created(){
this.loadInitData(this.$route.query);
},
methods: {
loadInitData(obj) {
let group=obj.group;
getQuestRecord(group).then(response =>{
let deviceConditionList=response.data.questTargetVO.deviceConditionVOList;
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
// if(response.data.mapLocation)
// {
// let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
// this.mapLocation=mapLocation;
// }
});
},
getBehaviorList(row){
this.$emit('getBehaviorList',row.id);
this.$store.dispatch('scriptRecord/updateMemberName',row.name);
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.tab-pane{
height:360px;
}
</style>

View File

@ -73,10 +73,6 @@
this.loading=false;
}
},
mounted(){
this.memberList=this.$store.state.scriptRecord.memberList;
this.loading=false;
},
methods:{
getDeviceInfo(){
let params = { role:this.memberVO.role};

View File

@ -48,18 +48,6 @@
components:{
DeviceCondition
},
mounted(){
let data=this.$store.state.scriptRecord.deviceConditionList;
if(data!=undefined)
{
var newData=JSON.parse(JSON.stringify(data).replace(/\"code\"/g,'"isAdded":true,"code"'));
this.deviceConditionList=newData;
}
else
{
this.deviceConditionList=[];
}
},
methods:{
addQuestAction(){
if(this.isAdding)

View File

@ -42,10 +42,6 @@
},
mounted(){
this.rowDrop();
let script=this.$store.state.scriptRecord.script;
let memeberList=this.$store.state.scriptRecord.memberList;
this.taskScriptList=memeberList;
this.setScriptList(memeberList,script);
},
data() {
return {

View File

@ -11,31 +11,7 @@
<div class="tip-body-box" ref="dragBody">
<div class="tip-body">
<template v-if="displayType=='role'">
<template>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="角色管理" name="first">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
</el-scrollbar>
</div>
</el-tab-pane>
<el-tab-pane label="任务目标" name="second">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<target-condition ref="targetCondition" :group="group"></target-condition>
</el-scrollbar>
</div>
</el-tab-pane>
<el-tab-pane label="任务剧本" name="third">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<task-script ref="taskScript" :group="group"></task-script>
</el-scrollbar>
</div>
</el-tab-pane>
</el-tabs>
</template>
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
</template>
<template v-if="displayType=='behavior'">
<div class="tab-pane-big">
@ -63,15 +39,12 @@
</div>
</template>
<script>
import RoleSection from './scriptRecord/roleSection';
import GetBehavior from './scriptRecord/getBehavior';
import GetAction from './scriptRecord/getAction';
import TargetCondition from './scriptRecord/targetCondition';
import TaskScript from './scriptRecord/taskScript';
import RoleConditionScript from './scriptRecord/roleConditionScript';
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
import {saveScriptScenes, saveScriptData, dumpScriptData,getQuestRecord} from '@/api/simulation';
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
import {updateMapLocation} from '@/api/quest';
export default {
@ -83,11 +56,9 @@
},
},
components: {
RoleSection,
GetBehavior,
GetAction,
TargetCondition,
TaskScript
RoleConditionScript,
},
data() {
return {
@ -96,7 +67,6 @@
memberId:null,
behaviorId:null,
displayType:"role",
activeName:"first",
mapLocation:{},
// isSaveStage: true,
}
@ -111,25 +81,9 @@
created() {
},
mounted(){
this.loadInitData(this.$route.query);
this.shrink();
},
methods: {
loadInitData(obj) {
let group=obj.group;
let that=this;
getQuestRecord(group).then(response =>{
let deviceConditionList=response.data.questTargetVO.deviceConditionVOList;
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
// if(response.data.mapLocation)
// {
// let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
// this.mapLocation=mapLocation;
// }
});
},
jump(obj) {
},
shrink() {
@ -145,11 +99,6 @@
this.isShrink = true;
}
},
getBehaviorList(row){
this.displayType="behavior";
this.memberId=row.id;
this.$store.dispatch('scriptRecord/updateMemberName',row.name);
},
backToMember(){
this.displayType="role";
},
@ -190,6 +139,10 @@
})
}).catch(error => { })
},
getBehaviorList(id){
this.displayType="behavior";
this.memberId=id;
},
backToTop(){
var div = this.$refs['elScrollbar'].$refs['wrap'];
div.scrollTop=0;
@ -221,9 +174,6 @@
position: relative;
// height: 540px;
}
.tab-pane{
height:360px;
}
.tab-pane-big{
height:420px;
}