2019-11-29 12:51:58 +08:00
|
|
|
<template>
|
|
|
|
<transition name="el-zoom-in-center">
|
|
|
|
<div class="map-control">
|
|
|
|
<div class="border-card">
|
2020-07-17 14:08:14 +08:00
|
|
|
<div class="map-operate">
|
2019-11-29 12:51:58 +08:00
|
|
|
<span>
|
|
|
|
{{ $t('map.mapName') }}
|
|
|
|
<b>{{ mapInfo.name }}</b>
|
|
|
|
</span>
|
2020-07-14 17:16:49 +08:00
|
|
|
<el-button v-if="isSave" type="text" style="float: right; padding: 3px 0" :disabled="$attrs.mapSaveing" @click="saveMapEvent">{{ $t('map.save') }}</el-button>
|
2020-07-17 14:08:14 +08:00
|
|
|
<el-dropdown class="operate-button" trigger="click">
|
2020-07-14 17:16:49 +08:00
|
|
|
<span class="el-dropdown-link">数据操作</span>
|
2020-05-09 10:51:13 +08:00
|
|
|
<el-dropdown-menu slot="dropdown">
|
2020-07-14 17:16:49 +08:00
|
|
|
<el-dropdown-item><span style="display:block;" :disabled="$attrs.mapSaveing" @click="verifyMapEvent">{{ $t('map.dataVerification') }}</span></el-dropdown-item>
|
|
|
|
<el-dropdown-item><span style="display:block;" :disabled="$attrs.mapSaveing" @click="generateCIEvent">生成联锁</span></el-dropdown-item>
|
2020-05-09 10:51:13 +08:00
|
|
|
</el-dropdown-menu>
|
|
|
|
</el-dropdown>
|
2020-07-17 14:08:14 +08:00
|
|
|
<el-button type="text" class="operate-button" @click="dataRelation">{{ $t('map.advanced') }}</el-button>
|
|
|
|
<el-button type="text" class="operate-button" @click="showMap">绘图显隐</el-button>
|
2019-11-29 12:51:58 +08:00
|
|
|
</div>
|
2020-05-12 16:45:45 +08:00
|
|
|
<el-tabs v-show="projectType" v-model="enabledTab" class="mapEdit" type="card">
|
2020-07-13 17:01:34 +08:00
|
|
|
<el-tab-pane v-for="(each,index) in tabList" :key="index" :label="each.label" class="tab_pane_box" :name="each.name" :lazy="lazy">
|
|
|
|
<component
|
|
|
|
:is="each.menus"
|
|
|
|
:ref="each.name"
|
2020-07-24 16:02:55 +08:00
|
|
|
:selected="selected"
|
2020-07-14 17:16:49 +08:00
|
|
|
v-bind="$attrs"
|
|
|
|
v-on="$listeners"
|
2020-07-14 14:27:35 +08:00
|
|
|
@deviceSelect="deviceSelect"
|
2020-03-19 16:17:34 +08:00
|
|
|
/>
|
|
|
|
</el-tab-pane>
|
2019-11-29 12:51:58 +08:00
|
|
|
</el-tabs>
|
2020-07-06 17:02:13 +08:00
|
|
|
<template v-show="!projectType">
|
2020-05-12 16:45:45 +08:00
|
|
|
<split-screen
|
|
|
|
ref="splitScreen"
|
|
|
|
:selected="selected"
|
|
|
|
/>
|
2020-07-06 17:02:13 +08:00
|
|
|
</template>
|
2019-11-29 12:51:58 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-12-27 15:23:42 +08:00
|
|
|
import SectionDraft from './section/index';
|
2020-01-13 11:25:51 +08:00
|
|
|
import SwitchDraft from './switch/index';
|
2019-12-05 14:31:39 +08:00
|
|
|
import SignalDraft from './signal/index';
|
2019-11-29 12:51:58 +08:00
|
|
|
import StationDraft from './station';
|
|
|
|
import StationStandDraft from './stationstand';
|
2019-12-06 18:03:13 +08:00
|
|
|
import PsdDraft from './psdDraft';
|
|
|
|
import EspDraft from './espDraft';
|
2019-11-29 12:51:58 +08:00
|
|
|
import TrainDraft from './train/index';
|
|
|
|
import LineDraft from './line';
|
2020-05-28 14:39:06 +08:00
|
|
|
import PowerDraft from './power';
|
2019-11-29 12:51:58 +08:00
|
|
|
import TextDraft from './text';
|
2020-03-17 16:12:15 +08:00
|
|
|
import ControlDraft from './ControlDraft';
|
2019-11-29 12:51:58 +08:00
|
|
|
import TrainWindowDraft from './trainwindow';
|
2019-12-04 14:08:55 +08:00
|
|
|
import ZcControlDraft from './zcControl';
|
2020-03-05 15:48:51 +08:00
|
|
|
import OutFrameDraft from './outFrameControl';
|
2019-12-04 14:08:55 +08:00
|
|
|
import LcControlDraft from './lcControl';
|
2019-11-29 12:51:58 +08:00
|
|
|
import ImageControlDraft from './ImageControl';
|
|
|
|
import CheckboxDraft from './checkboxDraft';
|
2020-03-19 16:17:34 +08:00
|
|
|
import ControlLamp from './controlLamp';
|
2020-04-15 14:13:08 +08:00
|
|
|
import SplitStation from './splitStation';
|
2020-04-26 16:24:34 +08:00
|
|
|
import Arrow from './arrow';
|
2020-05-12 16:45:45 +08:00
|
|
|
import SplitScreen from './splitScreen';
|
|
|
|
import { EventBus } from '@/scripts/event-bus';
|
2019-11-29 12:51:58 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'MapOperate',
|
|
|
|
components: {
|
2019-12-03 18:44:46 +08:00
|
|
|
// CounterDraft,
|
2019-11-29 12:51:58 +08:00
|
|
|
SectionDraft,
|
|
|
|
SwitchDraft,
|
|
|
|
SignalDraft,
|
|
|
|
StationDraft,
|
|
|
|
StationStandDraft,
|
2019-12-06 18:03:13 +08:00
|
|
|
PsdDraft,
|
|
|
|
EspDraft,
|
2020-03-17 16:12:15 +08:00
|
|
|
ControlDraft,
|
2019-11-29 12:51:58 +08:00
|
|
|
TrainWindowDraft,
|
|
|
|
TrainDraft,
|
|
|
|
LineDraft,
|
2020-05-28 14:39:06 +08:00
|
|
|
PowerDraft,
|
2019-11-29 12:51:58 +08:00
|
|
|
TextDraft,
|
2019-12-04 14:08:55 +08:00
|
|
|
ZcControlDraft,
|
2020-03-05 15:48:51 +08:00
|
|
|
OutFrameDraft,
|
2019-12-04 14:08:55 +08:00
|
|
|
LcControlDraft,
|
2019-11-29 12:51:58 +08:00
|
|
|
ImageControlDraft,
|
2020-03-19 16:17:34 +08:00
|
|
|
CheckboxDraft,
|
2020-04-15 14:13:08 +08:00
|
|
|
ControlLamp,
|
2020-04-26 16:24:34 +08:00
|
|
|
SplitStation,
|
2020-05-12 16:45:45 +08:00
|
|
|
Arrow,
|
|
|
|
SplitScreen
|
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')}; }
|
2020-07-14 17:16:49 +08:00
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2020-04-30 14:50:27 +08:00
|
|
|
lazy: true,
|
2020-07-13 17:01:34 +08:00
|
|
|
tabList:[
|
|
|
|
{label:this.$t('map.section'), name:'Section', menus:SectionDraft},
|
|
|
|
{label:this.$t('map.switch'), name:'Switch', menus:SwitchDraft},
|
|
|
|
{label:this.$t('map.station'), name:'Station', menus:StationDraft},
|
|
|
|
{label:this.$t('map.signal'), name:'Signal', menus:SignalDraft},
|
|
|
|
{label:this.$t('map.platform'), name:'StationStand', menus:StationStandDraft},
|
|
|
|
{label:this.$t('map.psd'), name:'Psd', menus:PsdDraft},
|
|
|
|
{label:this.$t('map.platformEmergencyStop'), name:'Esp', menus:EspDraft},
|
|
|
|
{label:this.$t('map.trainWindow'), name:'TrainWindow', menus:TrainWindowDraft},
|
|
|
|
{label:this.$t('map.zcZoneControl'), name:'ZcControl', menus:ZcControlDraft},
|
|
|
|
{label:this.$t('map.functionButton'), name:'ControlDraft', menus:ControlDraft},
|
|
|
|
{label:this.$t('map.saidLamp'), name:'ControlLamp', menus:ControlLamp},
|
|
|
|
{label:this.$t('map.train'), name:'Train', menus:TrainDraft},
|
|
|
|
{label:this.$t('map.line'), name:'Line', menus:LineDraft},
|
|
|
|
{label:'供电线', name:'Power', menus:PowerDraft},
|
|
|
|
{label:this.$t('map.text'), name:'Text', menus:TextDraft},
|
|
|
|
{label:this.$t('map.lcControl'), name:'LcControl', menus:LcControlDraft},
|
|
|
|
{label:this.$t('map.rectangularBox'), name:'OutFrame', menus:OutFrameDraft},
|
|
|
|
{label:this.$t('map.image'), name:'Resource', menus:ImageControlDraft},
|
|
|
|
{label:this.$t('map.boundingBox'), name:'CheckBox', menus:CheckboxDraft},
|
|
|
|
{label:'站间分隔', name:'SplitStation', menus:SplitStation},
|
|
|
|
{label:'箭头', name:'Arrow', menus:Arrow}
|
|
|
|
],
|
2020-07-14 14:27:35 +08:00
|
|
|
selectDevice:'',
|
2019-11-29 13:27:17 +08:00
|
|
|
enabledTab: 'Section',
|
2020-05-12 16:45:45 +08:00
|
|
|
projectType: true
|
2019-11-29 12:51:58 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isSave() {
|
|
|
|
return this.mapInfo && this.mapInfo.id;
|
|
|
|
}
|
|
|
|
},
|
2019-12-06 14:36:18 +08:00
|
|
|
watch: {
|
|
|
|
'$store.state.map.deleteCount': function (val) {
|
2020-01-13 13:48:45 +08:00
|
|
|
if (this.selected) {
|
2020-07-13 17:01:34 +08:00
|
|
|
this.$refs[this.enabledTab][0].deleteObj();
|
2020-01-13 13:48:45 +08:00
|
|
|
}
|
2019-12-06 15:12:22 +08:00
|
|
|
},
|
|
|
|
'$store.state.map.updateCount': function (val) {
|
2020-07-13 17:01:34 +08:00
|
|
|
this.$refs[this.enabledTab][0].edit();
|
2020-05-08 18:52:46 +08:00
|
|
|
},
|
|
|
|
selected(val, oldVal) {
|
|
|
|
if (this.selected) {
|
|
|
|
this.$nextTick(() => {
|
2020-07-13 17:01:34 +08:00
|
|
|
this.$refs[this.enabledTab][0].deviceSelect(val);
|
2020-05-08 18:52:46 +08:00
|
|
|
});
|
|
|
|
}
|
2019-12-06 14:36:18 +08:00
|
|
|
}
|
|
|
|
},
|
2019-11-29 12:51:58 +08:00
|
|
|
mounted() {
|
2020-05-12 16:45:45 +08:00
|
|
|
EventBus.$on('select_DrawType', (showMode) => {
|
|
|
|
if (showMode == '04') {
|
|
|
|
this.projectType = false;
|
|
|
|
} else {
|
|
|
|
this.projectType = true;
|
|
|
|
}
|
|
|
|
});
|
2019-11-29 12:51:58 +08:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
dataRelation() {
|
|
|
|
this.$emit('selectView', 'path');
|
|
|
|
},
|
|
|
|
showMap() {
|
|
|
|
this.$emit('showMap');
|
|
|
|
},
|
2019-12-04 14:02:39 +08:00
|
|
|
handleSelectControlPage(device) {
|
2020-05-18 17:08:21 +08:00
|
|
|
const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle'];
|
2019-11-29 12:51:58 +08:00
|
|
|
const type = device._type;
|
2020-07-14 14:27:35 +08:00
|
|
|
if (this.selectDevice) {
|
|
|
|
this.enabledTab = this.selectDevice;
|
2020-07-17 11:14:50 +08:00
|
|
|
} else if (['AutomaticRoute', 'AutoTurnBack', 'AxleReset', 'LimitControl', 'GuideLock', 'StationTurnBack'].includes(type)) {
|
2020-03-17 16:12:15 +08:00
|
|
|
this.enabledTab = 'ControlDraft';
|
2020-07-14 14:27:35 +08:00
|
|
|
} else if (controlLampTypeList.includes(type)) {
|
2020-03-19 16:17:34 +08:00
|
|
|
this.enabledTab = 'ControlLamp';
|
2019-11-29 12:51:58 +08:00
|
|
|
} else {
|
|
|
|
this.enabledTab = type;
|
|
|
|
}
|
|
|
|
},
|
2020-07-14 14:27:35 +08:00
|
|
|
deviceSelect(type) {
|
|
|
|
this.selectDevice = type;
|
2019-12-03 14:42:00 +08:00
|
|
|
},
|
2019-11-29 12:51:58 +08:00
|
|
|
saveMapEvent() {
|
|
|
|
this.$emit('saveMapEvent');
|
|
|
|
},
|
|
|
|
verifyMapEvent() {
|
|
|
|
this.$emit('verifyMapEvent');
|
|
|
|
},
|
2020-04-30 10:12:11 +08:00
|
|
|
generateCIEvent() {
|
2020-04-30 14:50:27 +08:00
|
|
|
this.$emit('generateCIEvent');
|
2019-11-29 12:51:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
@import "src/styles/mixin.scss";
|
2020-05-09 10:51:13 +08:00
|
|
|
.el-dropdown-link {
|
|
|
|
cursor: pointer;
|
|
|
|
color: #409EFF;
|
|
|
|
}
|
|
|
|
.el-icon-arrow-down {
|
|
|
|
font-size: 12px;
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
.map-control {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
.border-card{
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-17 14:08:14 +08:00
|
|
|
.operate-button{
|
|
|
|
float: right;
|
|
|
|
padding: 3px 0;
|
|
|
|
margin-right: 5px;
|
|
|
|
}
|
|
|
|
|
2019-11-29 12:51:58 +08:00
|
|
|
.physical-view {
|
|
|
|
line-height: 25px;
|
|
|
|
height: 118px;
|
|
|
|
padding-left: 12px;
|
|
|
|
|
|
|
|
.el-checkbox {
|
|
|
|
width: 70px;
|
|
|
|
margin: 0;
|
|
|
|
margin-right: 30px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-17 14:08:14 +08:00
|
|
|
.map-operate{
|
2019-11-29 12:51:58 +08:00
|
|
|
height: 47px;
|
|
|
|
padding: 15px
|
|
|
|
}
|
|
|
|
.mapEdit{
|
|
|
|
height: calc(100% - 47px);
|
|
|
|
.tab_pane_box{
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/deep/ .button_box{
|
|
|
|
width: 100%;
|
|
|
|
background: #ffffff;
|
|
|
|
border-top: 1px #f3f1f1 solid;
|
|
|
|
box-shadow: 4px 7px 10px #565656;
|
|
|
|
border-radius: 0;
|
|
|
|
border-bottom: 1px transparent solid;
|
2020-07-16 10:50:59 +08:00
|
|
|
position:absolute;
|
|
|
|
bottom:0;
|
2020-07-27 16:11:29 +08:00
|
|
|
z-index:3;
|
2019-11-29 12:51:58 +08:00
|
|
|
}
|
|
|
|
|
2020-07-16 10:50:59 +08:00
|
|
|
/deep/ .view-control-content{
|
|
|
|
height:100%;
|
|
|
|
padding-bottom:46px;
|
2020-07-16 16:18:13 +08:00
|
|
|
overflow-y:auto;
|
2020-07-16 10:50:59 +08:00
|
|
|
}
|
|
|
|
|
2019-11-29 12:51:58 +08:00
|
|
|
/deep/ .map-draft-group {
|
|
|
|
float: right;
|
|
|
|
margin: 6px 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
/deep/ .view-control {
|
2020-07-16 14:41:21 +08:00
|
|
|
height:100%;
|
2019-11-29 12:51:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/deep/ {
|
2020-04-10 16:41:48 +08:00
|
|
|
.mapEdit .el-tabs__nav-wrap.is-scrollable {
|
|
|
|
padding: 0 20px;
|
|
|
|
}
|
|
|
|
.mapEdit .el-tabs__header .el-tabs__item.is-active {
|
|
|
|
border-bottom-color: #f5f7fa;
|
|
|
|
background: #f5f7fa;
|
|
|
|
}
|
|
|
|
.mapEdit .el-tabs__active-bar{
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
.mapEdit .el-tabs__content {
|
|
|
|
height: calc(100% - 56px);
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-04-10 16:41:48 +08:00
|
|
|
.card .el-tabs__nav .el-tabs__item.is-active {
|
|
|
|
border-bottom: 2px solid #E4E7ED;
|
|
|
|
background: #409eff;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
.card .el-tabs__nav .el-tabs__item{
|
|
|
|
padding: 0 20px!important;
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-04-10 16:41:48 +08:00
|
|
|
.mapEdit .el-tabs__nav-prev {
|
|
|
|
width: 20px;
|
|
|
|
height: 41px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
box-shadow: 1px 1px 4px #ccc;
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2020-04-10 16:41:48 +08:00
|
|
|
.mapEdit .el-tabs__nav-next {
|
|
|
|
width: 20px;
|
|
|
|
height: 41px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
box-shadow: 1px 1px 4px #ccc;
|
|
|
|
}
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
|
|
|
// 页面页签样式
|
|
|
|
/deep/ {
|
|
|
|
.card .el-transfer-panel__filter{
|
|
|
|
margin: 5px 15px;
|
|
|
|
}
|
|
|
|
.card .el-transfer-panel__list.is-filterable{
|
|
|
|
height: 290px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.card .el-transfer-panel__body{
|
|
|
|
height: 328px;
|
|
|
|
}
|
|
|
|
.card .el-transfer__buttons{
|
|
|
|
padding: 0 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.card .el-transfer{
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|