实训管理和项目设备登录调整

This commit is contained in:
fan 2023-12-01 13:27:31 +08:00
parent 3fcf066e66
commit bd310dbc28
12 changed files with 138 additions and 95 deletions

View File

@ -32,14 +32,21 @@ export function updateTraining(data) {
data data
}); });
} }
/** 更新实训标签 */ /** 更新发布实训信息(标签 描述, 标题) */
export function updateTrainingLabel(data) { export function updateTrainingInfo(data) {
return request({ return request({
url: `/api/v2/training/published/update/label`, url: `/api/v2/training/published/update`,
method: 'put', method: 'put',
data data
}); });
} }
/** 已发布实训转为草稿 */
export function saveAsTrainingDraft(trainingId) {
return request({
url: `/api/v2/training/published/${trainingId}/saveAsDraft`,
method: 'post'
});
}
/** 查询步骤列表 */ /** 查询步骤列表 */
export function getTrainingStepList(trainingId) { export function getTrainingStepList(trainingId) {
return request({ return request({

BIN
src/assets/bg_pis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
src/assets/bg_tms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -234,7 +234,9 @@ export default {
{ label: '列车', value: 'TRAIN' }, { label: '列车', value: 'TRAIN' },
{ label: 'UDP客户端', value: 'UDP_CLIENT' }, { label: 'UDP客户端', value: 'UDP_CLIENT' },
{ label: '站台PIS', value: 'PIS_STAND' }, { label: '站台PIS', value: 'PIS_STAND' },
{ label: '列车PIS', value: 'PIS_TRAIN' } { label: '列车PIS', value: 'PIS_TRAIN' },
{ label: '乘客PIS', value: 'PIS' },
{ label: 'TMS', value: 'TMS' }
], ],
ossList: [ ossList: [
{ name: '场景1', url: '场景1—桂花园道岔故障配分版60分.pdf' }, { name: '场景1', url: '场景1—桂花园道岔故障配分版60分.pdf' },

View File

@ -35,7 +35,7 @@ export function getTopic(type, group, param) {
topic = `/queue/simulation/${group}/iscs/gate/${param.stationCode}`; topic = `/queue/simulation/${group}/iscs/gate/${param.stationCode}`;
break; break;
case 'TMS': case 'TMS':
topic = `/queue/simulation/${group}/train/001/tms` topic = `/queue/simulation/${group}/train/001/tms`;
break; break;
case 'PIS_STAND': case 'PIS_STAND':
topic = `/queue/simulation/${group}/standPis/${param.standCode}`; topic = `/queue/simulation/${group}/standPis/${param.standCode}`;

View File

@ -57,6 +57,8 @@ import bgIscsImg from '@/assets/bg_iscs.jpg';
import bgCctvImg from '@/assets/bg_cctv.jpg'; import bgCctvImg from '@/assets/bg_cctv.jpg';
import bgLswImg from '@/assets/bg_lsw.jpg'; import bgLswImg from '@/assets/bg_lsw.jpg';
import bgPsdImg from '@/assets/bg_psd.png'; import bgPsdImg from '@/assets/bg_psd.png';
import bgPisImg from '@/assets/bg_pis.png';
import bgTmsImg from '@/assets/bg_tms.png';
import ZongheIcon from '@/assets/icon/icon_zonghe.png'; import ZongheIcon from '@/assets/icon/icon_zonghe.png';
import { getLoginWmurl, checkLoginStatus, getLoginInfo } from '@/api/login'; import { getLoginWmurl, checkLoginStatus, getLoginInfo } from '@/api/login';
import { getToken} from '@/utils/auth'; import { getToken} from '@/utils/auth';
@ -97,7 +99,7 @@ export default {
return this.$route.query.type; return this.$route.query.type;
}, },
syncLogin() { syncLogin() {
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW', 'PIS_STAND', 'PIS_TRAIN']; const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW', 'PIS_STAND', 'PIS_TRAIN', 'PIS', 'TMS'];
return this.type ? synchronousLogin.includes(this.type) : false; return this.type ? synchronousLogin.includes(this.type) : false;
}, },
bgImg() { bgImg() {
@ -142,7 +144,9 @@ export default {
ILW:{text:'检测教员机登录中', Img:bgLswImg}, ILW:{text:'检测教员机登录中', Img:bgLswImg},
PIS_TRAIN:{text:'检测教员机登录中'}, PIS_TRAIN:{text:'检测教员机登录中'},
PIS_STAND:{text:'检测教员机登录中'}, PIS_STAND:{text:'检测教员机登录中'},
SANDBOX:{Img:bgLswImg, text:'检测教员机登录中'} SANDBOX:{Img:bgLswImg, text:'检测教员机登录中'},
PIS:{text:'检测教员机登录中', Img: bgPisImg},
TMS:{text:'检测列车驾驶终端登录中', Img: bgTmsImg}
}; };
this.loadingText = deviceMap[this.type].text; this.loadingText = deviceMap[this.type].text;
this.deviceImg = deviceMap[this.type].Img; this.deviceImg = deviceMap[this.type].Img;

View File

@ -24,7 +24,7 @@ import { loadTrainingBg } from '@/api/jmap/training';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import { loadDraftTraining } from '@/api/jmap/training'; import { loadDraftTraining } from '@/api/jmap/training';
import { deleteTraining, publishTraining } from '@/api/trainingManage'; import { deleteTraining, publishTraining, jumpToTraining } from '@/api/trainingManage';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
export default { export default {
@ -206,6 +206,18 @@ export default {
this.$jlmap && this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y}); this.$jlmap && this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
} }
this.$emit('updateDetails', resp.data); this.$emit('updateDetails', resp.data);
if (resp.data && resp.data.needRunToFinalStep) {
this.$confirm('此草稿实训为转存后实训且未保存步骤背景,如需编辑则需快速仿真到最后一步!', this.$t('global.tips'), {
confirmButtonText: '快速仿真',
cancelButtonText: this.$t('global.cancel'),
type: 'info'
}).then(() => {
const stepList = JSON.parse(resp.data.stepJson);
jumpToTraining(this.$route.query.group, stepList[stepList.length - 1].id).then(()=>{
this.$message.success('开始快速仿真!');
}).catch(e => this.$message.error('开始快速仿真失败!'));
});
}
}).catch((e) => { }).catch((e) => {
console.error(e); console.error(e);
this.$emit('updateDetails', {}); this.$emit('updateDetails', {});

View File

@ -53,7 +53,7 @@
</template> </template>
<script> <script>
import { updateTrainingLabel } from '@/api/trainingManage'; import { updateTrainingInfo } from '@/api/trainingManage';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
export default { export default {
@ -87,8 +87,8 @@ export default {
const form = { const form = {
labelWidth: '90px', labelWidth: '90px',
items: [ items: [
{ prop: 'name', label: '名称', type: 'text', required: true, disabled: true }, { prop: 'name', label: '名称', type: 'text', required: true },
{ prop: 'description', label: '描述', type: 'textarea', isAutoSize: true, required: true, disabled: true }, { prop: 'description', label: '描述', type: 'textarea', isAutoSize: true, required: true },
{ prop: 'type', label: '类型', type: 'select', options: ConstConfig.ConstSelect.trainingType, required: true, disabled: true } { prop: 'type', label: '类型', type: 'select', options: ConstConfig.ConstSelect.trainingType, required: true, disabled: true }
] ]
}; };
@ -168,8 +168,9 @@ export default {
const cpData = Object.assign({}, this.formModel); const cpData = Object.assign({}, this.formModel);
cpData.client = this.formModel.type === 'SINGLE' ? this.tagForm.client : ''; cpData.client = this.formModel.type === 'SINGLE' ? this.tagForm.client : '';
cpData.labelJson = JSON.stringify(this.tagForm.dynamicTags); cpData.labelJson = JSON.stringify(this.tagForm.dynamicTags);
const api = updateTrainingLabel; const api = updateTrainingInfo;
const mes = '编辑标签'; const mes = '编辑标签';
console.log(cpData, 'cpData');
api(cpData).then(res => { api(cpData).then(res => {
this.$message.success(`${mes}成功!`); this.$message.success(`${mes}成功!`);
this.$emit('editLabel'); this.$emit('editLabel');

View File

@ -14,7 +14,7 @@ import { launchFullscreen } from '@/utils/screen';
import editTraining from './editTraining'; import editTraining from './editTraining';
import { superAdmin, admin } from '@/router/index'; import { superAdmin, admin } from '@/router/index';
import { getAllPublishTrainingList, getManageTrainingListInOrg, publishTrainingPutOn, publishTrainingPutOff, publishTrainingDelete } from '@/api/jmap/training'; import { getAllPublishTrainingList, getManageTrainingListInOrg, publishTrainingPutOn, publishTrainingPutOff, publishTrainingDelete } from '@/api/jmap/training';
import { exportTrainingData, importTrainingData } from '@/api/trainingManage'; import { exportTrainingData, importTrainingData, saveAsTrainingDraft } from '@/api/trainingManage';
export default { export default {
name:'TrainingManage', name:'TrainingManage',
components: { components: {
@ -102,7 +102,7 @@ export default {
{ {
type: 'button', type: 'button',
title: this.$t('trainingManage.operate'), title: this.$t('trainingManage.operate'),
width: '240', width: '330',
buttons: [ buttons: [
// { // {
// name: '', // name: '',
@ -111,11 +111,17 @@ export default {
// showControl:(row) => { return row.mapSystem; } // showControl:(row) => { return row.mapSystem; }
// } // }
{ {
name: '修改标签', name: '修改信息',
handleClick: this.handlerEditLabel, handleClick: this.handlerEditLabel,
type: 'primary', type: 'primary',
showControl: row => { return this.isAdmin; } showControl: row => { return this.isAdmin; }
}, },
{
name: '存为草稿',
handleClick: this.handlerSaveDraft,
type: 'primary',
showControl: row => { return this.isAdmin; }
},
{ {
name: '上架', name: '上架',
handleClick: this.handlerShelf, handleClick: this.handlerShelf,
@ -226,6 +232,17 @@ export default {
handlerEditLabel(index, data) { handlerEditLabel(index, data) {
this.$refs.editTraining.doShow(data); this.$refs.editTraining.doShow(data);
}, },
handlerSaveDraft(index, data) {
this.$confirm('此操作将实训转存为草稿, 是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'info'
}).then(() => {
saveAsTrainingDraft(data.id).then(resp=>{
this.$message.success('转存为草稿成功!');
}).catch(e => this.$message.error('转存为草稿失败!'));
});
},
handlerShelf(index, data) { handlerShelf(index, data) {
publishTrainingPutOn({ids: [data.id]}).then(resp=>{ publishTrainingPutOn({ids: [data.id]}).then(resp=>{
this.queryList.reload(); this.queryList.reload();

View File

@ -484,7 +484,6 @@ export default {
handleMember(member, stationList) { handleMember(member, stationList) {
const data = { value: member.id, label: '', memberType: member.type }; const data = { value: member.id, label: '', memberType: member.type };
const device = stationList.find(station => station.code === member.deviceCode) || {}; const device = stationList.find(station => station.code === member.deviceCode) || {};
console.log(member, '====');
switch (member.type) { switch (member.type) {
case 'DISPATCHER': case 'DISPATCHER':
data.label = '行调' + (member.name ? `-${member.name }` : ''); data.label = '行调' + (member.name ? `-${member.name }` : '');

View File

@ -82,7 +82,9 @@ export default {
UDP_CLIENT: 'UDP客户端', UDP_CLIENT: 'UDP客户端',
PIS_STAND: '站台PIS', PIS_STAND: '站台PIS',
PIS_TRAIN: '列车PIS', PIS_TRAIN: '列车PIS',
UDP_LOW:'UDP下位机' UDP_LOW:'UDP下位机',
PIS: '乘客PIS',
TMS: 'TMS'
}, },
mapList: [], mapList: [],
roleList:[], roleList:[],
@ -115,7 +117,6 @@ export default {
this.jsonConfig = JSON.stringify(JSON.parse(resp.data.config), null, 4); this.jsonConfig = JSON.stringify(JSON.parse(resp.data.config), null, 4);
} }
}).catch((e)=> { }).catch((e)=> {
console.error(e, '======');
this.$message.error('获取项目设备详情失败!'); this.$message.error('获取项目设备详情失败!');
}); });
// if (row.type === 'PSL' || row.type === 'PSC') { // if (row.type === 'PSL' || row.type === 'PSC') {
@ -153,7 +154,7 @@ export default {
// } else { // } else {
const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: this.jsonConfig }; const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: this.jsonConfig };
flag && setDeviceConfig(data).then(response => { flag && setDeviceConfig(data).then(response => {
self.$message.success('设置设备网关映射配置成功'); self.$message.success('设置设备配置成功');
self.handleClose(); self.handleClose();
self.$emit('reloadTable'); self.$emit('reloadTable');
}).catch(error => { }).catch(error => {
@ -173,7 +174,7 @@ export default {
// this.standCode = ''; // this.standCode = '';
this.dialogVisible = false; this.dialogVisible = false;
this.$refs.form && this.$refs.form.resetFields(); this.$refs.form && this.$refs.form.resetFields();
}, }
// mapIdChange(mapId, functionId) { // mapIdChange(mapId, functionId) {
// if (mapId) { // if (mapId) {
// querySimulationStationsByMapId(mapId).then(resp => { // querySimulationStationsByMapId(mapId).then(resp => {
@ -236,76 +237,76 @@ export default {
// }); // });
// } // }
// } // }
handleMember(member, stationList) { // handleMember(member, stationList) {
const data = { value: member.id, label: '', memberType: member.type }; // const data = { value: member.id, label: '', memberType: member.type };
const device = stationList.find(station => station.code === member.deviceCode) || {}; // const device = stationList.find(station => station.code === member.deviceCode) || {};
switch (member.type) { // switch (member.type) {
case 'DISPATCHER': // case 'DISPATCHER':
data.label = '行调' + (member.name ? `-${member.name }` : ''); // data.label = '' + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_SUPERVISOR': // case 'STATION_SUPERVISOR':
data.label = '行值-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'DRIVER': // case 'DRIVER':
data.label = '司机-' + member.deviceCode; // data.label = '-' + member.deviceCode;
break; // break;
case 'MAINTAINER': // case 'MAINTAINER':
data.label = '通号' + (member.name ? `-${member.name }` : ''); // data.label = '' + (member.name ? `-${member.name }` : '');
break; // break;
case 'DEPOT_DISPATCHER': // case 'DEPOT_DISPATCHER':
data.label = '调度-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'SIGNAL_BUILDING': // case 'SIGNAL_BUILDING':
data.label = '信号楼-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_ASSISTANT': // case 'STATION_ASSISTANT':
data.label = '助理-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_MASTER': // case 'STATION_MASTER':
data.label = '站长-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_SIGNALER': // case 'STATION_SIGNALER':
data.label = '信号员-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_PASSENGER': // case 'STATION_PASSENGER':
data.label = '客运员-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_SWITCH_MAN': // case 'STATION_SWITCH_MAN':
data.label = '扳道员-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_FACILITATOR': // case 'STATION_FACILITATOR':
data.label = '引导员-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'STATION_WORKER': // case 'STATION_WORKER':
data.label = '工务工-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'DEVICE_MANAGER': // case 'DEVICE_MANAGER':
data.label = '设备管理员-' + device.name + (member.name ? `-${member.name }` : ''); // data.label = '-' + device.name + (member.name ? `-${member.name }` : '');
break; // break;
case 'TRAIN_MASTER': // case 'TRAIN_MASTER':
data.label = '车务段段长' + (member.name ? `-${member.name }` : ''); // data.label = '' + (member.name ? `-${member.name }` : '');
break; // break;
case 'ELECTRIC_DISPATCHER': // case 'ELECTRIC_DISPATCHER':
data.label = '工电调度' + (member.name ? `-${member.name }` : ''); // data.label = '' + (member.name ? `-${member.name }` : '');
break; // break;
case 'PARENT_DEPARTMENT': // case 'PARENT_DEPARTMENT':
data.label = '上级部分' + (member.name ? `-${member.name }` : ''); // data.label = '' + (member.name ? `-${member.name }` : '');
break; // break;
case 'SCHEDULING': // case 'SCHEDULING':
data.label = '派班员' + (member.name ? `-${member.name }` : ''); // data.label = '' + (member.name ? `-${member.name }` : '');
break; // break;
case 'SHIFT_MANAGER': // case 'SHIFT_MANAGER':
data.label = '值班主任' + (member.name ? `-${member.name }` : ''); // data.label = '' + (member.name ? `-${member.name }` : '');
break; // break;
case 'ENVIRONMENT_DISPATCHER': // case 'ENVIRONMENT_DISPATCHER':
data.label = '环控调度' + (member.name ? `-${member.name}` : ''); // data.label = '' + (member.name ? `-${member.name}` : '');
break; // break;
case 'STATION_ELECTRIC_WORKER': // case 'STATION_ELECTRIC_WORKER':
data.label = '电力工务 ' + (member.name ? `-${member.name}` : ''); // data.label = ' ' + (member.name ? `-${member.name}` : '');
break; // break;
} // }
return data; // return data;
} // }
} }
}; };
</script> </script>

View File

@ -187,7 +187,7 @@ export default {
}); });
}, },
editConfig(index, row) { editConfig(index, row) {
const configGatewayList = ['SWITCH', 'SIGNAL', 'PSD', 'PSL', 'PSC', 'UDP_LOW', 'SECTION', 'TRAIN', 'UDP_CLIENT', 'PIS_STAND', 'PIS_TRAIN']; const configGatewayList = ['SWITCH', 'SIGNAL', 'PSD', 'PSL', 'PSC', 'UDP_LOW', 'SECTION', 'TRAIN', 'UDP_CLIENT', 'PIS_STAND', 'PIS_TRAIN', 'PIS', 'TMS'];
if (['LW', 'VR_IBP', 'ISCS_LW', 'ISCS_CW', 'IM', 'CW', 'DRIVE', 'DEPOT'].includes(row.type)) { if (['LW', 'VR_IBP', 'ISCS_LW', 'ISCS_CW', 'IM', 'CW', 'DRIVE', 'DEPOT'].includes(row.type)) {
this.$refs.editConfig.doShow(row); this.$refs.editConfig.doShow(row);
} else if (configGatewayList.includes(row.type)) { } else if (configGatewayList.includes(row.type)) {