剧本编制修改

This commit is contained in:
joylink_cuiweidong 2019-08-16 17:15:20 +08:00
parent 50e847ec57
commit ecefa16f5e
8 changed files with 39 additions and 18 deletions

View File

@ -210,10 +210,10 @@ export function getScriptMemberData(group) {
} }
/** 清除仿真剧本数据*/ /** 清除仿真剧本数据*/
export function dumpScriptData(scriptId) { export function dumpScriptData(group) {
return request({ return request({
url: `/api/simulation/${scriptId}/clearScriptRecord`, url: `/api/simulation/${group}/scriptWrite/saveData`,
method: 'post' method: 'delete'
}); });
} }

View File

@ -77,9 +77,10 @@ export default {
{label: '管理员', value: 'Admin'}, {label: '管理员', value: 'Admin'},
{label: '教员', value: 'Instructor'}, {label: '教员', value: 'Instructor'},
{label: '行调', value: 'Dispatcher'}, {label: '行调', value: 'Dispatcher'},
{label: '车站', value: 'Attendant'}, {label: '行值', value: 'Attendant'},
{label: '观众', value: 'Audience'}, {label: '观众', value: 'Audience'},
{label: '司机', value: 'Driver'} {label: '司机', value: 'Driver'},
{label: '通号', value: 'Repair'}
], ],
SimulationType: [ SimulationType: [

View File

@ -8,7 +8,7 @@
</el-button-group> --> </el-button-group> -->
<el-button-group> <el-button-group>
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">按计划行车</el-button> <el-button type="success" :disabled="isDisable" @click="selectBeginTime">按计划行车</el-button>
<el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button> <!-- <el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button> -->
<el-button type="primary" @click="back">返回</el-button> <el-button type="primary" @click="back">返回</el-button>
</el-button-group> </el-button-group>
</div> </div>

View File

@ -3,7 +3,7 @@
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="actionInfo" label-position="right"> <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-form-item label="主体角色" class="conditionVO" prop="actionVO.memberId">
<el-select v-model="modalData.actionVO.memberId" placeholder="请选择主体角色"> <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-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="完成时间" class="conditionVO"> <el-form-item label="完成时间" class="conditionVO">
@ -16,7 +16,7 @@
</el-form-item> </el-form-item>
<el-form-item label="目标角色" class="conditionVO" prop="actionVO.targetId" v-if="isConversitionAdd"> <el-form-item label="目标角色" class="conditionVO" prop="actionVO.targetId" v-if="isConversitionAdd">
<el-select v-model="modalData.actionVO.targetId" placeholder="请选择目标角色"> <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-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="内容" class="conditionVO" prop="actionVO.reply" v-if="isConversitionAdd"> <el-form-item label="内容" class="conditionVO" prop="actionVO.reply" v-if="isConversitionAdd">
@ -47,6 +47,7 @@
import Vue from 'vue'; import Vue from 'vue';
import DeviceTypeDic from '@/scripts/DeviceTypeDic'; import DeviceTypeDic from '@/scripts/DeviceTypeDic';
// import CommandForm from "./commandForm"; // import CommandForm from "./commandForm";
import ConstConfig from '@/scripts/ConstConfig';
import {addScriptAction,modifyScriptAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType,getScriptMemberData} from '@/api/simulation'; import {addScriptAction,modifyScriptAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType,getScriptMemberData} from '@/api/simulation';
export default { export default {
name: 'addAction', name: 'addAction',
@ -67,6 +68,14 @@
// components:{ // components:{
// CommandForm, // CommandForm,
// }, // },
watch:{
'$store.state.socket.simulationStart': function (val) {
if(val)
{
this.initData();
}
}
},
data() { data() {
return { return {
modalData:{ modalData:{
@ -120,7 +129,14 @@
methods:{ methods:{
initData(){ initData(){
getScriptMemberData(this.group).then(resp => { getScriptMemberData(this.group).then(resp => {
this.memberList=resp.data; let roleTypeList=ConstConfig.ConstSelect.roleType;
let lastData=JSON.stringify(resp.data);
roleTypeList.forEach(function(element){
let rolename=element.value;
lastData=lastData.replace(new RegExp(rolename,'g'),element.label);
});
lastData=JSON.parse(lastData);
this.memberList=lastData;
getAvailableDeviceCommand().then(response=>{ getAvailableDeviceCommand().then(response=>{
this.deviceCommandList=response.data; this.deviceCommandList=response.data;
this.getDeviceCode(); this.getDeviceCode();
@ -131,7 +147,6 @@
let params = {deviceType:"StationStand"}; let params = {deviceType:"StationStand"};
let group=this.group; let group=this.group;
getDeviceCodeByDeviceType(group,params).then(response =>{ getDeviceCodeByDeviceType(group,params).then(response =>{
// debugger;
let resultData=response.data; let resultData=response.data;
resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name")); resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));
this.stationList=resultData; this.stationList=resultData;
@ -182,7 +197,6 @@
resetDisabled(){ resetDisabled(){
if(this.$refs['modalData']) if(this.$refs['modalData'])
{ {
debugger;
this.$refs['modalData'].resetFields(); this.$refs['modalData'].resetFields();
} }
}, },

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="actionList"> <div class="actionList">
<span class="titleStyle">添加剧本动作</span> <span class="titleStyle">剧本动作</span>
</div> </div>
<div class="tab-pane-big"> <div class="tab-pane-big">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar"> <el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">

View File

@ -14,10 +14,10 @@
<get-action ref="getAction" :group="group"></get-action> <get-action ref="getAction" :group="group"></get-action>
</div> </div>
<el-button-group class="button-group"> <el-button-group class="button-group">
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button> <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="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
<el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button> <el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button>
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
</el-button-group> </el-button-group>
</div> </div>
</div> </div>
@ -97,12 +97,13 @@
}) })
}, },
dumpScenesData() { dumpScenesData() {
this.$confirm('此操作将会清除已保存的录制数据, 是否继续?', '提示', { let group=this.group;
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
dumpScriptData(this.scriptId).then(resp => { dumpScriptData(group).then(resp => {
// this.isSaveStage = true; // this.isSaveStage = true;
this.$message.success('清除数据成功'); this.$message.success('清除数据成功');
}).catch(error => { }).catch(error => {

View File

@ -7,7 +7,7 @@
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
<div class="addScript" @click="addScript"> <div class="addScript" @click="addScript">
<i class="el-icon-plus"></i> <i class="el-icon-plus" style="color:#409eff;font-size:16px;"></i>
<span class="addScriptText">添加剧本</span> <span class="addScriptText">添加剧本</span>
</div> </div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px', width:'100%',margin:'5px 0 0 0' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px', width:'100%',margin:'5px 0 0 0' }">
@ -134,5 +134,10 @@ export default {
font-size: 14px; font-size: 14px;
border-radius: 3px; border-radius: 3px;
cursor: pointer; cursor: pointer;
margin-top: 5px;
}
.addScriptText{
color:#409eff;
font-size: 15px;
} }
</style> </style>

View File

@ -51,7 +51,7 @@
labelWidth: '100px', labelWidth: '100px',
items: [ items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true}, { prop: 'name', label: '剧本名称', type: 'text', required: true},
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled}, { prop: 'mapId', label: '所属地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true}, { prop: 'description', label: '剧本描述', type: 'textarea', required: true},
] ]
} }
@ -64,7 +64,7 @@
{ required: true, message: '请输入剧本名称', trigger: 'change' }, { required: true, message: '请输入剧本名称', trigger: 'change' },
], ],
mapId: [ mapId: [
{ required: true, message: '请选择地图', trigger: 'change' }, { required: true, message: '请选择所属地图', trigger: 'change' },
], ],
description:[ description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' }, { required: true, message: '请输入剧本描述', trigger: 'blur' },