线路功能调整

This commit is contained in:
fan 2022-10-31 14:31:34 +08:00
parent d2050dacd8
commit ce6781e1d9
6 changed files with 299 additions and 150 deletions

View File

@ -76,48 +76,48 @@ export function getSubSystemByProjectCode() {
});
}
/** 创建地图系统 */
export function createMapSystem(data) {
export function createMapFunction(data) {
return request({
url: `/api/mapSystem/new`,
url: `/api/mapFunction`,
method: 'post',
data
});
}
/** 列表查询地图系统 */
export function queryMapSystemList(params) {
export function queryMapFunctionList(params) {
return request({
url: `/api/mapSystem/new/list`,
url: `/api/mapFunction/list`,
method: 'get',
params
});
}
/** 更新地图系统 */
export function updateMapSystem(data) {
export function updateMapFunction(data) {
return request({
url: `/api/mapSystem/new/${data.id}`,
method: 'post',
url: `/api/mapFunction/${data.id}`,
method: 'put',
data
});
}
/** 删除地图系统 */
export function deleteMapSystem(id) {
export function deleteMapFunction(id) {
return request({
url: `/api/mapSystem/new/${id}`,
url: `/api/mapFunction/${id}`,
method: 'delete'
});
}
/** 分页查询地图系统 */
export function queryMapSystemPaged(params) {
export function queryMapFunctionPaged(params) {
return request({
url: `/api/mapSystem/new/paged`,
url: `/api/mapFunction/paged`,
method: 'get',
params
});
}
/** 生成地图子系统 */
export function generateMapSystemNew(mapId, data) {
export function generateMapFunctionNew(mapId, data) {
return request({
url: `/api/mapSystem/new/${mapId}/generate`,
url: `/api/mapFunction/${mapId}/generate`,
method: 'post',
data
});

View File

@ -23,13 +23,13 @@ export function handlerUrl() {
let OSS_URL;
if (process.env.NODE_ENV === 'development') {
// 开发分支
BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.3.90:9000'; // 周寅
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -1,12 +1,13 @@
<template>
<el-dialog
width="30%"
:title="title"
:before-close="close"
:visible.sync="visible"
center
fullscreen
>
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="120px">
<div style="padding: 0 150px">
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="120px" size="small">
<el-form-item label="子系统名称:" prop="name">
<el-input v-model="ruleForm.name" style="width: 200px;" />
</el-form-item>
@ -17,31 +18,37 @@
<el-option label="应急调度" value="EMERGENCY" />
</el-select>
</el-form-item>
<el-form-item label="客户端:" prop="client">
<el-select v-model="ruleForm.client" clearable placeholder="请选择使用客户端" @change="clientChange">
<el-option v-for="option in clientList" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
<el-form-item label="默认扮演成员:" prop="DEFAULT_MEMBER">
<el-checkbox v-model="ruleForm.DEFAULT_MEMBER" />
</el-form-item>
<el-form-item label="仿真成员:" prop="memberId">
<el-form-item v-if="ruleForm.DEFAULT_MEMBER" label="仿真成员:" prop="memberId">
<el-select v-model="ruleForm.memberId" placeholder="请选择仿真成员">
<el-option v-for="option in memberList" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
</el-form-item>
<el-form-item label="功能:" prop="function">
<el-select v-model="ruleForm.function" clearable placeholder="请选择功能">
<el-option label="大客流" value="LPF" />
<el-option label="实训室" value="TRAINING_ROOM" />
<el-option label="实训设计" value="TRAINING_DESIGN" />
<el-option label="实训" value="TRAINING" />
<el-option label="考试" value="EXAM" />
</el-select>
<el-form-item label="大客流:" prop="LPF">
<el-checkbox v-model="ruleForm.LPF" />
</el-form-item>
<el-form-item v-if="ruleForm.function === 'TRAINING'" label="实训:" prop="trainingName">
<el-form-item label="真实设备:" prop="REAL_DEVICE">
<el-checkbox v-model="ruleForm.REAL_DEVICE" />
</el-form-item>
<el-form-item label="实训:" prop="TRAINING">
<el-checkbox v-model="ruleForm.TRAINING" />
</el-form-item>
<el-form-item v-if="ruleForm.TRAINING" label="实训名称:" prop="trainingName">
<div style="display: flex;">
<div style="width: 200px;">{{ ruleForm.trainingName? ruleForm.trainingName: '-' }}</div>
<el-button style="margin-left: 10px;" type="primary" size="mini" @click="handleChoose">选择</el-button>
</div>
</el-form-item>
<el-form-item label="考试:" prop="EXAM">
<el-checkbox v-model="ruleForm.EXAM" />
</el-form-item>
<el-form-item label="试卷:" prop="examId">
<el-select v-model="ruleForm.examId" placeholder="请选择试卷">
<el-option v-for="option in examList" :key="option.id" :label="option.name" :value="option.id" />
</el-select>
</el-form-item>
<el-form-item label="描述:" prop="desc">
<el-input
v-model="ruleForm.desc"
@ -50,48 +57,119 @@
placeholder="请输入内容"
/>
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="单客户端:" prop="singleClient">
<el-checkbox v-model="ruleForm.singleClient" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单角色类型:" prop="singleMember">
<el-checkbox v-model="ruleForm.singleMember" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="含有实训:" prop="hasTraining">
<el-checkbox v-model="ruleForm.hasTraining" />
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="客户端:" prop="client">-->
<!-- <el-select v-model="ruleForm.client" clearable placeholder="请选择使用客户端" @change="clientChange">-->
<!-- <el-option v-for="option in clientList" :key="option.value" :label="option.label" :value="option.value" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-table
:data="tableData"
border
style="width: 100%;margin-top: 10px;"
>
<el-table-column
prop="label"
label="前端配置项"
/>
<el-table-column
prop="value"
label="value"
>
<template slot-scope="scope">
<el-checkbox v-if="scope.row.type === 'checkbox'" v-model="scope.row.value" />
<el-select v-else-if="scope.row.type === 'select'" v-model="scope.row.value">
<el-option
v-for="item in scope.row.optionList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</el-table>
<!-- <el-form-item label="功能:" prop="function">-->
<!-- <el-select v-model="ruleForm.function" clearable placeholder="请选择功能">-->
<!-- <el-option label="大客流" value="LPF" />-->
<!-- <el-option label="实训室" value="TRAINING_ROOM" />-->
<!-- <el-option label="实训设计" value="TRAINING_DESIGN" />-->
<!-- <el-option label="实训" value="TRAINING" />-->
<!-- <el-option label="考试" value="EXAM" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-row>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item label="单客户端:" prop="singleClient">-->
<!-- <el-checkbox v-model="ruleForm.singleClient" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item label="单角色类型:" prop="singleMember">-->
<!-- <el-checkbox v-model="ruleForm.singleMember" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item label="含有实训:" prop="hasTraining">-->
<!-- <el-checkbox v-model="ruleForm.hasTraining" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form>
<span slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="commit"> </el-button>
</span>
</div>
</div>
<choose-training ref="chooseTraining" @choose="choose" />
</el-dialog>
</template>
<script>
import { updateMapSystem, createMapSystem } from '@/api/trainingPlatform';
import { updateMapFunction, createMapFunction } from '@/api/trainingPlatform';
import { querySimulationMemberByMapId, querySimulationStationsByMapId } from '@/api/jmap/map';
import { getTrainingDetailNew } from '@/api/jmap/training';
import ChooseTraining from './chooseTraining';
export default {
name: 'EditSubsystem',
components: {
ChooseTraining
},
data() {
const clientList = [
{ label: '中心ATS工作站', value: 'C_ATS' },
{ label: '中心ATS大屏', value: 'C_ATS_BS' },
{ label: '中心PA系统', value: 'C_PA' },
{ label: '中心视频监控系统', value: 'C_CCTV' },
{ label: '现地ATS工作站', value: 'L_ATS' },
{ label: '本地控制工作站', value: 'LCW' },
{ label: '现地视频监控系统', value: 'L_CCTV' },
{ label: '现地PA系统', value: 'L_PA' },
{ label: '调度台终端', value: 'GPC' },
{ label: '联锁工作站', value: 'IPC' },
{ label: '车务终端', value: 'STPC' },
{ label: '车务管理终端', value: 'DMP' },
{ label: 'ISCS', value: 'ISCS' },
{ label: 'IBP', value: 'IBP' },
{ label: 'PSL', value: 'PSL' },
{ label: '运行图编制', value: 'RUN_PLAN_DESIGN' },
{ label: '列车驾驶', value: 'DRIVE' }
];
return {
visible: false,
title: '',
mapSystemId: '',
memberList: [],
examList: [],
tableData: [
{ key: 'singleMember', label: '是否单角色', value: false, type: 'checkbox' },
{ key: 'singleClient', label: '是否单客户端', value: false, type: 'checkbox' },
{ key: 'client', label: '初始客户端', value: '', type: 'select', optionList: clientList},
{ key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'},
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' }
],
rules: {
name: [
{ required: true, message: '请输入子系统名称', trigger: 'blur' }
@ -109,12 +187,14 @@ export default {
desc: '',
memberId: '',
client: '',
function: '',
trainingId: '',
trainingName: '',
singleMember: false,
singleClient: false,
hasTraining: false
examId: '',
DEFAULT_MEMBER: false,
LPF: false,
REAL_DEVICE: false,
TRAINING: false,
EXAM: false
},
clientList: [
{ label: '中心ATS工作站', value: 'C_ATS' },
@ -172,18 +252,44 @@ export default {
this.ruleForm.name = row.name;
this.ruleForm.desc = row.desc || '';
this.ruleForm.type = row.paramVO.type;
this.ruleForm.client = row.paramVO.client || '';
this.ruleForm.memberId = row.paramVO.memberId || '';
this.clientChange(this.ruleForm.client);
if (row.paramVO.functionInfoMap) {
const functionList = Object.keys(row.paramVO.functionInfoMap);
if (functionList && functionList.length) {
this.ruleForm.function = functionList[0];
this.typeChange(this.ruleForm.type);
// this.ruleForm.singleMember = row.paramVO.domConfig.singleMember;
// this.ruleForm.singleClient = row.paramVO.domConfig.singleClient;
// this.ruleForm.hasTraining = row.paramVO.domConfig.hasTraining;
// this.ruleForm.hasExam = row.paramVO.domConfig.hasExam;
// this.ruleForm.trainingDesign = row.paramVO.domConfig.trainingDesign;
// { key: 'client', label: '', value: '', type: 'select', optionList: clientList},
this.tableData.forEach(item => {
if (item.key === 'singleMember') {
item.value = row.paramVO.domConfig.singleMember;
} else if (item.key === 'singleClient') {
item.value = row.paramVO.domConfig.singleClient;
} else if (item.key === 'client') {
item.value = row.paramVO.domConfig.client;
} else if (item.key === 'hasTraining') {
item.value = row.paramVO.domConfig.hasTraining;
} else if (item.key === 'hasExam') {
item.value = row.paramVO.domConfig.hasExam;
} else if (item.key === 'trainingDesign') {
item.value = row.paramVO.domConfig.trainingDesign;
}
}
if (this.ruleForm.function === 'TRAINING' && row.paramVO.functionInfoMap[this.ruleForm.function]) {
this.ruleForm.trainingId = row.paramVO.functionInfoMap[this.ruleForm.function].id;
});
for (const key in row.paramVO.itemMap) {
if (key === 'DEFAULT_MEMBER') {
this.ruleForm.DEFAULT_MEMBER = true;
this.ruleForm.memberId = row.paramVO.itemMap[key];
} else if (key === 'LPF') {
this.ruleForm.LPF = true;
} else if (key === 'REAL_DEVICE') {
this.ruleForm.REAL_DEVICE = true;
} else if (key === 'TRAINING') {
this.ruleForm.TRAINING = true;
this.ruleForm.trainingId = row.paramVO.itemMap[key];
getTrainingDetailNew(this.ruleForm.trainingId).then(resp => { this.ruleForm.trainingName = resp.data.name; }).catch(e=> { console.error(e); });
} else if (key === 'EXAM') {
this.ruleForm.EXAM = true;
this.ruleForm.examId = row.paramVO.itemMap[key];
}
}
this.title = '修改子系统';
} else {
@ -207,22 +313,22 @@ export default {
this.memberList = [...temMemberList];
}
},
clientChange(val) {
if (this.ruleForm.type === 'METRO') {
this.memberList = [...this.memberMetroList];
} else if (this.ruleForm.type === 'RAILWAY') {
this.memberList = [...this.memberRailwayList];
} else if (this.ruleForm.type === 'EMERGENCY') {
this.memberList = [...this.memberEmergencyList];
}
if (['C_ATS', 'C_ATS_BS', 'C_PA', 'C_CCTV', 'GPC'].includes(val)) {
const temMemberList = this.memberList.filter(member => member.memberType === 'DISPATCHER');
this.memberList = [...temMemberList];
} else if (['L_ATS', 'LCW', 'L_CCTV', 'L_PA'].includes(val)) {
const temMemberList = this.memberList.filter(member => member.memberType === 'STATION_SUPERVISOR');
this.memberList = [...temMemberList];
}
},
// clientChange(val) {
// if (this.ruleForm.type === 'METRO') {
// this.memberList = [...this.memberMetroList];
// } else if (this.ruleForm.type === 'RAILWAY') {
// this.memberList = [...this.memberRailwayList];
// } else if (this.ruleForm.type === 'EMERGENCY') {
// this.memberList = [...this.memberEmergencyList];
// }
// if (['C_ATS', 'C_ATS_BS', 'C_PA', 'C_CCTV', 'GPC'].includes(val)) {
// const temMemberList = this.memberList.filter(member => member.memberType === 'DISPATCHER');
// this.memberList = [...temMemberList];
// } else if (['L_ATS', 'LCW', 'L_CCTV', 'L_PA'].includes(val)) {
// const temMemberList = this.memberList.filter(member => member.memberType === 'STATION_SUPERVISOR');
// this.memberList = [...temMemberList];
// }
// },
handleMember(member, stationList) {
const data = { value: member.id, label: '', memberType: member.type };
const device = stationList.find(station => station.code === member.deviceCode) || {};
@ -288,16 +394,18 @@ export default {
this.mapSystemId = '';
this.ruleForm = {
name: '',
desc: '',
type: '',
desc: '',
memberId: '',
client: '',
function: '',
trainingId: '',
trainingName: '',
singleClient: false,
singleMember: false,
hasTraining: false
examId: '',
DEFAULT_MEMBER: false,
LPF: false,
REAL_DEVICE: false,
TRAINING: false,
EXAM: false
};
this.visible = false;
this.$refs.ruleForm.resetFields();
@ -305,32 +413,38 @@ export default {
commit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
let functionMap = null;
if (this.ruleForm.function === 'TRAINING') {
functionMap = {};
functionMap[this.ruleForm.function] = { function: this.ruleForm.function, id: this.ruleForm.trainingId};
} else if (this.ruleForm.function) {
functionMap = {};
functionMap[this.ruleForm.function] = { function: this.ruleForm.function };
const itemMap = {};
if (this.ruleForm.DEFAULT_MEMBER) {
itemMap.DEFAULT_MEMBER = this.ruleForm.memberId;
}
if (this.ruleForm.LPF) {
itemMap.LPF = null;
}
if (this.ruleForm.REAL_DEVICE) {
itemMap.REAL_DEVICE = null;
}
if (this.ruleForm.TRAINING) {
itemMap.TRAINING = this.ruleForm.trainingId;
}
if (this.ruleForm.EXAM) {
itemMap.EXAM = this.ruleForm.examId;
}
const domConfig = {};
this.tableData.forEach(item => {
domConfig[item.key] = item.value;
});
const data = {
mapId: this.$route.query.mapId,
name: this.ruleForm.name,
desc: this.ruleForm.desc,
paramVO: {
type: this.ruleForm.type,
client: this.ruleForm.client ? this.ruleForm.client : null,
memberId: this.ruleForm.memberId,
functionInfoMap: functionMap,
domConfig: {
singleClient: this.ruleForm.singleClient,
singleMember: this.ruleForm.singleMember,
hasTraining: this.ruleForm.hasTraining
}
itemMap:itemMap,
domConfig: domConfig
}
};
if (this.title === '创建子系统') {
createMapSystem(data).then(resp => {
createMapFunction(data).then(resp => {
this.visible = false;
this.$emit('tableReload');
this.$message.success('创建子系统成功!');
@ -340,7 +454,7 @@ export default {
});
} else {
data.id = this.mapSystemId;
updateMapSystem(data).then(resp => {
updateMapFunction(data).then(resp => {
this.visible = false;
this.$emit('tableReload');
this.close();
@ -364,5 +478,7 @@ export default {
</script>
<style scoped>
.dialog-footer {
text-align: center;
}
</style>

View File

@ -28,7 +28,7 @@ export default {
{ label: 'ibp数据', value: 'ibp' },
{ label: 'iscs数据', value: 'iscs' },
{ label: '线路配置', value: 'REAL_LINE_CONFIG'},
{ label: '子系统数据', value: 'mapSystem' },
{ label: '子系统数据', value: 'mapFunction' },
{ label: '实训数据', value: 'training' }
]
};
@ -60,7 +60,7 @@ export default {
ibp: this.checkList.includes('ibp'),
iscs: this.checkList.includes('iscs'),
realLineConfig: this.checkList.includes('REAL_LINE_CONFIG'),
mapSystem: this.checkList.includes('mapSystem'),
mapFunction: this.checkList.includes('mapFunction'),
training: this.checkList.includes('training')
};
const res = await getPublishMapExportNew(this.row.id, data);

View File

@ -27,7 +27,7 @@
</template>
<script>
import { queryMapSystemPaged, deleteMapSystem, generateMapSystemNew } from '@/api/trainingPlatform';
import { queryMapFunctionPaged, deleteMapFunction, generateMapFunctionNew } from '@/api/trainingPlatform';
import { getPublishMapListOnline } from '@/api/jmap/map';
import EditSubsystem from './editSubsystem';
const simTypeMap = {
@ -111,12 +111,45 @@ export default {
columnValue: (row) => { return simTypeMap[row.simType]; },
tagType: () => { return 'success'; }
},
// DEFAULT_MEMBER: false,
// LPF: false,
// REAL_DEVICE: false,
// TRAINING: false,
// EXAM: false
{
title: '客户端',
prop: 'client',
title: '默认扮演成员',
prop: 'DEFAULT_MEMBER',
type: 'tag',
columnValue: (row) => { return clientMap[row.paramVO.client]; },
tagType: () => { return ''; }
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('DEFAULT_MEMBER') ? '是' : '否'; },
tagType: () => { return 'success'; }
},
{
title: '大客流',
prop: 'LPF',
type: 'tag',
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('LPF') ? '是' : '否'; },
tagType: () => { return 'success'; }
},
{
title: '真实设备',
prop: 'REAL_DEVICE',
type: 'tag',
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('REAL_DEVICE') ? '是' : '否'; },
tagType: () => { return 'success'; }
},
{
title: '加载实训',
prop: 'TRAINING',
type: 'tag',
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('TRAINING') ? '是' : '否'; },
tagType: () => { return 'success'; }
},
{
title: '加载试卷',
prop: 'EXAM',
type: 'tag',
columnValue: (row) => { return row.paramVO.itemMap.hasOwnProperty('EXAM') ? '是' : '否'; },
tagType: () => { return 'success'; }
},
{
title: '描述',
@ -160,7 +193,7 @@ export default {
methods: {
queryFunction(params) {
params['mapId'] = this.$route.query.mapId;
return queryMapSystemPaged(params);
return queryMapFunctionPaged(params);
},
deleteRow(index, row) {
this.$confirm('删除子系统,是否继续?', '提 示', {
@ -168,7 +201,7 @@ export default {
cancelButtonText: '取 消',
type: 'warning'
}).then(() => {
deleteMapSystem(row.id).then(resp => {
deleteMapFunction(row.id).then(resp => {
this.reloadTable();
}).catch(error => {
this.$message.error(`删除子系统: ${error.message}`);
@ -181,7 +214,7 @@ export default {
// cancelButtonText: ' ',
// type: 'warning'
// }).then(() => {
// generateMapSystemNew(this.$route.query.mapId).then(resp => {
// generateMapFunctionNew(this.$route.query.mapId).then(resp => {
// this.reloadTable();
// }).catch(error => {
// this.$message.error(`: ${error.message}`);
@ -196,7 +229,7 @@ export default {
generateCommit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
generateMapSystemNew(this.$route.query.mapId, this.form).then(resp => {
generateMapFunctionNew(this.$route.query.mapId, this.form).then(resp => {
this.reloadTable();
this.doCloseGenerate();
}).catch(error => {

View File

@ -22,7 +22,7 @@
<script>
import { listUserPermision } from '@/api/management/author';
import { queryMapSystemList } from '@/api/trainingPlatform';
import { queryMapFunctionList } from '@/api/trainingPlatform';
import { superAdmin, admin } from '@/router/index';
import selectRole from './selectRole/list';
import LangStorage from '@/utils/lang';
@ -149,7 +149,7 @@ export default {
this.$refs.selectRole.doShow(row.id);
},
initMapSystem() {
queryMapSystemList({mapId: this.$route.params.mapId}).then(resp => {
queryMapFunctionList({mapId: this.$route.params.mapId}).then(resp => {
this.systemList = resp.data;
console.log(resp);
}).catch(() => {