This commit is contained in:
joylink_cuiweidong 2019-12-10 18:02:08 +08:00
commit b6e6e72d17
4 changed files with 59 additions and 141 deletions

View File

@ -30,12 +30,12 @@
/>
</el-tab-pane>
<el-tab-pane label="折返" class="tab_pane_box" name="turned">
<!--<turned-operate-->
<!--ref="trunedOperate"-->
<!--:map-info="mapInfo"-->
<!--:selected="selected"-->
<!--@setCenter="setCenter"-->
<!--/>-->
<turned-operate
ref="trunedOperate"
:map-info="mapInfo"
:selected="selected"
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane :label="$t('map.automaticSignal')" class="tab_pane_box" name="automatic">
<automatic-operate

View File

@ -29,6 +29,7 @@ export default {
data() {
return {
show: false,
showType: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -69,12 +70,19 @@ export default {
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
handleClick: this.editObj,
showControl: () => { return this.showType !== 'select'; }
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
type: 'danger',
showControl: () => { return this.showType !== 'select'; }
},
{
name: '选择',
handleClick: this.selectedObj,
showControl: () => { return this.showType === 'select'; }
}
]
}
@ -94,9 +102,12 @@ export default {
mounted() {
},
methods: {
doShow() {
doShow(type) {
this.show = true;
this.reloadTable();
if (type) {
this.showType = type;
}
},
doClose() {
this.show = false;
@ -137,6 +148,10 @@ export default {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
selectedObj(index, row) {
this.$emit('setOverlapCode', row.code);
this.show = false;
}
}
};

View File

@ -188,65 +188,9 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.routeProtectsData') + ':'" prop="routeOverlapSectionList">
<el-select v-model="addModel.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(addModel.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="addModel.routeOverlapSwitchList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<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(addModel.routeOverlapSwitchList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-form-item label="关联延续保护区段:" prop="overlapCode">
<el-input v-model="addModel.overlapCode" style="width: 178px" readonly="true" />
<el-button type="primary" @click="selectedOverlapCode">选择</el-button>
</el-form-item>
<el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList">
<el-select v-model="addModel.conflictingRouteList" multiple clearable :filterable="true">
@ -271,15 +215,20 @@
</el-form-item>
</el-form>
</el-scrollbar>
<protect-detail ref="routeDetail" :map-info="mapInfo" @setOverlapCode="setOverlapCode" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
import ProtectDetail from '../protectoperate/detail';
export default {
name: 'RouteOperation',
components: {
ProtectDetail
},
props: {
selected: {
type: Object,
@ -304,8 +253,6 @@ export default {
return {
isSave: true,
field: '',
overlapCode: '',
overlapType: '',
flankCode: '',
flankType: '',
routeCode: '',
@ -333,8 +280,7 @@ export default {
routeFlankProtectionList: [], //
psdList: [], //
espList: [], //
routeOverlapSectionList: [], //
routeOverlapSwitchList: [], //
overlapCode:'',
conflictingRouteList: [] //
}
};
@ -399,9 +345,6 @@ export default {
this.addModel.routeFlankProtectionList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
this.addModel.routeOverlapSwitchList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
this.addModel.routeSwitchList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
@ -432,6 +375,12 @@ export default {
deviceChange(code) {
this.$emit('setCenter', code);
},
setOverlapCode(code) {
this.addModel.overlapCode = code;
},
selectedOverlapCode() {
this.$refs.routeDetail.doShow('select');
},
hover(field) {
this.field = field === this.field ? '' : field;
},
@ -489,7 +438,6 @@ export default {
this.addModel.mapId = this.mapInfo.id;
this.addModel.routeSwitchList = [];
this.addModel.routeFlankProtectionList = [];
this.addModel.routeOverlapSwitchList = [];
if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = this.selected.code;
}
@ -504,10 +452,6 @@ export default {
this.addModel.startSignalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'endSignalCode'.toUpperCase()) {
this.addModel.endSignalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSectionList'.toUpperCase()) {
if (this.addModel.routeOverlapSectionList.indexOf(selected.code) === -1) {
this.addModel.routeOverlapSectionList.push(selected.code);
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'conflictingRouteList'.toUpperCase()) {
if (this.addModel.conflictingRouteList.indexOf(selected.code) === -1) {
this.addModel.conflictingRouteList.push(selected.code);
@ -516,8 +460,6 @@ export default {
if (this.addModel.routeSectionList.indexOf(selected.code) === -1) {
this.addModel.routeSectionList.push(selected.code);
}
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSwitchList'.toUpperCase()) {
this.overlapCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeSwitchList'.toUpperCase()) {
this.routeCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeFlankProtectionList'.toUpperCase()) {

View File

@ -3,57 +3,16 @@
<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="$t('map.signalID')" prop="signalCode">
<el-select v-model="addModel.signalCode" clearable :filterable="true">
<el-option
v-for="item in signalList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">{{ $t('map.activate') }}
</el-button>
<el-form-item label="折返名称:" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item :label="$t('map.routeSegmentData') + ':'" prop="sectionList">
<el-select v-model="addModel.sectionList" 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 === 'sectionList' ? 'danger' : 'primary'"
@click="hover('sectionList')"
>{{ $t('map.activate') }}</el-button>
<el-form-item label="折返进路" prop="turnBackRouteCode">
<el-input v-model="addModel.turnBackRouteName" />
<el-button type="primary">选择</el-button>
</el-form-item>
<el-form-item :label="$t('map.psdList') + ':'" prop="psdList">
<el-select v-model="addModel.psdList" multiple clearable :filterable="true">
<el-option
v-for="item in psdList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.espList') + ':'" prop="espList">
<el-select v-model="addModel.espList" multiple clearable :filterable="true">
<el-option
v-for="item in espList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.alwaysRed') + ':'" prop="alwaysRed">
<el-radio-group v-model="addModel.alwaysRed">
<el-radio :label="true">{{ $t('map.are') }}</el-radio>
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
</el-radio-group>
<el-form-item label="基础进路" prop="basicRouteCode">
<el-input v-model="addModel.basicRouteName" />
<el-button type="primary">选择</el-button>
</el-form-item>
<el-form-item>
<el-button-group>
@ -103,24 +62,26 @@ export default {
field: '',
isSave: true,
loading: false,
editModel: {},
addModel: {
id: '',
code: '',
mapId: '',
signalCode: '',
alwaysRed: true,
sectionList: [],
psdList: [],
espList: []
name: '',
turnBackRouteName: '',
basicRouteName:'',
turnBackRouteCode: '',
basicRouteCode:''
},
editShow: false,
rules: {
signalCode: [
{ required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' }
name: [
{ required: true, message: '请输入折返名称', trigger: 'blur' }
],
sectionList: [
{ required: true, message: this.$t('map.triggerSegmentData'), trigger: 'change' }
turnBackRouteCode: [
{ required: true, message: '请选择折返进路', trigger: 'blur' }
],
basicRouteCode: [
{ required: true, message: '请选择基础进路', trigger: 'blur'}
]
}
};