rt-sim-training-client/src/views/iscs/iscsDesign/demonList.vue

532 lines
19 KiB
Vue
Raw Normal View History

2020-01-15 10:11:26 +08:00
<template>
<div v-loading="loading" class="joylink-card map-list-main">
<div class="clearfix">
<span>iscs系统列表</span>
2020-01-15 10:11:26 +08:00
</div>
<div class="text_item">
<el-cascader v-model="mapStationList" style="width: 100%;" :props="props" placeholder="请选择车站" />
2020-01-15 10:11:26 +08:00
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<div class="tree_box">
<el-tree ref="tree" :data="treeList" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent" @node-contextmenu="showContextMenu">
<span slot-scope="{ node:tnode, data }">
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
<span>&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</div>
<div class="buttonList">
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
</div>
</div>
</div>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { removeSessionStorage } from '@/utils/auth';
import { getPublishMapListOnline, getStationListNeedAttendant } from '@/api/jmap/map';
2020-01-15 10:11:26 +08:00
export default {
name: 'UserMapList',
data() {
return {
loading: false,
defaultShowKeys: [],
filterText: '',
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
editModel: {},
lineCode: '',
mapList: [],
mapStationList: []
2020-01-15 10:11:26 +08:00
};
},
computed: {
props() {
const self = this;
return {
lazy: true,
lazyLoad (node, resolve) {
const { level } = node;
let nodes = [];
if (level === 1) {
getStationListNeedAttendant(node.data.value).then(resp => {
nodes = resp.data.map(elem => { return {value: elem.code, label: elem.name, leaf: true}; });
resolve(nodes);
}).catch(() => {
self.$message.error('获取车站列表失败');
resolve(nodes);
});
} else if (!level) {
getPublishMapListOnline().then(resp => {
nodes = resp.data.map(elem => { return { value: elem.id, label: elem.name, leaf: false }; });
resolve(nodes);
}).catch(() => {
self.$message.error('获取地图列表失败!');
resolve(nodes);
});
}
}
};
}
2020-01-15 10:11:26 +08:00
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
mapStationList(val) {
console.log(val);
2020-01-15 10:11:26 +08:00
}
},
beforeDestroy () {
removeSessionStorage('demonList');
},
mounted() {
this.loadInitData();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
createMap() {
this.$emit('createMap');
},
async loadInitData() {
this.treeList = [];
this.treeList = [
{
2020-06-24 15:02:09 +08:00
name: 'FAS界面',
mode: 'fas',
id: 'fas',
type: 'totalSystem',
2020-01-15 10:11:26 +08:00
children: [
{
2020-06-24 15:02:09 +08:00
name: '站厅报警',
2020-01-16 16:25:33 +08:00
mode: 'fas',
2020-06-24 15:02:09 +08:00
id: 'stationHall',
2020-02-05 10:16:59 +08:00
type: 'system',
children: [
{
name: '站厅报警',
2020-02-05 10:16:59 +08:00
mode: 'fas',
id: 'stationHall',
2020-06-24 15:02:09 +08:00
type: 'interface'
}
]
},
{
name: '站台报警',
mode: 'fas',
id: 'stand',
type: 'system',
children: [
2020-02-05 10:16:59 +08:00
{
name: '站台报警',
2020-02-05 10:16:59 +08:00
mode: 'fas',
id: 'stand',
2020-06-24 15:02:09 +08:00
type: 'interface'
2020-06-01 18:33:17 +08:00
},
{
2020-06-24 15:02:09 +08:00
name: '公共区域',
2020-06-01 18:33:17 +08:00
mode: 'fas',
2020-06-24 15:02:09 +08:00
id: 'standPublicArea',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '系统状态',
mode: 'fas',
id: 'systemState',
type: 'system',
children: [
2020-05-09 10:04:57 +08:00
{
name: '系统状态',
mode: 'fas',
2020-06-24 15:02:09 +08:00
id: 'systemState',
2020-05-09 10:04:57 +08:00
type: 'interface'
2020-02-05 10:16:59 +08:00
}
]
2020-06-24 15:02:09 +08:00
}
]
},
{
name: 'BAS界面',
mode: 'bas',
id: 'bas',
type: 'totalSystem',
2020-06-24 15:02:09 +08:00
children: [
{
2020-06-24 15:02:09 +08:00
name: '大系统',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'bigSystem',
type: 'system',
2020-06-24 15:02:09 +08:00
children:[
{
name: '大系统',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'bigSystem',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '小系统',
mode: 'bas',
id: 'smallSystem',
type: 'system',
children: [
{
2020-06-24 15:02:09 +08:00
name: '小系统A端(一)',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'aSideOne',
type: 'interface'
},
{
2020-06-24 15:02:09 +08:00
name: '小系统A端(二)',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'aSideTwo',
type: 'interface'
},
{
2020-06-24 15:02:09 +08:00
name: '小系统B端',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'bSide',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '水系统',
mode: 'bas',
id: 'waterSystem',
type: 'system',
children: [
{
name: '水系统',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'waterSystem',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '照明',
mode: 'bas',
id: 'lightingSystem',
type: 'system',
children: [
2020-06-02 16:12:34 +08:00
{
2020-06-24 15:02:09 +08:00
name: '照明系统',
2020-06-02 16:12:34 +08:00
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'lightingSystem',
2020-06-02 16:12:34 +08:00
type: 'interface'
2020-06-02 17:50:56 +08:00
},
{
name: 'EPS系统',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'epsSystem',
2020-06-02 17:50:56 +08:00
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '电扶梯',
mode: 'bas',
id: 'electricEscalator',
type: 'system',
children: [
{
name: '电扶梯',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'electricEscalator',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '机电排水',
mode: 'bas',
id: 'waterSupply',
type: 'system',
children: [
{
name: '机电排水',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'waterSupply',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '隧道通风',
mode: 'bas',
id: 'tunnelVentilation',
type: 'system',
children: [
{
name: '隧道通风',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'tunnelVentilation',
type: 'interface'
},
{
2020-06-24 15:02:09 +08:00
name: '射流风机图',
mode: 'bas',
2020-06-24 15:02:09 +08:00
id: 'jetFan',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '车站网络',
mode: 'bas',
id: 'stationNet',
type: 'system',
children: [
{
name: '车站网络',
2020-06-24 15:02:09 +08:00
mode:'bas',
id: 'stationNet',
type: 'interface'
}
]
2020-06-24 15:02:09 +08:00
}
]
},
{
name: 'PSD界面',
mode: 'psd',
id: 'psd',
type: 'totalSystem',
2020-06-24 15:02:09 +08:00
children: [
2020-01-16 16:25:33 +08:00
{
2020-06-24 15:02:09 +08:00
name: '屏蔽门',
2020-01-16 16:25:33 +08:00
mode: 'psd',
2020-06-24 15:02:09 +08:00
id: 'psd',
2020-02-05 10:16:59 +08:00
type: 'system',
children: [
{
name: '屏蔽门',
mode: 'psd',
2020-06-24 15:02:09 +08:00
id: 'psd',
type: 'interface'
2020-02-05 10:16:59 +08:00
}
]
2020-06-24 15:02:09 +08:00
}
]
},
{
name: 'cctv界面',
mode: 'cctv',
id: 'cctv',
type: 'system',
children: [
2020-01-17 14:15:14 +08:00
{
2020-06-24 15:02:09 +08:00
name: '车站控制',
2020-01-17 14:15:14 +08:00
mode: 'cctv',
2020-06-24 15:02:09 +08:00
id: 'cctv',
2020-02-05 10:16:59 +08:00
type: 'system',
children: [
{
2020-06-24 15:02:09 +08:00
name: '站厅',
2020-02-05 10:16:59 +08:00
mode: 'cctv',
2020-06-24 15:02:09 +08:00
id: 'stationHall',
type: 'interface'
2020-02-05 10:16:59 +08:00
},
{
2020-06-24 15:02:09 +08:00
name: '站台',
2020-02-05 10:16:59 +08:00
mode: 'cctv',
2020-06-24 15:02:09 +08:00
id: 'stand',
type: 'interface'
2020-06-01 18:33:17 +08:00
},
{
2020-06-24 15:02:09 +08:00
name: '云台',
2020-06-01 18:33:17 +08:00
mode: 'cctv',
2020-06-24 15:02:09 +08:00
id: 'holder',
2020-06-01 18:33:17 +08:00
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '中心设备状态',
mode: 'cctv',
id: 'centralDeviceState',
type: 'system',
children: [
{
2020-06-24 15:02:09 +08:00
name: '中心设备状态',
mode: 'cctv',
2020-06-24 15:02:09 +08:00
id: 'centralDeviceState',
type: 'interface'
2020-02-05 10:16:59 +08:00
}
]
2020-06-24 15:02:09 +08:00
}
]
},
{
name: 'AFC界面',
mode: 'afc',
id: 'afc',
type: 'totalSystem',
2020-06-24 15:02:09 +08:00
children: [
2020-01-17 18:45:28 +08:00
{
2020-06-24 15:02:09 +08:00
name: '售检票',
2020-01-17 18:45:28 +08:00
mode: 'afc',
2020-06-24 15:02:09 +08:00
id: 'afc',
2020-02-05 10:16:59 +08:00
type: 'system',
children: [
{
name: '售检票',
mode: 'afc',
2020-06-24 15:02:09 +08:00
id: 'afc',
type: 'interface'
2020-02-05 10:16:59 +08:00
}
]
2020-06-24 15:02:09 +08:00
}
]
},
{
name: 'ACS界面',
mode: 'acs',
id: 'acs',
type: 'totalSystem',
2020-06-24 15:02:09 +08:00
children: [
2020-01-17 18:45:28 +08:00
{
2020-06-24 15:02:09 +08:00
name: '门禁-站台层',
2020-01-17 18:45:28 +08:00
mode: 'acs',
2020-08-12 15:19:38 +08:00
id: 'acs',
2020-02-05 10:16:59 +08:00
type: 'system',
children: [
{
2020-02-05 10:22:22 +08:00
name: '门禁-站台层',
2020-02-05 10:16:59 +08:00
mode: 'acs',
2020-06-24 15:02:09 +08:00
id: 'stand',
type: 'interface'
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '门禁-站厅层',
mode: 'acs',
2020-08-12 15:19:38 +08:00
id: 'acs',
2020-06-24 15:02:09 +08:00
type: 'system',
children: [
2020-02-05 10:22:22 +08:00
{
name: '门禁-站厅层',
mode: 'acs',
2020-06-24 15:02:09 +08:00
id: 'stationHall',
type: 'interface'
2020-02-05 10:16:59 +08:00
}
]
2020-06-24 15:02:09 +08:00
}
]
},
{
name: '网络状态',
mode: 'netState',
id: 'netState',
type: 'totalSystem',
2020-06-24 15:02:09 +08:00
children: [
{
name: '网络状态',
mode: 'netState',
2020-06-24 15:02:09 +08:00
id: 'netState',
type: 'system',
children: [
{
name: '网络状态',
mode: 'netState',
2020-06-24 15:02:09 +08:00
id: 'netState',
type: 'interface'
}
]
2020-01-15 10:11:26 +08:00
}
]
}
];
},
clickEvent(obj, data, ele) {
2020-01-15 13:27:07 +08:00
switch (obj.type) {
case 'totalSystem':
break;
2020-01-15 13:27:07 +08:00
case 'system' :
break;
case 'interface':
2020-06-24 15:02:09 +08:00
this.$router.push({ path: `/iscs/design/edit`, query: {mode: obj.mode, system: data.parent.data.id, part: obj.id} });
2020-01-15 13:27:07 +08:00
break;
}
2020-01-15 10:11:26 +08:00
},
showContextMenu(e, obj, node, vueElem) {
const deviceMenuMap = { system: DeviceMenu.IscsSystem, interface: DeviceMenu.IscsInterface };
if (obj && (obj.type == 'system' || obj.type == 'interface')) {
2020-01-15 10:11:26 +08:00
e.preventDefault();
const menu = deviceMenuMap[obj.type];
2020-01-15 10:11:26 +08:00
this.point = {
x: e.clientX,
y: e.clientY
};
this.editModel = obj;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
}
}
};
</script>
<style lang="scss" scoped>
.clearfix{
padding: 0 20px;
border-bottom: 1px solid #EBEEF5;
box-sizing: border-box;
height: 47px;
line-height: 47px;
2020-04-15 15:42:47 +08:00
position: absolute;
width:100%;
2020-01-15 10:11:26 +08:00
}
.text_item{
2020-04-15 15:42:47 +08:00
height: 100%;
padding-top: 47px;
2020-01-15 10:11:26 +08:00
.tree_box{
height: calc(100% - 89px);
overflow-y: auto;
}
}
.buttonList{
padding: 8px 0px 8px 0px;
border-top: 1px #ccc solid;
}
.eachButton{
margin-left:10px;
}
.uploadDemo {
position: relative;
overflow: hidden;
// float: right;
padding: 9px 15px;
margin-right: 3px;
cursor: pointer;
input {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
}
}
.map-list-main{
text-align:left;
height: 100%;
2020-04-15 15:42:47 +08:00
position: relative;
2020-01-15 10:11:26 +08:00
}
</style>