This commit is contained in:
fan 2019-09-11 09:26:38 +08:00
commit 7bb4ac4a06
12 changed files with 293 additions and 120 deletions

View File

@ -1,22 +1,102 @@
export default { export default {
scriptTitle: 'Task Recording', scriptTitle: 'Task Recording',
saveMaplocation: 'Update Location',
saveBackground: 'Save Background', saveBackground: 'Save Background',
saveData: 'Save Data', saveData: 'Save Data',
roleManage: 'Role Manage', mapList: 'Map List',
targetCondition: 'Task Target', createScript: 'Create Script',
taskScript: 'Task Script', scriptName: 'Script Name',
roleName: 'Role Name', addScript: 'Add Script',
roleType: 'Role Type', map: 'Map',
deviceCode: 'Device Code', scriptDescription: 'Script Description',
roleList: 'Role List', submit: 'submit',
operation: 'Operation', scriptNameRule: 'Please input script name',
roleAdd: 'Add', scriptDescriptionRule: 'Please input script description',
delete: 'Delete', createScriptSuccess: 'Create script success',
behaviorOperate: 'Behavior Operate', createScriptFail: 'Create script failure',
conditionTitle: 'Target condition', scriptDetail: 'Script Detail',
deviceType: 'Device Type', scriptRecord: 'Record',
deviceCondition: 'Device Condition', scriptModify: 'Modify',
paramDeviceType: 'Param DeviceType', scriptDelete: 'Delete',
paramDeviceCode: 'Param DeviceCode' getScriptFail: 'Get script information failure',
createSimulationFail: 'Create simulation failure',
modifyScriptSuccess: 'Modify script success',
modifyScriptFail: 'Modify script failure',
deleteScriptTip: 'This action will delete this script, whether to continue?',
operateTip: 'Prompt',
confirmButtonText: 'Submit',
cancelButtonText: 'Cancle',
deleteScriptSucess: 'delete script sucess',
deleteScriptFail: 'delete script failure',
scriptRecordTitle: 'Script Record',
drivingPause: 'Pause',
recoverAndExecute: 'Recover And Execute',
resetScript: 'Reset Script',
pauseFail: 'Pause failure',
recoverFail: 'Recover failure',
saveBackgroundSuceess: 'Save background suceess',
updateLocationFail: 'update location failure',
saveBackgroundFail: 'Save background failure',
saveDataSucess: 'Save data sucess',
saveDataFail: 'Save data failure',
clearDataTip: 'This action will clear the saved script data, whether to continue?',
resetDataSuccess: 'Reset script success',
resetDataFail: 'Reset script failure',
allRoles: 'All Roles',
actors: 'Actors',
roleSexMale: 'Male',
roleSexFemale: 'Female',
selectScriptActorSuccess: 'Select script actor success',
selectScriptActorFail: 'Select script actor failure',
cancleScriptActorSuccess: 'Cancle script actor success',
cancleScriptActorFail: 'Cancle script actor failure',
modifyScriptActorSexSuccess: 'Modify script actor sex success',
modifyScriptActorSexFail: 'Modify script actor sex failure',
addConversition: 'Add Conversition',
narrator: 'Narrator',
narratorRules: 'Please select narrator',
receiver: 'Receiver',
receiverRules: 'Please select receiver',
conversitionContent: 'Content',
addCommand: 'Add Command',
executor: 'Executor',
executorRules: 'Please select executor',
executeCommand: 'Command',
executeCommandRules: 'Please select execute command',
startStation: 'Start Station',
startStationRules: 'Please select start station ',
endStation: 'End Station',
endStationRules: 'Please select end station',
addCommandButton: 'Add Command',
addConversitionButton: 'Add Conversition',
conversitionContentRules: 'Please input content',
addCommandSucess: 'Add command sucess',
addCommandFail: 'Add command failure',
addConversitionSuccess: 'Add conversition success',
addConversitionFail: 'Add conversition failure',
modifyConversitionSuccess: 'Modify conversition success',
modifyConversitionFail: 'Modify conversition failure',
modifyConversition: 'Modify Conversition',
modifyConversitionButton: 'modify',
drivingByPlan: 'Driving By Plan',
scriptBack: 'Back'
// roleManage: 'Role Manage',
// targetCondition: 'Task Target',
// taskScript: 'Task Script',
// roleName: 'Role Name',
// roleType: 'Role Type',
// deviceCode: 'Device Code',
// roleList: 'Role List',
// operation: 'Operation',
// roleAdd: 'Add',
// delete: 'Delete',
// behaviorOperate: 'Behavior Operate',
// conditionTitle: 'Target condition',
// deviceType: 'Device Type',
// deviceCondition: 'Device Condition',
// paramDeviceType: 'Param DeviceType',
// paramDeviceCode: 'Param DeviceCode'
}; };

View File

@ -1,11 +1,88 @@
export default { export default {
scriptTitle: '剧本录制', scriptTitle: '剧本录制',
// saveMaplocation: '更新定位',
saveBackground: '保存背景', saveBackground: '保存背景',
saveData: '保存数据', saveData: '保存数据',
mapList: '地图列表', mapList: '地图列表',
createScript: '创建剧本', createScript: '创建剧本',
scriptName: '剧本名称', scriptName: '剧本名称',
addScript: '添加剧本',
map: '所属地图',
scriptDescription: '剧本描述',
submit: '确定',
scriptNameRule: '请输入剧本名称',
scriptDescriptionRule: '请输入剧本描述',
createScriptSuccess: '创建剧本成功',
createScriptFail: '创建剧本失败',
scriptDetail: '剧本详情',
scriptRecord: '编制',
scriptModify: '修改',
scriptDelete: '删除',
getScriptFail: '获取剧本信息失败',
createSimulationFail: '创建仿真失败',
modifyScriptSuccess: '修改剧本成功',
modifyScriptFail: '修改剧本失败',
deleteScriptTip: '此操作将删除此剧本, 是否继续?',
operateTip: '提示',
confirmButtonText: '确定',
cancelButtonText: '取消',
deleteScriptSucess: '删除成功',
deleteScriptFail: '删除失败',
scriptRecordTitle: '剧本编制',
drivingPause: '暂停',
recoverAndExecute: '恢复并执行',
resetScript: '重置剧本',
pauseFail: '暂停失败',
recoverFail: '恢复失败',
saveBackgroundSuceess: '保存背景成功',
updateLocationFail: '更新定位失败',
saveBackgroundFail: '保存背景失败',
saveDataSucess: '保存数据成功',
saveDataFail: '保存数据失败',
clearDataTip: '此操作将会清除已保存的编制数据, 是否继续?',
resetDataSuccess: '重置剧本成功',
resetDataFail: '重置剧本失败',
allRoles: '所有角色',
actors: '演员角色',
roleSexMale: '男',
roleSexFemale: '女',
selectScriptActorSuccess: '选择剧本角色成功',
selectScriptActorFail: '选择剧本角色失败',
cancleScriptActorSuccess: '取消剧本角色成功',
cancleScriptActorFail: '取消剧本角色失败',
modifyScriptActorSexSuccess: '修改剧本成员性别成功',
modifyScriptActorSexFail: '修改剧本成员性别失败',
addConversition: '添加对话',
narrator: '讲述者',
narratorRules: '请选择讲述者',
receiver: '接收者',
receiverRules: '请选择接收者',
conversitionContent: '内容',
addCommand: '添加指令',
executor: '执行者',
executorRules: '请选择执行者',
executeCommand: '执行指令',
executeCommandRules: '请选择执行指令',
startStation: '起始站台',
startStationRules: '请选择起始站台',
endStation: '终点站台',
endStationRules: '请选择终点站台',
addCommandButton: '添加指令',
addConversitionButton: '添加对话',
conversitionContentRules: '请输入内容',
addCommandSucess: '添加指令成功',
addCommandFail: '添加指令失败',
addConversitionSuccess: '添加对话成功',
addConversitionFail: '添加对话失败',
modifyConversitionSuccess: '修改对话成功',
modifyConversitionFail: '修改对话失败',
modifyConversition: '修改对话',
modifyConversitionButton: '修改',
drivingByPlan: '按计划行车',
scriptBack: '返回'
// roleManage: '角色管理', // roleManage: '角色管理',
// targetCondition: '任务目标', // targetCondition: '任务目标',

View File

@ -122,14 +122,17 @@ class MouseController extends Eventful {
} }
mouseup(e) { mouseup(e) {
console.log('-------', this.eventTarget._type===deviceType.Background);
if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) { if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) {
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY); this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
this.eventTarget.dirty(); this.eventTarget.dirty();
this.eventTarget = '';
} }
// debugger;
if (this.eventTarget && this.eventTarget._type === deviceType.Background) { if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
// console.log('111-------');
this.eventTarget.setCursor('default'); this.eventTarget.setCursor('default');
} }
this.eventTarget = '';
this._dragging = false; this._dragging = false;
} }

View File

@ -7,9 +7,9 @@
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button> <el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
</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">{{$t('scriptRecord.drivingByPlan')}}</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">{{$t('scriptRecord.scriptBack')}}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" /> <set-time ref="setTime" @ConfirmSelectBeginTime="start" />

View File

@ -94,8 +94,8 @@
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.opacity = model.opacity; this.opacity = model.opacity;
this.form.lineWidth = model.form.lineWidth; this.form.lineWidth = model.lineWidth;
this.form.stroke = model.form.stroke; this.form.stroke = model.stroke;
} }
} }
}, },

View File

@ -1,8 +1,8 @@
<template> <template>
<el-card v-loading="loading" class="map-list-main"> <el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="mapListTitle">地图列表</span> <span class="mapListTitle">{{ $t('scriptRecord.mapList') }}</span>
<el-button type="primary" size="small" @click="addScript" class="addScript">添加剧本</el-button> <el-button type="primary" size="small" @click="addScript" class="addScript">{{ $t('scriptRecord.addScript') }}</el-button>
</div> </div>
<el-select v-model="mapSelect" size="medium" class="mapSelect" @change="mapSelectChange"> <el-select v-model="mapSelect" size="medium" class="mapSelect" @change="mapSelectChange">
<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" />

View File

@ -2,15 +2,15 @@
<el-card :style="{height: height+'px'}"> <el-card :style="{height: height+'px'}">
<div class="home-box"> <div class="home-box">
<el-card class="box-card"> <el-card class="box-card">
<div id="scriptTitle">剧本详情</div> <div id="scriptTitle">{{$t('scriptRecord.scriptDetail')}}</div>
<div id="sciptForm"> <div id="sciptForm">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div> </div>
<div id="btnList"> <div id="btnList">
<span slot="footer" class="btn-footer"> <span slot="footer" class="btn-footer">
<el-button type="success" @click="drawUp">编制</el-button> <el-button type="success" @click="drawUp">{{$t('scriptRecord.scriptRecord')}}</el-button>
<el-button type="primary" @click="modifyScript">修改</el-button> <el-button type="primary" @click="modifyScript">{{$t('scriptRecord.scriptModify')}}</el-button>
<el-button type="danger" @click="deleteScript">删除</el-button> <el-button type="danger" @click="deleteScript">{{$t('scriptRecord.scriptDelete')}}</el-button>
</span> </span>
</div> </div>
</el-card> </el-card>
@ -18,6 +18,10 @@
</el-card> </el-card>
</template> </template>
<script> <script>
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import {listPublishMap} from '@/api/jmap/map'; import {listPublishMap} from '@/api/jmap/map';
@ -43,11 +47,11 @@ export default {
computed: { computed: {
form() { form() {
const form = { const form = {
labelWidth: '100px', labelWidth: '150px',
items: [ items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true}, { prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList, disabled: this.disabled}, { prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled: this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true} { prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
] ]
}; };
return form; return form;
@ -55,13 +59,15 @@ export default {
rules() { rules() {
const crules = { const crules = {
name: [ name: [
{ required: true, message: '请输入剧本', trigger: 'blur' } { required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'change' }
], ],
mapId: [ mapId: [
{ required: true, message: '请选择地图', trigger: 'change' } { required: true, message: '请选择地图', trigger: 'change' }
], ],
description: [ description: [
{ required: true, message: '请输入剧本描述', trigger: 'blur' } { required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'change' }
] ]
}; };
return crules; return crules;
@ -90,7 +96,7 @@ export default {
this.formModel=data; this.formModel=data;
this.formModel.id=scriptId; this.formModel.id=scriptId;
}).catch(error => { }).catch(error => {
this.$message.error('获取剧本信息失败:' + error.message); this.$message.error(this.$t('scriptRecord.getScriptFail')+':' + error.message);
}); });
} }
}, },
@ -101,31 +107,31 @@ export default {
this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query }); this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
}); });
}, },
modifyScript() { modifyScript() {
const data=this.formModel; const data=this.formModel;
updateQuest(data.id, data).then(resp => { updateQuest(data.id, data).then(resp => {
this.$emit('refresh'); this.$emit('refresh');
this.$message.success('修改剧本成功'); this.$message.success(this.$t('scriptRecord.modifyScriptSuccess'));
}).catch(error => { }).catch(error => {
this.$messageBox(`修改剧本失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyScriptFail')}: ${error.message}`);
}); });
}, },
deleteScript() { deleteScript() {
const data=this.formModel; const data=this.formModel;
this.$confirm('此操作将删除此剧本, 是否继续?', '提示', { this.$confirm(this.$t('scriptRecord.deleteScriptTip'), this.$t('scriptRecord.operateTip'), {
confirmButtonText: '确定', confirmButtonText: this.$t('scriptRecord.confirmButtonText'),
cancelButtonText: '取消', cancelButtonText: this.$t('scriptRecord.cancelButtonText'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteQuest(data.id).then(response => { deleteQuest(data.id).then(response => {
this.$message.success('删除成功'); this.$message.success(this.$t('scriptRecord.deleteScriptSucess'));
this.$emit('refresh'); this.$emit('refresh');
this.$router.push({ path: `${UrlConfig.script.prefix}` }); this.$router.push({ path: `${UrlConfig.script.prefix}` });
}).catch(() => { }).catch(() => {
this.$messageBox('删除失败'); this.$messageBox(this.$t('scriptRecord.deleteScriptFail'));
}); });
}).catch(() => { }); }).catch(() => { });
} }

View File

@ -4,7 +4,7 @@
<el-container class="actionPane"> <el-container class="actionPane">
<el-header style="height:50px;"> <el-header style="height:50px;">
<el-row class="actionList"> <el-row class="actionList">
<span class="titleStyle">剧本编制</span> <span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span>
</el-row> </el-row>
</el-header> </el-header>
<el-main style="padding-top:10px;padding-bottom:10px;"> <el-main style="padding-top:10px;padding-bottom:10px;">
@ -14,9 +14,9 @@
</el-main> </el-main>
<el-footer> <el-footer>
<el-button-group class="button-group"> <el-button-group class="button-group">
<el-button v-if="isPause" type="primary" :disabled="executeDisabled" @click="pauseScript">暂停</el-button> <el-button v-if="isPause" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button>
<el-button v-else type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复并执行</el-button> <el-button v-else type="primary" :disabled="executeDisabled" @click="executePlayScript">{{ $t('scriptRecord.recoverAndExecute') }}</el-button>
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button> <el-button type="danger" @click="dumpScenesData">{{ $t('scriptRecord.resetScript') }}</el-button>
<el-button type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button> <el-button type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
<el-button type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button> <el-button type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
<!-- 暂停 --> <!-- 暂停 -->
@ -24,6 +24,10 @@
</el-footer> </el-footer>
</el-container> </el-container>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
@ -48,7 +52,7 @@ export default {
}, },
data() { data() {
return { return {
title: '剧本编制', title: this.$t('scriptRecord.scriptRecordTitle'),
isShrink: false, isShrink: false,
mapLocation: {}, mapLocation: {},
autoSaveScript: null, autoSaveScript: null,
@ -99,14 +103,14 @@ export default {
scriptPause(this.group).then(resp => { scriptPause(this.group).then(resp => {
this.$store.dispatch('scriptRecord/updateSimulationPause', true); this.$store.dispatch('scriptRecord/updateSimulationPause', true);
}).catch(() => { }).catch(() => {
this.$messageBox('暂停失败!'); this.$messageBox(this.$t('scriptRecord.pauseFail'));
}); });
}, },
executePlayScript() { executePlayScript() {
executeScript(this.group).then(resp => { executeScript(this.group).then(resp => {
this.$store.dispatch('scriptRecord/updateSimulationPause', false); this.$store.dispatch('scriptRecord/updateSimulationPause', false);
}).catch(() => { }).catch(() => {
this.$messageBox('恢复失败!'); this.$messageBox(this.$t('scriptRecord.recoverFail'));
}); });
}, },
saveScenesStage() { saveScenesStage() {
@ -116,23 +120,23 @@ export default {
saveScriptScenes(this.group).then(resp => { saveScriptScenes(this.group).then(resp => {
updateMapLocation(group, dataZoom).then(response=>{ updateMapLocation(group, dataZoom).then(response=>{
this.$store.dispatch('scriptRecord/updateBgSet', true); this.$store.dispatch('scriptRecord/updateBgSet', true);
this.$message.success('保存背景成功'); this.$message.success(this.$t('scriptRecord.saveBackgroundSuceess'));
}).catch(error => { }).catch(error => {
this.$messageBox(`更新定位失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.updateLocationFail')}: ${error.message}`);
}); });
}).catch(() => { }).catch(() => {
this.$messageBox('保存背景失败!'); this.$messageBox(this.$t('scriptRecord.saveBackgroundFail'));
}); });
}, },
saveScenesData() { saveScenesData() {
this.isSavingScript=true; this.isSavingScript=true;
saveScriptData(this.group).then(resp => { saveScriptData(this.group).then(resp => {
this.$message.success('保存数据成功'); this.$message.success(this.$t('scriptRecord.saveDataSucess'));
this.isSavingScript=false; this.isSavingScript=false;
this.initAutoSaveScript(); this.initAutoSaveScript();
}).catch(error => { }).catch(error => {
this.$messageBox(`保存数据失败!: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.saveDataFail')}: ${error.message}`);
this.isSavingScript=false; this.isSavingScript=false;
if (error.code === 40004 || error.code === 40005 || error.code === 40003) { if (error.code === 40004 || error.code === 40005 || error.code === 40003) {
this.clearAutoSave(); this.clearAutoSave();
@ -144,9 +148,9 @@ export default {
dumpScenesData() { dumpScenesData() {
this.clearAutoSave(); this.clearAutoSave();
const group=this.group; const group=this.group;
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', { this.$confirm(this.$t('scriptRecord.clearDataTip'), this.$t('scriptRecord.operateTip'), {
confirmButtonText: '确定', confirmButtonText: this.$t('scriptRecord.confirmButtonText'),
cancelButtonText: '取消', cancelButtonText: this.$t('scriptRecord.cancelButtonText'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
dumpScriptData(group).then(resp => { dumpScriptData(group).then(resp => {
@ -157,9 +161,9 @@ export default {
this.$refs['addAction'].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(this.$t('scriptRecord.resetDataSuccess'));
}).catch(() => { }).catch(() => {
this.$messageBox('重置数据失败!'); this.$messageBox(this.$t('scriptRecord.resetDataFail'));
}); });
}).catch(() => { }).catch(() => {
this.initAutoSaveScript(); this.initAutoSaveScript();

View File

@ -2,13 +2,13 @@
<el-card :style="{height: height+'px'}"> <el-card :style="{height: height+'px'}">
<div class="home-box"> <div class="home-box">
<el-card class="box-card"> <el-card class="box-card">
<div id="scriptTitle">创建剧本</div> <div id="scriptTitle">{{ $t('scriptRecord.createScript') }}</div>
<div id="sciptForm"> <div id="sciptForm">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div> </div>
<div id="btnList"> <div id="btnList">
<span slot="footer" class="btn-footer"> <span slot="footer" class="btn-footer">
<el-button type="primary" :loading="loading" @click="doCreate"> </el-button> <el-button type="primary" :loading="loading" @click="doCreate">{{$t('scriptRecord.submit')}}</el-button>
</span> </span>
</div> </div>
</el-card> </el-card>
@ -40,11 +40,11 @@ export default {
computed: { computed: {
form() { form() {
const form = { const form = {
labelWidth: '100px', labelWidth: '150px',
items: [ items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true}, { prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
{ prop: 'mapId', label: '所属地图', type: 'select', required: true, options: this.mapList, disabled: this.disabled}, { prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled: this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true} { prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
] ]
}; };
return form; return form;
@ -52,15 +52,17 @@ export default {
rules() { rules() {
const crules = { const crules = {
name: [ name: [
{ required: true, message: '请输入剧本名称', trigger: 'blur' }, { required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'blur' },
{ required: true, message: '请输入剧本名称', trigger: 'change' } { required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'change' }
], ],
mapId: [ mapId: [
{ required: true, message: '请选择所属地图', trigger: 'change' } { required: true, message: '请选择所属地图', trigger: 'change' }
], ],
description: [ description: [
{ required: true, message: '请输入剧本描述', trigger: 'blur' }, { required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'blur' },
{ required: true, message: '请输入剧本描述', trigger: 'change' } { required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'change' }
] ]
}; };
return crules; return crules;
@ -94,13 +96,15 @@ export default {
createQuest(data).then(resp => { createQuest(data).then(resp => {
const data={mapId: self.formModel.mapId, scriptId: resp.data}; const data={mapId: self.formModel.mapId, scriptId: resp.data};
this.$emit('refresh', data); this.$emit('refresh', data);
this.$message.success('创建剧本成功'); this.$message.success(this.$t('scriptRecord.createScriptSuccess'));
this.formModel={}; this.formModel={};
this.loading=false; this.loading=false;
this.$router.push({ path: `${UrlConfig.script.detail}/${resp.data}` }); this.$router.push({ path: `${UrlConfig.script.detail}/${resp.data}` });
}).catch(error => { }).catch(error => {
this.loading=false; this.loading=false;
this.$messageBox(`创建剧本失败: ${error.message}`); this.$messageBox(`${$t('scriptRecord.createScriptFail')}${error.message}`);
}); });
}); });
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<el-scrollbar class="addScript" :style="{width:size.width+'px',height:size.height+'px'}" ref="elActionScrollbar" wrapClass="scrollbar-wrapper"> <el-scrollbar class="addScript" :style="{width:size.width+'px',height:size.height+'px'}" ref="elActionScrollbar" wrapClass="scrollbar-wrapper">
<el-card class="conversitionCard"> <el-card class="conversitionCard">
<div class="addConversition">添加对话</div> <div class="addConversition">{{$t('scriptRecord.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">
<!-- <el-form-item label="动作类型" class="conditionVO" prop="actionVO.type" > <!-- <el-form-item label="动作类型" class="conditionVO" prop="actionVO.type" >
<el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType" :disabled="deviceTypeReadOnly||isPause"> <el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType" :disabled="deviceTypeReadOnly||isPause">
@ -10,13 +10,13 @@
</el-form-item> --> </el-form-item> -->
<div> <div>
<div class="itemGroup"> <div class="itemGroup">
<el-form-item label="讲述者" class="conditionVO" prop="actionVO.memberId"> <el-form-item :label="$t('scriptRecord.narrator')" class="conditionVO" prop="actionVO.memberId">
<el-select v-model="modalData.actionVO.memberId" placeholder="请选择讲述者" :disabled="isPause&&isNotModify"> <el-select v-model="modalData.actionVO.memberId" :placeholder="$t('scriptRecord.narratorRules')" :disabled="isPause&&isNotModify">
<el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':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.targetId"> <el-form-item :label="$t('scriptRecord.receiver')" class="conditionVO" prop="actionVO.targetId">
<el-select v-model="modalData.actionVO.targetId" placeholder="请选择接收者" :disabled="isPause&&isNotModify"> <el-select v-model="modalData.actionVO.targetId" :placeholder="$t('scriptRecord.receiverRules')" :disabled="isPause&&isNotModify">
<el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':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>
@ -27,8 +27,7 @@
<div class="changeBottom"></div> <div class="changeBottom"></div>
</div> </div>
</div> </div>
<el-form-item :label="$t('scriptRecord.conversitionContent')" class="conditionVO" prop="actionVO.reply">
<el-form-item label="内容" class="conditionVO" prop="actionVO.reply">
<el-input v-model="modalData.actionVO.reply" type="textarea" class="textareaStyle" rows="3" :disabled="isPause&&isNotModify"></el-input> <el-input v-model="modalData.actionVO.reply" type="textarea" class="textareaStyle" rows="3" :disabled="isPause&&isNotModify"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -37,30 +36,30 @@
</el-form> </el-form>
</el-card> </el-card>
<el-card class="commandCard"> <el-card class="commandCard">
<div class="addCommand">添加指令</div> <div class="addCommand">{{$t('scriptRecord.addCommand')}}</div>
<el-form size="mini" :model="commandData" ref="commandData" :rules="commandRules" label-width="100px" class="actionInfo" label-position="right"> <el-form size="mini" :model="commandData" ref="commandData" :rules="commandRules" label-width="120px" class="actionInfo" label-position="right">
<el-form-item label="执行者" class="conditionVO" prop="action.memberId"> <el-form-item :label="$t('scriptRecord.executor')" class="conditionVO" prop="action.memberId">
<el-select v-model="commandData.action.memberId" placeholder="请选择执行者" :disabled="isPause" @change="changeRole"> <el-select v-model="commandData.action.memberId" :placeholder="$t('scriptRecord.executorRules')" :disabled="isPause" @change="changeRole">
<el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':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="action.deviceCommand"> <el-form-item :label="$t('scriptRecord.executeCommand')" class="conditionVO" prop="action.deviceCommand">
<el-select v-model="commandData.action.deviceCommand " placeholder="请选择执行指令" @change="changeCommand" class="inputStyle" :disabled="isPause"> <el-select v-model="commandData.action.deviceCommand " :placeholder="$t('scriptRecord.executeCommandRules')" @change="changeCommand" class="inputStyle" :disabled="isPause">
<el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option> <el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="起始站台" class="conditionVO" v-if="isJinLu" prop="param.startStation"> <el-form-item :label="$t('scriptRecord.startStation')" class="conditionVO" v-if="isJinLu" prop="param.startStation">
<el-select v-model="commandData.param.startStation " placeholder="请选择起始站台" class="inputStyle" :disabled="isPause"> <el-select v-model="commandData.param.startStation " :placeholder="$t('scriptRecord.startStationRules')" class="inputStyle" :disabled="isPause">
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option> <el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="终点站台" class="conditionVO" v-if="isJinLu" prop="param.endStation"> <el-form-item :label="$t('scriptRecord.endStation')" class="conditionVO" v-if="isJinLu" prop="param.endStation">
<el-select v-model="commandData.param.endStation " placeholder="请选择终点站台" class="inputStyle" :disabled="isPause"> <el-select v-model="commandData.param.endStation " :placeholder="$t('scriptRecord.endStationRules')" class="inputStyle" :disabled="isPause">
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option> <el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="addCommandAction('commandData')" :disabled="isPause" :loading="adding">添加指令</el-button> <el-button type="primary" @click="addCommandAction('commandData')" :disabled="isPause" :loading="adding">{{$t('scriptRecord.addCommandButton')}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -104,7 +103,7 @@
}, },
data() { data() {
return { return {
buttonName:"添加对话", buttonName:this.$t('scriptRecord.addConversitionButton'),
operateType:"add", operateType:"add",
modalData:{ modalData:{
actionVO:{ actionVO:{
@ -139,31 +138,31 @@
rules:{ rules:{
actionVO:{ actionVO:{
memberId:[ memberId:[
{ required: true, message: '请选择主体角色', trigger: 'change' } { required: true, message: this.$t('scriptRecord.narratorRules'), trigger: 'change' }
], ],
reply:[ reply:[
{ required: true, message: '请输入内容', trigger: 'blur' } { required: true, message: this.$t('scriptRecord.conversitionContentRules'), trigger: 'blur' }
], ],
targetId:[ targetId:[
{ required: true, message: '请选择目标角色', trigger: 'change' } { required: true, message: this.$t('scriptRecord.receiverRules'), trigger: 'change' }
] ]
}, },
}, },
commandRules:{ commandRules:{
action:{ action:{
memberId:[ memberId:[
{ required: true, message: '请选择主体角色', trigger: 'change' } { required: true, message: this.$t('scriptRecord.executorRules'), trigger: 'change' }
], ],
deviceCommand:[ deviceCommand:[
{ required: true, message: '请选择执行指令', trigger: 'change' } { required: true, message: this.$t('scriptRecord.executeCommandRules'), trigger: 'change' }
] ]
}, },
param:{ param:{
startStation:[ startStation:[
{ required: true, message: '请选择起始站台', trigger: 'change' } { required: true, message: this.$t('scriptRecord.startStationRules'), trigger: 'change' }
], ],
endStation:[ endStation:[
{ required: true, message: '请选择终点站台', trigger: 'change' } { required: true, message: this.$t('scriptRecord.endStationRules'), trigger: 'change' }
] ]
} }
} }
@ -174,7 +173,7 @@
}, },
methods:{ methods:{
initData(){ initData(){
this.buttonName="添加对话"; this.buttonName=this.$t('scriptRecord.addConversitionButton');
this.operateType="add"; this.operateType="add";
getScriptPlayMember(this.group).then(resp => { getScriptPlayMember(this.group).then(resp => {
let roleTypeList=ConstConfig.ConstSelect.roleType; let roleTypeList=ConstConfig.ConstSelect.roleType;
@ -224,14 +223,14 @@
this.adding=true; this.adding=true;
addScriptAction(group,data).then(response=>{ addScriptAction(group,data).then(response=>{
this.adding=false; this.adding=false;
this.$message.success('添加指令成功'); this.$message.success(this.$t('scriptRecord.addCommandSucess'));
this.$emit('create'); this.$emit('create');
// this.$emit('create',[this.commandData.action.memberId]); // this.$emit('create',[this.commandData.action.memberId]);
// 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;
this.$messageBox(`添加指令失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.addCommandFail')}: ${error.message}`);
}); });
} }
else { else {
@ -252,14 +251,14 @@
{ {
addScriptAction(group,data).then(response=>{ addScriptAction(group,data).then(response=>{
this.modifying=false; this.modifying=false;
this.$message.success('添加对话成功'); this.$message.success(this.$t('scriptRecord.addConversitionSuccess'));
this.$emit('create'); this.$emit('create');
// [this.modalData.actionVO.memberId] // [this.modalData.actionVO.memberId]
// 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(`${this.$t('scriptRecord.addConversitionFail')}: ${error.message}`);
}); });
} }
else else
@ -269,15 +268,15 @@
this.modifying=false; this.modifying=false;
this.isNotModify=true; this.isNotModify=true;
this.$emit("setDisabled",this.isNotModify); this.$emit("setDisabled",this.isNotModify);
this.buttonName="添加对话"; this.buttonName=this.$t('scriptRecord.addConversitionButton');
this.operateType="add"; this.operateType="add";
this.$message.success('修改对话成功'); this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess'));
this.$emit('create'); 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 => {
this.modifying=false; this.modifying=false;
this.$messageBox(`修改对话失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
}); });
} }
} }
@ -344,7 +343,7 @@
doShow(data){ doShow(data){
if(data) if(data)
{ {
this.buttonName="修改对话"; this.buttonName=this.$t('scriptRecord.modifyConversition');
this.operateType="modify"; this.operateType="modify";
this.clearValidate(); this.clearValidate();
this.isNotModify=false; this.isNotModify=false;

View File

@ -1,11 +1,11 @@
<template> <template>
<el-card class="scriptTop"> <el-card class="scriptTop">
<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="[$t('scriptRecord.allRoles'), $t('scriptRecord.actors')]" @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>
<el-radio-group v-model="option.gender" size="mini" class="sexGroup" @change="changeSex($event,option.key)"> <el-radio-group v-model="option.gender" size="mini" class="sexGroup" @change="changeSex($event,option.key)">
<el-radio-button label="Male"></el-radio-button> <el-radio-button label="Male">{{$t('scriptRecord.roleSexMale')}}</el-radio-button>
<el-radio-button label="Female"></el-radio-button> <el-radio-button label="Female">{{$t('scriptRecord.roleSexFemale')}}</el-radio-button>
</el-radio-group> </el-radio-group>
</span> </span>
</el-transfer> </el-transfer>
@ -27,7 +27,7 @@
return { return {
allRoleData:[], allRoleData:[],
selectRoleData:[], selectRoleData:[],
sexGroup:"男", sexGroup:this.$t('scriptRecord.roleSexMale'),
} }
}, },
mounted(){ mounted(){
@ -75,11 +75,11 @@
let group=this.$props.group; let group=this.$props.group;
let data=movedKeys; let data=movedKeys;
selectScriptMembers(group,data).then(response=>{ selectScriptMembers(group,data).then(response=>{
this.$message.success('选择剧本角色成功'); this.$message.success(this.$t('scriptRecord.selectScriptActorSuccess'));
this.$emit("refresh"); this.$emit("refresh");
}) })
.catch(error => { .catch(error => {
this.$messageBox(`选择剧本角色失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.selectScriptActorFail')}: ${error.message}`);
return false; return false;
}); });
break; break;
@ -89,10 +89,10 @@
let data=movedKeys; let data=movedKeys;
cancleScriptMembers(group,data).then(response=>{ cancleScriptMembers(group,data).then(response=>{
this.$emit("refresh"); this.$emit("refresh");
this.$message.success('取消剧本角色成功'); this.$message.success(this.$t('scriptRecord.cancleScriptActorSuccess'));
}) })
.catch(error => { .catch(error => {
this.$messageBox(`取消剧本角色失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.cancleScriptActorFail')}: ${error.message}`);
this.initData(); this.initData();
}); });
} }
@ -117,10 +117,10 @@
let group=this.$props.group; let group=this.$props.group;
let data={"gender":event}; let data={"gender":event};
modifyScriptMemberSex(group,id,data).then(response=>{ modifyScriptMemberSex(group,id,data).then(response=>{
this.$message.success('修改剧本成员性别成功'); this.$message.success(this.$t('scriptRecord.modifyScriptActorSexSuccess'));
}) })
.catch(error => { .catch(error => {
this.$messageBox(`修改剧本成员性别失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyScriptActorSexFail')}: ${error.message}`);
}); });
} }
} }

View File

@ -21,7 +21,7 @@
</span> </span>
</div> </div>
<div class="btnGroup"> <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="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)" v-if="actionInfo.visible">{{$t('scriptRecord.modifyConversitionButton')}}</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> --> <!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div> </div>
</el-card> </el-card>