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

This commit is contained in:
joylink_cuiweidong 2019-10-22 09:36:37 +08:00
parent 9fcdda5d60
commit c04abcc67a
6 changed files with 97 additions and 18 deletions

View File

@ -57,3 +57,13 @@ export function getMapSystemPageList(params) {
params params
}); });
} }
export function createMapSubSystem(data) {
/** 创建地图系统 */
return request({
url: `/api/mapSystem`,
method: 'post',
data: data
});
}

View File

@ -12,6 +12,11 @@ export default {
inputName: 'Please input subsystem name', inputName: 'Please input subsystem name',
selectType: 'Please select type', selectType: 'Please select type',
selectPrdName: 'Please select product name', selectPrdName: 'Please select product name',
createSubSystem: 'Create SubSystem', createSubSystem: 'Commission SubSystem',
modifySubSystem: 'Modify SubSystem' modifySubSystem: 'Modify SubSystem',
commission: 'Commission',
customized: 'Project',
selectProject: 'Please select project',
createMapSystemSuccess: 'Create map system success',
createMapSystemFail: 'Create map system fail'
}; };

View File

@ -12,7 +12,12 @@ export default {
inputName: '请输入子系统名称', inputName: '请输入子系统名称',
selectType: '请选择类型', selectType: '请选择类型',
selectPrdName: '请选择产品名称', selectPrdName: '请选择产品名称',
createSubSystem: '创建子系统', createSubSystem: '定制子系统',
modifySubSystem: '修改子系统' modifySubSystem: '修改子系统',
commission: '定制',
customized: '项目',
selectProject: '请选择项目',
createMapSystemSuccess: '创建地图系统成功',
createMapSystemFail: '创建地图系统失败'
}; };

View File

@ -109,6 +109,9 @@ export default {
{ enlabel: 'Exam System', label: '考试系统', value: 'Exam'}, { enlabel: 'Exam System', label: '考试系统', value: 'Exam'},
{ enlabel: 'Simulation System', label: '仿真系统', value: 'Simulation'}, { enlabel: 'Simulation System', label: '仿真系统', value: 'Simulation'},
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'} { enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
],
customeredProductType: [
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
] ]
} }
}; };

View File

@ -10,13 +10,20 @@
</div> </div>
</template> </template>
<script> <script>
import { listPublishMap } from '@/api/jmap/map' import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd';
export default { export default {
name: 'OnceGenerate', name: 'OnceGenerate',
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
mapList: [], mapList: [],
productList:[],
mapInfoList:[],
projectList:[],
typeList:[],
formModel:{ formModel:{
mapId:'', mapId:'',
name: "", name: "",
@ -36,16 +43,20 @@
let form={ let form={
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true,options: this.mapList,change:true, onChange:this.changeMap()}, { prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true,options: this.projectList},
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true}, { prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true,options: this.mapList,change:true,onChange:this.changeMap},
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true}, { prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true,options:this.productList},
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true} { 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},
] ]
} }
return form return form
}, },
rules() { rules() {
let crules ={ let crules ={
customized:[
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'},
],
mapId:[ mapId:[
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'}, { required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'},
], ],
@ -65,12 +76,32 @@
}, },
methods:{ methods:{
loadInitData(){ 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 => { listPublishMap().then(response => {
this.mapInfoList=response.data;
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } }); this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
}) })
}, },
changeMap(){ 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() { doShow() {
this.dialogVisible = true this.dialogVisible = true
@ -89,3 +120,11 @@
} }
}; };
</script> </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

@ -4,9 +4,9 @@
<b>地图子系统生成</b> <b>地图子系统生成</b>
</div> --> </div> -->
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<once-generate ref="generate" @create="create"></once-generate> <once-generate ref="generate" @create="generateMapSystem"></once-generate>
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')"></createMapSystem> <createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate"></createMapSystem>
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')"></createMapSystem> <createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify"></createMapSystem>
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }"> <!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
<el-select v-model="mapId" clearable placeholder="请选择地图"> <el-select v-model="mapId" clearable placeholder="请选择地图">
<el-option <el-option
@ -25,7 +25,7 @@
<script> <script>
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { generateMapSystem,getMapSystemPageList } from '@/api/trainingPlatform'; import { generateMapSystem,getMapSystemPageList,createMapSubSystem } from '@/api/trainingPlatform';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import OnceGenerate from './generate'; import OnceGenerate from './generate';
import createMapSystem from './create'; import createMapSystem from './create';
@ -105,7 +105,7 @@
}, },
], ],
actions: [ 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 } { text: this.$t('systemGenerate.generate'), handler: this.generate }
] ]
}, },
@ -134,10 +134,27 @@
methods: { methods: {
updateData(index,row){ updateData(index,row){
},
handleCreate(data){
debugger;
createMapSubSystem(data).then(response => {
this.$message.success(this.$t('systemGenerate.createMapSystemSuccess'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.createMapSystemFail'));
});
},
handleModify(){
}, },
handleAdd(){ handleAdd(){
this.$refs.createMapSystem.doShow(); this.$refs.createMapSystem.doShow();
}, },
reloadTable(){
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
async loadInitData() { async loadInitData() {
try { try {
// //
@ -158,7 +175,6 @@
this.queryForm.queryObject.type.config.data.push({ value: elem.value, label: elem.label }); this.queryForm.queryObject.type.config.data.push({ value: elem.value, label: elem.label });
this.prdTypeList.push({ value: elem.value, label: elem.label }); this.prdTypeList.push({ value: elem.value, label: elem.label });
}); });
} }
} catch (error) { } catch (error) {
console.error(error, '获取发布地图'); console.error(error, '获取发布地图');
@ -167,7 +183,7 @@
generate() { generate() {
this.$refs.generate.doShow(); this.$refs.generate.doShow();
}, },
create(data) { generateMapSystem(data) {
// if(!this.mapId){this.$messageBox(''); return;} // if(!this.mapId){this.$messageBox(''); return;}
// this.$confirm('', this.$t('tip.hint'), { // this.$confirm('', this.$t('tip.hint'), {
// confirmButtonText: this.$t('tip.confirm'), // confirmButtonText: this.$t('tip.confirm'),
@ -175,6 +191,7 @@
// type: 'warning' // type: 'warning'
// }).then(() => { // }).then(() => {
generateMapSystem(data.mapId).then(response => { generateMapSystem(data.mapId).then(response => {
this.reloadTable();
this.$message.success(this.$t('systemGenerate.generateSuccess')); this.$message.success(this.$t('systemGenerate.generateSuccess'));
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('systemGenerate.generateFail')); this.$messageBox(this.$t('systemGenerate.generateFail'));