设计平台 系统管理 子系统 创建子系统接口

This commit is contained in:
joylink_cuiweidong 2019-10-21 18:03:13 +08:00
parent 343372d83a
commit 9fcdda5d60
7 changed files with 213 additions and 23 deletions

View File

@ -5,5 +5,13 @@ 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: 'Create SubSystem',
modifySubSystem: 'Modify SubSystem'
};

View File

@ -5,5 +5,14 @@ export default {
name: '名称',
type: '类型',
updateData: '更新',
generate: '生成'
generate: '生成',
selectMap: '请选择地图',
generateSuccess: '生成该地图下子系统成功!',
generateFail: '生成该地图下子系统失败!',
inputName: '请输入子系统名称',
selectType: '请选择类型',
selectPrdName: '请选择产品名称',
createSubSystem: '创建子系统',
modifySubSystem: '修改子系统'
};

View File

@ -107,7 +107,8 @@ 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'}
]
}
};

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

@ -0,0 +1,91 @@
<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:'',
name: "",
prdCode: "",
type: ""
}
}
},
mounted() {
this.loadInitData();
},
props: {
title: String,
},
computed: {
form() {
let form={
labelWidth: '150px',
items: [
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true,options: this.mapList,change:true, onChange:this.changeMap()},
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true},
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true}
]
}
return form
},
rules() {
let crules ={
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'},
]
}
return crules
},
},
methods:{
loadInitData(){
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
changeMap(){
},
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>

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: '一键生成',
}
},
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,7 +4,9 @@
<b>地图子系统生成</b>
</div> -->
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<once-generate ref="generate" @create="create"></once-generate>
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')"></createMapSystem>
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')"></createMapSystem>
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
<el-select v-model="mapId" clearable placeholder="请选择地图">
<el-option
@ -16,7 +18,6 @@
</el-select>
<el-button type="primary" @click="generate">生成</el-button>
</div> -->
</el-card>
</template>
@ -26,6 +27,8 @@
import { listPublishMap } from '@/api/jmap/map';
import { generateMapSystem,getMapSystemPageList } from '@/api/trainingPlatform';
import ConstConfig from '@/scripts/ConstConfig';
import OnceGenerate from './generate';
import createMapSystem from './create';
export default {
name: 'SystemGenerate',
@ -109,6 +112,10 @@
}
},
components: {
OnceGenerate,
createMapSystem
},
// created(){
// listPublishMap().then(response=>{
// response.data.forEach(elem => {
@ -129,7 +136,7 @@
},
handleAdd(){
this.$refs.createMapSystem.doShow();
},
async loadInitData() {
try {
@ -158,21 +165,22 @@
}
},
generate() {
this.$refs.generate.doShow();
},
create(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(data.mapId).then(response => {
this.$message.success(this.$t('systemGenerate.generateSuccess'));
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.generateFail'));
});
// }).catch(() => { });
},
// generate() {
// 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('');
// });
// }).catch(() => { });
// },
queryFunction(params) {
return getMapSystemPageList(params);
},