This commit is contained in:
fan 2019-10-22 13:40:55 +08:00
commit b7a16a9074
15 changed files with 401 additions and 62 deletions

View File

@ -57,3 +57,22 @@ export function getMapSystemPageList(params) {
params
});
}
export function createMapSubSystem(data) {
/** 创建地图系统 */
return request({
url: `/api/mapSystem`,
method: 'post',
data: data
});
}
export function updateSubSystem(id, data) {
/** 查询子系统信息 */
return request({
url: `/api/mapSystem/${id}`,
method: 'put',
data: data
});
}

View File

@ -100,5 +100,8 @@ export default {
publishScriptSuccess: 'Publish Script Success',
publishScriptFailed: 'Publish Script Failed',
releaseScriptTip: 'This action will apply to release script, whether to continue?',
revokeScriptTip: 'This action will undo release script, whether to continue?'
revokeScriptTip: 'This action will undo release script, whether to continue?',
inputScriptName: 'Please input script name',
selectMap: 'Please select map',
inputScriptDescription: 'Please input script description'
};

View File

@ -5,5 +5,22 @@ export default {
name: 'Name',
type: 'Type',
updateData: 'Modify',
generate: 'Generate'
generate: 'Generate',
selectMap: 'Please select map',
generateSuccess: 'The subsystem under the map is generated successfully!',
generateFail: 'The subsystem under the map failed to generate!',
inputName: 'Please input subsystem name',
selectType: 'Please select type',
selectPrdName: 'Please select product name',
createSubSystem: 'Commission SubSystem',
modifySubSystem: 'Modify SubSystem',
commission: 'Commission',
customized: 'Project',
selectProject: 'Please select project',
createMapSystemSuccess: 'Create map system success',
createMapSystemFail: 'Create map system failed',
getSubSystemInfoFail: 'Get subsystem infomation failed',
updateMapSystemSuccess: 'Update map system success',
updateMapSystemFail: 'Update map system failed',
generation: 'One-click Generation'
};

View File

@ -101,5 +101,8 @@ export default {
publishScriptSuccess: '发布成功',
publishScriptFailed: '发布失败',
releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?'
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
inputScriptName: '请输入剧本',
selectMap: '请选择地图',
inputScriptDescription: '请输入剧本描述'
};

View File

@ -5,5 +5,23 @@ export default {
name: '名称',
type: '类型',
updateData: '更新',
generate: '生成'
generate: '生成',
selectMap: '请选择地图',
generateSuccess: '生成该地图下子系统成功!',
generateFail: '生成该地图下子系统失败!',
inputName: '请输入子系统名称',
selectType: '请选择类型',
selectPrdName: '请选择产品名称',
createSubSystem: '定制子系统',
modifySubSystem: '修改子系统',
commission: '定制',
customized: '项目',
selectProject: '请选择项目',
createMapSystemSuccess: '创建地图系统成功',
createMapSystemFail: '创建地图系统失败',
getSubSystemInfoFail: '获取子系统信息失败',
updateMapSystemSuccess: '更新地图系统成功',
updateMapSystemFail: '更新地图系统失败',
generation: '一键生成'
};

View File

@ -311,7 +311,7 @@ export const constantRoutes = [
hidden: true
},
{
path: '/jlmap3d/edit',
path: '/design/jlmap3d/edit',
component: Jlmap3dedit,
hidden: true
},

View File

@ -107,7 +107,11 @@ export default {
productType: [
{ enlabel: 'Lesson System', label: '教学系统', value: 'Lesson'},
{ enlabel: 'Exam System', label: '考试系统', value: 'Exam'},
{ enlabel: 'Simulation System', label: '仿真系统', value: 'Simulation'}
{ enlabel: 'Simulation System', label: '仿真系统', value: 'Simulation'},
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
],
customeredProductType: [
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
]
}
};

View File

@ -18,8 +18,7 @@
formModel:{
id:'',
explanation:'',
},
isShow: false,
}
}
},
props: {
@ -60,7 +59,6 @@
},
doClose() {
this.$refs.dataform.resetForm();
this.isShow = false;
this.dialogVisible = false
}
}

View File

@ -187,7 +187,7 @@ export default {
}
},
jlmap3d() {
this.$router.push({ path: '/jlmap3d/edit', query: { mapid: this.editModel.id } });
this.$router.push({ path: '/design/jlmap3d/edit', query: { mapid: this.editModel.id } });
},
importf() {
const loading = this.$loading({

View File

@ -63,10 +63,10 @@ export default {
label: this.$t('map.deleteObj'),
handler: this.deleteObj
},
// {
// label: this.$t('map.jlmap3d'),
// handler: this.jlmap3d
// }
{
label: this.$t('map.jlmap3d'),
handler: this.jlmap3d
}
],
menuNormal: [],
menu: []

View File

@ -48,13 +48,13 @@
rules() {
let crules = {
name: [
{ required: true, message: '请输入剧本', trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
],
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' },
{ required: true, message: this.$t('scriptRecord.selectMap'), trigger: 'change' },
],
description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
]
}
return crules

View File

@ -244,12 +244,21 @@ export default {
covertData(row){
let releaseReview=ConstConfig.ConstSelect.releaseReview;
let lastData=Object.assign({}, row);
if(Cookies.get("user_lang")=="en"){
releaseReview.forEach(function(element){
let rolename=element.value;
if(lastData.status==rolename){
lastData.status=element.enlabel;
}
});
}else{
releaseReview.forEach(function(element){
let rolename=element.value;
if(lastData.status==rolename){
lastData.status=element.label;
}
});
}
return lastData.status;
// let explanation=lastData.explanation?'{ '+lastData.explanation+'}':'';
// return lastData.status+explanation;

View File

@ -0,0 +1,157 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :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>
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd';
export default {
name: 'OnceGenerate',
data() {
return {
dialogVisible: false,
mapList: [],
disabled:null,
productList:[],
mapInfoList:[],
projectList:[],
typeList:[],
formModel:{
mapId:'',
name: "",
prdCode: "",
type: "",
id:null,
}
}
},
mounted() {
this.loadInitData();
},
props: {
title: String,
operateType:String
},
computed: {
form() {
let form={};
if(this.operateType=="add"){
form={
labelWidth: '150px',
items: [
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true,options: this.projectList},
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true,options: this.mapList,change:true,onChange:this.changeMap},
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true,options:this.productList},
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,},
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true,options: this.typeList},
]
}
}
else{
form={
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,},
]
}
}
return form
},
rules() {
let crules ={};
if(this.operateType=="add"){
crules ={customized:[
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'},
],
mapId:[
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'},
],
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' },
],
type:[
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'},
],
prdCode:[
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'},
]
}
}else{
crules ={
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' },
],
};
}
return crules
},
},
methods:{
loadInitData(){
this.projectList=[{value:'xty',label:'西铁院'}];
let customeredProductType=ConstConfig.ConstSelect.customeredProductType;
if(Cookies.get("user_lang")=="en"){
customeredProductType.forEach(elem => {
this.typeList.push({ value: elem.value, label: elem.enlabel });
});
}else{
customeredProductType.forEach(elem => {
this.typeList.push({ value: elem.value, label: elem.label });
});
}
listPublishMap().then(response => {
this.mapInfoList=response.data;
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
changeMap(index){
this.productList=[];
let mapInfo=this.mapInfoList.find(elem=>{
return elem.id==index;
});
getCommodityMapProduct(mapInfo.skinCode).then((response) => {
this.productList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
this.formModel.prdCode="";
});
},
doShow(data) {
if(data){
this.formModel.name=data.name;
this.formModel.id=data.id;
}
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.dialogVisible = false
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 25px 55px 20px 20px;
}
/deep/ .el-dialog--center .el-dialog__body .el-input{
width:200px !important;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :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>
</div>
</template>
<script>
import { listPublishMap } from '@/api/jmap/map'
export default {
name: 'OnceGenerate',
data() {
return {
dialogVisible: false,
mapList: [],
formModel:{
mapId:'',
},
title: this.$t('systemGenerate.generation')
}
},
mounted() {
this.loadInitData();
},
computed: {
form() {
let form={
labelWidth: '150px',
items: [
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true,options: this.mapList},
]
}
return form
},
rules() {
let crules ={
mapId:[
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'},
]
}
return crules
},
},
methods: {
loadInitData() {
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
doShow() {
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.dialogVisible = false
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 25px 55px 20px 30px;
}
</style>

View File

@ -4,6 +4,9 @@
<b>地图子系统生成</b>
</div> -->
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<once-generate ref="generate" @create="generateMapSystem"></once-generate>
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate" operateType="add"></createMapSystem>
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify" operateType="modify"></createMapSystem>
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
<el-select v-model="mapId" clearable placeholder="请选择地图">
<el-option
@ -15,7 +18,6 @@
</el-select>
<el-button type="primary" @click="generate">生成</el-button>
</div> -->
</el-card>
</template>
@ -23,8 +25,10 @@
<script>
import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map';
import { generateMapSystem,getMapSystemPageList } from '@/api/trainingPlatform';
import { generateMapSystem,getMapSystemPageList,createMapSubSystem,getSubSystemInfo,updateSubSystem} from '@/api/trainingPlatform';
import ConstConfig from '@/scripts/ConstConfig';
import OnceGenerate from './generate';
import createMapSystem from './create';
export default {
name: 'SystemGenerate',
@ -101,13 +105,17 @@
},
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd },
{ text: this.$t('systemGenerate.commission'), handler: this.handleAdd },
{ text: this.$t('systemGenerate.generate'), handler: this.generate }
]
},
}
},
components: {
OnceGenerate,
createMapSystem
},
// created(){
// listPublishMap().then(response=>{
// response.data.forEach(elem => {
@ -125,10 +133,37 @@
},
methods: {
updateData(index,row){
getSubSystemInfo(row.id).then(response => {
this.$refs.modifyMapSystem.doShow(response.data);
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
});
},
handleCreate(data){
delete data.id;
createMapSubSystem(data).then(response => {
this.$message.success(this.$t('systemGenerate.createMapSystemSuccess'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.createMapSystemFail'));
});
},
handleModify(data){
let datainfo={'name':data.name};
updateSubSystem(data.id,datainfo).then(response => {
this.$message.success(this.$t('systemGenerate.updateMapSystemSuccess'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.updateMapSystemFail'));
});
},
handleAdd(){
this.$refs.createMapSystem.doShow();
},
reloadTable(){
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
async loadInitData() {
try {
@ -150,28 +185,29 @@
this.queryForm.queryObject.type.config.data.push({ value: elem.value, label: elem.label });
this.prdTypeList.push({ value: elem.value, label: elem.label });
});
}
} catch (error) {
console.error(error, '获取发布地图');
}
},
generate() {
this.$refs.generate.doShow();
},
// generate() {
generateMapSystem(data) {
// if(!this.mapId){this.$messageBox(''); return;}
// this.$confirm('', this.$t('tip.hint'), {
// confirmButtonText: this.$t('tip.confirm'),
// cancelButtonText: this.$t('tip.cancel'),
// type: 'warning'
// }).then(() => {
// generateMapSystem(this.mapId).then(response => {
// this.$message.success('');
// }).catch(() => {
// this.$messageBox('');
// });
generateMapSystem(data.mapId).then(response => {
this.reloadTable();
this.$message.success(this.$t('systemGenerate.generateSuccess'));
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.generateFail'));
});
// }).catch(() => { });
// },
},
queryFunction(params) {
return getMapSystemPageList(params);
},