rt-sim-training-client/src/views/newMap/newMapdraft/dataRelation/index.vue

246 lines
7.5 KiB
Vue
Raw Normal View History

2019-11-29 12:51:58 +08:00
<template>
<transition name="el-zoom-in-center">
<div class="map-control">
<div class="joylink-card">
<div class="clearfix">
<span>
{{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" class="mapEdit_box" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
<el-button type="text" class="mapEdit_box" @click="createRouteEvent">{{ $t('map.newConstruction') }}</el-button>
<el-button type="text" class="mapEdit_box" @click="drawMap">{{ $t('map.drawMap') }}</el-button>
<el-button type="text" class="mapEdit_box" @click="showMap">{{ $t('map.viewLayer') }}</el-button>
</div>
2019-12-19 16:21:00 +08:00
<el-tabs v-model="enabledTab" type="card" class="map_card" :before-leave="tabBeforeLeave" @tab-click="changePane">
2019-12-18 13:21:07 +08:00
<el-tab-pane :label="$t('map.routeID')" class="tab_pane_box" name="route">
<route-operate
ref="routeOperate"
2019-11-29 12:51:58 +08:00
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="侧防" class="tab_pane_box" name="flankProtect">
<flank-protect-operate
ref="flankProtectOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
2019-12-11 13:56:46 +08:00
<el-tab-pane label="自动折返" class="tab_pane_box" name="turned">
2019-12-10 17:55:43 +08:00
<turned-operate
2019-12-27 09:40:52 +08:00
ref="turnedOperate"
2019-12-10 17:55:43 +08:00
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
2019-12-10 16:50:38 +08:00
</el-tab-pane>
2019-11-29 12:51:58 +08:00
<el-tab-pane :label="$t('map.automaticSignal')" class="tab_pane_box" name="automatic">
<automatic-operate
ref="automaticOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
2019-12-10 18:11:11 +08:00
<el-tab-pane :label="$t('map.signalApprochSection')" class="tab_pane_box" name="signal">
2019-11-29 12:51:58 +08:00
<signal-operate
ref="signalOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="设置运行等级" class="tab_pane_box" name="runLevel">
<run-level-operate
ref="runLevelOperate"
2019-11-29 12:51:58 +08:00
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane :label="$t('map.routing')" class="tab_pane_box" name="routing">
<routing-operate
ref="routingOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
2020-04-20 09:57:00 +08:00
<el-tab-pane label="停站时间" class="tab_pane_box" name="dwellTime">
<dwell-time-operate
ref="dwellTimeOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
2019-11-29 12:51:58 +08:00
</el-tabs>
</div>
</div>
</transition>
</template>
<script>
import RouteOperate from './routeoperate/index';
import RoutingOperate from './routingoperate/index';
import AutomaticOperate from './automaticoperate/index';
// import PathOperate from './pathoperate/index';
import RunLevelOperate from './runLeveloperate/index';
2019-11-29 12:51:58 +08:00
import SignalOperate from './signaloperate/index';
2019-12-10 16:50:38 +08:00
import TurnedOperate from './turnedoperate/index';
import FlankProtectOperate from './flankProtectOperate/index';
2020-04-20 09:57:00 +08:00
import DwellTimeOperate from './dwellTimeOperate/index';
2019-11-29 12:51:58 +08:00
export default {
name: 'DataRelation',
components: {
RouteOperate,
RoutingOperate,
AutomaticOperate,
RunLevelOperate,
FlankProtectOperate,
// PathOperate,
2019-12-10 10:18:25 +08:00
SignalOperate,
2020-04-20 09:57:00 +08:00
TurnedOperate,
DwellTimeOperate
2019-11-29 12:51:58 +08:00
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
},
mapInfo: {
type: Object,
default: function() { return {name: this.$t('map.pleaseSelectMap')}; }
}
},
data() {
return {
2019-12-19 10:08:12 +08:00
enabledTab: 'route',
2019-12-27 09:40:52 +08:00
oldDevice: null,
enabledTabMenu: {
route: 'routeOperate',
routing: 'routingOperate',
automatic: 'automaticOperate',
signal: 'signalOperate',
runLevel: 'runLevelOperate',
turned: 'turnedOperate',
2020-04-20 09:57:00 +08:00
flankProtect: 'flankProtectOperate',
dwellTime: 'dwellTimeOperate'
2019-12-27 09:40:52 +08:00
}
2019-11-29 12:51:58 +08:00
};
},
mounted() {
},
methods: {
showMap() {
this.$emit('showMap');
},
initLoad() {
2020-04-20 18:29:50 +08:00
if (this.enabledTab === 'route' || this.enabledTab == 'runLevel') {
2019-12-27 09:40:52 +08:00
this.$refs[this.enabledTabMenu[this.enabledTab]].initLoad();
}
},
createRouteEvent() { // 创建 清空表单内容
2019-12-27 09:40:52 +08:00
this.$refs[this.enabledTabMenu[this.enabledTab]].createRouteEvent();
2019-11-29 12:51:58 +08:00
},
previewRouteEvent() { // 预览调用
2019-12-27 09:40:52 +08:00
this.$refs[this.enabledTabMenu[this.enabledTab]].previewRouteEvent();
2019-11-29 12:51:58 +08:00
},
changePane(data) {
this.enabledTab = data.name;
},
setSelected(selected) {
2019-12-27 09:40:52 +08:00
this.$refs[this.enabledTabMenu[this.enabledTab]].setSelected(selected);
2019-11-29 12:51:58 +08:00
},
setCenter(code) {
this.$emit('setCenter', code);
},
drawMap() {
2019-12-27 09:40:52 +08:00
this.$refs.routeOperate.batchSectionListFocus(false);
this.$refs.signalOperate.batchSectionListFocus(false);
2020-04-20 18:29:50 +08:00
this.$refs.runLevelOperate.batchSectionListFocus(false);
2019-11-29 12:51:58 +08:00
this.$emit('selectView', 'draft');
2019-12-13 14:46:38 +08:00
},
2019-12-19 16:21:00 +08:00
tabBeforeLeave(activeName, oldActiveName) {
2020-04-20 18:29:50 +08:00
if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel') {
2019-12-27 09:40:52 +08:00
this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true);
2019-12-19 16:21:00 +08:00
}
if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel') {
2019-12-27 09:40:52 +08:00
this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false);
2019-12-19 16:21:00 +08:00
}
2019-11-29 12:51:58 +08:00
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.map-context {
display: block;
float: left;
margin-left: 5px;
}
.map-control {
float: right;
width: 100%;
height: 100%;
.clearfix{
height: 47px;
padding: 15px;
}
.joylink-card{
height: 100%;
}
}
.mapEdit_box{
float: right;
padding: 3px 0;
margin-right: 5px;
}
.map_card {
height: calc(100% - 47px);
.tab_pane_box{
height: 100%;
}
}
.physical-view {
line-height: 25px;
height: 118px;
padding-left: 12px;
.el-checkbox {
width: 70px;
margin: 0;
margin-right: 30px;
}
}
/deep/ {
.map_card .el-tabs__header .el-tabs__item.is-active {
border-bottom-color: #f5f7fa;
background: #f5f7fa;
}
.map_card .el-tabs__content{
height: calc(100% - 56px);
}
}
/deep/ .map-draft-group {
float: right;
margin: 10px 5px;
}
/deep/ {
.view-control {
overflow-y: auto;
}
}
</style>