实训管理调整

This commit is contained in:
fan 2020-04-07 16:41:08 +08:00
parent 87ddad535b
commit d3bd167c70
6 changed files with 83 additions and 59 deletions

View File

@ -106,9 +106,10 @@ export function getCommandDetail(id) {
}
// 获取指令列表
export function getCmdList(lineCode) {
export function getCmdList(lineCode, simulationRole) {
return request({
url: `/api/cmd/line/${lineCode}`,
method: 'get'
method: 'get',
params: {simulationRole: simulationRole}
});
}

View File

@ -115,5 +115,6 @@ export default {
simulationOperationIsNotDefined: 'The simulation operation is not defined',
simulationOperationFailed: 'The simulation operation failed',
operationConflict: 'Operation conflict',
simulationOperationProcessingMethodNotFound: 'Simulation operation processing method not found'
simulationOperationProcessingMethodNotFound: 'Simulation operation processing method not found',
failedToObtainTrainingType: 'Failed to obtain training type'
};

View File

@ -115,5 +115,6 @@ export default {
simulationOperationIsNotDefined: '仿真操做未定义',
simulationOperationFailed: '仿真操做执行失败',
operationConflict: '操做冲突',
simulationOperationProcessingMethodNotFound: '仿真操做处理方法未找到'
simulationOperationProcessingMethodNotFound: '仿真操做处理方法未找到',
failedToObtainTrainingType: '获取实训类型失败'
};

View File

@ -155,6 +155,19 @@ export default {
{ enlabel: 'Driver simulation driving system', label: '司机模拟驾驶系统', value: '04'},
{ enlabel: 'Dispatch workstation', label: '派班工作站', value: '05'},
{ enlabel: 'ISCS workstation', label: 'ISCS工作站', value: '06'}
]
],
trainingPrdType: [
{ enlabel: 'ATS local workstation', label: 'ATS现地工作站', value: 'Local'},
{ enlabel: 'ATS Traffic dispatching workstation', label: 'ATS行调工作站', value: 'Center'}
],
trainingDeviceType: {
Switch: {enlabel: 'Switch training', label:'道岔实训'},
Section: {enlabel: 'Section training', label:'区段实训'},
Signal: {enlabel: 'Signal training', label:'信号机实训'},
Stand: {enlabel: 'Stand training', label:'站台实训'},
Station: {enlabel: 'Station training', label:'车站实训'},
ControlConvertMenu: {enlabel: 'Control mode training', label:'控制模式实训'},
TrainWindow: {enlabel: 'TrainWindow training', label:'车次窗实训'}
}
}
};

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -23,10 +23,11 @@ import { pageQueryTraining, pageQueryTrainingNew } from '@/api/jmap/training';
import { trainingNotify, trainingNotifyNew } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { getOperateTrainingList } from '@/api/management/operation';
import { getCmdList } from '@/api/management/dictionary';
import { UrlConfig } from '@/scripts/ConstDic';
import TrainingDraft from './draft';
import localStore from 'storejs';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'TrainingGeneration',
@ -37,7 +38,15 @@ export default {
return {
mapIdList: [],
trainingTypeList: [],
trainingOperateTypeMap: {},
trainingOperateTypeMap: {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: []
},
trainingTypeMap: {},
pagerConfig: {
pageSize: 'pageSize',
@ -175,65 +184,64 @@ export default {
this.$Dictionary.trainingType().then(list => {
this.trainingTypeList = list;
});
this.trainingOperateTypeMap = {};
const list01 = await this.$Dictionary.stationControl();
this.trainingOperateTypeMap['01'] = list01; //
const list02 = await this.$Dictionary.signalOperation();
this.trainingOperateTypeMap['02'] = list02; //
const list03 = await this.$Dictionary.switchOperation();
this.trainingOperateTypeMap['03'] = list03; //
const list04 = await this.$Dictionary.sectionOperation();
this.trainingOperateTypeMap['04'] = list04; //
const list05 = await this.$Dictionary.stationStandOperation();
this.trainingOperateTypeMap['05'] = list05; //
const list06 = await this.$Dictionary.trainPlanOperation();
this.trainingOperateTypeMap['06'] = list06; //
const list07 = await this.$Dictionary.trainOperation();
this.trainingOperateTypeMap['07'] = list07; //
const list08 = await this.$Dictionary.limitOperation();
this.trainingOperateTypeMap['08'] = list08; //
let val;
for ( val in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
}
for ( val in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['Station'][val]);
}
for ( val in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
await this.prdChoose(queryData);
this.reloadTable();
},
async prdChoose(queryData) {
this.trainingTypeMap = {};
const mapId = this.$route.query.mapId;
const res = await getOperateTrainingList({ mapId: mapId, productType: queryData.prdType });
if (res && res.code == 200) {
const trainingTypeLists = res.data;
this.trainingTypeList.forEach(elem => {
trainingTypeLists.forEach(item => {
if (item.id == elem.code) {
item.label = elem.name;
item.value = elem.code;
}
if (this.trainingOperateTypeMap[item.id].length) {
this.trainingOperateTypeMap[item.id].forEach(i => {
item.children.forEach(v => {
if (i.code == v.id) {
v.name = i.name;
v.code = i.code;
const lineCode = this.$route.query.lineCode;
const res = await getCmdList(lineCode, queryData.prdType);
const trainingOperateList = [];
const trainingOperateConfigList = [];
const operateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: []
};
if (res && res.code === 200) {
res.data.forEach(item => {
this.trainingOperateTypeMap[item.operateObject].forEach(ele => {
if (ele.value === item.operate) {
operateTypeMap[item.operateObject].push(ele);
}
});
});
if (!trainingOperateList.includes(item.operateObject)) {
trainingOperateList.push(item.operateObject);
const objectLabel = ConstConfig.ConstSelect.trainingDeviceType[item.operateObject] || {};
trainingOperateConfigList.push({value: item.operateObject, label: Cookies.get('user_lang') == 'en' ? objectLabel.enlabel : objectLabel.label});
}
});
});
trainingTypeLists.forEach(item => {
item.children.forEach(v => {
if (!this.trainingTypeMap[item.id]) {
this.trainingTypeMap[item.id] = [];
}
this.trainingTypeMap[item.id].push({
label: v.name,
value: v.code
});
});
});
this.queryForm.queryObject.type.config.data = trainingTypeLists;
this.queryForm.queryObject.type.config.data = trainingOperateConfigList;
this.trainingTypeMap = operateTypeMap;
} else {
this.$message.error(this.$t('error.failedToObtainTrainingType'));
}
},
typeChoose(form) {