Merge branch 'dev' of https://git.cloud.tencent.com/joylink/jl-nclient into dev
This commit is contained in:
commit
7bb4ac4a06
@ -1,22 +1,102 @@
|
||||
export default {
|
||||
scriptTitle: 'Task Recording',
|
||||
saveMaplocation: 'Update Location',
|
||||
saveBackground: 'Save Background',
|
||||
saveData: 'Save Data',
|
||||
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'
|
||||
mapList: 'Map List',
|
||||
createScript: 'Create Script',
|
||||
scriptName: 'Script Name',
|
||||
addScript: 'Add Script',
|
||||
map: 'Map',
|
||||
scriptDescription: 'Script Description',
|
||||
submit: 'submit',
|
||||
scriptNameRule: 'Please input script name',
|
||||
scriptDescriptionRule: 'Please input script description',
|
||||
createScriptSuccess: 'Create script success',
|
||||
createScriptFail: 'Create script failure',
|
||||
scriptDetail: 'Script Detail',
|
||||
scriptRecord: 'Record',
|
||||
scriptModify: 'Modify',
|
||||
scriptDelete: 'Delete',
|
||||
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'
|
||||
};
|
||||
|
@ -1,11 +1,88 @@
|
||||
export default {
|
||||
scriptTitle: '剧本录制',
|
||||
// saveMaplocation: '更新定位',
|
||||
saveBackground: '保存背景',
|
||||
saveData: '保存数据',
|
||||
mapList: '地图列表',
|
||||
createScript: '创建剧本',
|
||||
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: '角色管理',
|
||||
// targetCondition: '任务目标',
|
||||
|
@ -122,14 +122,17 @@ class MouseController extends Eventful {
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
console.log('-------', this.eventTarget._type===deviceType.Background);
|
||||
if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) {
|
||||
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||
this.eventTarget.dirty();
|
||||
this.eventTarget = '';
|
||||
}
|
||||
// debugger;
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
// console.log('111-------');
|
||||
this.eventTarget.setCursor('default');
|
||||
}
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
}
|
||||
|
||||
|
@ -7,9 +7,9 @@
|
||||
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
|
||||
</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="primary" @click="back">返回</el-button>
|
||||
<el-button type="primary" @click="back">{{$t('scriptRecord.scriptBack')}}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
|
||||
|
@ -94,8 +94,8 @@
|
||||
this.form.x = model.point.x;
|
||||
this.form.y = model.point.y;
|
||||
this.opacity = model.opacity;
|
||||
this.form.lineWidth = model.form.lineWidth;
|
||||
this.form.stroke = model.form.stroke;
|
||||
this.form.lineWidth = model.lineWidth;
|
||||
this.form.stroke = model.stroke;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<el-card v-loading="loading" class="map-list-main">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="mapListTitle">地图列表</span>
|
||||
<el-button type="primary" size="small" @click="addScript" class="addScript">添加剧本</el-button>
|
||||
<span class="mapListTitle">{{ $t('scriptRecord.mapList') }}</span>
|
||||
<el-button type="primary" size="small" @click="addScript" class="addScript">{{ $t('scriptRecord.addScript') }}</el-button>
|
||||
</div>
|
||||
<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" />
|
||||
|
@ -2,15 +2,15 @@
|
||||
<el-card :style="{height: height+'px'}">
|
||||
<div class="home-box">
|
||||
<el-card class="box-card">
|
||||
<div id="scriptTitle">剧本详情</div>
|
||||
<div id="scriptTitle">{{$t('scriptRecord.scriptDetail')}}</div>
|
||||
<div id="sciptForm">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
</div>
|
||||
<div id="btnList">
|
||||
<span slot="footer" class="btn-footer">
|
||||
<el-button type="success" @click="drawUp">编制</el-button>
|
||||
<el-button type="primary" @click="modifyScript">修改</el-button>
|
||||
<el-button type="danger" @click="deleteScript">删除</el-button>
|
||||
<el-button type="success" @click="drawUp">{{$t('scriptRecord.scriptRecord')}}</el-button>
|
||||
<el-button type="primary" @click="modifyScript">{{$t('scriptRecord.scriptModify')}}</el-button>
|
||||
<el-button type="danger" @click="deleteScript">{{$t('scriptRecord.scriptDelete')}}</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -18,6 +18,10 @@
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import {listPublishMap} from '@/api/jmap/map';
|
||||
@ -43,11 +47,11 @@ export default {
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
labelWidth: '150px',
|
||||
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}
|
||||
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
|
||||
{ prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled: this.disabled},
|
||||
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -55,13 +59,15 @@ export default {
|
||||
rules() {
|
||||
const crules = {
|
||||
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: [
|
||||
{ required: true, message: '请选择地图', trigger: 'change' }
|
||||
],
|
||||
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;
|
||||
@ -90,7 +96,7 @@ export default {
|
||||
this.formModel=data;
|
||||
this.formModel.id=scriptId;
|
||||
}).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 });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||
});
|
||||
},
|
||||
modifyScript() {
|
||||
const data=this.formModel;
|
||||
updateQuest(data.id, data).then(resp => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success('修改剧本成功');
|
||||
this.$message.success(this.$t('scriptRecord.modifyScriptSuccess'));
|
||||
}).catch(error => {
|
||||
this.$messageBox(`修改剧本失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.modifyScriptFail')}: ${error.message}`);
|
||||
});
|
||||
},
|
||||
deleteScript() {
|
||||
const data=this.formModel;
|
||||
this.$confirm('此操作将删除此剧本, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm(this.$t('scriptRecord.deleteScriptTip'), this.$t('scriptRecord.operateTip'), {
|
||||
confirmButtonText: this.$t('scriptRecord.confirmButtonText'),
|
||||
cancelButtonText: this.$t('scriptRecord.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteQuest(data.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.$message.success(this.$t('scriptRecord.deleteScriptSucess'));
|
||||
this.$emit('refresh');
|
||||
this.$router.push({ path: `${UrlConfig.script.prefix}` });
|
||||
}).catch(() => {
|
||||
this.$messageBox('删除失败');
|
||||
this.$messageBox(this.$t('scriptRecord.deleteScriptFail'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-container class="actionPane">
|
||||
<el-header style="height:50px;">
|
||||
<el-row class="actionList">
|
||||
<span class="titleStyle">剧本编制</span>
|
||||
<span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span>
|
||||
</el-row>
|
||||
</el-header>
|
||||
<el-main style="padding-top:10px;padding-bottom:10px;">
|
||||
@ -14,9 +14,9 @@
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button-group class="button-group">
|
||||
<el-button v-if="isPause" type="primary" :disabled="executeDisabled" @click="pauseScript">暂停</el-button>
|
||||
<el-button v-else type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复并执行</el-button>
|
||||
<el-button type="danger" @click="dumpScenesData">重置剧本</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">{{ $t('scriptRecord.recoverAndExecute') }}</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="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
|
||||
<!-- 暂停 -->
|
||||
@ -24,6 +24,10 @@
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -48,7 +52,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '剧本编制',
|
||||
title: this.$t('scriptRecord.scriptRecordTitle'),
|
||||
isShrink: false,
|
||||
mapLocation: {},
|
||||
autoSaveScript: null,
|
||||
@ -99,14 +103,14 @@ export default {
|
||||
scriptPause(this.group).then(resp => {
|
||||
this.$store.dispatch('scriptRecord/updateSimulationPause', true);
|
||||
}).catch(() => {
|
||||
this.$messageBox('暂停失败!');
|
||||
this.$messageBox(this.$t('scriptRecord.pauseFail'));
|
||||
});
|
||||
},
|
||||
executePlayScript() {
|
||||
executeScript(this.group).then(resp => {
|
||||
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
|
||||
}).catch(() => {
|
||||
this.$messageBox('恢复失败!');
|
||||
this.$messageBox(this.$t('scriptRecord.recoverFail'));
|
||||
});
|
||||
},
|
||||
saveScenesStage() {
|
||||
@ -116,23 +120,23 @@ export default {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
updateMapLocation(group, dataZoom).then(response=>{
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', true);
|
||||
this.$message.success('保存背景成功');
|
||||
this.$message.success(this.$t('scriptRecord.saveBackgroundSuceess'));
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.updateLocationFail')}: ${error.message}`);
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox('保存背景失败!');
|
||||
this.$messageBox(this.$t('scriptRecord.saveBackgroundFail'));
|
||||
});
|
||||
|
||||
},
|
||||
saveScenesData() {
|
||||
this.isSavingScript=true;
|
||||
saveScriptData(this.group).then(resp => {
|
||||
this.$message.success('保存数据成功');
|
||||
this.$message.success(this.$t('scriptRecord.saveDataSucess'));
|
||||
this.isSavingScript=false;
|
||||
this.initAutoSaveScript();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`保存数据失败!: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.saveDataFail')}: ${error.message}`);
|
||||
this.isSavingScript=false;
|
||||
if (error.code === 40004 || error.code === 40005 || error.code === 40003) {
|
||||
this.clearAutoSave();
|
||||
@ -144,9 +148,9 @@ export default {
|
||||
dumpScenesData() {
|
||||
this.clearAutoSave();
|
||||
const group=this.group;
|
||||
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm(this.$t('scriptRecord.clearDataTip'), this.$t('scriptRecord.operateTip'), {
|
||||
confirmButtonText: this.$t('scriptRecord.confirmButtonText'),
|
||||
cancelButtonText: this.$t('scriptRecord.cancelButtonText'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
dumpScriptData(group).then(resp => {
|
||||
@ -157,9 +161,9 @@ export default {
|
||||
this.$refs['addAction'].initData();
|
||||
this.initAutoSaveScript();
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
||||
this.$message.success('重置数据成功');
|
||||
this.$message.success(this.$t('scriptRecord.resetDataSuccess'));
|
||||
}).catch(() => {
|
||||
this.$messageBox('重置数据失败!');
|
||||
this.$messageBox(this.$t('scriptRecord.resetDataFail'));
|
||||
});
|
||||
}).catch(() => {
|
||||
this.initAutoSaveScript();
|
||||
|
@ -2,13 +2,13 @@
|
||||
<el-card :style="{height: height+'px'}">
|
||||
<div class="home-box">
|
||||
<el-card class="box-card">
|
||||
<div id="scriptTitle">创建剧本</div>
|
||||
<div id="scriptTitle">{{ $t('scriptRecord.createScript') }}</div>
|
||||
<div id="sciptForm">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
</div>
|
||||
<div id="btnList">
|
||||
<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>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -40,11 +40,11 @@ export default {
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
labelWidth: '150px',
|
||||
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}
|
||||
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
|
||||
{ prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled: this.disabled},
|
||||
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -52,15 +52,17 @@ export default {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入剧本名称', trigger: 'blur' },
|
||||
{ required: true, message: '请输入剧本名称', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'change' }
|
||||
|
||||
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: '请选择所属地图', trigger: 'change' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
|
||||
{ required: true, message: '请输入剧本描述', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
@ -94,13 +96,15 @@ export default {
|
||||
createQuest(data).then(resp => {
|
||||
const data={mapId: self.formModel.mapId, scriptId: resp.data};
|
||||
this.$emit('refresh', data);
|
||||
this.$message.success('创建剧本成功');
|
||||
this.$message.success(this.$t('scriptRecord.createScriptSuccess'));
|
||||
|
||||
|
||||
this.formModel={};
|
||||
this.loading=false;
|
||||
this.$router.push({ path: `${UrlConfig.script.detail}/${resp.data}` });
|
||||
}).catch(error => {
|
||||
this.loading=false;
|
||||
this.$messageBox(`创建剧本失败: ${error.message}`);
|
||||
this.$messageBox(`${$t('scriptRecord.createScriptFail')}${error.message}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<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>
|
||||
<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-item label="动作类型" class="conditionVO" prop="actionVO.type" >
|
||||
<el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType" :disabled="deviceTypeReadOnly||isPause">
|
||||
@ -10,13 +10,13 @@
|
||||
</el-form-item> -->
|
||||
<div>
|
||||
<div class="itemGroup">
|
||||
<el-form-item label="讲述者" class="conditionVO" prop="actionVO.memberId">
|
||||
<el-select v-model="modalData.actionVO.memberId" placeholder="请选择讲述者" :disabled="isPause&&isNotModify">
|
||||
<el-form-item :label="$t('scriptRecord.narrator')" class="conditionVO" prop="actionVO.memberId">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="接收者" class="conditionVO" prop="actionVO.targetId">
|
||||
<el-select v-model="modalData.actionVO.targetId" placeholder="请选择接收者" :disabled="isPause&&isNotModify">
|
||||
<el-form-item :label="$t('scriptRecord.receiver')" class="conditionVO" prop="actionVO.targetId">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
@ -27,8 +27,7 @@
|
||||
<div class="changeBottom"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form-item label="内容" class="conditionVO" prop="actionVO.reply">
|
||||
<el-form-item :label="$t('scriptRecord.conversitionContent')" class="conditionVO" prop="actionVO.reply">
|
||||
<el-input v-model="modalData.actionVO.reply" type="textarea" class="textareaStyle" rows="3" :disabled="isPause&&isNotModify"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -37,30 +36,30 @@
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="commandCard">
|
||||
<div class="addCommand">添加指令</div>
|
||||
<el-form size="mini" :model="commandData" ref="commandData" :rules="commandRules" label-width="100px" class="actionInfo" label-position="right">
|
||||
<el-form-item label="执行者" class="conditionVO" prop="action.memberId">
|
||||
<el-select v-model="commandData.action.memberId" placeholder="请选择执行者" :disabled="isPause" @change="changeRole">
|
||||
<div class="addCommand">{{$t('scriptRecord.addCommand')}}</div>
|
||||
<el-form size="mini" :model="commandData" ref="commandData" :rules="commandRules" label-width="120px" class="actionInfo" label-position="right">
|
||||
<el-form-item :label="$t('scriptRecord.executor')" class="conditionVO" prop="action.memberId">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="执行指令" class="conditionVO" prop="action.deviceCommand">
|
||||
<el-select v-model="commandData.action.deviceCommand " placeholder="请选择执行指令" @change="changeCommand" class="inputStyle" :disabled="isPause">
|
||||
<el-form-item :label="$t('scriptRecord.executeCommand')" class="conditionVO" prop="action.deviceCommand">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始站台" class="conditionVO" v-if="isJinLu" prop="param.startStation">
|
||||
<el-select v-model="commandData.param.startStation " placeholder="请选择起始站台" class="inputStyle" :disabled="isPause">
|
||||
<el-form-item :label="$t('scriptRecord.startStation')" class="conditionVO" v-if="isJinLu" prop="param.startStation">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终点站台" class="conditionVO" v-if="isJinLu" prop="param.endStation">
|
||||
<el-select v-model="commandData.param.endStation " placeholder="请选择终点站台" class="inputStyle" :disabled="isPause">
|
||||
<el-form-item :label="$t('scriptRecord.endStation')" class="conditionVO" v-if="isJinLu" prop="param.endStation">
|
||||
<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-select>
|
||||
</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>
|
||||
</el-card>
|
||||
@ -104,7 +103,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
buttonName:"添加对话",
|
||||
buttonName:this.$t('scriptRecord.addConversitionButton'),
|
||||
operateType:"add",
|
||||
modalData:{
|
||||
actionVO:{
|
||||
@ -139,31 +138,31 @@
|
||||
rules:{
|
||||
actionVO:{
|
||||
memberId:[
|
||||
{ required: true, message: '请选择主体角色', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.narratorRules'), trigger: 'change' }
|
||||
],
|
||||
reply:[
|
||||
{ required: true, message: '请输入内容', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('scriptRecord.conversitionContentRules'), trigger: 'blur' }
|
||||
],
|
||||
targetId:[
|
||||
{ required: true, message: '请选择目标角色', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.receiverRules'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
},
|
||||
commandRules:{
|
||||
action:{
|
||||
memberId:[
|
||||
{ required: true, message: '请选择主体角色', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.executorRules'), trigger: 'change' }
|
||||
],
|
||||
deviceCommand:[
|
||||
{ required: true, message: '请选择执行指令', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.executeCommandRules'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
param:{
|
||||
startStation:[
|
||||
{ required: true, message: '请选择起始站台', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.startStationRules'), trigger: 'change' }
|
||||
],
|
||||
endStation:[
|
||||
{ required: true, message: '请选择终点站台', trigger: 'change' }
|
||||
{ required: true, message: this.$t('scriptRecord.endStationRules'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -174,7 +173,7 @@
|
||||
},
|
||||
methods:{
|
||||
initData(){
|
||||
this.buttonName="添加对话";
|
||||
this.buttonName=this.$t('scriptRecord.addConversitionButton');
|
||||
this.operateType="add";
|
||||
getScriptPlayMember(this.group).then(resp => {
|
||||
let roleTypeList=ConstConfig.ConstSelect.roleType;
|
||||
@ -224,14 +223,14 @@
|
||||
this.adding=true;
|
||||
addScriptAction(group,data).then(response=>{
|
||||
this.adding=false;
|
||||
this.$message.success('添加指令成功');
|
||||
this.$message.success(this.$t('scriptRecord.addCommandSucess'));
|
||||
this.$emit('create');
|
||||
// this.$emit('create',[this.commandData.action.memberId]);
|
||||
// this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
|
||||
// this.initCommandActionData();
|
||||
}).catch(error => {
|
||||
this.adding=false;
|
||||
this.$messageBox(`添加指令失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.addCommandFail')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
else {
|
||||
@ -252,14 +251,14 @@
|
||||
{
|
||||
addScriptAction(group,data).then(response=>{
|
||||
this.modifying=false;
|
||||
this.$message.success('添加对话成功');
|
||||
this.$message.success(this.$t('scriptRecord.addConversitionSuccess'));
|
||||
this.$emit('create');
|
||||
// [this.modalData.actionVO.memberId]
|
||||
// this.initActionData();
|
||||
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.actionVO.memberId,this.modalData.actionVO.targetId]);
|
||||
}).catch(error => {
|
||||
this.modifying=false;
|
||||
this.$messageBox(`添加对话失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.addConversitionFail')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
else
|
||||
@ -269,15 +268,15 @@
|
||||
this.modifying=false;
|
||||
this.isNotModify=true;
|
||||
this.$emit("setDisabled",this.isNotModify);
|
||||
this.buttonName="添加对话";
|
||||
this.buttonName=this.$t('scriptRecord.addConversitionButton');
|
||||
this.operateType="add";
|
||||
this.$message.success('修改对话成功');
|
||||
this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess'));
|
||||
this.$emit('create');
|
||||
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]);
|
||||
this.initActionData();
|
||||
}).catch(error => {
|
||||
this.modifying=false;
|
||||
this.$messageBox(`修改对话失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -344,7 +343,7 @@
|
||||
doShow(data){
|
||||
if(data)
|
||||
{
|
||||
this.buttonName="修改对话";
|
||||
this.buttonName=this.$t('scriptRecord.modifyConversition');
|
||||
this.operateType="modify";
|
||||
this.clearValidate();
|
||||
this.isNotModify=false;
|
||||
|
@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<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>{{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-button label="Male">男</el-radio-button>
|
||||
<el-radio-button label="Female">女</el-radio-button>
|
||||
<el-radio-button label="Male">{{$t('scriptRecord.roleSexMale')}}</el-radio-button>
|
||||
<el-radio-button label="Female">{{$t('scriptRecord.roleSexFemale')}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</span>
|
||||
</el-transfer>
|
||||
@ -27,7 +27,7 @@
|
||||
return {
|
||||
allRoleData:[],
|
||||
selectRoleData:[],
|
||||
sexGroup:"男",
|
||||
sexGroup:this.$t('scriptRecord.roleSexMale'),
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
@ -75,11 +75,11 @@
|
||||
let group=this.$props.group;
|
||||
let data=movedKeys;
|
||||
selectScriptMembers(group,data).then(response=>{
|
||||
this.$message.success('选择剧本角色成功');
|
||||
this.$message.success(this.$t('scriptRecord.selectScriptActorSuccess'));
|
||||
this.$emit("refresh");
|
||||
})
|
||||
.catch(error => {
|
||||
this.$messageBox(`选择剧本角色失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.selectScriptActorFail')}: ${error.message}`);
|
||||
return false;
|
||||
});
|
||||
break;
|
||||
@ -89,10 +89,10 @@
|
||||
let data=movedKeys;
|
||||
cancleScriptMembers(group,data).then(response=>{
|
||||
this.$emit("refresh");
|
||||
this.$message.success('取消剧本角色成功');
|
||||
this.$message.success(this.$t('scriptRecord.cancleScriptActorSuccess'));
|
||||
})
|
||||
.catch(error => {
|
||||
this.$messageBox(`取消剧本角色失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.cancleScriptActorFail')}: ${error.message}`);
|
||||
this.initData();
|
||||
});
|
||||
}
|
||||
@ -117,10 +117,10 @@
|
||||
let group=this.$props.group;
|
||||
let data={"gender":event};
|
||||
modifyScriptMemberSex(group,id,data).then(response=>{
|
||||
this.$message.success('修改剧本成员性别成功');
|
||||
this.$message.success(this.$t('scriptRecord.modifyScriptActorSexSuccess'));
|
||||
})
|
||||
.catch(error => {
|
||||
this.$messageBox(`修改剧本成员性别失败: ${error.message}`);
|
||||
this.$messageBox(`${this.$t('scriptRecord.modifyScriptActorSexFail')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
</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="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> -->
|
||||
</div>
|
||||
</el-card>
|
||||
|
Loading…
Reference in New Issue
Block a user