剧本录制模块页面结构调整
This commit is contained in:
parent
252ad5b593
commit
2abda64836
@ -79,8 +79,6 @@ export default {
|
||||
},
|
||||
mapSelectChange(id){
|
||||
this.loading = true;
|
||||
// debugger;
|
||||
// this.$store
|
||||
localStore.set("script_mapId", id);
|
||||
this.$store.dispatch('scriptRecord/updateScriptId',id);
|
||||
this.getQuestPageList(id);
|
||||
|
@ -1,24 +1,37 @@
|
||||
<template>
|
||||
<div class="reminder-drag">
|
||||
<div class="reminder-box" ref="drapBox" :style="{height:'100%'}">
|
||||
<div class="actionPane">
|
||||
<get-action ref="getAction" :group="group"></get-action>
|
||||
</div>
|
||||
<el-container class="actionPane">
|
||||
<el-header style="height:50px;">
|
||||
<el-row class="actionList">
|
||||
<span class="titleStyle">剧本编制</span>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-main style="padding-top:10px;padding-bottom:10px;">
|
||||
<add-role :group="group" ref="addRole" @refresh="refresh"></add-role>
|
||||
<add-action ref="addAction" :group="group" :size="size" @create="create" @setDisabled="setDisabled"></add-action>
|
||||
<get-action ref="getAction" :group="group" :size="size" @setAction="setAction"></get-action>
|
||||
</el-main>
|
||||
<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="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</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>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import AddAction from '../scriptRecord/addAction';
|
||||
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';
|
||||
|
||||
export default {
|
||||
@ -31,7 +44,10 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
|
||||
},
|
||||
components: {
|
||||
GetAction,
|
||||
AddRole,
|
||||
AddAction
|
||||
},
|
||||
mixins: [WindowResizeHandler],
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
@ -40,9 +56,13 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
|
||||
mapLocation:{},
|
||||
autoSaveScript: null,
|
||||
isSavingScript:false,
|
||||
isPause:false,
|
||||
isPause:true,
|
||||
executeDisabled:false,
|
||||
backDisabled:false,
|
||||
size:{
|
||||
width:350,
|
||||
height:window.innerHeight-130-212,
|
||||
}
|
||||
// isSaveStage: true,
|
||||
}
|
||||
},
|
||||
@ -56,26 +76,13 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
|
||||
mounted(){
|
||||
this.initAutoSaveScript();
|
||||
this.backDisabled=this.$store.state.scriptRecord.bgSet;
|
||||
// this.shrink();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearAutoSave();
|
||||
},
|
||||
methods: {
|
||||
jump(obj) {
|
||||
},
|
||||
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;
|
||||
}
|
||||
resizeHandler() {
|
||||
this.size = { width:350, height:window.innerHeight-130-212};
|
||||
},
|
||||
setIsParse(isPause){
|
||||
this.isPause=isPause;
|
||||
@ -114,7 +121,6 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
|
||||
});
|
||||
},
|
||||
saveScenesStage() {
|
||||
|
||||
let data=Vue.prototype.$jlmap.$options;
|
||||
let group=this.$route.query.group;
|
||||
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.$parent.$refs['display'].$refs['menuScript'].resetBeginTime();
|
||||
this.$refs["getAction"].loadInitData();
|
||||
this.$refs["getAction"].$refs["addRole"].initData();
|
||||
this.$refs["getAction"].$refs["addBehavior"].initData();
|
||||
this.$refs["addRole"].initData();
|
||||
this.$refs["addAction"].initData();
|
||||
this.initAutoSaveScript();
|
||||
this.$store.dispatch('scriptRecord/updateBgSet',false);
|
||||
this.$message.success('重置数据成功');
|
||||
@ -173,25 +179,22 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
|
||||
this.initAutoSaveScript();
|
||||
})
|
||||
},
|
||||
refresh(){
|
||||
this.$refs['addAction'].initData();
|
||||
},
|
||||
create(){
|
||||
this.$refs['getAction'].loadInitData();
|
||||
},
|
||||
setAction(row){
|
||||
debugger;
|
||||
this.$refs['addAction'].doShow(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@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 {
|
||||
position: absolute;
|
||||
float: left;
|
||||
@ -206,31 +209,22 @@ import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation, scr
|
||||
|
||||
.actionPane{
|
||||
height: 100%;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.list-label {
|
||||
width: 105px;
|
||||
}
|
||||
.button-group{
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
right: 20px;
|
||||
}
|
||||
.actionInfo{
|
||||
margin-top:30px;
|
||||
}
|
||||
.conditionVO{
|
||||
width:400px;
|
||||
margin-bottom: 20px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.actionList{
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
margin-bottom:10px;
|
||||
padding-top: 5px;
|
||||
border-bottom: 1px #ccc solid;
|
||||
height: 35px;
|
||||
}
|
||||
.titleStyle{
|
||||
margin-left:10px;
|
||||
margin-left:5px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <el-card class="scriptTop">
|
||||
<add-role :group="group" ref="addRole"></add-role>
|
||||
</el-card> -->
|
||||
<el-scrollbar class="addScript" :style="{width:size.width+'px',height:size.height+'px'}" ref="elActionScrollbar" wrapClass="scrollbar-wrapper">
|
||||
<el-card class="conversitionCard">
|
||||
<div class="addConversition">添加对话</div>
|
||||
<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>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
@ -82,22 +79,12 @@
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
buttonName:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
operateType:{
|
||||
type:String,
|
||||
size:{
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.socket.simulationStart': function (val) {
|
||||
if(val)
|
||||
{
|
||||
this.$parent.$parent.$refs['addRole'].initData();
|
||||
}
|
||||
},
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
|
||||
this.isPause=!(this.$store.state.scriptRecord.simulationPause);
|
||||
@ -117,13 +104,14 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
buttonName:"添加对话",
|
||||
operateType:"add",
|
||||
modalData:{
|
||||
actionVO:{
|
||||
memberId:"",
|
||||
targetId:"",
|
||||
reply:"",
|
||||
type:"Conversation",
|
||||
|
||||
}
|
||||
},
|
||||
commandData:{
|
||||
@ -235,8 +223,8 @@
|
||||
addScriptAction(group,data).then(response=>{
|
||||
this.adding=false;
|
||||
this.$message.success('添加指令成功');
|
||||
this.$emit('create',true);
|
||||
this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
|
||||
this.$emit('create');
|
||||
// this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
|
||||
// this.initCommandActionData();
|
||||
}).catch(error => {
|
||||
this.adding=false;
|
||||
@ -257,14 +245,14 @@
|
||||
let data=this.modalData.actionVO;
|
||||
let obj=this;
|
||||
this.modifying=true;
|
||||
if(this.$props.operateType=="add")
|
||||
if(this.operateType=="add")
|
||||
{
|
||||
addScriptAction(group,data).then(response=>{
|
||||
this.modifying=false;
|
||||
this.$message.success('添加对话成功');
|
||||
this.$emit('create',true);
|
||||
this.$emit('create');
|
||||
// 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 => {
|
||||
this.modifying=false;
|
||||
this.$messageBox(`添加对话失败: ${error.message}`);
|
||||
@ -276,10 +264,11 @@
|
||||
modifyScriptAction(group,actionId,data).then(response=>{
|
||||
this.modifying=false;
|
||||
this.isNotModify=true;
|
||||
this.$parent.$parent.$parent.setDisabled(this.isNotModify);
|
||||
this.$emit('modifyButtonName');
|
||||
this.$emit("setDisabled",this.isNotModify);
|
||||
this.buttonName="添加对话";
|
||||
this.operateType="add";
|
||||
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.initActionData();
|
||||
}).catch(error => {
|
||||
@ -316,6 +305,7 @@
|
||||
initCommandActionData(){
|
||||
if(this.$refs['commandData'])
|
||||
{
|
||||
this.deviceCommandList=[];
|
||||
this.$refs['commandData'].resetFields();
|
||||
this.commandData.action.memberId="";
|
||||
this.commandData.param.startStation="";
|
||||
@ -350,9 +340,11 @@
|
||||
doShow(data){
|
||||
if(data)
|
||||
{
|
||||
this.buttonName="修改对话";
|
||||
this.operateType="modify";
|
||||
this.clearValidate();
|
||||
this.isNotModify=false;
|
||||
this.$parent.$parent.$parent.setDisabled(this.isNotModify);
|
||||
this.$emit("setDisabled",this.isNotModify);
|
||||
// this.initData();
|
||||
this.modalData.actionVO.id=data.id;
|
||||
this.modalData.actionVO.memberId=data.memberId;
|
||||
@ -363,20 +355,6 @@
|
||||
this.modalData.actionVO.targetId=data.targetId;
|
||||
this.modalData.actionVO.reply=data.reply;
|
||||
}
|
||||
// else if(data.type=="Command")
|
||||
// {
|
||||
// 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;
|
||||
}
|
||||
.conversitionCard{
|
||||
margin-left: 20px;
|
||||
padding-bottom: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
@ -418,7 +395,6 @@
|
||||
padding: 20px 10px;
|
||||
}
|
||||
.commandCard{
|
||||
margin-left: 20px;
|
||||
padding-bottom: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
@ -452,9 +428,9 @@
|
||||
border-right: 1px #c0c4cc solid;
|
||||
height: 15px;
|
||||
}
|
||||
.scriptTop{
|
||||
margin-left: 20px;
|
||||
padding: 15px 0px 30px 0px;
|
||||
width: 360px;
|
||||
.addScript{
|
||||
margin-top:20px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <div class="selectRole">选择角色</div> -->
|
||||
<el-card class="scriptTop">
|
||||
<el-transfer v-model="selectRoleData" :data="allRoleData" class="script-player-choose" :titles="['所有角色', '演员角色']" @change="handleChange">
|
||||
<span slot-scope="{option}">
|
||||
<span>{{option.role+(option.name==undefined?'':option.name)}}</span>
|
||||
@ -10,7 +9,7 @@
|
||||
</el-radio-group>
|
||||
</span>
|
||||
</el-transfer>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
@ -34,6 +33,14 @@
|
||||
mounted(){
|
||||
this.initData();
|
||||
},
|
||||
watch:{
|
||||
'$store.state.socket.simulationStart': function (val) {
|
||||
if(val)
|
||||
{
|
||||
this.initData();
|
||||
}
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
initData(){
|
||||
let group=this.$props.group;
|
||||
@ -66,7 +73,7 @@
|
||||
let data=movedKeys;
|
||||
selectScriptMembers(group,data).then(response=>{
|
||||
this.$message.success('选择剧本角色成功');
|
||||
this.$parent.$parent.$refs['addBehavior'].initData();
|
||||
this.$emit("refresh");
|
||||
})
|
||||
.catch(error => {
|
||||
this.$messageBox(`选择剧本角色失败: ${error.message}`);
|
||||
@ -78,7 +85,7 @@
|
||||
let group=this.$props.group;
|
||||
let data=movedKeys;
|
||||
cancleScriptMembers(group,data).then(response=>{
|
||||
this.$parent.$parent.$refs['addBehavior'].initData();
|
||||
this.$emit("refresh");
|
||||
this.$message.success('取消剧本角色成功');
|
||||
})
|
||||
.catch(error => {
|
||||
@ -116,14 +123,14 @@
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.selectRole{
|
||||
font-size: 15px;
|
||||
padding: 0px 20px 15px 15px;
|
||||
}
|
||||
.elTransfer{
|
||||
margin-left:20px;
|
||||
width:700px;
|
||||
}
|
||||
.scriptTop{
|
||||
padding: 10px 10px;
|
||||
width: 730px;
|
||||
}
|
||||
/deep/ {
|
||||
.script-player-choose .el-transfer-panel__body{
|
||||
height: 120px;
|
||||
@ -132,14 +139,17 @@
|
||||
height: 120px;
|
||||
}
|
||||
.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>
|
||||
.elTransfer .el-transfer-panel{
|
||||
width:300px ;
|
||||
}
|
||||
.sexGroup{
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
@ -1,26 +1,5 @@
|
||||
<template>
|
||||
<div class="actionPaneInner">
|
||||
<div class="actionList">
|
||||
<span class="titleStyle">剧本编制</span>
|
||||
</div>
|
||||
<div class="tab-pane-big">
|
||||
<el-card class="scriptTop">
|
||||
<add-role :group="group" ref="addRole"></add-role>
|
||||
</el-card>
|
||||
<div class="scriptPane">
|
||||
<!-- <el-card class="scriptTop">
|
||||
<template>
|
||||
<div class="selectRole">选择角色</div>
|
||||
<el-transfer v-model="selectRoleData" :data="allRoleData" class="elTransfer" :titles="['待选成员角色', '已选成员角色']"></el-transfer>
|
||||
</template>
|
||||
</el-card> -->
|
||||
|
||||
<div class="scriptBottom">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar" class="elScrollbar">
|
||||
<add-action ref="addBehavior" :group="group" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName" class="addScript"></add-action>
|
||||
</el-scrollbar>
|
||||
<div class="block actionListTable">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar" class="scriptBottom" :style="{width:370+'px',height:size.height+'px'}">
|
||||
<el-timeline :reverse="reverse" class="el_timeline">
|
||||
<el-timeline-item v-for="(actionInfo,index) in actionInfoList" :key="index">
|
||||
<el-card>
|
||||
@ -49,16 +28,9 @@
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import AddAction from './addAction';
|
||||
import AddRole from './addRole';
|
||||
import {getScriptRecord,deleteScriptAction,getAvailableDeviceCommand,getScriptPlayMember,getScriptMemberData} from '@/api/simulation';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
export default {
|
||||
@ -68,24 +40,21 @@
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
size:{
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// actionList:[],
|
||||
actionInfoList:[],
|
||||
deviceCommandList:[],
|
||||
reverse:true,
|
||||
loading:true,
|
||||
behaviorName:"",
|
||||
// behaviorName:"",
|
||||
memberName:"",
|
||||
operateType:"add",
|
||||
buttonName:"添加对话",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddAction,
|
||||
AddRole
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData();
|
||||
},
|
||||
@ -174,57 +143,17 @@
|
||||
reloadTable(){
|
||||
this.loadInitData();
|
||||
},
|
||||
create(data){
|
||||
this.reloadTable();
|
||||
},
|
||||
// create(data){
|
||||
// this.reloadTable();
|
||||
// },
|
||||
modifyAction(row){
|
||||
this.operateType="modify";
|
||||
this.buttonName="修改对话"
|
||||
this.$refs.addBehavior.doShow(row);
|
||||
},
|
||||
modifyButtonName(){
|
||||
this.buttonName="添加对话",
|
||||
this.operateType="add"
|
||||
this.$emit("setAction",row);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@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{
|
||||
width:280px;
|
||||
padding: 15px 0px 10px 15px;
|
||||
@ -237,20 +166,10 @@
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
}
|
||||
.vertialLine{
|
||||
height: 100%;
|
||||
margin-left: 440px;
|
||||
border-right: 1px #dadada solid;
|
||||
position:absolute;
|
||||
width: 0px;
|
||||
}
|
||||
.el_timeline{
|
||||
width: 360px;
|
||||
margin-top:10px;
|
||||
}
|
||||
.elScrollbar{
|
||||
width: 380px;
|
||||
position: absolute;
|
||||
width: 350px;
|
||||
margin-top:20px;
|
||||
padding-left: 25px;
|
||||
}
|
||||
.roleClass{
|
||||
color:#409EFF
|
||||
@ -263,22 +182,7 @@
|
||||
padding-top:200px;
|
||||
}
|
||||
.scriptBottom{
|
||||
height: 100%;
|
||||
position: relative;
|
||||
margin-left:360px;
|
||||
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>
|
||||
|
@ -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>
|
@ -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>
|
Loading…
Reference in New Issue
Block a user