Merge remote-tracking branch 'origin/test'

This commit is contained in:
joylink_zhangsai 2021-05-27 18:30:08 +08:00
commit d38f81276e
21 changed files with 989 additions and 626 deletions

View File

@ -317,10 +317,11 @@ export function getApproachSectionDetail(id) {
});
}
// 更新信号机接近区段
export function putApproachSection(data) {
// 更新信号机接近区段 修改信号机接近区段
export function putApproachSection(mapId, data) {
return request({
url: `/api/mapBuild/approachSection/${data.id}`,
// url: `/api/mapBuild/approachSection/${data.id}`,
url: `/api/draftMap/${mapId}/signalApproachSection/${data.signalCode}`,
method: 'put',
data: data
});
@ -329,36 +330,54 @@ export function putApproachSection(data) {
// 分页查询信号机接近区段列表
export function getApproachSectionList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/approachSection/paging`,
// url: `/api/mapBuild/${mapId}/approachSection/paging`,
url: `/api/draftMap/${mapId}/signalApproachSection/paging`,
method: 'get',
params
});
}
// 延续保护相关接口 创建修改删除根据id查询, 分页查询
export function postContinueProtect(data) {
// 查询所有信号机接近区段数据
export function getSignalApproachSectionList(mapId) {
return request({
url: `/api/mapBuild/overlap`,
method: 'post',
data: data
url: `/api/draftMap/${mapId}/signalApproachSection/all`,
method: 'get'
});
}
export function putContinueProtect(data) {
// 延续保护相关接口 创建修改删除根据id查询, 分页查询
// export function postContinueProtect(data) {
// return request({
// url: `/api/mapBuild/overlap`,
// method: 'post',
// data: data
// });
// }
// 获取所有延续保护 list
export function getOverlapAllList(mapId) {
return request({
url: `/api/mapBuild/overlap/${data.id}`,
url: `/api/draftMap/${mapId}/overlap/all`,
method: 'get'
});
}
export function putContinueProtect(mapId, data) {
return request({
// url: `/api/mapBuild/overlap/${data.id}`,
url: `/api/draftMap/${mapId}/overlap/${data.code}`,
method: 'put',
data: data
});
}
export function delContinueProtect(id) {
export function delContinueProtect(mapId, code) {
return request({
url: `/api/mapBuild/overlap/${id}`,
// url: `/api/mapBuild/overlap/${id}`,
url: `/api/draftMap/${mapId}/overlap/${code}`,
method: 'delete'
});
}
export function getContinueProtectList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/overlap/paging`,
// url: `/api/mapBuild/${mapId}/overlap/paging`,
url: `/api/draftMap/${mapId}/overlap/paging`,
method: 'get',
params
});

View File

@ -52,13 +52,34 @@
:sort-by="column.sortBy"
>
<template slot-scope="scope">
<template v-if="!column.edit">
<span class="hideOutContent">{{ scope.row[column.prop] }}</span>
</template>
<template v-else>
<template v-if="column.edit">
<div v-show="!scope.row.isEdit" class="hideOutContent" @click="handleEdit(scope.row, column, scope.$index)">{{ scope.row[column.prop] }}</div>
<el-input v-show="scope.row.isEdit" ref="customerInput" v-model="scope.row[column.prop]" placeholder="请输入内容" size="mini" autofocus @blur="handleEditBlur(scope.row, column)" />
</template>
<template v-else>
<span class="hideOutContent">{{ scope.row[column.prop] }}</span>
</template>
</template>
</el-table-column>
<el-table-column
v-else-if="checkColumnTyep(column, 'select')"
:key="index"
:prop="column.prop"
:label="column.title"
:width="column.width"
show-overflow-tooltip
:sortable="column.sortable"
:sort-by="column.sortBy"
>
<template slot-scope="scope">
<el-select v-model="scope.row[column.prop]" placeholder="请选择" size="mini">
<el-option
v-for="item in column.options"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</template>
</el-table-column>
<el-table-column

View File

@ -7,6 +7,12 @@ export default {
runPlanManage: 'Run plan',
productEdit: 'Product editor',
newDesignEditor: 'Editor',
newDesignEditorList: 'Editor List',
newDesignDraftEditorList: 'Draft Editor List',
uploadPdf: 'Upload Pdf',
fileManage:'File Manage',
designhomePage: 'Public map',
designUserPage: 'Personal map',
newDesignUserPage: 'Personal map',

View File

@ -8,6 +8,7 @@ export default {
newDesignEditorList: '图文列表',
newDesignDraftEditorList: '文章草稿',
uploadPdf: 'PDF上传',
fileManage:'文件管理',
mapManage: '地图管理',
skinManage: '皮肤管理',

View File

@ -156,6 +156,26 @@ export default {
handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
},
{
label: '设置联锁自动进路',
handler: this.setAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
},
{
label: '取消联锁自动进路',
handler: this.cancelAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
},
{
label: '设置联锁自动触发',
handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
},
{
label: '取消联锁自动触发',
handler: this.cancelAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
},
{
label: '进路引导',
handler: this.guide,

View File

@ -1143,7 +1143,7 @@ export const asyncRouter = [
path: '/editor',
component: Layout,
meta: {
i18n: 'router.newDesignEditor',
i18n: 'router.fileManage',
roles: [admin, user]
},
children: [
@ -1162,24 +1162,14 @@ export const asyncRouter = [
}
},
{
path: '',
path: 'draft',
component: Ueditor,
meta: {
i18n: 'router.newDesignEditor'
}
}
]
},
{
path: '/uploading',
component: Layout,
meta: {
i18n: 'router.uploadPdf',
roles: [admin, user]
},
children: [
},
{
path: 'list',
path: 'uploading/list',
component: UploadPdfList,
meta: {
i18n: 'router.uploadPdf'
@ -1187,6 +1177,23 @@ export const asyncRouter = [
}
]
},
// {
// path: '/uploading',
// component: Layout,
// meta: {
// i18n: 'router.uploadPdf',
// roles: [admin, user]
// },
// children: [
// {
// path: 'list',
// component: UploadPdfList,
// meta: {
// i18n: 'router.uploadPdf'
// }
// }
// ]
// },
{ // 新个人地图
path: '/design',
component: Layout,

View File

@ -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'; // 杜康

View File

@ -56,11 +56,11 @@ StompClient.prototype = {
that.status = false;
console.info(`通信连接已断开!`);
checkLoginLine().then((resp) => {
if (resp.code !== 40004) {
if (resp.code !== 40004 && resp.code !== 40005) {
that.count++;
that.reconnect(that.count);
}
}).catch((err) => {
}).catch(() => {
that.count++;
that.reconnect(that.count);
});

View File

@ -89,7 +89,8 @@ export default {
this.editor.create(); //
this.handleEdit();
if (this.draft) { this.handleEdit(); }
},
beforeDestroy() {
// API

View File

@ -197,7 +197,7 @@ export default {
if (deviceId) {
const list = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const key in mapDevice[key]) {
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowStation(list, deviceId);

View File

@ -119,6 +119,7 @@ export default {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
creatSubscribe(getTopic('STATE', this.$route.query.group), header);
await this.$store.dispatch('training/setHasSubscribed');
},
async subscribeNew() {
@ -136,6 +137,7 @@ export default {
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.groupModel}`);
clearSubscribe(getTopic('STATE', this.$route.query.group));
},
setCenter(code) {
this.$refs.mapCommon && this.$refs.mapCommon.setCenter(code);

View File

@ -0,0 +1,196 @@
<template>
<el-dialog v-dialogDrag class="autoSignal" title="延续保护列表" :visible.sync="show" width="85%" top="2vh" :before-do-close="doClose" append-to-body>
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
</el-dialog>
</template>
<script>
// import { mapGetters } from 'vuex';
// import { listMap } from '@/api/jmap/mapdraft';
import { getContinueProtectList, delContinueProtect, putContinueProtect } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
// mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
// stationCode: {
// type: 'select',
// label: '',
// config: {
// data: []
// }
// },
name: {
type: 'text',
label: '延续保护名称'
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '延续保护名称',
prop: 'name',
edit: true
},
{
title: '延续保护code',
prop: 'code'
},
{
title: '延续保护解锁区段',
prop: 'unlockSectionCode'
},
{
title: '延续保护解锁时间',
prop: 'unlockTime',
edit: true
},
{
type: 'button',
title: this.$t('map.operation'),
width: '300',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
},
{
name: '更新',
handleClick: this.handleUpload
}
]
}
]
}
};
},
computed: {
// ...mapGetters('map', [
// '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;
// }
// }
},
mounted() {
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
doClose() {
this.show = false;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getContinueProtectList(this.mapInfo.id, params);
}
},
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']);
// });
// }
}
return data;
},
handleUpload(index, row) {
putContinueProtect(this.$route.params.mapId, row).then(res => {
this.$message.success('更新成功');
}).catch(() => {
this.$messageBox('操作异常');
});
},
editObj(index, row) {
this.$emit('routeSelected', row);
this.doClose();
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
delContinueProtect(this.mapInfo.id, row.code).then(response => {
this.$message.success('删除成功!');
// this.$store.dispatch('map/delFlankProtectList', row);
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));
});
}).catch(() => {
this.$message.info('已取消删除');
});
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>
<style lang="scss">
.autoSignal .el-dialog__body {
padding: 0px 20px 10px 20px;
color: #606266;
font-size: 14px;
}
.autoSignal .el-dialog{
margin-top: 5vh !important;
}
</style>

View File

@ -0,0 +1,101 @@
<template>
<div style="height: 100%;">
<big-route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
@setCenter="setCenter"
/>
<big-route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" @refresh="refresh" />
</div>
</template>
<script>
import BigRouteDraft from './route';
import BigRouteDetail from './detail';
export default {
name: 'BigRouteOperate',
components: {
BigRouteDraft,
BigRouteDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
enabledTab: 'Route',
routeData: null,
routeList:[]
};
},
created() {
// filterRouteList() {
// return this.routeList.filter(route=>{ return !route.multiRoute; });
// } 'routeList',
},
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;
});
}
},
routeSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isModify = data.id;
this.$refs.routeEdit.selectedData(data);
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
initLoad() {
this.$refs.routeEdit && this.$refs.routeEdit.initLoad();
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
setCenter(code) {
this.$emit('setCenter', code);
},
batchSectionListFocus(flag) {
this.$refs.routeEdit.batchSectionListFocus(flag);
},
refresh() {
this.$refs.routeEdit.initPage();
}
}
};
</script>

View File

@ -1,44 +1,51 @@
<template>
<div style="height: 100%; border: 1px solid #EBEEF5; position: relative; left: 8%; width: 88%">
<el-form ref="form" :model="addModel" label-width="150px" size="mini" style="margin-top: 10px">
<div class="definition">
<el-form-item label="延续保护解锁区段:" prop="unlockSectionCode">
<el-select v-model="addModel.unlockSectionCode" clearable :disabled="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</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>
<div style="height: 100%; position: relative; left: 8%; width: 88%">
<el-form ref="form" :model="addModel" :rules="rules" label-width="150px" size="mini" style="margin-top: 10px">
<el-form-item label="延续保护名称:" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item label="方向:" prop="right">
<el-radio-group v-model="addModel.right">
<el-radio :label="true">向右</el-radio>
<el-radio :label="false">向左</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="延续保护解锁区段:" prop="unlockSectionCode">
<el-select v-model="addModel.unlockSectionCode" clearable>
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</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="pathList">
<el-table :data="addModel.pathList" 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.pathList, scope.$index)"
>
移出
</el-button>
<el-button
type="text"
size="small"
@click.native.prevent="editOverlab(addModel.pathList, scope.$index)"
>
编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
@ -51,8 +58,8 @@
</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-form-item :label="$t('map.routeProtectsData') + ':'" prop="sectionList">
<el-select v-model="addOverlapModel.sectionList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -65,7 +72,7 @@
@click="hover('routeOverlapSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.continueProtectSwitchData') + ':'" prop="routeOverlapSwitchList">
<el-form-item :label="$t('map.continueProtectSwitchData') + ':'" prop="switchPositionList">
<el-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
@ -75,12 +82,12 @@
/>
</el-select>
<el-button
:type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSwitchList')"
:type=" field === 'switchPositionList' ? 'danger' : 'primary'"
@click="hover('switchPositionList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addOverlapModel.routeOverlapSwitchList, {switchCode: overlapCode, normal: overlapType, switchType: overlapType ? '定位' : '反位'})"
@click="pushSwitch(addOverlapModel.switchPositionList, {switchCode: overlapCode, normal: overlapType, switchType: overlapType ? '定位' : '反位'})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="overlapType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
@ -91,7 +98,7 @@
:value="item.code"
/>
</el-select>
<el-table :data="addOverlapModel.routeOverlapSwitchList" border style="width: 97%">
<el-table :data="addOverlapModel.switchPositionList" 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>
@ -103,7 +110,7 @@
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addOverlapModel.routeOverlapSwitchList, scope.$index)"
@click.native.prevent="deleteSwitch(addOverlapModel.switchPositionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
@ -118,8 +125,8 @@
</template>
<script>
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { postContinueProtect, putContinueProtect, delContinueProtect } from '@/api/jmap/mapdraft';
// import { setUID } from '@/jmapNew/utils/Uid';
// import { postContinueProtect, putContinueProtect, delContinueProtect } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
import { deepAssign } from '@/utils/index';
@ -155,15 +162,17 @@ export default {
addModel: {
id: '',
code: '',
name: '',
right: '',
mapId: '',
unlockSectionCode:'',
unlockTime: 0,
relSectionSwitchList: []
pathList: []
},
addOverlapModel: {
parentIndex: '',
routeOverlapSectionList: [], //
routeOverlapSwitchList: [] //
sectionList: [], //
switchPositionList: [] //
},
overlapType: '',
SwitchLocateTypeList: [
@ -192,7 +201,15 @@ export default {
}
},
newRouteOverlapSectionList() {
return JSON.stringify(this.addOverlapModel.routeOverlapSectionList);
return JSON.stringify(this.addOverlapModel.sectionList);
},
rules() {
const baseRules = {
name: [
{ required: true, message: this.$t('rules.pleaseEnterPathName'), trigger: 'blur' }
]
};
return baseRules;
}
},
watch: {
@ -202,13 +219,15 @@ export default {
}
},
protectData(val, old) {
console.log(val, 'val');
if (val) {
this.addModel = val;
this.addModel.relSectionSwitchList && this.addModel.relSectionSwitchList.forEach(item => {
item.routeOverlapSwitchList.length && item.routeOverlapSwitchList.forEach( ele => {
this.addModel.pathList && this.addModel.pathList.forEach(item => {
item.switchPositionList.length && item.switchPositionList.forEach( ele => {
ele.switchType = ele.normal ? '定位' : '反位';
});
});
this.clearOverlab();
this.editShow = true;
}
},
@ -232,9 +251,6 @@ export default {
methods: {
hover(field) {
this.field = field === this.field ? '' : field;
if (this.field) {
this.$emit('clearHover');
}
},
pushSwitch(list, data) {
const index = list.findIndex(elem => { return elem.switchCode == data.switchCode; });
@ -260,71 +276,69 @@ export default {
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSectionList'.toUpperCase()) {
const sectionIndex = this.addOverlapModel.routeOverlapSectionList.indexOf(selected.code);
const sectionIndex = this.addOverlapModel.sectionList.indexOf(selected.code);
if ((selected.type === '01' || selected.type === '03' || selected.type === '02') && sectionIndex === -1) {
this.addOverlapModel.routeOverlapSectionList.push(selected.code);
this.addOverlapModel.sectionList.push(selected.code);
} else if ( sectionIndex !== -1 ) {
this.addOverlapModel.routeOverlapSectionList.splice(sectionIndex, 1);
this.addOverlapModel.sectionList.splice(sectionIndex, 1);
}
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSwitchList'.toUpperCase()) {
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchPositionList'.toUpperCase()) {
this.overlapCode = selected.code;
}
}
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; }
model['mapId'] = this.$route.params.mapId;
return model;
},
save() {
this.createProtect('saveProtectSuccess');
},
update() {
if (this.addModel.code && this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length && this.addModel.unlockTime) {
const model = this.buildModel();
putContinueProtect(model).then(resp => {
this.$emit('updateProtectSuccess', model.code);
}).catch(() => {
this.$messageBox('更新延续保护失败!');
});
} else if (this.addModel.code && !this.addModel.relSectionSwitchList.length) {
delContinueProtect(this.addModel.id).then(resp => {
this.$emit('updateProtectSuccess', '');
});
} else if (this.addModel.code && !this.addModel.unlockSectionCode) {
this.$messageBox('请填写延续保护解锁区段或清除延续保护线路相关数据!');
} else if (this.addModel.code && this.addModel.unlockTime) {
this.$messageBox('请填写延续保护解锁时间或清除延续保护线路相关数据!');
} else {
this.createProtect('updateProtectSuccess');
}
},
createProtect(parentFunction) {
if (this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length && this.addModel.unlockTime) {
const model = this.buildModel(setUID('Protect'));
postContinueProtect(model).then(resp => {
this.$emit(parentFunction, model.code);
}).catch(() => {
this.$messageBox('创建延续保护失败!');
});
} else if (!this.addModel.relSectionSwitchList.length) {
this.$emit(parentFunction, '');
} else {
if (!this.addModel.unlockSectionCode) {
this.$messageBox('请填写延续保护解锁区段或清除延续保护线路相关数据!');
} else if (!this.addModel.unlockTime.length) {
this.$messageBox('请填写延续保护解锁时间或清除延续保护线路相关数据!');
}
}
},
// buildModel(code) {
// const model = Object.assign({}, this.addModel);
// if (code) { model['code'] = code; }
// model['mapId'] = this.$route.params.mapId;
// return model;
// },
// update() {
// if (this.addModel.code && this.addModel.unlockSectionCode && this.addModel.pathList.length && this.addModel.unlockTime) {
// const model = this.buildModel();
// putContinueProtect(model).then(resp => {
// this.$emit('updateProtectSuccess', model.code);
// }).catch(() => {
// this.$messageBox('');
// });
// } else if (this.addModel.code && !this.addModel.pathList.length) {
// delContinueProtect(this.addModel.id).then(resp => {
// this.$emit('updateProtectSuccess', '');
// });
// } else if (this.addModel.code && !this.addModel.unlockSectionCode) {
// this.$messageBox('线');
// } else if (this.addModel.code && this.addModel.unlockTime) {
// this.$messageBox('线');
// } else {
// this.createProtect('updateProtectSuccess');
// }
// },
// createProtect(parentFunction) {
// if (this.addModel.unlockSectionCode && this.addModel.pathList.length && this.addModel.unlockTime) {
// const model = this.buildModel(setUID('Protect'));
// postContinueProtect(model).then(resp => {
// this.$emit(parentFunction, model.code);
// }).catch(() => {
// this.$messageBox('');
// });
// } else if (!this.addModel.pathList.length) {
// this.$emit(parentFunction, '');
// } else {
// if (!this.addModel.unlockSectionCode) {
// this.$messageBox('线');
// } else if (!this.addModel.unlockTime.length) {
// this.$messageBox('线');
// }
// }
// },
clear() {
if (this.$refs && this.$refs.form) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.$route.params.mapId;
this.addModel.relSectionSwitchList = [];
this.addModel.mapId = '';
this.addModel.pathList = [];
this.addModel.code = '';
this.addModel.name = '';
this.addModel.right = '';
this.addModel.unlockTime = 0;
this.addModel.unlockSectionCode = '';
this.addModel.id = '';
@ -346,9 +360,9 @@ export default {
},
updateOverlab() {
if (this.addOverlapModel.parentIndex || this.addOverlapModel.parentIndex === 0 ) {
this.addModel.relSectionSwitchList[this.addOverlapModel.parentIndex] = {
routeOverlapSectionList:this.addOverlapModel.routeOverlapSectionList,
routeOverlapSwitchList:this.addOverlapModel.routeOverlapSwitchList
this.addModel.pathList[this.addOverlapModel.parentIndex] = {
sectionList:this.addOverlapModel.sectionList,
switchPositionList:this.addOverlapModel.switchPositionList
};
this.clearOverlab();
this.cardMode = 'generate';
@ -359,12 +373,12 @@ export default {
this.cardMode = 'generate';
},
generateOverlab() {
if (!this.addOverlapModel.routeOverlapSectionList.length) {
if (!this.addOverlapModel.sectionList.length) {
this.$messageBox('请选择进路延续保护区段!');
} else {
this.addModel.relSectionSwitchList.push({
routeOverlapSectionList:this.addOverlapModel.routeOverlapSectionList,
routeOverlapSwitchList:this.addOverlapModel.routeOverlapSwitchList
this.addModel.pathList.push({
sectionList:this.addOverlapModel.sectionList,
switchPositionList:this.addOverlapModel.switchPositionList
});
this.$refs.overlabForm.resetFields();
this.clearOverlab();
@ -373,8 +387,8 @@ export default {
clearOverlab() {
this.addOverlapModel = {
parentIndex: '',
routeOverlapSectionList:[],
routeOverlapSwitchList:[]
sectionList:[],
switchPositionList:[]
};
this.overlapCode = '';
this.overlapType = '';
@ -392,8 +406,12 @@ export default {
}
});
},
batchSectionListFocus(flag) {
this.changeSectionSelected(this.addOverlapModel.routeOverlapSectionList, flag, 'continueProtectSection');
validate(cb) {
this.$refs.form.validate((valid) => {
if (valid) {
cb(this.addModel);
}
});
}
}
};
@ -417,10 +435,10 @@ export default {
}
.el-card__header{
border-bottom: 1px solid #EBEEF5;
border-top: 1px solid #EBEEF5;
border-top: 0 solid #EBEEF5;
}
.el-card{
border:0 solid #EBEEF5;
border:1px solid #EBEEF5;
}
}

View File

@ -0,0 +1,111 @@
<template>
<div class="BigRouteInfo">
<protect-operate ref="protect" :protect-data="protectData" />
<div class="bigDraft">
<el-button-group class="bigDraftBtn">
<el-button v-if="isModify" type="warning" size="small" :loading="loading" @click="update">更新延续保护</el-button>
<el-button v-else type="primary" size="small" :loading="loading" @click="save">保存延续保护</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { putContinueProtect } from '@/api/jmap/mapdraft';
import ProtectOperate from './protect';
export default {
name:'BigRouteInfo',
components: {
ProtectOperate
},
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
field: '',
loading: false,
isModify:false,
protectData:null
};
},
computed: {
},
mounted() {
this.initPage();
},
methods:{
initPage() {
this.routeList = [];
},
selectedData(data) {
this.protectData = data;
},
setSelected(selected) {
if (selected) {
this.$refs.protect.setSelected(selected);
}
},
save() {
const that = this;
that.$refs.form.validate((valid) => {
if (valid) {
console.log('保存');
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
this.$refs.form.resetFields();
}
},
update() {
this.$refs.protect.validate((data) => {
putContinueProtect(this.$route.params.mapId, data).then(res => {
this.$message.success('更新成功!');
this.$refs.protect.clear();
this.isModify = false;
}).catch(() => {
this.$message.error('更新失败!');
});
});
}
}
};
</script>
<style lang="scss" scoped>
.BigRouteInfo{
height: 100%;
overflow:auto;
padding-bottom: 60px;
}
.bigDefinition{
}
.bigDraft{
position: absolute;
bottom: 0;
background: #fff;
box-shadow: 4px 5px 10px #565656;
width: 100%;
padding: 8px 10px;
}
.bigDraftBtn{float: right;}
</style>

View File

@ -40,6 +40,7 @@ import TurnedOperate from './turnedoperate/index';
import FlankProtectOperate from './flankProtectOperate/index';
import DwellTimeOperate from './dwellTimeOperate/index';
import DestinationOperate from './destinationOperate/index';
import ContinueProtectOperate from './continueProtectOperate/index';
export default {
name: 'DataRelation',
@ -53,7 +54,8 @@ export default {
// PathOperate,
SignalOperate,
TurnedOperate,
DwellTimeOperate
DwellTimeOperate,
ContinueProtectOperate
// DestinationOperate
},
props: {
@ -100,10 +102,11 @@ export default {
} else {
this.tabList = [
{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:'turned', menus:TurnedOperate},
{label: '目的地码', name:'destination', menus:DestinationOperate},
{label: this.$t('map.automaticSignal'), name:'automatic', menus:AutomaticOperate},
{label: this.$t('map.signalApprochSection'), name:'signal', menus:SignalOperate},
{label: '侧防', name:'flankProtect', menus:FlankProtectOperate},
{label: this.$t('map.routing'), name:'routing', menus:RoutingOperate},
{label: '停站时间', name:'dwellTime', menus:DwellTimeOperate},

View File

@ -10,7 +10,7 @@
/>
</div>
<pre-view-field ref="previewField" :map-info="mapInfo" />
<protect-detail ref="protectDetail" :map-info="mapInfo" />
<!-- <protect-detail ref="protectDetail" :map-info="mapInfo" /> -->
</el-dialog>
<related ref="related" :map-info="mapInfo" />
</div>
@ -18,8 +18,8 @@
<script>
import { mapGetters } from 'vuex';
import { listMap, getRouteNewList, delRouteNew, getRouteNewById, putRouteNew, getContinueProtectList, delContinueProtect, putSetDraftMapRouteById } from '@/api/jmap/mapdraft';
import ProtectDetail from './protectDetail';
import { listMap, getRouteNewList, delRouteNew, putRouteNew, putSetDraftMapRouteById, getOverlapAllList } from '@/api/jmap/mapdraft';
// import ProtectDetail from './protectDetail';
import PreViewField from './preview';
import Related from './related';
@ -27,7 +27,7 @@ export default {
name: 'RouteDetail',
components: {
PreViewField,
ProtectDetail,
// ProtectDetail,
Related
},
props: {
@ -48,6 +48,7 @@ export default {
RouteAutoTypeList: [],
SwitchLocateTypeList: [],
ContinueProtectList: [],
overlapList: [], //
turnBackList: [
{ label: '是', value: true },
{ label: '否', value: false }
@ -89,8 +90,19 @@ export default {
}
}
}
},
queryList: {
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
]),
queryList() {
return {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
@ -169,57 +181,13 @@ export default {
title: this.$t('map.endingSignalName'),
prop: 'endSignalCode'
},
// {
// type: 'button',
// title: this.$t('map.continueProtect'),
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.overlapSwitchDetail,
// showControl: (row) => { return row.overlapCode; }
// }
// ]
// },
// {
// type: 'button',
// title: this.$t('map.accessSideTurnoutData'),
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.flankProtectionSwitchDetail,
// showControl: (row) => { return row.routeFlankProtectionList && row.routeFlankProtectionList.length > 0; }
// }
// ]
// },
// {
// type: 'button',
// title: this.$t('map.physicalSection'), // list
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.sectionDetail
// }
// ]
// },
// {
// type: 'button',
// title: this.$t('map.routeRouteTurnoutData'),
// buttons: [
// {
// name: this.$t('map.preview'),
// handleClick: this.routeSwitchDetail,
// showControl: (row) => { return row.routeSwitchList.length > 0; }
// }
// ]
// },
// {
// title: this.$t('map.hostileData'),
// prop: 'conflictingSignalList',
// type: 'tagMore',
// width: '250',
// columnValue: (row) => { return this.showConflictingSignalList(row.conflictingSignalList); },
// tagType: (row) => { return ''; }
// },
{
title: '延续保护',
prop: 'overlapCode',
type: 'select',
options: this.overlapList,
width: 190
},
{
type: 'button',
title: this.$t('map.operation'),
@ -230,12 +198,6 @@ export default {
handleClick: this.edit,
showControl: () => { return this.showType !== 'select'; }
},
// {
// name: '',
// handleClick: this.copyObj,
// type: 'warning',
// showControl: () => { return this.showType !== 'select'; }
// },
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
@ -255,17 +217,8 @@ export default {
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
])
};
}
},
watch: {
signalList: function (val, old) {
@ -303,6 +256,7 @@ export default {
this.SwitchLocateTypeList = list;
});
this.acquireMapList();
this.initProtectData();
},
methods: {
doShow(showType, codeType) {
@ -316,6 +270,11 @@ export default {
doClose() {
this.show = false;
},
initProtectData() {
getOverlapAllList(this.$route.params.mapId).then(resp => {
this.overlapList = resp.data;
});
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getRouteNewList(this.mapInfo.id, params);
@ -343,107 +302,6 @@ export default {
}
return data;
},
// async routeOverlap(index, row) { //
// if (this.$refs && this.$refs.previewField && row) {
// const sectionDict = {};
// this.sectionList.map(elem => { sectionDict[elem.code] = elem.name; });
// const routeOverlapSectionList = row.routeOverlapSectionList.map(elem => { return {sectionCode : elem}; });
// const fieldList = {
// id: row.id,
// mapId: this.$route.params.mapId,
// title: this.$t('map.routeContinuesToProtectSectorData'),
// name: row.name,
// model: {
// items: [
// { prop: 'sectionCode', label: this.$t('map.physicalSectionID'), type: 'text' },
// { prop: 'sectionCode', label: this.$t('map.physicalSectionName'), type: 'select', options: sectionDict }
// ]
// }
// };
// this.$refs.previewField.doShow(fieldList, routeOverlapSectionList);
// }
// },
// async sectionDetail(index, row) { //
// if (this.$refs && this.$refs.previewField && row) {
// const sectionDict = {};
// this.sectionList.map(elem => { sectionDict[elem.code] = elem.name; });
// const routeSectionList = row.routeSectionList.map(elem => { return {sectionCode : elem}; });
// const fieldList = {
// id: row.id,
// mapId: this.$route.params.mapId,
// title: this.$t('map.routePhysicalSectionData'),
// name: row.name,
// model: {
// items: [
// { prop: 'sectionCode', label: this.$t('map.physicalSectionID'), type: 'text' },
// { prop: 'sectionCode', label: this.$t('map.physicalSectionName'), type: 'select', options: sectionDict }
// ]
// }
// };
// this.$refs.previewField.doShow(fieldList, routeSectionList);
// }
// },
// async overlapSwitchDetail(index, row) { //
// if (this.$refs && this.$refs.protectDetail && row) {
// const param = {
// code: row.overlapCode,
// pageNum: 10,
// pageSize:1
// };
// getContinueProtectList(this.$route.params.mapId, param).then(resp => {
// this.$refs.protectDetail.doShow(resp.data.list[0]);
// }).catch((error) => {
// console.log(error);
// });
// }
// },
// async flankProtectionSwitchDetail(index, row) { //
// if (this.$refs && this.$refs.previewField && row) {
// const switchDict = {};
// this.switchList.map(elem => { switchDict[elem.code] = elem.name; });
// const fieldList = {
// id: row.id,
// mapId: this.$route.params.mapId,
// title: this.$t('map.routeSideDefenseSwitch'),
// name: row.name,
// model: {
// items: [
// { prop: 'switchCode', label: this.$t('map.switchID'), type: 'text' },
// { prop: 'switchCode', label: this.$t('map.switchName'), type: 'select', options: switchDict },
// { prop: 'switchType', label: this.$t('map.switchType'), type: 'text'}
// ]
// }
// };
// row.routeFlankProtectionList.forEach( item => {
// item.switchType = item.normal ? this.$t('map.normalPosition') : this.$t('map.reversePosition');
// });
// this.$refs.previewField.doShow(fieldList, row.routeFlankProtectionList);
// }
// },
// async routeSwitchDetail(index, row) { //
// if (this.$refs && this.$refs.previewField && row) {
// const switchDict = {};
// this.switchList.map(elem => { switchDict[elem.code] = elem.name; });
// const fieldList = {
// id: row.id,
// mapId: this.$route.params.mapId,
// title: this.$t('map.entryTurnout'),
// name: row.name,
// model: {
// field: 'routeSwitchList',
// items: [
// { prop: 'switchCode', label: this.$t('map.switchID'), type: 'text' },
// { prop: 'switchCode', label: this.$t('map.switchName'), type: 'select', options: switchDict },
// { prop: 'switchType', label: this.$t('map.switchType'), type: 'text'}
// ]
// }
// };
// row.routeSwitchList.forEach( item => {
// item.switchType = item.normal ? this.$t('map.normalPosition') : this.$t('map.reversePosition');
// });
// this.$refs.previewField.doShow(fieldList, row.routeSwitchList);
// }
// },
handleUpdate(index, row) {
putSetDraftMapRouteById(this.$route.params.mapId, row).then(res => {
this.$message.success('更新成功');
@ -460,36 +318,12 @@ export default {
});
},
edit(index, row) {
// this.mapList.forEach(elem => {
// if (elem.name === row.mapId) {
// const model = {
// mapId: elem.id,
// id: row.id
// };
getRouteNewById(row.mapId).then(response => {
const data = response.data;
this.$emit('routeSelected', data);
this.doClose();
});
// }
// getRouteNewById(row.mapId).then(response => {
// const data = response.data;
this.$emit('routeSelected', row);
this.doClose();
// });
},
// copyObj(index, row) {
// this.mapList.forEach(elem => {
// if (elem.name === row.mapId) {
// const model = {
// mapId: elem.id,
// id: row.id
// };
// getRouteNewById(model.id).then(response => {
// const data = response.data;
// delete data.id;
// this.$emit('routeSelected', data);
// this.doClose();
// });
// }
// });
// },
deleteObj(index, row) {
if (row) {
this.$confirm('是否确认删除?', '提示', {
@ -498,18 +332,6 @@ export default {
type: 'warning'
}).then(() => {
delRouteNew(this.$route.params.mapId, row.code).then(response => {
// const param = {
// code: row.overlapCode,
// pageNum: 10,
// pageSize:1
// };
// getContinueProtectList(this.$route.params.mapId, param).then(resp => {
// if (resp.data.list[0]) {
// delContinueProtect(resp.data.list[0].id).then( res => {
// this.$message.success('');
// });
// }
// });
this.reloadTable();
}).catch(() => {
this.$messageBox('删除失败');

View File

@ -22,10 +22,10 @@
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('map.delayUnlockingTime') + ':'" prop="delayReleaseTime">
<!-- <el-form-item :label="$t('map.delayUnlockingTime') + ':'" prop="delayReleaseTime">
<el-input-number v-model="addModel.delayReleaseTime" :min="0" />
<span>s</span>
</el-form-item>
</el-form-item> -->
<el-form-item :label="$t('map.accessType') + ':'" prop="turnBack">
<el-radio-group v-model="addModel.turnBack">
<el-radio :label="true">{{ $t('map.are') }}</el-radio>
@ -115,6 +115,16 @@
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="延续保护:">
<el-select v-model="addModel.overlapCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="(item,index) in overlapList"
:key="index"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="侧防列表:">
<el-select v-model="addModel.flankProtectionList" clearable multiple filterable :placeholder="$t('map.pleaseSelect')">
<el-option
@ -142,7 +152,6 @@
</el-form>
<hostile-data ref="hostile" :conflicting-signal-list="addModel.conflictingSignalList" @hover="hover" />
<br>
<protect-operate ref="protect" :protect-data="protectData" @saveProtectSuccess="saveProtectSuccess" @updateProtectSuccess="updateProtectSuccess" @clearHover="clearHover" />
<div class="draft">
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.saveRoute') }}
@ -155,15 +164,12 @@
</template>
<script>
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { postRouteNew, putRouteNew, getRouteNewList, getContinueProtectList, getFlankProtectionList } from '@/api/jmap/mapdraft';
import ProtectOperate from './protect';
import { getRouteNewList, getFlankProtectionList, getOverlapAllList, putSetDraftMapRouteById } from '@/api/jmap/mapdraft';
import HostileData from './hostileData';
export default {
name: 'RouteOperation',
components: {
ProtectOperate,
HostileData
},
props: {
@ -200,7 +206,6 @@ export default {
{ name: '定位', code: true },
{ name: '反位', code: false }
],
// flankProtectList: [], //
addModel: {
mapId: '',
code: '',
@ -209,7 +214,7 @@ export default {
arc: false, // /
flt: false, // /
lockFirst:false, //
delayReleaseTime: '', //
// delayReleaseTime: '', //
turnBack: false, //
startSignalCode: '', //
endSignalCode: '', //
@ -222,7 +227,7 @@ export default {
overlapCode:'',
conflictingSignalList: [] //
},
protectData:null,
overlapList: [], //
routeList: [] //
};
},
@ -284,9 +289,7 @@ export default {
},
routeData(val, old) {
if (val) {
this.$refs.protect.clear();
this.addModel = val;
val.overlapCode && this.initProtectData(val);
this.addModel.routeSwitchList.forEach(item => {
item.normal ? item.switchType = '定位' : item.switchType = '反位';
});
@ -305,7 +308,6 @@ export default {
this.changeSectionSelected(objOld, false, 'routePhysicalSection');
}
if (obj && obj.length) {
this.$refs.protect.addModel.unlockSectionCode = obj[obj.length - 1];
this.changeSectionSelected(obj, true, 'routePhysicalSection');
}
},
@ -334,6 +336,7 @@ export default {
mounted() {
this.getRouteList();
this.getFlankProtectList();
this.initProtectData();
},
methods: {
initLoad() { //
@ -366,12 +369,8 @@ export default {
},
hover(field) {
this.field = field === this.field ? '' : field;
this.$refs.protect.hover('');
this.$refs.hostile.setField(this.field);
},
clearHover() {
this.field = '';
},
pushSwitch(list, data) {
const index = list.findIndex(elem => { return elem.switchCode == data.switchCode; });
if (index < 0) {
@ -391,39 +390,16 @@ export default {
return model;
},
save() {
this.$refs.protect.save();
},
saveProtectSuccess(overlapCode) {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
postRouteNew(this.buildModel(overlapCode, setUID('Route'))).then(response => {
this.$message.success(this.$t('tip.creatingSuccessful'));
this.loading = false;
this.routeList.push(this.buildModel(setUID('Route')));
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
this.loading = false;
});
}
});
console.log('暂无接口');
},
update() {
this.$refs.protect.update();
},
updateProtectSuccess(overlapCode) {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
putRouteNew(this.buildModel(overlapCode)).then(response => {
this.$message.success(this.$t('map.updateSuccessfully'));
this.loading = false;
putSetDraftMapRouteById(this.mapInfo.id, this.addModel).then(res => {
this.$message.success('更新进路成功!');
this.clear();
this.getRouteList();
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
this.loading = false;
this.$message.error('更新进路失败!');
});
}
});
@ -440,28 +416,21 @@ export default {
this.addModel.code = '';
this.addModel.conflictingSignalList = [];
this.isSave = true;
this.$refs.protect.clear();
this.routeCode = '';
this.routeType = '';
this.addModel.stationCode = this.routeList[this.routeList.length - 1].stationCode;
this.addModel.delayReleaseTime = this.routeList[this.routeList.length - 1].delayReleaseTime;
// this.addModel.delayReleaseTime = this.routeList[this.routeList.length - 1].delayReleaseTime;
}
},
initProtectData(val) {
const param = {
code: val.overlapCode,
pageNum: 10,
pageSize:1
};
getContinueProtectList(this.$route.params.mapId, param).then(resp => {
this.protectData = resp.data.list[0];
initProtectData() {
getOverlapAllList(this.$route.params.mapId).then(resp => {
this.overlapList = resp.data;
});
},
batchSectionListFocus(flag) {
this.changeSectionSelected(this.addModel.routeSectionList, flag, 'routePhysicalSection');
this.changeSignalSelected(this.addModel.startSignalCode, flag, 'routeSignal');
this.changeSignalSelected(this.addModel.endSignalCode, flag, 'routeSignal');
this.$refs['protect'].batchSectionListFocus(flag);
},
changeSectionSelected(list, flag, type) {
list && list.forEach((item) => {
@ -507,8 +476,6 @@ export default {
this.$refs.hostile.setHostileSignal(selected.code);
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchPositionList'.toUpperCase()) {
this.$refs.hostile.hostileSwitchCode = selected.code;
} else {
this.$refs.protect.setSelected(selected);
}
}
}

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag :title="$t('map.signalApprochSection')" :visible.sync="show" width="85%" :before-do-close="doClose" append-to-body>
<el-dialog v-dialogDrag :title="$t('map.signalApprochSection')" :visible.sync="show" width="85%" top="2vh" :before-do-close="doClose" append-to-body>
<div>
<QueryListPage
ref="queryListPage"
@ -14,7 +14,7 @@
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getApproachSectionList, deleteApproachSection, getApproachSectionDetail } from '@/api/jmap/mapdraft';
import { getApproachSectionList, deleteApproachSection } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
@ -55,30 +55,40 @@ export default {
{
title: this.$t('map.signalCodeName'),
prop: 'signalCode',
width: '120'
},
{
title: this.$t('map.nearSectionCodeColon'),
prop: 'routeSectionList',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.routeSectionList, this.sectionList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
},
{
title: '接近区段(后备)',
prop: 'blockSectionList',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.blockSectionList || [], this.sectionList, ['code', 'name'], true); },
tagType: (row) => { return ''; }
},
{
title: '是否是引导信号机',
prop: 'releaseTime',
type: 'tag',
width: '80',
columnValue: (row) => { return row.releaseTime; },
columnValue: (row) => { return this.$convertField(row.signalCode, this.signalList, ['code', 'name']); },
tagType: (row) => { return ''; }
},
{
title: '信号机code',
prop: 'signalCode'
},
{
title: '进路解锁时间',
prop: 'releaseTime'
},
// {
// title: this.$t('map.nearSectionCodeColon'),
// prop: 'routeSectionList',
// type: 'tagMore',
// columnValue: (row) => { return this.$convertField(row.routeSectionList, this.sectionList, ['code', 'name'], true); },
// tagType: (row) => { return ''; }
// },
// {
// title: '()',
// prop: 'blockSectionList',
// type: 'tagMore',
// columnValue: (row) => { return this.$convertField(row.blockSectionList || [], this.sectionList, ['code', 'name'], true); },
// tagType: (row) => { return ''; }
// },
// {
// title: '',
// prop: 'releaseTime',
// type: 'tag',
// width: '80',
// columnValue: (row) => { return row.releaseTime; },
// tagType: (row) => { return ''; }
// },
{
type: 'button',
title: this.$t('map.operation'),
@ -147,27 +157,12 @@ export default {
this.mapList = response.data;
});
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
elem.code = elem.signalCode;
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
that.$convertSpecifiedField(elem, this.signalList, 'code', 'name', ['signalCode']);
elem.signalCode = `${elem.signalCode}(${elem.code})`;
});
}
}
return data;
},
editObj(index, row) {
getApproachSectionDetail(row.id).then(response => {
const data = response.data;
this.$emit('autoMaticoSelected', data);
this.doClose();
});
// getApproachSectionDetail(row.id).then(response => {
// const data = response.data;
this.$emit('autoMaticoSelected', row);
this.doClose();
// });
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {

View File

@ -15,39 +15,106 @@
<el-button :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">{{ $t('map.activate') }}
</el-button>
</el-form-item>
<el-form-item :label="$t('map.nearSectionCodeColon')" prop="routeSectionList">
<el-select v-model="addModel.routeSectionList" 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 === 'routeSectionList' ? 'danger' : 'primary'"
@click="hover('routeSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="接近区段(后备):" prop="blockSectionList">
<el-select v-model="addModel.blockSectionList" 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 === 'blockSectionList' ? 'danger': 'primary'"
@click="hover('blockSectionList')"
>
{{ $t('map.activate') }}
</el-button>
</el-form-item>
<el-form-item label="进路解锁时间:" prop="releaseTime">
<el-input-number v-model="addModel.releaseTime" />
</el-form-item>
<el-form-item label="延续保护线路:" prop="sectionPathList">
<el-table :data="addModel.sectionPathList" 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.sectionPathList, scope.$index)"
>
移出
</el-button>
<el-button
type="text"
size="small"
@click.native.prevent="editOverlab(addModel.sectionPathList, scope.$index)"
>
编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-card class="box-card" shadow="never" style="width: 88%; margin-left: 6%;">
<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="sectionList">
<el-select v-model="addOverlapModel.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 === 'routeOverlapSectionList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.continueProtectSwitchData') + ':'" prop="switchPositionList">
<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 === 'switchPositionList' ? 'danger' : 'primary'"
@click="hover('switchPositionList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addOverlapModel.switchPositionList, {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.switchPositionList" 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.switchPositionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
</div>
</el-card>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
@ -64,7 +131,7 @@
<script>
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { postApproachSection, putApproachSection, getApproachSectionList } from '@/api/jmap/mapdraft';
import { postApproachSection, putApproachSection } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/jmapNew/theme/parser/util';
import { deepAssign } from '@/utils/index';
@ -98,38 +165,50 @@ export default {
isSave: true,
loading: false,
editModel: {},
overlapCode: '',
overlapType: '',
cardMode: 'generate',
addModel: {
id: '',
code: '',
mapId: '',
signalCode: '',
routeSectionList: [],
blockSectionList: [],
releaseTime: 0
releaseTime: 0,
sectionPathList: []
},
addOverlapModel: {
parentIndex: '',
sectionList: [], //
switchPositionList: [] //
},
rules: {
signalCode: [
{ required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' }
],
routeSectionList: [
{ required: true, message: this.$t('map.triggerSegmentData'), trigger: 'change' }
],
blockSectionList: [
{ required: true, message: '请选择接近区段(后备)', trigger: 'change'}
]
}
},
overLapRules: {
},
SwitchLocateTypeList: [
{ name: '定位', code: true },
{ name: '反位', code: false }
]
};
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList'
]),
newRouteSectionList() {
return JSON.stringify(this.addModel.routeSectionList);
},
newBlockSectionList() {
return JSON.stringify(this.addModel.blockSectionList);
cardTitle() {
if (this.cardMode === 'generate') {
return '生成信号机接近区段';
} else if (this.cardMode === 'edit') {
return '编辑信号机接近区段';
} else {
return '';
}
}
},
watch: {
@ -141,41 +220,20 @@ export default {
routeData(val, old) {
if (val) {
this.addModel = deepAssign(this.addModel, val);
this.addModel.sectionPathList && this.addModel.sectionPathList.forEach(item => {
item.switchPositionList.length && item.switchPositionList.forEach( ele => {
ele.switchType = ele.normal ? '定位' : '反位';
});
});
this.clearOverlab();
}
},
newRouteSectionList: {
handler: function(val, old) {
const obj = JSON.parse(val);
const objOld = JSON.parse(old);
if (objOld && objOld.length) {
this.changeSectionSelected(objOld, true);
}
if (obj && obj.length) {
this.changeSectionSelected(obj, true);
}
},
deep: true
},
newBlockSectionList: {
handler: function(val, old) {
const obj = JSON.parse(val);
const objOld = JSON.parse(old);
if (objOld && objOld.length) {
this.changeSectionSelected(objOld, true);
}
if (obj && obj.length) {
this.changeSectionSelected(obj, true);
}
},
deep: true
},
'addModel.signalCode': function (val, old) {
if (old) {
this.changeSignalSelected(old, false, 'routeSignal');
}
if (val) {
this.changeSignalSelected(val, true, 'routeSignal');
this.changeSignal(val);
}
}
},
@ -189,44 +247,40 @@ export default {
formatName(code) {
return formatName(code);
},
changeSignal(val) {
if (val && this.mapInfo && this.mapInfo.id) {
const params = {
signalCode : val,
pageSize: 10,
pageNum: 1
};
getApproachSectionList(this.mapInfo.id, params).then( resp => {
if (resp.data && resp.data.list && resp.data.list.length) {
this.routeData = resp.data.list[0];
this.isSave = false;
} else {
this.addModel.id = '';
this.addModel.code = '';
this.addModel.mapId = '';
this.addModel.routeSectionList = [];
this.addModel.blockSectionList = [];
this.isSave = true;
}
}).catch(error=> {
console.log(error);
});
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'));
}
},
swictchName(code) {
let name = '';
if (code) {
const swch = this.$store.getters['map/getDeviceByCode'](code);
if (swch) {
name = `${swch.name}(${swch.code})`;
}
}
return name;
},
deleteSwitch(list, index) {
list.splice(index, 1);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'signalCode'.toUpperCase()) {
this.addModel.signalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeSectionList'.toUpperCase()) {
if ((selected.type === '01' || selected.type === '03' || selected.type === '02') && this.addModel.routeSectionList.indexOf(selected.code) === -1) {
this.addModel.routeSectionList.push(selected.code);
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'blockSectionList'.toUpperCase()) {
if ((selected.type === '01' || selected.type === '03') && this.addModel.blockSectionList.indexOf(selected.code) === -1) {
this.addModel.blockSectionList.push(selected.code);
} else if (selected.type === '02' && this.addModel.blockSectionList.indexOf(selected.parentCode) === -1) {
this.addModel.blockSectionList.push(selected.parentCode);
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSectionList'.toUpperCase()) {
const sectionIndex = this.addOverlapModel.sectionList.indexOf(selected.code);
if ((selected.type === '01' || selected.type === '03' || selected.type === '02') && sectionIndex === -1) {
this.addOverlapModel.sectionList.push(selected.code);
} else if ( sectionIndex !== -1 ) {
this.addOverlapModel.sectionList.splice(sectionIndex, 1);
}
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchPositionList'.toUpperCase()) {
this.overlapCode = selected.code;
}
}
},
@ -255,7 +309,8 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
putApproachSection(this.buildModel()).then(resp => {
console.log(this.addModel, '====');
putApproachSection(this.mapInfo.id, this.addModel).then(resp => {
this.$message.success(this.$t('map.signalSectionUpdateSucceeded'));
this.loading = false;
this.clear();
@ -271,56 +326,65 @@ export default {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id;
this.addModel.routeSectionList = [];
this.addModel.blockSectionList = [];
this.addModel.signalCode = '';
this.addModel.sectionPathList = [];
this.addModel.code = '';
this.isSave = true;
this.cardMode = 'generate';
}
},
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';
},
generateOverlab() {
if (!this.addOverlapModel.sectionList.length) {
this.$messageBox('请选择进路延续保护区段!');
} else {
this.addModel.sectionPathList.push({
sectionList:this.addOverlapModel.sectionList,
switchPositionList:this.addOverlapModel.switchPositionList
});
this.$refs.overlabForm.resetFields();
this.clearOverlab();
}
},
updateOverlab() {
if (this.addOverlapModel.parentIndex || this.addOverlapModel.parentIndex === 0 ) {
this.addModel.sectionPathList[this.addOverlapModel.parentIndex] = {
sectionList:this.addOverlapModel.sectionList,
switchPositionList:this.addOverlapModel.switchPositionList
};
this.clearOverlab();
this.cardMode = 'generate';
}
},
cancelOverlab() {
this.clearOverlab();
this.cardMode = 'generate';
},
clearOverlab() {
this.addOverlapModel = {
parentIndex: '',
sectionList:[],
switchPositionList:[]
};
this.overlapCode = '';
this.overlapType = '';
},
batchSectionListFocus(flag) {
this.changeSectionSelected(this.addModel.routeSectionList, flag);
this.changeSectionSelected(this.addModel.blockSectionList, flag);
this.changeSignalSelected(this.addModel.signalCode, flag, 'routeSignal');
},
changeSignalSelected(val, flag, type) {
const signal = this.$store.getters['map/getDeviceByCode'](val);
signal && signal.instance.drawBatchSelected(flag, flag ? type : '');
},
changeSectionSelected(list, cutOut) {
let flag = true;
let type = '';
list && list.forEach((item) => {
const section = this.$store.getters['map/getDeviceByCode'](item);
if (!cutOut) {
this.setSectionSelectedType(section, cutOut, '');
return;
}
if (this.addModel.routeSectionList.indexOf(item) !== -1 && this.addModel.blockSectionList.indexOf(item) !== -1) {
type = 'signalNearSection';
flag = true;
} else if (this.addModel.routeSectionList.indexOf(item) !== -1) {
type = 'signalNearSectionCBTC';
flag = true;
} else if (this.addModel.blockSectionList.indexOf(item) !== -1) {
type = 'signalNearSectionReserve';
flag = true;
} else {
type = '';
flag = false;
}
this.setSectionSelectedType(section, flag, type);
});
},
setSectionSelectedType(section, flag, type) {
if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => {
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
});
} else {
section && section.instance.drawBatchSelected(flag, flag ? type : '');
}
}
}
};

View File

@ -37,6 +37,10 @@ export default {
type: 'text',
label: this.$t('system.name')
},
id: {
type: 'text',
label: 'id'
},
roles: {
type: 'select',
label: this.$t('system.roles'),
@ -71,6 +75,11 @@ export default {
selectCheckShow: false,
indexShow: true,
columns: [
{
title: 'id',
prop: 'id',
width: 80
},
{
title: this.$t('system.name'),
prop: 'name'