添加子系统生成页面

This commit is contained in:
fan 2019-10-17 17:11:15 +08:00
parent fa4c7a6599
commit 534fa388e8
9 changed files with 95 additions and 11 deletions

View File

@ -25,3 +25,11 @@ export function getTrainingSystemListByMapId(mapId) {
method: 'get' method: 'get'
}); });
} }
export function generateMapSystem(mapId) {
/** 根据mapId生成地图子系统 */
return request({
url: `/api/mapSystem/generate/${mapId}`,
method: 'post'
});
}

View File

@ -14,7 +14,7 @@ export default {
scriptPreview: 'Script Preview', scriptPreview: 'Script Preview',
passedScript: 'Passed Script', passedScript: 'Passed Script',
rejectScript: 'Reject Script', rejectScript: 'Reject Script',
explanation: 'explanation', explanation: 'Explanation',
inputScriptName: 'Please input script name', inputScriptName: 'Please input script name',
inputRejectExplanation: 'Please input reject explanation', inputRejectExplanation: 'Please input reject explanation',
passedScriptSuccess: 'Passed script success', passedScriptSuccess: 'Passed script success',

View File

@ -229,5 +229,6 @@ export default {
editPlanningTrain: 'Edit planning train', editPlanningTrain: 'Edit planning train',
runGraphName: 'Run graph name', runGraphName: 'Run graph name',
tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】', tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】',
serverTrainNum: '表号车次号' serverTrainNum: '表号车次号',
explanation: 'Explanation'
}; };

View File

@ -66,5 +66,6 @@ export default {
releaseApplication: 'Release application', releaseApplication: 'Release application',
courseApplication: 'Course release application', courseApplication: 'Course release application',
scriptReleaseApplication: 'Script release application', scriptReleaseApplication: 'Script release application',
runGraphReleaseApplication: 'Run graph release application' runGraphReleaseApplication: 'Run graph release application',
subsystemGeneration: 'Subsystem generation'
}; };

View File

@ -232,5 +232,6 @@ export default {
endTime: '终到时间', endTime: '终到时间',
editPlanningTrain: '编辑计划车', editPlanningTrain: '编辑计划车',
tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】', tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】',
serverTrainNum: '表号车次号' serverTrainNum: '表号车次号',
explanation: '驳回说明',
}; };

View File

@ -67,5 +67,6 @@ export default {
releaseApplication: '发布申请', releaseApplication: '发布申请',
courseApplication: '课程发布申请', courseApplication: '课程发布申请',
scriptReleaseApplication: '剧本发布申请', scriptReleaseApplication: '剧本发布申请',
runGraphReleaseApplication: '运行图发布申请' runGraphReleaseApplication: '运行图发布申请',
subsystemGeneration: '子系统生成'
}; };

View File

@ -110,7 +110,10 @@ import CacheControl from '@/views/management/cacheControl/index';
import LessonApproval from '@/views/approval/lesson/index'; import LessonApproval from '@/views/approval/lesson/index';
import ScriptApproval from '@/views/approval/script/index'; import ScriptApproval from '@/views/approval/script/index';
import runPlanApproval from '@/views/approval/runPlan/index'; import RunPlanApproval from '@/views/approval/runPlan/index';
import SystemGenerate from '@/views/systemGenerate/index';
import { loginTitle } from '@/scripts/ConstDic'; import { loginTitle } from '@/scripts/ConstDic';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
@ -1045,6 +1048,13 @@ export const asyncRouter = [
meta: { meta: {
i18n: 'router.existingSimulation' i18n: 'router.existingSimulation'
} }
},
{
path: 'systemGenerate',
component: SystemGenerate,
meta: {
i18n: 'router.subsystemGeneration'
}
} }
] ]
}, },
@ -1072,7 +1082,7 @@ export const asyncRouter = [
}, },
{ {
path: 'runGraph', path: 'runGraph',
component: runPlanApproval, component: RunPlanApproval,
meta: { meta: {
i18n: 'router.runGraphReleaseApplication' i18n: 'router.runGraphReleaseApplication'
} }

View File

@ -1,14 +1,14 @@
<template> <template>
<el-card :style="{height: height+'px'}"> <el-card :style="{height: height+'px'}">
<div class="runPlanHeader"> <div class="runPlanHeader">
<div class="runPlanList">运行图列表</div> <div class="runPlanList">{{$t('planMonitor.openRunPlan.runPlanList')}}</div>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">创建运行图</el-button> <el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">{{$t('planMonitor.createRunningDiagram')}}</el-button>
</div> </div>
<el-table :data="runPlanList" height="600" stripe <el-table :data="runPlanList" height="600" stripe
border border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;"> style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<el-table-column prop="name" label="运行图名称" /> <el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" />
<el-table-column label="状态"> <el-table-column :label="this.$('global.status')">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{handlerStatus(scope.row)}}</span> <span>{{handlerStatus(scope.row)}}</span>
</template> </template>

View File

@ -0,0 +1,62 @@
<template>
<el-card>
<div slot="header" style="text-align: center;">
<b>地图子系统生成</b>
</div>
<div style="margin:50px" :style="{ height: height - 160 +'px' }">
<el-select v-model="mapId" clearable placeholder="请选择">
<el-option
v-for="item in mapList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button type="primary" @click="generate">生成</el-button>
</div>
</el-card>
</template>
<script>
import { listPublishMap } from '@/api/jmap/map';
import { generateMapSystem } from '@/api/trainingPlatform';
export default {
name: 'SystemGenerate',
data() {
return{
mapList:[],
mapId: ''
}
},
created(){
listPublishMap().then(response=>{
response.data.forEach(elem => {
this.mapList.push({ value: elem.id, label: elem.name });
});
});
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
methods: {
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(() => { });
}
}
}
</script>