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>
<el-tab-pane label="折返" class="tab_pane_box" name="turned"> <el-tab-pane label="折返" class="tab_pane_box" name="turned">
<!--<turned-operate--> <turned-operate
<!--ref="trunedOperate"--> ref="trunedOperate"
<!--:map-info="mapInfo"--> :map-info="mapInfo"
<!--:selected="selected"--> :selected="selected"
<!--@setCenter="setCenter"--> @setCenter="setCenter"
<!--/>--> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('map.automaticSignal')" class="tab_pane_box" name="automatic"> <el-tab-pane :label="$t('map.automaticSignal')" class="tab_pane_box" name="automatic">
<automatic-operate <automatic-operate

View File

@ -29,6 +29,7 @@ export default {
data() { data() {
return { return {
show: false, show: false,
showType: '',
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -69,12 +70,19 @@ export default {
buttons: [ buttons: [
{ {
name: this.$t('map.compile'), name: this.$t('map.compile'),
handleClick: this.editObj handleClick: this.editObj,
showControl: () => { return this.showType !== 'select'; }
}, },
{ {
name: this.$t('map.deleteObj'), name: this.$t('map.deleteObj'),
handleClick: this.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() { mounted() {
}, },
methods: { methods: {
doShow() { doShow(type) {
this.show = true; this.show = true;
this.reloadTable(); this.reloadTable();
if (type) {
this.showType = type;
}
}, },
doClose() { doClose() {
this.show = false; this.show = false;
@ -137,6 +148,10 @@ export default {
if (this.queryList && this.queryList.reload) { if (this.queryList && this.queryList.reload) {
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-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.routeProtectsData') + ':'" prop="routeOverlapSectionList"> <el-form-item label="关联延续保护区段:" prop="overlapCode">
<el-select v-model="addModel.routeOverlapSectionList" multiple clearable :filterable="true"> <el-input v-model="addModel.overlapCode" style="width: 178px" readonly="true" />
<el-option <el-button type="primary" @click="selectedOverlapCode">选择</el-button>
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> </el-form-item>
<el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList"> <el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList">
<el-select v-model="addModel.conflictingRouteList" multiple clearable :filterable="true"> <el-select v-model="addModel.conflictingRouteList" multiple clearable :filterable="true">
@ -271,15 +215,20 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<protect-detail ref="routeDetail" :map-info="mapInfo" @setOverlapCode="setOverlapCode" />
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid'; import { getUID } from '@/jmap/utils/Uid';
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft'; import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
import ProtectDetail from '../protectoperate/detail';
export default { export default {
name: 'RouteOperation', name: 'RouteOperation',
components: {
ProtectDetail
},
props: { props: {
selected: { selected: {
type: Object, type: Object,
@ -304,8 +253,6 @@ export default {
return { return {
isSave: true, isSave: true,
field: '', field: '',
overlapCode: '',
overlapType: '',
flankCode: '', flankCode: '',
flankType: '', flankType: '',
routeCode: '', routeCode: '',
@ -333,8 +280,7 @@ export default {
routeFlankProtectionList: [], // routeFlankProtectionList: [], //
psdList: [], // psdList: [], //
espList: [], // espList: [], //
routeOverlapSectionList: [], // overlapCode:'',
routeOverlapSwitchList: [], //
conflictingRouteList: [] // conflictingRouteList: [] //
} }
}; };
@ -399,9 +345,6 @@ export default {
this.addModel.routeFlankProtectionList.forEach(item => { this.addModel.routeFlankProtectionList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位'; item.normal ? item.switchType = '定位' : item.switchType = '反位';
}); });
this.addModel.routeOverlapSwitchList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
this.addModel.routeSwitchList.forEach(item => { this.addModel.routeSwitchList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位'; item.normal ? item.switchType = '定位' : item.switchType = '反位';
}); });
@ -432,6 +375,12 @@ export default {
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },
setOverlapCode(code) {
this.addModel.overlapCode = code;
},
selectedOverlapCode() {
this.$refs.routeDetail.doShow('select');
},
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
}, },
@ -489,7 +438,6 @@ export default {
this.addModel.mapId = this.mapInfo.id; this.addModel.mapId = this.mapInfo.id;
this.addModel.routeSwitchList = []; this.addModel.routeSwitchList = [];
this.addModel.routeFlankProtectionList = []; this.addModel.routeFlankProtectionList = [];
this.addModel.routeOverlapSwitchList = [];
if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) { if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = this.selected.code; this.addModel.stationCode = this.selected.code;
} }
@ -504,10 +452,6 @@ export default {
this.addModel.startSignalCode = selected.code; this.addModel.startSignalCode = selected.code;
} 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() === '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()) { } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'conflictingRouteList'.toUpperCase()) {
if (this.addModel.conflictingRouteList.indexOf(selected.code) === -1) { if (this.addModel.conflictingRouteList.indexOf(selected.code) === -1) {
this.addModel.conflictingRouteList.push(selected.code); this.addModel.conflictingRouteList.push(selected.code);
@ -516,8 +460,6 @@ export default {
if (this.addModel.routeSectionList.indexOf(selected.code) === -1) { if (this.addModel.routeSectionList.indexOf(selected.code) === -1) {
this.addModel.routeSectionList.push(selected.code); 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()) { } else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeSwitchList'.toUpperCase()) {
this.routeCode = selected.code; this.routeCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeFlankProtectionList'.toUpperCase()) { } 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-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini"> <el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini">
<div class="definition"> <div class="definition">
<el-form-item :label="$t('map.signalID')" prop="signalCode"> <el-form-item label="折返名称:" prop="name">
<el-select v-model="addModel.signalCode" clearable :filterable="true"> <el-input v-model="addModel.name" />
<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> </el-form-item>
<el-form-item :label="$t('map.routeSegmentData') + ':'" prop="sectionList"> <el-form-item label="折返进路" prop="turnBackRouteCode">
<el-select v-model="addModel.sectionList" multiple clearable :filterable="true"> <el-input v-model="addModel.turnBackRouteName" />
<el-option <el-button type="primary">选择</el-button>
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> </el-form-item>
<el-form-item :label="$t('map.psdList') + ':'" prop="psdList"> <el-form-item label="基础进路" prop="basicRouteCode">
<el-select v-model="addModel.psdList" multiple clearable :filterable="true"> <el-input v-model="addModel.basicRouteName" />
<el-option <el-button type="primary">选择</el-button>
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> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group> <el-button-group>
@ -103,24 +62,26 @@ export default {
field: '', field: '',
isSave: true, isSave: true,
loading: false, loading: false,
editModel: {},
addModel: { addModel: {
id: '', id: '',
code: '', code: '',
mapId: '', mapId: '',
signalCode: '', name: '',
alwaysRed: true, turnBackRouteName: '',
sectionList: [], basicRouteName:'',
psdList: [], turnBackRouteCode: '',
espList: [] basicRouteCode:''
}, },
editShow: false, editShow: false,
rules: { rules: {
signalCode: [ name: [
{ required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' } { required: true, message: '请输入折返名称', trigger: 'blur' }
], ],
sectionList: [ turnBackRouteCode: [
{ required: true, message: this.$t('map.triggerSegmentData'), trigger: 'change' } { required: true, message: '请选择折返进路', trigger: 'blur' }
],
basicRouteCode: [
{ required: true, message: '请选择基础进路', trigger: 'blur'}
] ]
} }
}; };