This commit is contained in:
zyy 2019-08-23 09:14:27 +08:00
commit f30084539a
8 changed files with 155 additions and 554 deletions

View File

@ -89,7 +89,7 @@ export default {
{ label: '综合演练', value: 'Joint'}, { label: '综合演练', value: 'Joint'},
{ label: '大屏', value: 'BigScreen'}, { label: '大屏', value: 'BigScreen'},
{ label: '琏计划', value: 'RunPlan'}, { label: '琏计划', value: 'RunPlan'},
{ label: '任务录制', value: 'ScriptRecord'} { label: '剧本录制', value: 'ScriptWrite'}
], ],
skinCode: [ skinCode: [

View File

@ -79,8 +79,6 @@ export default {
}, },
mapSelectChange(id){ mapSelectChange(id){
this.loading = true; this.loading = true;
// debugger;
// this.$store
localStore.set("script_mapId", id); localStore.set("script_mapId", id);
this.$store.dispatch('scriptRecord/updateScriptId',id); this.$store.dispatch('scriptRecord/updateScriptId',id);
this.getQuestPageList(id); this.getQuestPageList(id);

View File

@ -1,24 +1,37 @@
<template> <template>
<div class="reminder-drag"> <div class="reminder-drag">
<div class="reminder-box" ref="drapBox" :style="{height:'100%'}"> <div class="reminder-box" ref="drapBox" :style="{height:'100%'}">
<div class="actionPane"> <el-container class="actionPane">
<get-action ref="getAction" :group="group"></get-action> <el-header style="height:50px;">
</div> <el-row class="actionList">
<el-button-group class="button-group"> <span class="titleStyle">剧本编制</span>
<el-button type="primary" @click="pauseScript" v-if="isPause" :disabled="executeDisabled">暂停</el-button> </el-row>
<el-button type="primary" @click="executePlayScript" v-else :disabled="executeDisabled">恢复并执行</el-button> </el-header>
<!-- <el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button> --> <el-main style="padding-top:10px;padding-bottom:10px;">
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button> <add-role :group="group" ref="addRole" @refresh="refresh"></add-role>
<el-button type="primary" @click="saveScenesStage" :disabled="backDisabled">{{$t('scriptRecord.saveBackground')}}</el-button> <add-action ref="addAction" :group="group" :size="size" @create="create" @setDisabled="setDisabled"></add-action>
<el-button type="success" @click="saveScenesData" :loading="isSavingScript" >{{$t('scriptRecord.saveData')}}</el-button> <get-action ref="getAction" :group="group" :size="size" @setAction="setAction"></get-action>
<!-- 暂停 --> </el-main>
</el-button-group> <el-footer>
<el-button-group class="button-group">
<el-button type="primary" @click="pauseScript" v-if="isPause" :disabled="executeDisabled">暂停</el-button>
<el-button type="primary" @click="executePlayScript" v-else :disabled="executeDisabled">恢复并执行</el-button>
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
<el-button type="primary" @click="saveScenesStage" :disabled="backDisabled">{{$t('scriptRecord.saveBackground')}}</el-button>
<el-button type="success" @click="saveScenesData" :loading="isSavingScript" >{{$t('scriptRecord.saveData')}}</el-button>
<!-- 暂停 -->
</el-button-group>
</el-footer>
</el-container>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import AddAction from '../scriptRecord/addAction';
import GetAction from '../scriptRecord/getAction'; import GetAction from '../scriptRecord/getAction';
import AddRole from '../scriptRecord/addRole';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scriptPause, executeScript} from '@/api/simulation'; import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scriptPause, executeScript} from '@/api/simulation';
export default { export default {
@ -31,7 +44,10 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
}, },
components: { components: {
GetAction, GetAction,
AddRole,
AddAction
}, },
mixins: [WindowResizeHandler],
// this.$t('scriptRecord.scriptTitle') // this.$t('scriptRecord.scriptTitle')
data() { data() {
return { return {
@ -40,9 +56,13 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
mapLocation:{}, mapLocation:{},
autoSaveScript: null, autoSaveScript: null,
isSavingScript:false, isSavingScript:false,
isPause:false, isPause:true,
executeDisabled:false, executeDisabled:false,
backDisabled:false, backDisabled:false,
size:{
width:350,
height:window.innerHeight-130-212,
}
// isSaveStage: true, // isSaveStage: true,
} }
}, },
@ -56,26 +76,13 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
mounted(){ mounted(){
this.initAutoSaveScript(); this.initAutoSaveScript();
this.backDisabled=this.$store.state.scriptRecord.bgSet; this.backDisabled=this.$store.state.scriptRecord.bgSet;
// this.shrink();
}, },
beforeDestroy() { beforeDestroy() {
this.clearAutoSave(); this.clearAutoSave();
}, },
methods: { methods: {
jump(obj) { resizeHandler() {
}, this.size = { width:350, height:window.innerHeight-130-212};
shrink() {
let height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top;
if (this.isShrink) {
this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = '';
this.isShrink = false;
} else {
this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top;
this.isShrink = true;
}
}, },
setIsParse(isPause){ setIsParse(isPause){
this.isPause=isPause; this.isPause=isPause;
@ -114,7 +121,6 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
}); });
}, },
saveScenesStage() { saveScenesStage() {
let data=Vue.prototype.$jlmap.$options; let data=Vue.prototype.$jlmap.$options;
let group=this.$route.query.group; let group=this.$route.query.group;
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY}; let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
@ -161,8 +167,8 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
// this.isSaveStage = true; // this.isSaveStage = true;
this.$parent.$refs['display'].$refs['menuScript'].resetBeginTime(); this.$parent.$refs['display'].$refs['menuScript'].resetBeginTime();
this.$refs["getAction"].loadInitData(); this.$refs["getAction"].loadInitData();
this.$refs["getAction"].$refs["addRole"].initData(); this.$refs["addRole"].initData();
this.$refs["getAction"].$refs["addBehavior"].initData(); this.$refs["addAction"].initData();
this.initAutoSaveScript(); this.initAutoSaveScript();
this.$store.dispatch('scriptRecord/updateBgSet',false); this.$store.dispatch('scriptRecord/updateBgSet',false);
this.$message.success('重置数据成功'); this.$message.success('重置数据成功');
@ -173,25 +179,22 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
this.initAutoSaveScript(); this.initAutoSaveScript();
}) })
}, },
refresh(){
this.$refs['addAction'].initData();
},
create(){
this.$refs['getAction'].loadInitData();
},
setAction(row){
debugger;
this.$refs['addAction'].doShow(row);
}
} }
} }
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
// .tip-body-box {
// position: relative;
// height:100%;
// }
.tab-pane-big{
height:420px;
// width:100%;
// height:100%;
}
.breadColor{
color:#fff;
}
.reminder-box { .reminder-box {
position: absolute; position: absolute;
float: left; float: left;
@ -206,31 +209,22 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
.actionPane{ .actionPane{
height: 100%; height: 100%;
padding-bottom: 80px;
} }
.list-label {
width: 105px;
}
.button-group{ .button-group{
position: absolute; margin-bottom: 20px;
bottom: 30px; float: right;
right: 20px;
}
.actionInfo{
margin-top:30px;
}
.conditionVO{
width:400px;
} }
.actionList{ .actionList{
margin-top: 10px; margin-top: 10px;
margin-left: 5px;
font-size: 15px; font-size: 15px;
margin-bottom:10px; padding-top: 5px;
border-bottom: 1px #ccc solid;
height: 35px;
} }
.titleStyle{ .titleStyle{
margin-left:10px; margin-left:5px;
} }
.icon { .icon {

View File

@ -1,8 +1,5 @@
<template> <template>
<div> <el-scrollbar class="addScript" :style="{width:size.width+'px',height:size.height+'px'}" ref="elActionScrollbar" wrapClass="scrollbar-wrapper">
<!-- <el-card class="scriptTop">
<add-role :group="group" ref="addRole"></add-role>
</el-card> -->
<el-card class="conversitionCard"> <el-card class="conversitionCard">
<div class="addConversition">添加对话</div> <div class="addConversition">添加对话</div>
<el-form size="mini" :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="conversitionInfo" label-position="right"> <el-form size="mini" :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="conversitionInfo" label-position="right">
@ -67,7 +64,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
</div> </el-scrollbar>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
@ -82,22 +79,12 @@
type: String, type: String,
required: true required: true
}, },
buttonName:{ size:{
type:String, type: Object,
required: true
},
operateType:{
type:String,
required: true required: true
} }
}, },
watch:{ watch:{
'$store.state.socket.simulationStart': function (val) {
if(val)
{
this.$parent.$parent.$refs['addRole'].initData();
}
},
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation); Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
this.isPause=!(this.$store.state.scriptRecord.simulationPause); this.isPause=!(this.$store.state.scriptRecord.simulationPause);
@ -117,13 +104,14 @@
}, },
data() { data() {
return { return {
buttonName:"添加对话",
operateType:"add",
modalData:{ modalData:{
actionVO:{ actionVO:{
memberId:"", memberId:"",
targetId:"", targetId:"",
reply:"", reply:"",
type:"Conversation", type:"Conversation",
} }
}, },
commandData:{ commandData:{
@ -235,8 +223,8 @@
addScriptAction(group,data).then(response=>{ addScriptAction(group,data).then(response=>{
this.adding=false; this.adding=false;
this.$message.success('添加指令成功'); this.$message.success('添加指令成功');
this.$emit('create',true); this.$emit('create');
this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]); // this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
// this.initCommandActionData(); // this.initCommandActionData();
}).catch(error => { }).catch(error => {
this.adding=false; this.adding=false;
@ -257,14 +245,14 @@
let data=this.modalData.actionVO; let data=this.modalData.actionVO;
let obj=this; let obj=this;
this.modifying=true; this.modifying=true;
if(this.$props.operateType=="add") if(this.operateType=="add")
{ {
addScriptAction(group,data).then(response=>{ addScriptAction(group,data).then(response=>{
this.modifying=false; this.modifying=false;
this.$message.success('添加对话成功'); this.$message.success('添加对话成功');
this.$emit('create',true); this.$emit('create');
// this.initActionData(); // this.initActionData();
this.$parent.$parent.$refs['addRole'].resetData([this.modalData.actionVO.memberId,this.modalData.actionVO.targetId]); // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.actionVO.memberId,this.modalData.actionVO.targetId]);
}).catch(error => { }).catch(error => {
this.modifying=false; this.modifying=false;
this.$messageBox(`添加对话失败: ${error.message}`); this.$messageBox(`添加对话失败: ${error.message}`);
@ -276,10 +264,11 @@
modifyScriptAction(group,actionId,data).then(response=>{ modifyScriptAction(group,actionId,data).then(response=>{
this.modifying=false; this.modifying=false;
this.isNotModify=true; this.isNotModify=true;
this.$parent.$parent.$parent.setDisabled(this.isNotModify); this.$emit("setDisabled",this.isNotModify);
this.$emit('modifyButtonName'); this.buttonName="添加对话";
this.operateType="add";
this.$message.success('修改对话成功'); this.$message.success('修改对话成功');
this.$emit('create',false); this.$emit('create');
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]);
this.initActionData(); this.initActionData();
}).catch(error => { }).catch(error => {
@ -316,6 +305,7 @@
initCommandActionData(){ initCommandActionData(){
if(this.$refs['commandData']) if(this.$refs['commandData'])
{ {
this.deviceCommandList=[];
this.$refs['commandData'].resetFields(); this.$refs['commandData'].resetFields();
this.commandData.action.memberId=""; this.commandData.action.memberId="";
this.commandData.param.startStation=""; this.commandData.param.startStation="";
@ -350,33 +340,21 @@
doShow(data){ doShow(data){
if(data) if(data)
{ {
this.clearValidate(); this.buttonName="修改对话";
this.isNotModify=false; this.operateType="modify";
this.$parent.$parent.$parent.setDisabled(this.isNotModify); this.clearValidate();
// this.initData(); this.isNotModify=false;
this.modalData.actionVO.id=data.id; this.$emit("setDisabled",this.isNotModify);
this.modalData.actionVO.memberId=data.memberId; // this.initData();
this.modalData.actionVO.type=data.type; this.modalData.actionVO.id=data.id;
if(data.type=="Conversation") this.modalData.actionVO.memberId=data.memberId;
{ this.modalData.actionVO.type=data.type;
this.isJinLu=false; if(data.type=="Conversation")
this.modalData.actionVO.targetId=data.targetId; {
this.modalData.actionVO.reply=data.reply; this.isJinLu=false;
} this.modalData.actionVO.targetId=data.targetId;
// else if(data.type=="Command") this.modalData.actionVO.reply=data.reply;
// { }
// this.isJinLu=false;
// 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];
// }
// }
} }
} }
} }
@ -409,7 +387,6 @@
width:200px; width:200px;
} }
.conversitionCard{ .conversitionCard{
margin-left: 20px;
padding-bottom: 20px; padding-bottom: 20px;
margin-top: 10px; margin-top: 10px;
} }
@ -418,7 +395,6 @@
padding: 20px 10px; padding: 20px 10px;
} }
.commandCard{ .commandCard{
margin-left: 20px;
padding-bottom: 20px; padding-bottom: 20px;
margin-top: 10px; margin-top: 10px;
} }
@ -452,9 +428,9 @@
border-right: 1px #c0c4cc solid; border-right: 1px #c0c4cc solid;
height: 15px; height: 15px;
} }
.scriptTop{ .addScript{
margin-left: 20px; margin-top:20px;
padding: 15px 0px 30px 0px; float:left;
width: 360px;
} }
</style> </style>

View File

@ -1,6 +1,5 @@
<template> <template>
<div> <el-card class="scriptTop">
<!-- <div class="selectRole">选择角色</div> -->
<el-transfer v-model="selectRoleData" :data="allRoleData" class="script-player-choose" :titles="['所有角色', '演员角色']" @change="handleChange"> <el-transfer v-model="selectRoleData" :data="allRoleData" class="script-player-choose" :titles="['所有角色', '演员角色']" @change="handleChange">
<span slot-scope="{option}"> <span slot-scope="{option}">
<span>{{option.role+(option.name==undefined?'':option.name)}}</span> <span>{{option.role+(option.name==undefined?'':option.name)}}</span>
@ -10,7 +9,7 @@
</el-radio-group> </el-radio-group>
</span> </span>
</el-transfer> </el-transfer>
</div> </el-card>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
@ -34,6 +33,14 @@
mounted(){ mounted(){
this.initData(); this.initData();
}, },
watch:{
'$store.state.socket.simulationStart': function (val) {
if(val)
{
this.initData();
}
},
},
methods:{ methods:{
initData(){ initData(){
let group=this.$props.group; let group=this.$props.group;
@ -66,7 +73,7 @@
let data=movedKeys; let data=movedKeys;
selectScriptMembers(group,data).then(response=>{ selectScriptMembers(group,data).then(response=>{
this.$message.success('选择剧本角色成功'); this.$message.success('选择剧本角色成功');
this.$parent.$parent.$refs['addBehavior'].initData(); this.$emit("refresh");
}) })
.catch(error => { .catch(error => {
this.$messageBox(`选择剧本角色失败: ${error.message}`); this.$messageBox(`选择剧本角色失败: ${error.message}`);
@ -78,7 +85,7 @@
let group=this.$props.group; let group=this.$props.group;
let data=movedKeys; let data=movedKeys;
cancleScriptMembers(group,data).then(response=>{ cancleScriptMembers(group,data).then(response=>{
this.$parent.$parent.$refs['addBehavior'].initData(); this.$emit("refresh");
this.$message.success('取消剧本角色成功'); this.$message.success('取消剧本角色成功');
}) })
.catch(error => { .catch(error => {
@ -116,14 +123,14 @@
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
.selectRole{
font-size: 15px;
padding: 0px 20px 15px 15px;
}
.elTransfer{ .elTransfer{
margin-left:20px; margin-left:20px;
width:700px; width:700px;
} }
.scriptTop{
padding: 10px 10px;
width: 730px;
}
/deep/ { /deep/ {
.script-player-choose .el-transfer-panel__body{ .script-player-choose .el-transfer-panel__body{
height: 120px; height: 120px;
@ -132,14 +139,17 @@
height: 120px; height: 120px;
} }
.script-player-choose .el-transfer-panel{ .script-player-choose .el-transfer-panel{
width: 300px; width: 310px;
}
.el-transfer-panel__item{
margin-right:0px;
}
.el-transfer__buttons{
padding: 0 20px;
} }
} }
</style> </style>
<style> <style>
.elTransfer .el-transfer-panel{
width:300px ;
}
.sexGroup{ .sexGroup{
margin-left: 10px; margin-left: 10px;
} }

View File

@ -1,64 +1,36 @@
<template> <template>
<div class="actionPaneInner"> <el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar" class="scriptBottom" :style="{width:370+'px',height:size.height+'px'}">
<div class="actionList"> <el-timeline :reverse="reverse" class="el_timeline">
<span class="titleStyle">剧本编制</span> <el-timeline-item v-for="(actionInfo,index) in actionInfoList" :key="index">
</div> <el-card>
<div class="tab-pane-big"> <div class="actionTable">
<el-card class="scriptTop"> <span class="detail" v-html="actionInfo.detail">
<add-role :group="group" ref="addRole"></add-role> </span>
</el-card> <span class="otherInfo" v-html="actionInfo.otherInfo"></span>
<div class="scriptPane"> <span v-if="actionInfo.isCoversition">
<!-- <el-card class="scriptTop"> <span class="roleClass">{{actionInfo.memberName}}</span>
<template> <span></span>
<div class="selectRole">选择角色</div> <span class="roleClass">{{actionInfo.targetName}}</span>
<el-transfer v-model="selectRoleData" :data="allRoleData" class="elTransfer" :titles="['待选成员角色', '已选成员角色']"></el-transfer> <span>: </span>
</template> <span>{{actionInfo.reply}}</span>
</el-card> --> </span>
<span v-else>
<div class="scriptBottom"> <span class="roleClass">{{actionInfo.memberName}}</span>
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar" class="elScrollbar"> <span>执行指令: </span>
<add-action ref="addBehavior" :group="group" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName" class="addScript"></add-action> <span class="commandStyle">{{actionInfo.command}}</span>
</el-scrollbar> </span>
<div class="block actionListTable">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<el-timeline :reverse="reverse" class="el_timeline">
<el-timeline-item v-for="(actionInfo,index) in actionInfoList" :key="index">
<el-card>
<div class="actionTable">
<span class="detail" v-html="actionInfo.detail">
</span>
<span class="otherInfo" v-html="actionInfo.otherInfo"></span>
<span v-if="actionInfo.isCoversition">
<span class="roleClass">{{actionInfo.memberName}}</span>
<span></span>
<span class="roleClass">{{actionInfo.targetName}}</span>
<span>: </span>
<span>{{actionInfo.reply}}</span>
</span>
<span v-else>
<span class="roleClass">{{actionInfo.memberName}}</span>
<span>执行指令: </span>
<span class="commandStyle">{{actionInfo.command}}</span>
</span>
</div>
<div class="btnGroup">
<el-button type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)" v-if="actionInfo.visible">修改</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</div> </div>
</div> <div class="btnGroup">
</div> <el-button type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)" v-if="actionInfo.visible">修改</el-button>
</div> <!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div> </div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import AddAction from './addAction';
import AddRole from './addRole';
import {getScriptRecord,deleteScriptAction,getAvailableDeviceCommand,getScriptPlayMember,getScriptMemberData} from '@/api/simulation'; import {getScriptRecord,deleteScriptAction,getAvailableDeviceCommand,getScriptPlayMember,getScriptMemberData} from '@/api/simulation';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
export default { export default {
@ -68,24 +40,21 @@
type: String, type: String,
required: true required: true
}, },
size:{
type: Object,
required: true
}
}, },
data() { data() {
return { return {
// actionList:[],
actionInfoList:[], actionInfoList:[],
deviceCommandList:[], deviceCommandList:[],
reverse:true, reverse:true,
loading:true, loading:true,
behaviorName:"", // behaviorName:"",
memberName:"", memberName:"",
operateType:"add",
buttonName:"添加对话",
} }
}, },
components: {
AddAction,
AddRole
},
mounted(){ mounted(){
this.loadInitData(); this.loadInitData();
}, },
@ -174,57 +143,17 @@
reloadTable(){ reloadTable(){
this.loadInitData(); this.loadInitData();
}, },
create(data){ // create(data){
this.reloadTable(); // this.reloadTable();
}, // },
modifyAction(row){ modifyAction(row){
this.operateType="modify"; this.$emit("setAction",row);
this.buttonName="修改对话"
this.$refs.addBehavior.doShow(row);
},
modifyButtonName(){
this.buttonName="添加对话",
this.operateType="add"
} }
} }
} }
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
.actionPaneInner{
height:100%;
padding-top:45px;
}
.addScript{
float:left;
width:380px;
display: inline-block;
}
.actionListTable{
font-size: 15px;
width:380px;
display: inline-block;
margin-left:380px;
height:100%;
}
.actionList{
height: 35px;
font-size: 18px;
padding-top: 5px;
position: absolute;
top: 0;
left: 0;
width: 740px;
border-bottom: 1px #ccc solid;
}
.titleStyle{
margin-left:10px;
}
.tab-pane-big{
height:100%;
padding-bottom: 20px;
position: relative;
}
.actionTable{ .actionTable{
width:280px; width:280px;
padding: 15px 0px 10px 15px; padding: 15px 0px 10px 15px;
@ -237,20 +166,10 @@
vertical-align: top; vertical-align: top;
display: inline-block; display: inline-block;
} }
.vertialLine{
height: 100%;
margin-left: 440px;
border-right: 1px #dadada solid;
position:absolute;
width: 0px;
}
.el_timeline{ .el_timeline{
width: 360px; width: 350px;
margin-top:10px; margin-top:20px;
} padding-left: 25px;
.elScrollbar{
width: 380px;
position: absolute;
} }
.roleClass{ .roleClass{
color:#409EFF color:#409EFF
@ -263,22 +182,7 @@
padding-top:200px; padding-top:200px;
} }
.scriptBottom{ .scriptBottom{
height: 100%; margin-left:360px;
position: relative; margin-top: 20px;
} }
.scriptTop{
position: absolute;
top: 0;
left: 20px;
padding: 10px 10px;
width: 730px;
}
// .elTransfer{
// height:230px;
// margin-left:100px;
// }
// .selectRole{
// font-size: 15px;
// padding: 0px 20px 15px 15px;
// }
</style> </style>

View File

@ -1,108 +0,0 @@
<template>
<el-dialog :title="title" :visible.sync="dialogVisible" width="25%" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate"> </el-button>
<el-button @click="doClose"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { listPublishMap } from '@/api/jmap/map'
import { getQuestById} from '@/api/quest';
export default {
name: 'ScriptDraft',
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
disabled:null,
formModel: {
name: '',
mapId: '',
description:''
},
isShow: false,
}
},
props: {
title: String,
},
computed: {
form() {
let isAdd = this.type === 'ADD'
let form = {
labelWidth: '100px',
items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true},
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true},
]
}
return form
},
rules() {
let crules = {
name: [
{ required: true, message: '请输入剧本', trigger: 'blur' },
],
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' },
],
description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
]
}
return crules
},
// title() {
// return ''
// }
},
mounted() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
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));
self.doClose()
})
},
doClose() {
this.$refs.dataform.resetForm();
this.isShow = false;
this.dialogVisible = false
}
}
}
</script>

View File

@ -1,173 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-script ref="createScript" title="创建脚本" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-script ref="modifyScript" title="修改脚本" @reloadTable="reloadTable" @create="handleConfirmModify" />
</div>
</template>
<script>
// import { listPublishMap } from '@/api/jmap/mapdraft';
import { listPublishMap } from '@/api/jmap/map';
// import { getSkinCodeList } from '@/api/management/mapskin'
import { UrlConfig } from '@/router/index';
import { getQuestPageList, createQuest, deleteQuest, updateQuest} from '@/api/quest';
import { scriptRecordNotify } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import CreateScript from './create';
export default {
name: 'ScriptManage',
components: {
CreateScript
},
data() {
return {
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: '地图',
config: {
data: []
}
}
}
},
queryList: {
query: getQuestPageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '剧本名称',
prop: 'name'
},
{
title: '地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.mapId, this.mapList, ['id', 'name']);
},
tagType: (row) => { return ''; }
},
{
title: '创建时间',
prop: 'createTime'
},
{
type: 'button',
title: '操作',
width: '350',
// hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [
{
name: '录制',
handleClick: this.handleRecord,
type: 'success'
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
},
{
name: '修改',
handleClick: this.handleModify,
type: ''
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreate }
]
},
currentModel: {}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data;
// this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
response.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
});
});
},
//
handleConfirmCreate(data) {
createQuest(data).then(resp => {
this.reloadTable();
this.$message.success('创建剧本成功');
}).catch(error => {
this.$messageBox(`创建剧本失败: ${error.message}`);
});
},
//
handleModify(index, row) {
this.$refs.modifyScript.doShow(row.id);
},
//
handleConfirmModify(data) {
updateQuest(data.id, data).then(resp => {
this.reloadTable();
this.$message.success('修改剧本成功');
}).catch(error => {
this.$messageBox(`修改剧本失败: ${error.message}`);
});
},
//
handleCreate(index, row) {
this.$refs.createScript.doShow(null);
},
//
handleRecord(index, row) {
scriptRecordNotify(row.id).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id };
this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
});
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除此剧本脚本, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuest(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
}).catch(error => {
this.reloadTable();
if (error.code == 500) {
this.$messageBox('删除失败');
} else if (error.code == 500009) {
this.$messageBox('该模板已被加载计划使用,无法删除');
}
});
}).catch(() => { });
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>