设计平台 系统管理 子系统 创建子系统接口调整
This commit is contained in:
parent
9fcdda5d60
commit
c04abcc67a
@ -57,3 +57,13 @@ export function getMapSystemPageList(params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function createMapSubSystem(data) {
|
||||
/** 创建地图系统 */
|
||||
return request({
|
||||
url: `/api/mapSystem`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,11 @@ export default {
|
||||
inputName: 'Please input subsystem name',
|
||||
selectType: 'Please select type',
|
||||
selectPrdName: 'Please select product name',
|
||||
createSubSystem: 'Create SubSystem',
|
||||
modifySubSystem: 'Modify SubSystem'
|
||||
createSubSystem: 'Commission SubSystem',
|
||||
modifySubSystem: 'Modify SubSystem',
|
||||
commission: 'Commission',
|
||||
customized: 'Project',
|
||||
selectProject: 'Please select project',
|
||||
createMapSystemSuccess: 'Create map system success',
|
||||
createMapSystemFail: 'Create map system fail'
|
||||
};
|
||||
|
@ -12,7 +12,12 @@ export default {
|
||||
inputName: '请输入子系统名称',
|
||||
selectType: '请选择类型',
|
||||
selectPrdName: '请选择产品名称',
|
||||
createSubSystem: '创建子系统',
|
||||
modifySubSystem: '修改子系统'
|
||||
createSubSystem: '定制子系统',
|
||||
modifySubSystem: '修改子系统',
|
||||
commission: '定制',
|
||||
customized: '项目',
|
||||
selectProject: '请选择项目',
|
||||
createMapSystemSuccess: '创建地图系统成功',
|
||||
createMapSystemFail: '创建地图系统失败'
|
||||
|
||||
};
|
||||
|
@ -109,6 +109,9 @@ export default {
|
||||
{ enlabel: 'Exam System', label: '考试系统', value: 'Exam'},
|
||||
{ enlabel: 'Simulation System', label: '仿真系统', value: 'Simulation'},
|
||||
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
|
||||
],
|
||||
customeredProductType: [
|
||||
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
@ -10,13 +10,20 @@
|
||||
</div>
|
||||
</template>
|
||||
<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 {
|
||||
name: 'OnceGenerate',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
mapList: [],
|
||||
productList:[],
|
||||
mapInfoList:[],
|
||||
projectList:[],
|
||||
typeList:[],
|
||||
formModel:{
|
||||
mapId:'',
|
||||
name: "",
|
||||
@ -36,16 +43,20 @@
|
||||
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}
|
||||
{ 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},
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules ={
|
||||
customized:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'},
|
||||
],
|
||||
mapId:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'},
|
||||
],
|
||||
@ -65,12 +76,32 @@
|
||||
},
|
||||
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(){
|
||||
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() {
|
||||
this.dialogVisible = true
|
||||
@ -89,3 +120,11 @@
|
||||
}
|
||||
};
|
||||
</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>
|
||||
|
@ -4,9 +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>
|
||||
<once-generate ref="generate" @create="generateMapSystem"></once-generate>
|
||||
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate"></createMapSystem>
|
||||
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify"></createMapSystem>
|
||||
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
|
||||
<el-select v-model="mapId" clearable placeholder="请选择地图">
|
||||
<el-option
|
||||
@ -25,7 +25,7 @@
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
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 OnceGenerate from './generate';
|
||||
import createMapSystem from './create';
|
||||
@ -105,7 +105,7 @@
|
||||
},
|
||||
],
|
||||
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 }
|
||||
]
|
||||
},
|
||||
@ -134,10 +134,27 @@
|
||||
methods: {
|
||||
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(){
|
||||
this.$refs.createMapSystem.doShow();
|
||||
},
|
||||
reloadTable(){
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
async loadInitData() {
|
||||
try {
|
||||
// 获取地图
|
||||
@ -158,7 +175,6 @@
|
||||
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, '获取发布地图');
|
||||
@ -167,7 +183,7 @@
|
||||
generate() {
|
||||
this.$refs.generate.doShow();
|
||||
},
|
||||
create(data) {
|
||||
generateMapSystem(data) {
|
||||
// if(!this.mapId){this.$messageBox('请选择要生成子系统的地图!'); return;}
|
||||
// this.$confirm('此操作将生成该地图下子系统,是否继续?', this.$t('tip.hint'), {
|
||||
// confirmButtonText: this.$t('tip.confirm'),
|
||||
@ -175,6 +191,7 @@
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
generateMapSystem(data.mapId).then(response => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('systemGenerate.generateSuccess'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.generateFail'));
|
||||
|
Loading…
Reference in New Issue
Block a user