产品分化剧本修改
This commit is contained in:
parent
bde4904b2a
commit
0bb8e6ba0b
@ -4,6 +4,7 @@ export default {
|
|||||||
saveData: 'Save Data',
|
saveData: 'Save Data',
|
||||||
mapList: 'Map List',
|
mapList: 'Map List',
|
||||||
createScript: 'Create Script',
|
createScript: 'Create Script',
|
||||||
|
modifyScript: 'Modify Script',
|
||||||
scriptName: 'Script Name',
|
scriptName: 'Script Name',
|
||||||
addScript: 'Add Script',
|
addScript: 'Add Script',
|
||||||
map: 'Map',
|
map: 'Map',
|
||||||
@ -15,6 +16,7 @@ export default {
|
|||||||
createScriptFail: 'Create script failure',
|
createScriptFail: 'Create script failure',
|
||||||
scriptDetail: 'Script Detail',
|
scriptDetail: 'Script Detail',
|
||||||
scriptRecord: 'Record',
|
scriptRecord: 'Record',
|
||||||
|
scriptCreate: 'Create',
|
||||||
scriptModify: 'Modify',
|
scriptModify: 'Modify',
|
||||||
scriptDelete: 'Delete',
|
scriptDelete: 'Delete',
|
||||||
getScriptFail: 'Get script information failure',
|
getScriptFail: 'Get script information failure',
|
||||||
|
@ -4,6 +4,7 @@ export default {
|
|||||||
saveData: '保存数据',
|
saveData: '保存数据',
|
||||||
mapList: '地图列表',
|
mapList: '地图列表',
|
||||||
createScript: '创建剧本',
|
createScript: '创建剧本',
|
||||||
|
modifyScript: '修改剧本',
|
||||||
scriptName: '剧本名称',
|
scriptName: '剧本名称',
|
||||||
addScript: '添加剧本',
|
addScript: '添加剧本',
|
||||||
map: '所属地图',
|
map: '所属地图',
|
||||||
@ -15,6 +16,7 @@ export default {
|
|||||||
createScriptFail: '创建剧本失败',
|
createScriptFail: '创建剧本失败',
|
||||||
scriptDetail: '剧本详情',
|
scriptDetail: '剧本详情',
|
||||||
scriptRecord: '编制',
|
scriptRecord: '编制',
|
||||||
|
scriptCreate: '创建',
|
||||||
scriptModify: '修改',
|
scriptModify: '修改',
|
||||||
scriptDelete: '删除',
|
scriptDelete: '删除',
|
||||||
getScriptFail: '获取剧本信息失败',
|
getScriptFail: '获取剧本信息失败',
|
||||||
|
109
src/views/scriptManage/create.vue
Normal file
109
src/views/scriptManage/create.vue
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
<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">{{$t('global.confirm')}}</el-button>
|
||||||
|
<el-button @click="doClose">{{$t('global.cancel')}}</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: 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
|
||||||
|
},
|
||||||
|
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.formModel.mapId=this.$route.params.mapId;
|
||||||
|
this.disabled="disabled";
|
||||||
|
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,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card :style="{height: height+'px'}">
|
<el-card :style="{height: height+'px'}">
|
||||||
|
<el-button size="small" type="primary" @click="handleCreate" style="margin-left:100px;">{{$t('scriptRecord.scriptCreate')}}</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
stripe
|
stripe
|
||||||
@ -23,15 +23,17 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
>
|
>
|
||||||
<el-button size="small" type="success" @click="drawUp">{{$t('scriptRecord.scriptRecord')}}</el-button>
|
<template slot-scope="scope">
|
||||||
<el-button size="small" type="primary" @click="modifyScript">{{$t('scriptRecord.scriptModify')}}</el-button>
|
<el-button size="small" type="success" @click="drawUp(scope.$index, scope.row)">{{$t('scriptRecord.scriptRecord')}}</el-button>
|
||||||
<el-button size="small" type="danger" @click="deleteScript">{{$t('scriptRecord.scriptDelete')}}</el-button>
|
<el-button size="small" type="primary" @click="handleModify(scope.$index, scope.row)">{{$t('scriptRecord.scriptModify')}}</el-button>
|
||||||
|
<el-button size="small" type="danger" @click="deleteScript(scope.$index, scope.row)">{{$t('scriptRecord.scriptDelete')}}</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- <create-script ref='createScript' @reloadTable="reloadTable" @create="handleConfirmCreate" title="创建脚本">
|
<create-script ref='createScript' @reloadTable="reloadTable" @create="handleConfirmCreate" :title="$t('scriptRecord.createScript')">
|
||||||
|
</create-script>
|
||||||
|
<create-script ref='modifyScript' @reloadTable="reloadTable" @create="handleConfirmModify" :title="$t('scriptRecord.modifyScript')">
|
||||||
</create-script>
|
</create-script>
|
||||||
<create-script ref='modifyScript' @reloadTable="reloadTable" @create="handleConfirmModify" title="修改脚本">
|
|
||||||
</create-script> -->
|
|
||||||
|
|
||||||
<!-- <div class="home-box">
|
<!-- <div class="home-box">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
@ -53,10 +55,16 @@
|
|||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
// import {listPublishMap} from '@/api/jmap/map';
|
// import {listPublishMap} from '@/api/jmap/map';
|
||||||
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
|
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
|
||||||
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
|
import { scriptRecordNotify } from '@/api/simulation';
|
||||||
|
import CreateScript from './create';
|
||||||
// import {createQuest} from '@/api/quest';
|
// import {createQuest} from '@/api/quest';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ScriptDraft',
|
name: 'ScriptDraft',
|
||||||
|
components: {
|
||||||
|
CreateScript,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData:[],
|
tableData:[],
|
||||||
@ -98,65 +106,58 @@ export default {
|
|||||||
let response=await getQuestPageList(id);
|
let response=await getQuestPageList(id);
|
||||||
this.tableData=response.data;
|
this.tableData=response.data;
|
||||||
},
|
},
|
||||||
// // 确定创建
|
drawUp(index,row) {
|
||||||
// handleConfirmCreate(data) {
|
scriptRecordNotify(row.id).then(resp => {
|
||||||
// createQuest(data).then(resp => {
|
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id };
|
||||||
// this.reloadTable();
|
this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query });
|
||||||
// this.$message.success('创建剧本成功');
|
launchFullscreen();
|
||||||
// }).catch(error => {
|
}).catch(error => {
|
||||||
// this.$messageBox(`创建剧本失败: ${error.message}`);
|
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||||
// })
|
});
|
||||||
// },
|
},
|
||||||
// //修改
|
deleteScript(index,row) {
|
||||||
// handleModify(index, row){
|
this.$confirm(this.$t('scriptRecord.deleteScriptTip'), this.$t('global.tips'), {
|
||||||
// this.$refs.modifyScript.doShow(row.id);
|
confirmButtonText: this.$t('global.confirm'),
|
||||||
// },
|
cancelButtonText: this.$t('global.cancel'),
|
||||||
// //确认修改
|
type: 'warning'
|
||||||
// handleConfirmModify(data){
|
}).then(() => {
|
||||||
// updateQuest(data.id,data).then(resp => {
|
deleteQuest(row.id).then(response => {
|
||||||
// this.reloadTable();
|
this.$message.success(this.$t('scriptRecord.deleteScriptSucess'));
|
||||||
// this.$message.success('修改剧本成功');
|
this.loadInitData();
|
||||||
// }).catch(error => {
|
}).catch(() => {
|
||||||
// this.$messageBox(`修改剧本失败: ${error.message}`);
|
this.$messageBox(this.$t('scriptRecord.deleteScriptFail'));
|
||||||
// })
|
});
|
||||||
// },
|
}).catch(() => { });
|
||||||
// // 创建
|
},
|
||||||
// handleCreate(index, row) {
|
// 确定创建
|
||||||
// this.$refs.createScript.doShow(null);
|
handleConfirmCreate(data) {
|
||||||
// },
|
createQuest(data).then(resp => {
|
||||||
// // 录制
|
this.reloadTable();
|
||||||
// handleRecord(index, row) {
|
this.$message.success('创建剧本成功');
|
||||||
// scriptRecordNotify(row.id).then(resp => {
|
}).catch(error => {
|
||||||
// let query = { skinStyle: row.skinCode, group: resp.data, scriptId: row.id };
|
this.$messageBox(`创建剧本失败: ${error.message}`);
|
||||||
// this.$router.push({ path: `${UrlConfig.display}/script`, query });
|
})
|
||||||
// launchFullscreen();
|
},
|
||||||
// }).catch(error => {
|
//修改
|
||||||
// this.$messageBox(`创建仿真失败: ${error.message}`);
|
handleModify(index, row){
|
||||||
// })
|
this.$refs.modifyScript.doShow(row.id);
|
||||||
// },
|
},
|
||||||
// // 删除
|
//确认修改
|
||||||
// handleDelete(index, row) {
|
handleConfirmModify(data){
|
||||||
// this.$confirm('此操作将删除此剧本脚本, 是否继续?', '提示', {
|
updateQuest(data.id,data).then(resp => {
|
||||||
// confirmButtonText: '确定',
|
this.reloadTable();
|
||||||
// cancelButtonText: '取消',
|
this.$message.success('修改剧本成功');
|
||||||
// type: 'warning'
|
}).catch(error => {
|
||||||
// }).then(() => {
|
this.$messageBox(`修改剧本失败: ${error.message}`);
|
||||||
// deleteQuest(row.id).then(response => {
|
})
|
||||||
// this.$message.success('删除成功')
|
},
|
||||||
// this.reloadTable()
|
// 创建
|
||||||
// }).catch(error => {
|
handleCreate() {
|
||||||
// this.reloadTable()
|
this.$refs.createScript.doShow(null);
|
||||||
// if (error.code == 500) {
|
},
|
||||||
// this.$messageBox('删除失败')
|
reloadTable() {
|
||||||
// } else if (error.code == 500009) {
|
this.loadInitData();
|
||||||
// this.$messageBox('该模板已被加载计划使用,无法删除')
|
}
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }).catch(() => { })
|
|
||||||
// },
|
|
||||||
// reloadTable() {
|
|
||||||
// this.queryList.reload()
|
|
||||||
// }
|
|
||||||
|
|
||||||
// loadInitData() {
|
// loadInitData() {
|
||||||
// this.mapList = [];
|
// this.mapList = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user