rt-sim-training-client/src/views/publish/publishMap/subsystem.vue
2022-10-17 15:40:33 +08:00

163 lines
5.0 KiB
Vue

<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-subsystem ref="editSubsystem" @tableReload="reloadTable" />
</div>
</template>
<script>
import { queryMapSystemPaged, deleteMapSystem } from '@/api/trainingPlatform';
import { getPublishMapListOnline } from '@/api/jmap/map';
import EditSubsystem from './editSubsystem';
const simTypeMap = {
METRO: '地铁CBTC',
RAILWAY: '大铁CTC',
EMERGENCY: '应急调度'
};
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: '车务终端',
DMP: '车务管理终端'
};
export default {
name: 'PublishMap',
components: {
EditSubsystem
},
data() {
return {
dialogVisible: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
leftSpan: 18,
queryObject: {
name: {
type: 'text',
label: '名称'
}
}
},
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'; }
},
{
title: '客户端',
prop: 'client',
type: 'tag',
columnValue: (row) => { return clientMap[row.paramVO.initParam.client]; },
tagType: () => { return ''; }
},
{
title: '描述',
prop: 'desc'
},
{
type: 'button',
title: '操作',
width: '300',
buttons: [
{
name: '更新',
handleClick: this.updateRow
},
{
name: '删除',
handleClick: this.deleteRow
}
]
}
],
actions: [
{ text: '新建', handler: this.handleAddSubsystem },
{ text: '返回', handler: this.goBack }
]
}
};
},
computed: {
isShow() {
return this.$store.getters['roles'].indexOf('05');
}
},
created() {
this.mapList = [];
getPublishMapListOnline().then(resp => {
this.mapList = resp.data;
});
},
methods: {
queryFunction(params) {
params['mapId'] = this.$route.query.mapId;
return queryMapSystemPaged(params);
},
deleteRow(index, row) {
this.$confirm('删除子系统,是否继续?', '提 示', {
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning'
}).then(() => {
deleteMapSystem(row.id).then(resp => {
this.reloadTable();
}).catch(error => {
this.$message.error(`删除子系统: ${error.message}`);
});
}).catch( () => { });
},
updateRow(index, row) {
this.$refs.editSubsystem.doShow(row);
},
handleAddSubsystem() {
this.$refs.editSubsystem.doShow();
},
reloadTable() {
this.queryList.reload();
},
goBack() {
this.$router.go(-1);
}
}
};
</script>
<style lang="scss" scoped>
/deep/
.el-button+.el-button{
margin-top: 5px;
margin-left: 5px;
}
</style>