Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
15e1868d6c
@ -484,18 +484,20 @@ export function postFlankProtection(data) {
|
||||
}
|
||||
|
||||
// 更新进路侧防数据
|
||||
export function putFlankProtection(data) {
|
||||
export function putFlankProtection(mapId, data) {
|
||||
return request({
|
||||
url: `/api/draftMap/flankProtection/${data.id}`,
|
||||
// url: `/api/draftMap/flankProtection/${data.id}`,
|
||||
url: `/api/draftMap/${mapId}/fls/${data.code}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除进路侧防
|
||||
export function delFlankProtection(id) {
|
||||
export function delFlankProtection(mapId, code) {
|
||||
return request({
|
||||
url: `/api/draftMap/flankProtection/${id}`,
|
||||
// url: `/api/draftMap/flankProtection/${id}`,
|
||||
url: `/api/draftMap/${mapId}/fls/${code}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
@ -511,11 +513,19 @@ export function getFlankProtectionDetail(id) {
|
||||
// 查询进路侧防明细list
|
||||
export function getFlankProtectionList(mapId, params) {
|
||||
return request({
|
||||
url: `/api/draftMap/flankProtection/${mapId}/paging`,
|
||||
// url: `/api/draftMap/flankProtection/${mapId}/paging`,
|
||||
url: `/api/draftMap/${mapId}/fls/paging`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 查询进路侧防明细list
|
||||
export function getDraftMapFlsList(mapId) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/fls/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// /** 创建车站区段停站时间 */
|
||||
// export function createStationParkTime(data) {
|
||||
// return request({
|
||||
|
@ -2,9 +2,9 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// 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.8.107:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
|
||||
BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
|
||||
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
|
||||
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
|
@ -64,6 +64,7 @@
|
||||
<script>
|
||||
import { saveMap, generateCI } from '@/api/jmap/mapdraft';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
export default {
|
||||
name: 'Config',
|
||||
components: {
|
||||
@ -244,6 +245,7 @@ export default {
|
||||
<span>生成站间运行等级数据${resp.data.stationRunlevelCount}条;</span>`;
|
||||
instance.type = 'success';
|
||||
instance.showCancelButton = false;
|
||||
EventBus.$emit('successCI');
|
||||
}).catch((error)=> {
|
||||
if (error.code === 500045) {
|
||||
this.$message.error('生成并保存联锁关系失败:地图基础信息有误');
|
||||
|
@ -13,8 +13,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { listMap } from '@/api/jmap/mapdraft';
|
||||
import { getFlankProtectionList, delFlankProtection, getFlankProtectionDetail } from '@/api/jmap/mapdraft';
|
||||
import { getFlankProtectionList, delFlankProtection, getDraftMapFlsList } from '@/api/jmap/mapdraft';
|
||||
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
@ -29,7 +28,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
mapList: [],
|
||||
// mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -37,17 +36,13 @@ export default {
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
stationCode: {
|
||||
code: {
|
||||
type: 'select',
|
||||
label: '联锁车站',
|
||||
label: '侧防code',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
number: {
|
||||
type: 'text',
|
||||
label: '侧防编号'
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '侧防名称'
|
||||
@ -68,22 +63,18 @@ export default {
|
||||
title: '侧防code',
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '侧防编号',
|
||||
prop: 'number'
|
||||
},
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapId'
|
||||
},
|
||||
{
|
||||
title: '连锁站',
|
||||
prop: 'stationCode'
|
||||
},
|
||||
// {
|
||||
// title: '侧防编号',
|
||||
// prop: 'number'
|
||||
// },
|
||||
// {
|
||||
// title: '连锁站',
|
||||
// prop: 'stationCode'
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.operation'),
|
||||
width: '200',
|
||||
width: '300',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.compile'),
|
||||
@ -102,21 +93,21 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
// 'stationList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
stationList: function (val, old) {
|
||||
const list = [];
|
||||
if (val && val.length) {
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
if (val[i].ciStation) {
|
||||
list.push({ label: val[i].name, value: val[i].code });
|
||||
}
|
||||
}
|
||||
this.queryForm.queryObject.stationCode.config.data = list;
|
||||
}
|
||||
}
|
||||
// stationList: function (val, old) {
|
||||
// const list = [];
|
||||
// if (val && val.length) {
|
||||
// for (let i = 0; i < val.length; i++) {
|
||||
// if (val[i].ciStation) {
|
||||
// list.push({ label: val[i].name, value: val[i].code });
|
||||
// }
|
||||
// }
|
||||
// this.queryForm.queryObject.stationCode.config.data = list;
|
||||
// }
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
this.acquireMapList();
|
||||
@ -143,30 +134,27 @@ export default {
|
||||
return getFlankProtectionList(this.mapInfo.id, params);
|
||||
}
|
||||
},
|
||||
acquireMapList() { // 地图名称列表
|
||||
listMap({ drawWay:true}).then(response => {
|
||||
this.mapList = response.data;
|
||||
acquireMapList() {
|
||||
getDraftMapFlsList(this.mapInfo.id).then(response => {
|
||||
this.queryForm.queryObject.code.config.data = response.data;
|
||||
});
|
||||
},
|
||||
afterQuery(data) {
|
||||
if (data && data.list) {
|
||||
const that = this;
|
||||
const list = data.list;
|
||||
if (list) {
|
||||
list.map(elem => {
|
||||
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
|
||||
that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
|
||||
});
|
||||
}
|
||||
// const that = this;
|
||||
// const list = data.list;
|
||||
// if (list) {
|
||||
// list.map(elem => {
|
||||
// that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
|
||||
// that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
|
||||
// });
|
||||
// }
|
||||
}
|
||||
return data;
|
||||
},
|
||||
editObj(index, row) {
|
||||
getFlankProtectionDetail(row.id).then(response => {
|
||||
const data = response.data;
|
||||
this.$emit('autoMaticoSelected', data);
|
||||
this.doClose();
|
||||
});
|
||||
this.$emit('autoMaticoSelected', row);
|
||||
this.doClose();
|
||||
},
|
||||
deleteObj(index, row) {
|
||||
if (this.mapInfo && this.mapInfo.id && row) {
|
||||
@ -176,7 +164,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 删除
|
||||
delFlankProtection(row.id).then(response => {
|
||||
delFlankProtection(this.mapInfo.id, row.code).then(response => {
|
||||
this.$message.success(this.$t('map.successfullyDelete'));
|
||||
this.$store.dispatch('map/delFlankProtectList', row);
|
||||
this.reloadTable();
|
||||
|
@ -3,162 +3,132 @@
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="140px" size="mini">
|
||||
<div class="definition">
|
||||
<el-form-item label="编号:" prop="number">
|
||||
<el-input v-model="addModel.number" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称:" prop="name">
|
||||
<el-input v-model="addModel.name" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属联锁站:" prop="stationCode">
|
||||
<el-select v-model="addModel.stationCode" clearable :filterable="true" style="width: 220px;" @change="changeStation">
|
||||
<el-option
|
||||
v-for="item in filterStationList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'flankStationList' ? 'danger' : 'primary'"
|
||||
@click="hover('flankStationList')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-form-item label="侧防1线路:" prop="level1List">
|
||||
<el-table :data="addModel.level1List" 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.level1List, scope.$index)"
|
||||
>
|
||||
移出
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.prevent="editOverlab(addModel.level1List, scope.$index, 'level1List')"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
<div style="height: 100%; position: relative; left: 8%; width: 88%; margin-bottom: 20px;">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 12px;">等级1</span>
|
||||
</div>
|
||||
<div style="margin-top: 8px;">
|
||||
<el-form-item label="侧防道岔:">
|
||||
<el-select v-model="addModel.level1.protectSwitch.switchCode" clearable filterable :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-form-item label="侧防2线路:" prop="level2List">
|
||||
<el-table :data="addModel.level2List" 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=" field === 'flankSwitchLevel1' ? 'danger' : 'primary'"
|
||||
@click="hover('flankSwitchLevel1')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-select v-model="addModel.level1.protectSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="侧防信号机:">
|
||||
<el-select v-model="addModel.level1.protectSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in signalList"
|
||||
:key="item.code"
|
||||
:label="`${item.name}(${item.code})`"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.prevent="deleteOverlab(addModel.level2List, scope.$index)"
|
||||
>
|
||||
移出
|
||||
</el-button>
|
||||
<el-button
|
||||
:type=" field === 'flankSingalLevel1' ? 'danger' : 'primary'"
|
||||
@click="hover('flankSingalLevel1')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="侧防区域元件:">
|
||||
<el-select v-model="addModel.level1.areaSwitch.switchCode" clearable filterable :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 === 'flankAreaSwitchLevel1' ? 'danger' : 'primary'"
|
||||
@click="hover('flankAreaSwitchLevel1')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-select v-model="addModel.level1.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div style="height: 100%; position: relative; left: 8%; width: 88%">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 12px;">等级2</span>
|
||||
</div>
|
||||
<div style="margin-top: 8px;">
|
||||
<el-form-item label="侧防道岔:">
|
||||
<el-select v-model="addModel.level2.protectSwitch.switchCode" clearable filterable :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 === 'flankSwitchLevel2' ? 'danger' : 'primary'"
|
||||
@click="hover('flankSwitchLevel2')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-select v-model="addModel.level2.protectSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="侧防信号机:">
|
||||
<el-select v-model="addModel.level2.protectSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in signalList"
|
||||
:key="item.code"
|
||||
:label="`${item.name}(${item.code})`"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'flankSingalLevel2' ? 'danger' : 'primary'"
|
||||
@click="hover('flankSingalLevel2')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="侧防区域元件:">
|
||||
<el-select v-model="addModel.level2.areaSwitch.switchCode" clearable filterable :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 === 'flankAreaSwitchLevel2' ? 'danger' : 'primary'"
|
||||
@click="hover('flankAreaSwitchLevel2')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-select v-model="addModel.level2.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.prevent="editOverlab(addModel.level2List, scope.$index, 'level2List')"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div style="height: 100%; position: relative; left: 8%; width: 88%; margin-bottom: 20px;">
|
||||
<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="handleLevel('level1List')">生成等级1</el-button>
|
||||
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0; margin-right: 10px;" type="text" @click="handleLevel('level2List')">生成等级2</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="addModelFlank" :rules="overLapRules" label-width="135px" size="mini" style="margin-top: 15px">
|
||||
<el-form-item label="侧防道岔:">
|
||||
<el-select v-model="addModelFlank.protectSwitch.switchCode" clearable filterable :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 === 'flankSwitchLevel' ? 'danger' : 'primary'"
|
||||
@click="hover('flankSwitchLevel')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-select v-model="addModelFlank.protectSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="侧防信号机:">
|
||||
<el-select v-model="addModelFlank.protectSignal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in signalList"
|
||||
:key="item.code"
|
||||
:label="`${item.name}(${item.code})`"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'flankSingalLevel' ? 'danger' : 'primary'"
|
||||
@click="hover('flankSingalLevel')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="侧防区域元件:">
|
||||
<el-select v-model="addModelFlank.areaSwitch.switchCode" clearable filterable :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 === 'flankAreaSwitchLevel' ? 'danger' : 'primary'"
|
||||
@click="hover('flankAreaSwitchLevel')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-select v-model="addModelFlank.areaSwitch.normal" clearable filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">保存侧防</el-button>
|
||||
@ -171,7 +141,8 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { setUID } from '@/jmapNew/utils/Uid';
|
||||
import { getFlankProtectionList, postFlankProtection, putFlankProtection } from '@/api/jmap/mapdraft';
|
||||
import { postFlankProtection, putFlankProtection } from '@/api/jmap/mapdraft';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
@ -208,56 +179,49 @@ export default {
|
||||
code: '',
|
||||
mapId: '',
|
||||
id: '',
|
||||
number: '',
|
||||
stationCode: '',
|
||||
name: '',
|
||||
level1: {
|
||||
protectSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
},
|
||||
protectSignal: '',
|
||||
areaSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
}
|
||||
source: {},
|
||||
level1List: [],
|
||||
level2List: []
|
||||
},
|
||||
addModelFlank: {
|
||||
protectSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
},
|
||||
level2: {
|
||||
protectSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
},
|
||||
protectSignal: '',
|
||||
areaSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
}
|
||||
protectSignal: '',
|
||||
areaSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
}
|
||||
},
|
||||
parentIndex: 0,
|
||||
editShow: false,
|
||||
overLapRules: {
|
||||
|
||||
},
|
||||
levelList: '',
|
||||
rules: {
|
||||
stationCode: [
|
||||
{ required: true, message: '请选择所属连锁站', trigger: 'change' }
|
||||
],
|
||||
number: [
|
||||
{ required: true, message: '请输入编号', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
cardMode: 'generate'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'switchList',
|
||||
'signalList'
|
||||
]),
|
||||
filterStationList() { // 过滤当前连锁站
|
||||
return this.stationList.filter(station=>{
|
||||
return station.ciStation;
|
||||
});
|
||||
cardTitle() {
|
||||
if (this.cardMode === 'generate') {
|
||||
return '生成侧防线路';
|
||||
} else if (this.cardMode === 'edit') {
|
||||
return '编辑侧防线路';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -268,8 +232,15 @@ export default {
|
||||
},
|
||||
routeData(val, old) {
|
||||
if (val) {
|
||||
// console.log(this, this.$copyClone);
|
||||
this.addModel = this.$copyClone(this.addModel, val);
|
||||
this.addModel = {
|
||||
code: val.code,
|
||||
mapId: val.mapId,
|
||||
id: val.id,
|
||||
name: val.name,
|
||||
source: JSON.parse(JSON.stringify(val.source)),
|
||||
level1List: JSON.parse(JSON.stringify(val.level1List)),
|
||||
level2List: JSON.parse(JSON.stringify(val.level2List))
|
||||
};
|
||||
this.editShow = true;
|
||||
}
|
||||
}
|
||||
@ -283,48 +254,19 @@ export default {
|
||||
setSelected(selected) {
|
||||
if (selected) {
|
||||
if (selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
if (this.field.toUpperCase() === 'flankSingalLevel1'.toUpperCase()) {
|
||||
this.addModel.level1.protectSignal = selected.code;
|
||||
} else if (this.field.toUpperCase() === 'flankSingalLevel2'.toUpperCase()) {
|
||||
this.addModel.level2.protectSignal = selected.code;
|
||||
if (this.field.toUpperCase() === 'flankSingalLevel'.toUpperCase()) {
|
||||
this.addModelFlank.protectSignal = selected.code;
|
||||
}
|
||||
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'flankStationList'.toUpperCase()) {
|
||||
this.addModel.stationCode = selected.code;
|
||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
if (this.field.toUpperCase() === 'flankSwitchLevel1'.toUpperCase()) {
|
||||
this.addModel.level1.protectSwitch.switchCode = selected.code;
|
||||
} else if (this.field.toUpperCase() === 'flankSwitchLevel2'.toUpperCase()) {
|
||||
this.addModel.level2.protectSwitch.switchCode = selected.code;
|
||||
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel1'.toUpperCase()) {
|
||||
this.addModel.level1.areaSwitch.switchCode = selected.code;
|
||||
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel2'.toUpperCase()) {
|
||||
this.addModel.level2.areaSwitch.switchCode = selected.code;
|
||||
if (this.field.toUpperCase() === 'flankSwitchLevel'.toUpperCase()) {
|
||||
this.addModelFlank.protectSwitch.switchCode = selected.code;
|
||||
} else if (this.field.toUpperCase() === 'flankAreaSwitchLevel'.toUpperCase()) {
|
||||
this.addModelFlank.areaSwitch.switchCode = selected.code;
|
||||
}
|
||||
}
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
async changeStation(code) {
|
||||
if (code) {
|
||||
const params = {
|
||||
stationCode: code,
|
||||
number: '',
|
||||
name: '',
|
||||
pageSize: 999,
|
||||
pageNum: 1
|
||||
};
|
||||
const res = await getFlankProtectionList(this.mapInfo.id, params);
|
||||
if (res.data.list.length) {
|
||||
let num = 0;
|
||||
res.data.list.forEach(elem => {
|
||||
if (Number(elem.number) > num) {
|
||||
num = Number(elem.number);
|
||||
}
|
||||
});
|
||||
this.addModel.number = num + 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
buildModel(code) {
|
||||
const model = Object.assign({}, this.addModel);
|
||||
if (code) { model['code'] = code; }
|
||||
@ -343,7 +285,6 @@ export default {
|
||||
this.$message.success('保存成功');
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
this.changeStation(dataModel.stationCode);
|
||||
}).catch(() => {
|
||||
this.$messageBox('保存失败');
|
||||
this.loading = false;
|
||||
@ -355,13 +296,10 @@ export default {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = this.buildModel();
|
||||
putFlankProtection(data).then(resp => {
|
||||
const dataModel = JSON.parse(JSON.stringify(data));
|
||||
putFlankProtection(this.mapInfo.id, this.addModel).then(resp => {
|
||||
this.$message.success('更新成功');
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
this.changeStation(dataModel.stationCode);
|
||||
}).catch(() => {
|
||||
this.$messageBox('更新失败');
|
||||
this.loading = false;
|
||||
@ -371,39 +309,71 @@ export default {
|
||||
},
|
||||
clear() {
|
||||
if (this.$refs && this.$refs.form && this.mapInfo) {
|
||||
// this.$refs.form.resetFields();
|
||||
this.addModel = {
|
||||
code: '',
|
||||
mapId: '',
|
||||
id: '',
|
||||
number: '',
|
||||
name: '',
|
||||
stationCode: this.addModel.stationCode,
|
||||
level1: {
|
||||
protectSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
},
|
||||
protectSignal: '',
|
||||
areaSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
}
|
||||
},
|
||||
level2: {
|
||||
protectSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
},
|
||||
protectSignal: '',
|
||||
areaSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
}
|
||||
}
|
||||
level1List: [],
|
||||
level2List: []
|
||||
};
|
||||
this.isSave = true;
|
||||
}
|
||||
},
|
||||
deleteOverlab(list, index) {
|
||||
list.splice(index, 1);
|
||||
this.clearOverlab();
|
||||
this.cardMode = 'generate';
|
||||
this.levelList = '';
|
||||
},
|
||||
editOverlab(list, index, level) {
|
||||
this.addModelFlank = deepAssign(this.addModelFlank, list[index]);
|
||||
this.parentIndex = index;
|
||||
this.cardMode = 'edit';
|
||||
this.levelList = level;
|
||||
},
|
||||
updateOverlab() {
|
||||
if (this.addModelFlank.protectSwitch.switchCode || this.addModelFlank.protectSignal) {
|
||||
this.addModel[this.levelList][this.parentIndex] = {
|
||||
protectSwitch: this.addModelFlank.protectSwitch,
|
||||
protectSignal: this.addModelFlank.protectSignal,
|
||||
areaSwitch: this.addModelFlank.areaSwitch
|
||||
};
|
||||
this.clearOverlab();
|
||||
this.cardMode = 'generate';
|
||||
this.levelList = '';
|
||||
}
|
||||
},
|
||||
cancelOverlab() {
|
||||
this.clearOverlab();
|
||||
this.cardMode = 'generate';
|
||||
this.levelList = '';
|
||||
},
|
||||
handleLevel(level) {
|
||||
if (!this.addModelFlank.protectSwitch.switchCode || !this.addModelFlank.protectSignal) {
|
||||
this.$messageBox('请选择侧防等级信息!');
|
||||
} else {
|
||||
this.addModel[level].push({
|
||||
protectSwitch: this.addModelFlank.protectSwitch,
|
||||
protectSignal: this.addModelFlank.protectSignal,
|
||||
areaSwitch: this.addModelFlank.areaSwitch
|
||||
});
|
||||
this.clearOverlab();
|
||||
}
|
||||
},
|
||||
clearOverlab() {
|
||||
this.addModelFlank = {
|
||||
protectSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
},
|
||||
protectSignal: '',
|
||||
areaSwitch: {
|
||||
switchCode: '',
|
||||
normal: ''
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -104,10 +104,10 @@ export default {
|
||||
{label: this.$t('map.routeID'), name:'route', menus:RouteOperate},
|
||||
{label: '延续保护', name: 'overlap', menus: ContinueProtectOperate},
|
||||
{label: this.$t('map.signalApprochSection'), name:'signal', menus:SignalOperate}, // 信号机接近区段
|
||||
{label: '侧防', name:'flankProtect', menus:FlankProtectOperate},
|
||||
{label: '自动折返', name:'turned', menus:TurnedOperate},
|
||||
{label: '目的地码', name:'destination', menus:DestinationOperate},
|
||||
{label: this.$t('map.automaticSignal'), name:'automatic', menus:AutomaticOperate},
|
||||
{label: '侧防', name:'flankProtect', menus:FlankProtectOperate},
|
||||
{label: this.$t('map.routing'), name:'routing', menus:RoutingOperate},
|
||||
{label: '停站时间', name:'dwellTime', menus:DwellTimeOperate},
|
||||
{label: '设置运行等级', name:'runLevel', menus:RunLevelOperate}
|
||||
|
@ -22,6 +22,7 @@ import { listMap, getRouteNewList, delRouteNew, putRouteNew, putSetDraftMapRoute
|
||||
// import ProtectDetail from './protectDetail';
|
||||
import PreViewField from './preview';
|
||||
import Related from './related';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
@ -257,6 +258,9 @@ export default {
|
||||
});
|
||||
this.acquireMapList();
|
||||
this.initProtectData();
|
||||
EventBus.$on('successCI', () => {
|
||||
this.initProtectData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(showType, codeType) {
|
||||
|
@ -166,6 +166,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getRouteNewList, getFlankProtectionList, getOverlapAllList, putSetDraftMapRouteById } from '@/api/jmap/mapdraft';
|
||||
import HostileData from './hostileData';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
@ -337,6 +338,9 @@ export default {
|
||||
this.getRouteList();
|
||||
this.getFlankProtectList();
|
||||
this.initProtectData();
|
||||
EventBus.$on('successCI', () => {
|
||||
this.initProtectData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initLoad() { // 加载联锁车站列表
|
||||
|
Loading…
Reference in New Issue
Block a user