rt-sim-training-client/src/views/publish/publishMap/subsystem.vue

229 lines
7.5 KiB
Vue
Raw Normal View History

2022-10-11 09:55:07 +08:00
<template>
2022-10-12 15:31:15 +08:00
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
2022-10-14 14:50:16 +08:00
<edit-subsystem ref="editSubsystem" @tableReload="reloadTable" />
2022-10-19 09:30:23 +08:00
<el-dialog
width="30%"
:title="title"
:before-close="doCloseGenerate"
:visible.sync="visible"
center
>
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="120px">
<el-form-item label="系统:" prop="type">
<el-select v-model="form.simTypes" multiple placeholder="请选择生成仿真类型">
<el-option label="地铁CBTC" value="METRO" />
<el-option label="大铁CTC" value="RAILWAY" />
<el-option label="应急调度" value="EMERGENCY" />
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="doCloseGenerate"> </el-button>
<el-button type="primary" @click="generateCommit"> </el-button>
</span>
</el-dialog>
2022-10-12 15:31:15 +08:00
</div>
2022-10-11 09:55:07 +08:00
</template>
<script>
2022-10-19 09:30:23 +08:00
import { queryMapSystemPaged, deleteMapSystem, generateMapSystemNew } from '@/api/trainingPlatform';
2022-10-12 15:31:15 +08:00
import { getPublishMapListOnline } from '@/api/jmap/map';
import EditSubsystem from './editSubsystem';
const simTypeMap = {
METRO: '地铁CBTC',
RAILWAY: '大铁CTC',
EMERGENCY: '应急调度'
};
2022-10-17 15:40:33 +08:00
const clientMap = {
C_ATS: '中心ATS工作站',
C_ATS_BS: '中心ATS大屏',
C_PA: '中心PA系统',
C_CCTV: '中心视频监控系统',
L_ATS: '现地ATS工作站',
LCW: '本地控制工作站',
L_CCTV: '现地视频监控系统',
L_PA: '现地PA系统',
GPC: '调度台终端',
IPC: '联锁工作站',
STPC: '车务终端',
2022-10-19 09:30:23 +08:00
DMP: '车务管理终端',
ISCS: 'ISCS',
IBP: 'IBP',
PSL: 'PSL',
RUN_PLAN_DESIGN: '运行图编制',
DRIVE: '列车驾驶'
2022-10-12 15:31:15 +08:00
};
2022-10-11 09:55:07 +08:00
export default {
2022-10-12 15:31:15 +08:00
name: 'PublishMap',
components: {
EditSubsystem
},
2022-10-11 09:55:07 +08:00
data() {
return {
dialogVisible: false,
2022-10-12 15:31:15 +08:00
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
2022-10-11 09:55:07 +08:00
},
2022-10-19 09:30:23 +08:00
title: '一键生成子系统',
visible: false,
rules: {
type: [
{ required: true, message: '请选择生成仿真系统类型', trigger: 'change' }
]
},
form: {
simTypes: []
},
2022-10-12 15:31:15 +08:00
queryForm: {
labelWidth: '80px',
reset: true,
leftSpan: 18,
queryObject: {
name: {
type: 'text',
label: '名称'
}
}
2022-10-11 09:55:07 +08:00
},
2022-10-12 15:31:15 +08:00
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '名称',
prop: 'name'
},
{
title: '地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
tagType: () => { return 'success'; }
},
{
title: '系统',
prop: 'simType',
type: 'tag',
columnValue: (row) => { return simTypeMap[row.simType]; },
tagType: () => { return 'success'; }
},
{
2022-10-17 15:40:33 +08:00
title: '客户端',
prop: 'client',
2022-10-12 15:31:15 +08:00
type: 'tag',
2022-10-17 15:40:33 +08:00
columnValue: (row) => { return clientMap[row.paramVO.initParam.client]; },
2022-10-12 15:31:15 +08:00
tagType: () => { return ''; }
},
{
title: '描述',
prop: 'desc'
},
{
type: 'button',
title: '操作',
width: '300',
buttons: [
{
name: '更新',
handleClick: this.updateRow
},
{
name: '删除',
handleClick: this.deleteRow
}
]
}
2022-10-11 09:55:07 +08:00
],
2022-10-12 15:31:15 +08:00
actions: [
2022-10-19 09:30:23 +08:00
{ text: '一键生成', handler: this.generateMapSystem },
2022-10-12 15:31:15 +08:00
{ text: '新建', handler: this.handleAddSubsystem },
{ text: '返回', handler: this.goBack }
2022-10-11 09:55:07 +08:00
]
2022-10-12 15:31:15 +08:00
}
2022-10-11 09:55:07 +08:00
};
},
2022-10-12 15:31:15 +08:00
computed: {
isShow() {
return this.$store.getters['roles'].indexOf('05');
}
},
created() {
this.mapList = [];
getPublishMapListOnline().then(resp => {
this.mapList = resp.data;
});
},
2022-10-11 09:55:07 +08:00
methods: {
2022-10-12 15:31:15 +08:00
queryFunction(params) {
params['mapId'] = this.$route.query.mapId;
return queryMapSystemPaged(params);
2022-10-11 09:55:07 +08:00
},
2022-10-14 16:05:36 +08:00
deleteRow(index, row) {
2022-10-11 09:55:07 +08:00
this.$confirm('删除子系统,是否继续?', '提 示', {
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning'
}).then(() => {
deleteMapSystem(row.id).then(resp => {
2022-10-14 16:07:27 +08:00
this.reloadTable();
2022-10-11 09:55:07 +08:00
}).catch(error => {
this.$message.error(`删除子系统: ${error.message}`);
});
}).catch( () => { });
},
2022-10-19 09:30:23 +08:00
generateMapSystem() {
// this.$confirm('一键生成子系统,是否继续?', '提 示', {
// confirmButtonText: '确 定',
// cancelButtonText: '取 消',
// type: 'warning'
// }).then(() => {
// generateMapSystemNew(this.$route.query.mapId).then(resp => {
// this.reloadTable();
// }).catch(error => {
// this.$message.error(`生成子系统: ${error.message}`);
// });
// }).catch( () => { });
this.visible = true;
},
doCloseGenerate() {
this.form.simTypes = [];
this.visible = false;
},
generateCommit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
generateMapSystemNew(this.$route.query.mapId, this.form).then(resp => {
this.reloadTable();
}).catch(error => {
this.$message.error(`一键生成仿真系统失败: ${error.message}`);
});
}
});
},
2022-10-12 15:31:15 +08:00
updateRow(index, row) {
this.$refs.editSubsystem.doShow(row);
2022-10-11 09:55:07 +08:00
},
2022-10-12 15:31:15 +08:00
handleAddSubsystem() {
this.$refs.editSubsystem.doShow();
},
reloadTable() {
this.queryList.reload();
2022-10-11 09:55:07 +08:00
},
2022-10-12 15:31:15 +08:00
goBack() {
this.$router.go(-1);
2022-10-11 09:55:07 +08:00
}
}
};
</script>
2022-10-12 15:31:15 +08:00
<style lang="scss" scoped>
/deep/
.el-button+.el-button{
margin-top: 5px;
margin-left: 5px;
}
2022-10-11 09:55:07 +08:00
</style>