进路物理区段列表连续高亮
This commit is contained in:
parent
30fc3132d3
commit
143f35a222
@ -22,6 +22,7 @@ export default class Section extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.selected = false; // 绘图选中状态
|
this.selected = false; // 绘图选中状态
|
||||||
|
this.batchSelected = false; // 绘图批量选中状态
|
||||||
this.create();
|
this.create();
|
||||||
this.createMouseEvent();
|
this.createMouseEvent();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
@ -853,7 +854,15 @@ export default class Section extends Group {
|
|||||||
drawSelected(selected) {
|
drawSelected(selected) {
|
||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
if (selected) {
|
if (selected) {
|
||||||
this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'});
|
!this.batchSelected && this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'});
|
||||||
|
} else {
|
||||||
|
!this.batchSelected && this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drawBatchSelected(selected) {
|
||||||
|
this.batchSelected = selected;
|
||||||
|
if (selected) {
|
||||||
|
this.section && this.section.setStyle({stroke: 'rgba(255,255,0,0.6)'});
|
||||||
} else {
|
} else {
|
||||||
this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor });
|
this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor });
|
||||||
}
|
}
|
||||||
@ -862,8 +871,8 @@ export default class Section extends Group {
|
|||||||
checkIsDrawMap() {
|
checkIsDrawMap() {
|
||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
if (path.includes('/map/draw')) {
|
if (path.includes('/map/draw')) {
|
||||||
this.on('mouseout', () => { !this.selected && this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); });
|
this.on('mouseout', () => { !this.batchSelected && !this.selected && this.section && this.section.setStyle({stroke: this.style.Section.line.spareColor }); });
|
||||||
this.on('mouseover', () => { this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); });
|
this.on('mouseover', () => { !this.batchSelected && this.section && this.section.setStyle({stroke: 'rgba(0,255,255,0.6)'}); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||||
BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||||
} else {
|
} else {
|
||||||
BASE_API = process.env.VUE_APP_BASE_API;
|
BASE_API = process.env.VUE_APP_BASE_API;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<el-button type="text" class="mapEdit_box" @click="drawMap">{{ $t('map.drawMap') }}</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>
|
<el-button type="text" class="mapEdit_box" @click="showMap">{{ $t('map.viewLayer') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-tabs v-model="enabledTab" type="card" class="map_card" @tab-click="changePane">
|
<el-tabs v-model="enabledTab" type="card" class="map_card" :before-leave="tabBeforeLeave" @tab-click="changePane">
|
||||||
<el-tab-pane :label="$t('map.routeID')" class="tab_pane_box" name="route">
|
<el-tab-pane :label="$t('map.routeID')" class="tab_pane_box" name="route">
|
||||||
<route-operate
|
<route-operate
|
||||||
ref="routeOperate"
|
ref="routeOperate"
|
||||||
@ -183,8 +183,17 @@ export default {
|
|||||||
this.$emit('setCenter', code);
|
this.$emit('setCenter', code);
|
||||||
},
|
},
|
||||||
drawMap() {
|
drawMap() {
|
||||||
|
this.$refs.routeOperate.routeSectionListFocus(false);
|
||||||
this.$emit('selectView', 'draft');
|
this.$emit('selectView', 'draft');
|
||||||
},
|
},
|
||||||
|
tabBeforeLeave(activeName, oldActiveName) {
|
||||||
|
if (activeName === 'route') {
|
||||||
|
this.$refs.routeOperate.routeSectionListFocus(true);
|
||||||
|
}
|
||||||
|
if (oldActiveName === 'route') {
|
||||||
|
this.$refs.routeOperate.routeSectionListFocus(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
handleHightLight(selected) {
|
handleHightLight(selected) {
|
||||||
if (this.oldDevice && (this.oldDevice._type === 'Section' || this.oldDevice._type === 'Psd') && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') {
|
if (this.oldDevice && (this.oldDevice._type === 'Section' || this.oldDevice._type === 'Psd') && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') {
|
||||||
if (this.isSwitchSection) {
|
if (this.isSwitchSection) {
|
||||||
|
@ -1,157 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog v-dialogDrag :title="$t('map.continueProtectList')" :visible.sync="show" width="85%" :before-do-close="doClose">
|
|
||||||
<div>
|
|
||||||
<QueryListPage
|
|
||||||
ref="queryListPage"
|
|
||||||
:pager-config="pagerConfig"
|
|
||||||
:query-form="queryForm"
|
|
||||||
:query-list="queryList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { getContinueProtectList, delContinueProtect, getContinueProtectById } from '@/api/jmap/mapdraft';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ProtectDetail',
|
|
||||||
props: {
|
|
||||||
mapInfo: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
show: false,
|
|
||||||
showType: '',
|
|
||||||
pagerConfig: {
|
|
||||||
pageSize: 'pageSize',
|
|
||||||
pageIndex: 'pageNum'
|
|
||||||
},
|
|
||||||
queryForm: {
|
|
||||||
labelWidth: '120px',
|
|
||||||
queryObject: {
|
|
||||||
name: {
|
|
||||||
type: 'text',
|
|
||||||
label: '延续保护名称'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
queryList: {
|
|
||||||
query: this.queryFunction,
|
|
||||||
selectCheckShow: false,
|
|
||||||
indexShow: true,
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
title: '延续保护名称',
|
|
||||||
prop: 'name'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '解锁区段',
|
|
||||||
prop: 'unlockSectionCode',
|
|
||||||
type: 'tag',
|
|
||||||
columnValue: (row) => { return this.$convertField(row.unlockSectionCode, this.sectionList, ['code', 'name']); },
|
|
||||||
tagType: (row) => { return ''; }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '解锁时间(s)',
|
|
||||||
prop: 'unlockTime'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
title: this.$t('map.operation'),
|
|
||||||
width: '200',
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
name: this.$t('map.compile'),
|
|
||||||
handleClick: this.editObj,
|
|
||||||
showControl: () => { return this.showType !== 'select'; }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: this.$t('map.deleteObj'),
|
|
||||||
handleClick: this.deleteObj,
|
|
||||||
type: 'danger',
|
|
||||||
showControl: () => { return this.showType !== 'select'; }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '选择',
|
|
||||||
handleClick: this.selectedObj,
|
|
||||||
showControl: () => { return this.showType === 'select'; }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('map', [
|
|
||||||
'sectionList',
|
|
||||||
'espList',
|
|
||||||
'psdList'
|
|
||||||
])
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
doShow(type) {
|
|
||||||
this.show = true;
|
|
||||||
this.reloadTable();
|
|
||||||
if (type) {
|
|
||||||
this.showType = type;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doClose() {
|
|
||||||
this.show = false;
|
|
||||||
},
|
|
||||||
formatName(code) {
|
|
||||||
let name = '';
|
|
||||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
|
||||||
if (device) {
|
|
||||||
name = device.uniqueName;
|
|
||||||
}
|
|
||||||
|
|
||||||
return name;
|
|
||||||
},
|
|
||||||
queryFunction(params) {
|
|
||||||
if (this.mapInfo && this.mapInfo.id) {
|
|
||||||
return getContinueProtectList(this.mapInfo.id, params);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
editObj(index, row) {
|
|
||||||
getContinueProtectById(row.id).then(response => {
|
|
||||||
const data = response.data;
|
|
||||||
this.$emit('protectSelected', data);
|
|
||||||
this.doClose();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deleteObj(index, row) {
|
|
||||||
if (this.mapInfo && this.mapInfo.id && row) {
|
|
||||||
// 删除
|
|
||||||
delContinueProtect(row.id).then(response => {
|
|
||||||
this.$message.success(this.$t('map.successfullyDelete'));
|
|
||||||
this.reloadTable();
|
|
||||||
}).catch(() => {
|
|
||||||
this.$messageBox(this.$t('map.failDelete'));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reloadTable() {
|
|
||||||
if (this.queryList && this.queryList.reload) {
|
|
||||||
this.queryList.reload();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
selectedObj(index, row) {
|
|
||||||
this.$emit('setOverlapCode', row);
|
|
||||||
this.show = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -1,84 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="height: 100%;">
|
|
||||||
<route-draft
|
|
||||||
ref="routeEdit"
|
|
||||||
:selected="selected"
|
|
||||||
:map-info="mapInfo"
|
|
||||||
:route-data="routeData"
|
|
||||||
/>
|
|
||||||
<route-detail ref="routeDetail" :map-info="mapInfo" @protectSelected="protectSelected" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import RouteDraft from './route';
|
|
||||||
import RouteDetail from './detail';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ContinueProtect',
|
|
||||||
components: {
|
|
||||||
RouteDraft,
|
|
||||||
RouteDetail
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
mapInfo: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
selected: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
enabledTab: 'protect',
|
|
||||||
routeData: null
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
clickEvent(e, model) {
|
|
||||||
this.onSelect(model);
|
|
||||||
},
|
|
||||||
onSelect(model) {
|
|
||||||
if (model) {
|
|
||||||
this.selected = model;
|
|
||||||
} else {
|
|
||||||
this.selected = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setDelayUnlockStatus(data, status) {
|
|
||||||
if (data && data.delayShowList) {
|
|
||||||
data.delayShowList.forEach(elem => {
|
|
||||||
elem.status = status;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
protectSelected: function (data) {
|
|
||||||
this.routeData = data;
|
|
||||||
if (this.$refs.routeEdit) {
|
|
||||||
this.$refs.routeEdit.isSave = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
previewRouteEvent: function () {
|
|
||||||
if (this.$refs.routeDetail) {
|
|
||||||
this.$refs.routeDetail.doShow();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
createRouteEvent: function () {
|
|
||||||
if (this.$refs.routeEdit) {
|
|
||||||
this.$refs.routeEdit.clear();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setSelected(selected) {
|
|
||||||
this.$refs.routeEdit.setSelected(selected);
|
|
||||||
},
|
|
||||||
setCenter(code) {
|
|
||||||
this.$emit('setCenter', code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -1,413 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="height: 100%;">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
||||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini">
|
|
||||||
<div class="definition">
|
|
||||||
<el-form-item label="延续保护名称:" prop="name">
|
|
||||||
<el-input v-model="addModel.name" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="解锁区段" prop="unlockSectionCode">
|
|
||||||
<el-select v-model="addModel.unlockSectionCode">
|
|
||||||
<el-option
|
|
||||||
v-for="item in sectionList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name + ' (' + item.code+ ')'"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-button
|
|
||||||
:type=" field === 'unlockSectionCode' ? 'danger' : 'primary'"
|
|
||||||
@click="hover('unlockSectionCode')"
|
|
||||||
>{{ $t('map.activate') }}</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="解锁时间(s)" prop="unlockTime">
|
|
||||||
<el-input-number v-model="addModel.unlockTime" :min="0" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="延续保护线路:" prop="relSectionSwitchList">
|
|
||||||
<el-table :data="addModel.relSectionSwitchList" border style="width: 80%">
|
|
||||||
<el-table-column type="index" label="序号" width="100" />
|
|
||||||
<el-table-column fixed="right" :label="$t('map.operation')">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
@click.native.prevent="deleteOverlab(addModel.relSectionSwitchList, scope.$index)"
|
|
||||||
>
|
|
||||||
移出
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
@click.native.prevent="editOverlab(addModel.relSectionSwitchList, scope.$index)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
|
||||||
<el-card class="box-card" shadow="never">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span style="font-size: 14px;">{{ cardTitle }}</span>
|
|
||||||
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
|
|
||||||
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
|
|
||||||
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
|
|
||||||
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
|
|
||||||
</el-button-group>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-form ref="overlabForm" :model="addOverlapModel" :rules="overLapRules" label-width="135px" size="mini" style="margin-top: 15px">
|
|
||||||
<el-form-item :label="$t('map.routeProtectsData') + ':'" prop="routeOverlapSectionList">
|
|
||||||
<el-select v-model="addOverlapModel.routeOverlapSectionList" multiple clearable :filterable="true">
|
|
||||||
<el-option
|
|
||||||
v-for="item in sectionList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name + ' (' + item.code+ ')'"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-button
|
|
||||||
:type=" field === 'routeOverlapSectionList' ? 'danger' : 'primary'"
|
|
||||||
@click="hover('routeOverlapSectionList')"
|
|
||||||
>{{ $t('map.activate') }}</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('map.continueProtectSwitchData') + ':'" prop="routeOverlapSwitchList">
|
|
||||||
<el-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
|
||||||
<el-option
|
|
||||||
v-for="item in switchList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="`${item.name}(${item.code})`"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-button
|
|
||||||
:type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'"
|
|
||||||
@click="hover('routeOverlapSwitchList')"
|
|
||||||
>{{ $t('map.activate') }}</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
@click="pushSwitch(addOverlapModel.routeOverlapSwitchList, {switchCode: overlapCode, normal: overlapType, switchType: overlapType ? '定位' : '反位'})"
|
|
||||||
>{{ $t('map.add') }}
|
|
||||||
</el-button>
|
|
||||||
<el-select v-model="overlapType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
|
||||||
<el-option
|
|
||||||
v-for="item in SwitchLocateTypeList"
|
|
||||||
:key="item.code"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.code"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-table :data="addOverlapModel.routeOverlapSwitchList" border style="width: 97%">
|
|
||||||
<el-table-column prop="switchCode" :label="$t('map.switchId')" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ swictchName(scope.row.switchCode) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="switchType" :label="$t('map.switchType')" />
|
|
||||||
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
@click.native.prevent="deleteSwitch(addOverlapModel.routeOverlapSwitchList, scope.$index)"
|
|
||||||
>
|
|
||||||
{{ $t('map.remove') }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<div class="draft">
|
|
||||||
<el-button-group>
|
|
||||||
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
|
|
||||||
</el-button>
|
|
||||||
</el-button-group>
|
|
||||||
</div>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { getUID } from '@/jmap/utils/Uid';
|
|
||||||
import { postContinueProtect, putContinueProtect } from '@/api/jmap/mapdraft';
|
|
||||||
import { ViewMode } from '@/scripts/ConstDic';
|
|
||||||
import { deepAssign } from '@/utils/index';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'RouteOperation',
|
|
||||||
props: {
|
|
||||||
selected: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mapInfo: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
routeData: {
|
|
||||||
type: Object,
|
|
||||||
default() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
ViewMode: ViewMode,
|
|
||||||
field: '',
|
|
||||||
overlapCode: '',
|
|
||||||
isSave: true,
|
|
||||||
loading: false,
|
|
||||||
editModel: {},
|
|
||||||
addModel: {
|
|
||||||
id: '',
|
|
||||||
code: '',
|
|
||||||
mapId: '',
|
|
||||||
name: '',
|
|
||||||
unlockSectionCode:'',
|
|
||||||
unlockTime: 0,
|
|
||||||
relSectionSwitchList: []
|
|
||||||
},
|
|
||||||
addOverlapModel: {
|
|
||||||
parentIndex: '',
|
|
||||||
routeOverlapSectionList: [], // 进路延续保护区段数据列表
|
|
||||||
routeOverlapSwitchList: [] // 进路延续保护道岔数据列表
|
|
||||||
},
|
|
||||||
overlapType: '',
|
|
||||||
SwitchLocateTypeList: [
|
|
||||||
{ name: '定位', code: true },
|
|
||||||
{ name: '反位', code: false }
|
|
||||||
],
|
|
||||||
editShow: false,
|
|
||||||
overLapRules: {
|
|
||||||
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
name: [
|
|
||||||
{ required: true, message: '请输入延续保护名称', trigger:'blur'}
|
|
||||||
],
|
|
||||||
unlockSectionCode: [
|
|
||||||
{ required: true, message: '请选择解锁区段', trigger:'change'}
|
|
||||||
],
|
|
||||||
unlockTime: [
|
|
||||||
{ required: true, message: '请输入解锁时间', trigger:'blur'}
|
|
||||||
],
|
|
||||||
relSectionSwitchList: [
|
|
||||||
{ required: true, message: '请生成延续保护线路', trigger: 'change'}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
cardMode: 'generate'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('map', [
|
|
||||||
'switchList',
|
|
||||||
'sectionList'
|
|
||||||
]),
|
|
||||||
cardTitle() {
|
|
||||||
if (this.cardMode === 'generate') {
|
|
||||||
return '生成延续保护线路';
|
|
||||||
} else if (this.cardMode === 'edit') {
|
|
||||||
return '编辑延续保护线路';
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
mapInfo(val) {
|
|
||||||
if (val) {
|
|
||||||
this.addModel.mapId = val.id;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
routeData(val, old) {
|
|
||||||
if (val) {
|
|
||||||
this.addModel = val;
|
|
||||||
this.editShow = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
hover(field) {
|
|
||||||
this.field = field === this.field ? '' : field;
|
|
||||||
},
|
|
||||||
pushSwitch(list, data) {
|
|
||||||
const index = list.findIndex(elem => { return elem.switchCode == data.switchCode; });
|
|
||||||
if (index < 0) {
|
|
||||||
list.push(data);
|
|
||||||
} else {
|
|
||||||
this.$messageBox(this.$t('tip.routeSameID'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deleteSwitch(list, index) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
},
|
|
||||||
swictchName(code) {
|
|
||||||
let name = '';
|
|
||||||
if (code) {
|
|
||||||
const swch = this.$store.getters['map/getDeviceByCode'](code);
|
|
||||||
if (swch) {
|
|
||||||
name = `${swch.name}(${swch.code})`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
},
|
|
||||||
setSelected(selected) {
|
|
||||||
if (selected) {
|
|
||||||
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSectionList'.toUpperCase()) {
|
|
||||||
if (this.addOverlapModel.routeOverlapSectionList.indexOf(selected.code) === -1) {
|
|
||||||
this.addOverlapModel.routeOverlapSectionList.push(selected.code);
|
|
||||||
}
|
|
||||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSwitchList'.toUpperCase()) {
|
|
||||||
this.overlapCode = selected.code;
|
|
||||||
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'unlockSectionCode'.toUpperCase()) {
|
|
||||||
this.addModel.unlockSectionCode = selected.code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buildModel(code) {
|
|
||||||
const model = Object.assign({}, this.addModel);
|
|
||||||
if (code) { model['code'] = code; }
|
|
||||||
model['mapId'] = this.mapInfo.id;
|
|
||||||
return model;
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
this.$refs.form.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.loading = true;
|
|
||||||
postContinueProtect(this.buildModel(getUID('Protect'))).then(resp => {
|
|
||||||
this.$message.success('创建延续保护成功!');
|
|
||||||
this.loading = false;
|
|
||||||
this.clear();
|
|
||||||
}).catch(() => {
|
|
||||||
this.$messageBox('创建延续保护失败!');
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
update() {
|
|
||||||
this.$refs.form.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.loading = true;
|
|
||||||
putContinueProtect(this.buildModel()).then(resp => {
|
|
||||||
this.$message.success('更新延续保护成功!');
|
|
||||||
this.loading = false;
|
|
||||||
this.clear();
|
|
||||||
}).catch(() => {
|
|
||||||
this.$messageBox('更新延续保护失败!');
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
clear() {
|
|
||||||
if (this.$refs && this.$refs.form && this.mapInfo) {
|
|
||||||
delete this.addModel.id;
|
|
||||||
this.$refs.form.resetFields();
|
|
||||||
this.addModel.mapId = this.mapInfo.id;
|
|
||||||
this.addModel.relSectionSwitchList = [];
|
|
||||||
this.addModel.code = '';
|
|
||||||
this.addModel.unlockTime = 0;
|
|
||||||
this.addModel.unlockSectionCode = '';
|
|
||||||
this.addModel.id = '';
|
|
||||||
this.addModel.name = '';
|
|
||||||
this.isSave = true;
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
this.clearOverlab();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deleteOverlab(list, index) {
|
|
||||||
list.splice(index, 1);
|
|
||||||
this.$refs.overlabForm.resetFields();
|
|
||||||
this.clearOverlab();
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
},
|
|
||||||
editOverlab(list, index) {
|
|
||||||
this.addOverlapModel = deepAssign({}, list[index]);
|
|
||||||
this.addOverlapModel.parentIndex = index;
|
|
||||||
this.cardMode = 'edit';
|
|
||||||
},
|
|
||||||
updateOverlab() {
|
|
||||||
if (this.addOverlapModel.parentIndex || this.addOverlapModel.parentIndex === 0 ) {
|
|
||||||
this.addModel.relSectionSwitchList[this.addOverlapModel.parentIndex] = {
|
|
||||||
routeOverlapSectionList:this.addOverlapModel.routeOverlapSectionList,
|
|
||||||
routeOverlapSwitchList:this.addOverlapModel.routeOverlapSwitchList
|
|
||||||
};
|
|
||||||
this.clearOverlab();
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
cancelOverlab() {
|
|
||||||
this.clearOverlab();
|
|
||||||
this.cardMode = 'generate';
|
|
||||||
},
|
|
||||||
generateOverlab() {
|
|
||||||
if (!this.addOverlapModel.routeOverlapSectionList.length) {
|
|
||||||
this.$messageBox('请选择进路延续保护区段!');
|
|
||||||
} else if (!this.addOverlapModel.routeOverlapSwitchList.length) {
|
|
||||||
this.$messageBox('请添加延续保护道岔!');
|
|
||||||
} else {
|
|
||||||
this.addModel.relSectionSwitchList.push({
|
|
||||||
routeOverlapSectionList:this.addOverlapModel.routeOverlapSectionList,
|
|
||||||
routeOverlapSwitchList:this.addOverlapModel.routeOverlapSwitchList
|
|
||||||
});
|
|
||||||
this.$refs.overlabForm.resetFields();
|
|
||||||
this.clearOverlab();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
clearOverlab() {
|
|
||||||
this.addOverlapModel = {
|
|
||||||
parentIndex: '',
|
|
||||||
routeOverlapSectionList:[],
|
|
||||||
routeOverlapSwitchList:[]
|
|
||||||
};
|
|
||||||
this.overlapCode = '';
|
|
||||||
this.overlapType = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
/deep/ .el-radio {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
/deep/ {
|
|
||||||
.el-select .el-tag {
|
|
||||||
height: auto;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding-right: 15px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
.el-input__suffix{
|
|
||||||
right: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.box-card {
|
|
||||||
width: 88%;
|
|
||||||
position: relative;
|
|
||||||
left: 8%;
|
|
||||||
}
|
|
||||||
.draft {
|
|
||||||
width: 400px;
|
|
||||||
text-align: center;
|
|
||||||
margin: 20px auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -79,6 +79,9 @@ export default {
|
|||||||
},
|
},
|
||||||
setCenter(code) {
|
setCenter(code) {
|
||||||
this.$emit('setCenter', code);
|
this.$emit('setCenter', code);
|
||||||
|
},
|
||||||
|
routeSectionListFocus(flag) {
|
||||||
|
this.$refs.routeEdit.routeSectionListFocus(flag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -350,9 +350,24 @@ export default {
|
|||||||
this.addModel.name = val;
|
this.addModel.name = val;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'addModel.routeSectionList': function(val) {
|
'addModel.routeSectionList': function(val, old) {
|
||||||
|
if (old && old.length) {
|
||||||
|
old.forEach((item) => {
|
||||||
|
const section = this.$store.getters['map/getDeviceByCode'](item);
|
||||||
|
section.instance.drawBatchSelected(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (val && val.length) {
|
if (val && val.length) {
|
||||||
this.$refs.protect.addModel.unlockSectionCode = val[val.length - 1];
|
this.$refs.protect.addModel.unlockSectionCode = val[val.length - 1];
|
||||||
|
val.forEach((item) => {
|
||||||
|
const section = this.$store.getters['map/getDeviceByCode'](item);
|
||||||
|
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
|
||||||
|
section.logicSectionCodeList.forEach( (logicSectionCode) => {
|
||||||
|
this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
section.instance.drawBatchSelected(true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -466,6 +481,12 @@ export default {
|
|||||||
this.protectData = resp.data.list[0];
|
this.protectData = resp.data.list[0];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
routeSectionListFocus(flag) {
|
||||||
|
this.addModel.routeSectionList.forEach((item) => {
|
||||||
|
const section = this.$store.getters['map/getDeviceByCode'](item);
|
||||||
|
section.instance.drawBatchSelected(flag);
|
||||||
|
});
|
||||||
|
},
|
||||||
setSelected(selected) {
|
setSelected(selected) {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'startSignalCode'.toUpperCase()) {
|
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'startSignalCode'.toUpperCase()) {
|
||||||
@ -473,8 +494,10 @@ export default {
|
|||||||
} else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'endSignalCode'.toUpperCase()) {
|
} else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'endSignalCode'.toUpperCase()) {
|
||||||
this.addModel.endSignalCode = selected.code;
|
this.addModel.endSignalCode = selected.code;
|
||||||
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeSectionList'.toUpperCase()) {
|
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeSectionList'.toUpperCase()) {
|
||||||
if (this.addModel.routeSectionList.indexOf(selected.code) === -1) {
|
if ((selected.type === '01' || selected.type === '03') && this.addModel.routeSectionList.indexOf(selected.code) === -1) {
|
||||||
this.addModel.routeSectionList.push(selected.code);
|
this.addModel.routeSectionList.push(selected.code);
|
||||||
|
} else if (selected.type === '02' && this.addModel.routeSectionList.indexOf(selected.parentCode) === -1) {
|
||||||
|
this.addModel.routeSectionList.push(selected.parentCode);
|
||||||
}
|
}
|
||||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeSwitchList'.toUpperCase()) {
|
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeSwitchList'.toUpperCase()) {
|
||||||
this.routeCode = selected.code;
|
this.routeCode = selected.code;
|
||||||
|
@ -240,6 +240,7 @@ export default {
|
|||||||
kmRangeLeft: 0,
|
kmRangeLeft: 0,
|
||||||
region: '',
|
region: '',
|
||||||
logicSectionNum: [],
|
logicSectionNum: [],
|
||||||
|
logicSectionCodeList: [],
|
||||||
logicSectionShow: false, // 是否显示逻辑区段
|
logicSectionShow: false, // 是否显示逻辑区段
|
||||||
standTrack: false, // 是否站台轨
|
standTrack: false, // 是否站台轨
|
||||||
standTrackName: '',
|
standTrackName: '',
|
||||||
|
@ -88,6 +88,10 @@ export default {
|
|||||||
counts += parseInt(ele.num);
|
counts += parseInt(ele.num);
|
||||||
});
|
});
|
||||||
if (count === 0 || allNotZeros) {
|
if (count === 0 || allNotZeros) {
|
||||||
|
const logicSectionCodeList = [];
|
||||||
|
models.forEach(item=> {
|
||||||
|
logicSectionCodeList.push(item.code);
|
||||||
|
});
|
||||||
this.sectionList.forEach(section => { // 删除之前的逻辑区段
|
this.sectionList.forEach(section => { // 删除之前的逻辑区段
|
||||||
if (section.type === '02' && section.parentCode == this.editModel.code) {
|
if (section.type === '02' && section.parentCode == this.editModel.code) {
|
||||||
models.push(deepAssign(section, {_dispose: true}));
|
models.push(deepAssign(section, {_dispose: true}));
|
||||||
@ -97,6 +101,7 @@ export default {
|
|||||||
logicSectionNumList = [];
|
logicSectionNumList = [];
|
||||||
}
|
}
|
||||||
this.editModel.logicSectionNum = [...logicSectionNumList];
|
this.editModel.logicSectionNum = [...logicSectionNumList];
|
||||||
|
this.editModel.logicSectionCodeList = logicSectionCodeList;
|
||||||
models.push(this.editModel);
|
models.push(this.editModel);
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user