线路数据管理-生成实训

This commit is contained in:
dong 2023-05-23 15:54:33 +08:00
parent 88b9ac889c
commit ac1ef8e5a8
2 changed files with 31 additions and 1 deletions

View File

@ -314,3 +314,11 @@ export function getClientDataById(mapId) {
method: 'get' method: 'get'
}); });
} }
/** 发布地图根据id生成实训 */
export function generateTrainingData(data) {
return request({
url: `/api/v2/training/rule/generate/mapId`,
method: 'post',
data: data
});
}

View File

@ -27,7 +27,7 @@
<script> <script>
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo, import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo,
getPublishMapExport, getPublishMapImportNew, generateAncillaryData, allSimulationCheck } from '@/api/jmap/map'; getPublishMapExport, getPublishMapImportNew, generateAncillaryData, allSimulationCheck, generateTrainingData } from '@/api/jmap/map';
import { getLineCodeList } from '@/api/management/mapline'; import { getLineCodeList } from '@/api/management/mapline';
import localStore from 'storejs'; import localStore from 'storejs';
import UpdateOperate from './draft.vue'; import UpdateOperate from './draft.vue';
@ -215,6 +215,10 @@ export default {
{ {
name: '每日运行图管理', name: '每日运行图管理',
handleClick: this.runPlanEveryDayManage handleClick: this.runPlanEveryDayManage
},
{
name: '生成实训',
handleClick: this.produceTraining
} }
] ]
} }
@ -491,6 +495,24 @@ export default {
}); });
}).catch(() => { }); }).catch(() => { });
}, },
produceTraining(index, row) {
this.$confirm('是否生成实训?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
generateTrainingData([row.id]).then(res => {
if (res.data.length) {
const s = res.data.join(';');
this.$message.error(`生成实训失败!${s}`);
} else {
this.$message.success('生成实训成功!');
}
}).catch((err) => {
this.$message.error(`生成实训失败!${err.message}`);
});
});
},
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
}, },