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

View File

@ -52,13 +52,34 @@
:sort-by="column.sortBy" :sort-by="column.sortBy"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="!column.edit"> <template v-if="column.edit">
<span class="hideOutContent">{{ scope.row[column.prop] }}</span>
</template>
<template v-else>
<div v-show="!scope.row.isEdit" class="hideOutContent" @click="handleEdit(scope.row, column, scope.$index)">{{ scope.row[column.prop] }}</div> <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)" /> <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>
<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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

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

View File

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

View File

@ -156,6 +156,26 @@ export default {
handler: this.reopenSignal, handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL 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: '进路引导', label: '进路引导',
handler: this.guide, handler: this.guide,

View File

@ -1143,7 +1143,7 @@ export const asyncRouter = [
path: '/editor', path: '/editor',
component: Layout, component: Layout,
meta: { meta: {
i18n: 'router.newDesignEditor', i18n: 'router.fileManage',
roles: [admin, user] roles: [admin, user]
}, },
children: [ children: [
@ -1162,24 +1162,14 @@ export const asyncRouter = [
} }
}, },
{ {
path: '', path: 'draft',
component: Ueditor, component: Ueditor,
meta: { meta: {
i18n: 'router.newDesignEditor' i18n: 'router.newDesignEditor'
} }
} },
]
},
{
path: '/uploading',
component: Layout,
meta: {
i18n: 'router.uploadPdf',
roles: [admin, user]
},
children: [
{ {
path: 'list', path: 'uploading/list',
component: UploadPdfList, component: UploadPdfList,
meta: { meta: {
i18n: 'router.uploadPdf' 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', path: '/design',
component: Layout, component: Layout,

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪 // 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.8.114:9000'; // 旭强 无线
// BASE_API = 'http://192.168.3.120:9000'; // 张赛 // BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://192.168.8.140:9000'; // 杜康

View File

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

View File

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

View File

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

View File

@ -119,6 +119,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() }; const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
creatSubscribe(getTopic('STATE', this.$route.query.group), header);
await this.$store.dispatch('training/setHasSubscribed'); await this.$store.dispatch('training/setHasSubscribed');
}, },
async subscribeNew() { async subscribeNew() {
@ -136,6 +137,7 @@ export default {
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.groupModel}`); clearSubscribe(`${displayTopic}\/${this.groupModel}`);
clearSubscribe(getTopic('STATE', this.$route.query.group));
}, },
setCenter(code) { setCenter(code) {
this.$refs.mapCommon && this.$refs.mapCommon.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> <template>
<div style="height: 100%; border: 1px solid #EBEEF5; position: relative; left: 8%; width: 88%"> <div style="height: 100%; position: relative; left: 8%; width: 88%">
<el-form ref="form" :model="addModel" label-width="150px" size="mini" style="margin-top: 10px"> <el-form ref="form" :model="addModel" :rules="rules" label-width="150px" size="mini" style="margin-top: 10px">
<div class="definition"> <el-form-item label="延续保护名称:" prop="name">
<el-form-item label="延续保护解锁区段:" prop="unlockSectionCode"> <el-input v-model="addModel.name" />
<el-select v-model="addModel.unlockSectionCode" clearable :disabled="true"> </el-form-item>
<el-option <el-form-item label="方向:" prop="right">
v-for="item in sectionList" <el-radio-group v-model="addModel.right">
:key="item.code" <el-radio :label="true">向右</el-radio>
:label="item.name + ' (' + item.code+ ')'" <el-radio :label="false">向左</el-radio>
:value="item.code" </el-radio-group>
/> </el-form-item>
</el-select> <el-form-item label="延续保护解锁区段:" prop="unlockSectionCode">
</el-form-item> <el-select v-model="addModel.unlockSectionCode" clearable>
<el-form-item label="延续保护解锁时间(s):" prop="unlockTime"> <el-option
<el-input-number v-model="addModel.unlockTime" :min="0" /> v-for="item in sectionList"
</el-form-item> :key="item.code"
<el-form-item label="延续保护线路:" prop="relSectionSwitchList"> :label="item.name + ' (' + item.code+ ')'"
<el-table :data="addModel.relSectionSwitchList" border style="width: 80%"> :value="item.code"
<el-table-column type="index" label="序号" width="100" /> />
<el-table-column fixed="right" :label="$t('map.operation')"> </el-select>
<template slot-scope="scope"> </el-form-item>
<el-button <el-form-item label="延续保护解锁时间(s):" prop="unlockTime">
type="text" <el-input-number v-model="addModel.unlockTime" :min="0" />
size="small" </el-form-item>
@click.native.prevent="deleteOverlab(addModel.relSectionSwitchList, scope.$index)" <el-form-item label="延续保护线路:" prop="pathList">
> <el-table :data="addModel.pathList" border style="width: 80%">
移出 <el-table-column type="index" label="序号" width="100" />
</el-button> <el-table-column fixed="right" :label="$t('map.operation')">
<el-button <template slot-scope="scope">
type="text" <el-button
size="small" type="text"
@click.native.prevent="editOverlab(addModel.relSectionSwitchList, scope.$index)" size="small"
> @click.native.prevent="deleteOverlab(addModel.pathList, scope.$index)"
编辑 >
</el-button> 移出
</template> </el-button>
</el-table-column> <el-button
</el-table> type="text"
</el-form-item> size="small"
</div> @click.native.prevent="editOverlab(addModel.pathList, scope.$index)"
>
编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form> </el-form>
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
@ -51,8 +58,8 @@
</div> </div>
<div> <div>
<el-form ref="overlabForm" :model="addOverlapModel" :rules="overLapRules" label-width="135px" size="mini" style="margin-top: 15px"> <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-form-item :label="$t('map.routeProtectsData') + ':'" prop="sectionList">
<el-select v-model="addOverlapModel.routeOverlapSectionList" multiple clearable :filterable="true"> <el-select v-model="addOverlapModel.sectionList" multiple clearable :filterable="true">
<el-option <el-option
v-for="item in sectionList" v-for="item in sectionList"
:key="item.code" :key="item.code"
@ -65,7 +72,7 @@
@click="hover('routeOverlapSectionList')" @click="hover('routeOverlapSectionList')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </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-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option <el-option
v-for="item in switchList" v-for="item in switchList"
@ -75,12 +82,12 @@
/> />
</el-select> </el-select>
<el-button <el-button
:type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'" :type=" field === 'switchPositionList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSwitchList')" @click="hover('switchPositionList')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
<el-button <el-button
type="primary" 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') }} >{{ $t('map.add') }}
</el-button> </el-button>
<el-select v-model="overlapType" :filterable="true" :placeholder="$t('map.pleaseSelect')"> <el-select v-model="overlapType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
@ -91,7 +98,7 @@
:value="item.code" :value="item.code"
/> />
</el-select> </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"> <el-table-column prop="switchCode" :label="$t('map.switchId')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span> <span>{{ swictchName(scope.row.switchCode) }}</span>
@ -103,7 +110,7 @@
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.prevent="deleteSwitch(addOverlapModel.routeOverlapSwitchList, scope.$index)" @click.native.prevent="deleteSwitch(addOverlapModel.switchPositionList, scope.$index)"
> >
{{ $t('map.remove') }} {{ $t('map.remove') }}
</el-button> </el-button>
@ -118,8 +125,8 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid'; // import { setUID } from '@/jmapNew/utils/Uid';
import { postContinueProtect, putContinueProtect, delContinueProtect } from '@/api/jmap/mapdraft'; // import { postContinueProtect, putContinueProtect, delContinueProtect } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic'; import { ViewMode } from '@/scripts/ConstDic';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
@ -155,15 +162,17 @@ export default {
addModel: { addModel: {
id: '', id: '',
code: '', code: '',
name: '',
right: '',
mapId: '', mapId: '',
unlockSectionCode:'', unlockSectionCode:'',
unlockTime: 0, unlockTime: 0,
relSectionSwitchList: [] pathList: []
}, },
addOverlapModel: { addOverlapModel: {
parentIndex: '', parentIndex: '',
routeOverlapSectionList: [], // sectionList: [], //
routeOverlapSwitchList: [] // switchPositionList: [] //
}, },
overlapType: '', overlapType: '',
SwitchLocateTypeList: [ SwitchLocateTypeList: [
@ -192,7 +201,15 @@ export default {
} }
}, },
newRouteOverlapSectionList() { 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: { watch: {
@ -202,13 +219,15 @@ export default {
} }
}, },
protectData(val, old) { protectData(val, old) {
console.log(val, 'val');
if (val) { if (val) {
this.addModel = val; this.addModel = val;
this.addModel.relSectionSwitchList && this.addModel.relSectionSwitchList.forEach(item => { this.addModel.pathList && this.addModel.pathList.forEach(item => {
item.routeOverlapSwitchList.length && item.routeOverlapSwitchList.forEach( ele => { item.switchPositionList.length && item.switchPositionList.forEach( ele => {
ele.switchType = ele.normal ? '定位' : '反位'; ele.switchType = ele.normal ? '定位' : '反位';
}); });
}); });
this.clearOverlab();
this.editShow = true; this.editShow = true;
} }
}, },
@ -232,9 +251,6 @@ export default {
methods: { methods: {
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
if (this.field) {
this.$emit('clearHover');
}
}, },
pushSwitch(list, data) { pushSwitch(list, data) {
const index = list.findIndex(elem => { return elem.switchCode == data.switchCode; }); const index = list.findIndex(elem => { return elem.switchCode == data.switchCode; });
@ -260,71 +276,69 @@ export default {
setSelected(selected) { setSelected(selected) {
if (selected) { if (selected) {
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSectionList'.toUpperCase()) { 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) { 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 ) { } 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; this.overlapCode = selected.code;
} }
} }
}, },
buildModel(code) { // buildModel(code) {
const model = Object.assign({}, this.addModel); // const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; } // if (code) { model['code'] = code; }
model['mapId'] = this.$route.params.mapId; // model['mapId'] = this.$route.params.mapId;
return model; // return model;
}, // },
save() { // update() {
this.createProtect('saveProtectSuccess'); // if (this.addModel.code && this.addModel.unlockSectionCode && this.addModel.pathList.length && this.addModel.unlockTime) {
}, // const model = this.buildModel();
update() { // putContinueProtect(model).then(resp => {
if (this.addModel.code && this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length && this.addModel.unlockTime) { // this.$emit('updateProtectSuccess', model.code);
const model = this.buildModel(); // }).catch(() => {
putContinueProtect(model).then(resp => { // this.$messageBox('');
this.$emit('updateProtectSuccess', model.code); // });
}).catch(() => { // } else if (this.addModel.code && !this.addModel.pathList.length) {
this.$messageBox('更新延续保护失败!'); // delContinueProtect(this.addModel.id).then(resp => {
}); // this.$emit('updateProtectSuccess', '');
} else if (this.addModel.code && !this.addModel.relSectionSwitchList.length) { // });
delContinueProtect(this.addModel.id).then(resp => { // } else if (this.addModel.code && !this.addModel.unlockSectionCode) {
this.$emit('updateProtectSuccess', ''); // this.$messageBox('线');
}); // } else if (this.addModel.code && this.addModel.unlockTime) {
} else if (this.addModel.code && !this.addModel.unlockSectionCode) { // this.$messageBox('线');
this.$messageBox('请填写延续保护解锁区段或清除延续保护线路相关数据!'); // } else {
} else if (this.addModel.code && this.addModel.unlockTime) { // this.createProtect('updateProtectSuccess');
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'));
createProtect(parentFunction) { // postContinueProtect(model).then(resp => {
if (this.addModel.unlockSectionCode && this.addModel.relSectionSwitchList.length && this.addModel.unlockTime) { // this.$emit(parentFunction, model.code);
const model = this.buildModel(setUID('Protect')); // }).catch(() => {
postContinueProtect(model).then(resp => { // this.$messageBox('');
this.$emit(parentFunction, model.code); // });
}).catch(() => { // } else if (!this.addModel.pathList.length) {
this.$messageBox('创建延续保护失败!'); // this.$emit(parentFunction, '');
}); // } else {
} else if (!this.addModel.relSectionSwitchList.length) { // if (!this.addModel.unlockSectionCode) {
this.$emit(parentFunction, ''); // this.$messageBox('线');
} else { // } else if (!this.addModel.unlockTime.length) {
if (!this.addModel.unlockSectionCode) { // this.$messageBox('线');
this.$messageBox('请填写延续保护解锁区段或清除延续保护线路相关数据!'); // }
} else if (!this.addModel.unlockTime.length) { // }
this.$messageBox('请填写延续保护解锁时间或清除延续保护线路相关数据!'); // },
}
}
},
clear() { clear() {
if (this.$refs && this.$refs.form) { if (this.$refs && this.$refs.form) {
delete this.addModel.id;
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.addModel.mapId = this.$route.params.mapId; this.addModel.mapId = '';
this.addModel.relSectionSwitchList = []; this.addModel.pathList = [];
this.addModel.code = ''; this.addModel.code = '';
this.addModel.name = '';
this.addModel.right = '';
this.addModel.unlockTime = 0; this.addModel.unlockTime = 0;
this.addModel.unlockSectionCode = ''; this.addModel.unlockSectionCode = '';
this.addModel.id = ''; this.addModel.id = '';
@ -346,9 +360,9 @@ export default {
}, },
updateOverlab() { updateOverlab() {
if (this.addOverlapModel.parentIndex || this.addOverlapModel.parentIndex === 0 ) { if (this.addOverlapModel.parentIndex || this.addOverlapModel.parentIndex === 0 ) {
this.addModel.relSectionSwitchList[this.addOverlapModel.parentIndex] = { this.addModel.pathList[this.addOverlapModel.parentIndex] = {
routeOverlapSectionList:this.addOverlapModel.routeOverlapSectionList, sectionList:this.addOverlapModel.sectionList,
routeOverlapSwitchList:this.addOverlapModel.routeOverlapSwitchList switchPositionList:this.addOverlapModel.switchPositionList
}; };
this.clearOverlab(); this.clearOverlab();
this.cardMode = 'generate'; this.cardMode = 'generate';
@ -359,12 +373,12 @@ export default {
this.cardMode = 'generate'; this.cardMode = 'generate';
}, },
generateOverlab() { generateOverlab() {
if (!this.addOverlapModel.routeOverlapSectionList.length) { if (!this.addOverlapModel.sectionList.length) {
this.$messageBox('请选择进路延续保护区段!'); this.$messageBox('请选择进路延续保护区段!');
} else { } else {
this.addModel.relSectionSwitchList.push({ this.addModel.pathList.push({
routeOverlapSectionList:this.addOverlapModel.routeOverlapSectionList, sectionList:this.addOverlapModel.sectionList,
routeOverlapSwitchList:this.addOverlapModel.routeOverlapSwitchList switchPositionList:this.addOverlapModel.switchPositionList
}); });
this.$refs.overlabForm.resetFields(); this.$refs.overlabForm.resetFields();
this.clearOverlab(); this.clearOverlab();
@ -373,8 +387,8 @@ export default {
clearOverlab() { clearOverlab() {
this.addOverlapModel = { this.addOverlapModel = {
parentIndex: '', parentIndex: '',
routeOverlapSectionList:[], sectionList:[],
routeOverlapSwitchList:[] switchPositionList:[]
}; };
this.overlapCode = ''; this.overlapCode = '';
this.overlapType = ''; this.overlapType = '';
@ -392,8 +406,12 @@ export default {
} }
}); });
}, },
batchSectionListFocus(flag) { validate(cb) {
this.changeSectionSelected(this.addOverlapModel.routeOverlapSectionList, flag, 'continueProtectSection'); this.$refs.form.validate((valid) => {
if (valid) {
cb(this.addModel);
}
});
} }
} }
}; };
@ -417,10 +435,10 @@ export default {
} }
.el-card__header{ .el-card__header{
border-bottom: 1px solid #EBEEF5; border-bottom: 1px solid #EBEEF5;
border-top: 1px solid #EBEEF5; border-top: 0 solid #EBEEF5;
} }
.el-card{ .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 FlankProtectOperate from './flankProtectOperate/index';
import DwellTimeOperate from './dwellTimeOperate/index'; import DwellTimeOperate from './dwellTimeOperate/index';
import DestinationOperate from './destinationOperate/index'; import DestinationOperate from './destinationOperate/index';
import ContinueProtectOperate from './continueProtectOperate/index';
export default { export default {
name: 'DataRelation', name: 'DataRelation',
@ -53,7 +54,8 @@ export default {
// PathOperate, // PathOperate,
SignalOperate, SignalOperate,
TurnedOperate, TurnedOperate,
DwellTimeOperate DwellTimeOperate,
ContinueProtectOperate
// DestinationOperate // DestinationOperate
}, },
props: { props: {
@ -100,10 +102,11 @@ export default {
} else { } else {
this.tabList = [ this.tabList = [
{label: this.$t('map.routeID'), name:'route', menus:RouteOperate}, {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:'turned', menus:TurnedOperate},
{label: '目的地码', name:'destination', menus:DestinationOperate}, {label: '目的地码', name:'destination', menus:DestinationOperate},
{label: this.$t('map.automaticSignal'), name:'automatic', menus:AutomaticOperate}, {label: this.$t('map.automaticSignal'), name:'automatic', menus:AutomaticOperate},
{label: this.$t('map.signalApprochSection'), name:'signal', menus:SignalOperate},
{label: '侧防', name:'flankProtect', menus:FlankProtectOperate}, {label: '侧防', name:'flankProtect', menus:FlankProtectOperate},
{label: this.$t('map.routing'), name:'routing', menus:RoutingOperate}, {label: this.$t('map.routing'), name:'routing', menus:RoutingOperate},
{label: '停站时间', name:'dwellTime', menus:DwellTimeOperate}, {label: '停站时间', name:'dwellTime', menus:DwellTimeOperate},

View File

@ -10,7 +10,7 @@
/> />
</div> </div>
<pre-view-field ref="previewField" :map-info="mapInfo" /> <pre-view-field ref="previewField" :map-info="mapInfo" />
<protect-detail ref="protectDetail" :map-info="mapInfo" /> <!-- <protect-detail ref="protectDetail" :map-info="mapInfo" /> -->
</el-dialog> </el-dialog>
<related ref="related" :map-info="mapInfo" /> <related ref="related" :map-info="mapInfo" />
</div> </div>
@ -18,8 +18,8 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { listMap, getRouteNewList, delRouteNew, getRouteNewById, putRouteNew, getContinueProtectList, delContinueProtect, putSetDraftMapRouteById } from '@/api/jmap/mapdraft'; import { listMap, getRouteNewList, delRouteNew, putRouteNew, putSetDraftMapRouteById, getOverlapAllList } from '@/api/jmap/mapdraft';
import ProtectDetail from './protectDetail'; // import ProtectDetail from './protectDetail';
import PreViewField from './preview'; import PreViewField from './preview';
import Related from './related'; import Related from './related';
@ -27,7 +27,7 @@ export default {
name: 'RouteDetail', name: 'RouteDetail',
components: { components: {
PreViewField, PreViewField,
ProtectDetail, // ProtectDetail,
Related Related
}, },
props: { props: {
@ -48,6 +48,7 @@ export default {
RouteAutoTypeList: [], RouteAutoTypeList: [],
SwitchLocateTypeList: [], SwitchLocateTypeList: [],
ContinueProtectList: [], ContinueProtectList: [],
overlapList: [], //
turnBackList: [ turnBackList: [
{ label: '是', value: true }, { label: '是', value: true },
{ label: '否', value: false } { label: '否', value: false }
@ -89,8 +90,19 @@ export default {
} }
} }
} }
}, }
queryList: { };
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
]),
queryList() {
return {
query: this.queryFunction, query: this.queryFunction,
afterQuery: this.afterQuery, afterQuery: this.afterQuery,
selectCheckShow: false, selectCheckShow: false,
@ -169,57 +181,13 @@ export default {
title: this.$t('map.endingSignalName'), title: this.$t('map.endingSignalName'),
prop: 'endSignalCode' prop: 'endSignalCode'
}, },
// { {
// type: 'button', title: '延续保护',
// title: this.$t('map.continueProtect'), prop: 'overlapCode',
// buttons: [ type: 'select',
// { options: this.overlapList,
// name: this.$t('map.preview'), width: 190
// 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 ''; }
// },
{ {
type: 'button', type: 'button',
title: this.$t('map.operation'), title: this.$t('map.operation'),
@ -230,12 +198,6 @@ export default {
handleClick: this.edit, handleClick: this.edit,
showControl: () => { return this.showType !== 'select'; } showControl: () => { return this.showType !== 'select'; }
}, },
// {
// name: '',
// handleClick: this.copyObj,
// type: 'warning',
// showControl: () => { return this.showType !== 'select'; }
// },
{ {
name: this.$t('map.deleteObj'), name: this.$t('map.deleteObj'),
handleClick: this.deleteObj, handleClick: this.deleteObj,
@ -255,17 +217,8 @@ export default {
] ]
} }
] ]
} };
}; }
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
])
}, },
watch: { watch: {
signalList: function (val, old) { signalList: function (val, old) {
@ -303,6 +256,7 @@ export default {
this.SwitchLocateTypeList = list; this.SwitchLocateTypeList = list;
}); });
this.acquireMapList(); this.acquireMapList();
this.initProtectData();
}, },
methods: { methods: {
doShow(showType, codeType) { doShow(showType, codeType) {
@ -316,6 +270,11 @@ export default {
doClose() { doClose() {
this.show = false; this.show = false;
}, },
initProtectData() {
getOverlapAllList(this.$route.params.mapId).then(resp => {
this.overlapList = resp.data;
});
},
queryFunction(params) { queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) { if (this.mapInfo && this.mapInfo.id) {
return getRouteNewList(this.mapInfo.id, params); return getRouteNewList(this.mapInfo.id, params);
@ -343,107 +302,6 @@ export default {
} }
return data; 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) { handleUpdate(index, row) {
putSetDraftMapRouteById(this.$route.params.mapId, row).then(res => { putSetDraftMapRouteById(this.$route.params.mapId, row).then(res => {
this.$message.success('更新成功'); this.$message.success('更新成功');
@ -460,36 +318,12 @@ export default {
}); });
}, },
edit(index, row) { edit(index, row) {
// this.mapList.forEach(elem => { // getRouteNewById(row.mapId).then(response => {
// if (elem.name === row.mapId) { // const data = response.data;
// const model = { this.$emit('routeSelected', row);
// mapId: elem.id, this.doClose();
// id: row.id
// };
getRouteNewById(row.mapId).then(response => {
const data = response.data;
this.$emit('routeSelected', data);
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) { deleteObj(index, row) {
if (row) { if (row) {
this.$confirm('是否确认删除?', '提示', { this.$confirm('是否确认删除?', '提示', {
@ -498,18 +332,6 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delRouteNew(this.$route.params.mapId, row.code).then(response => { 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(); this.reloadTable();
}).catch(() => { }).catch(() => {
this.$messageBox('删除失败'); this.$messageBox('删除失败');

View File

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

View File

@ -1,5 +1,5 @@
<template> <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> <div>
<QueryListPage <QueryListPage
ref="queryListPage" ref="queryListPage"
@ -14,7 +14,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft'; import { listMap } from '@/api/jmap/mapdraft';
import { getApproachSectionList, deleteApproachSection, getApproachSectionDetail } from '@/api/jmap/mapdraft'; import { getApproachSectionList, deleteApproachSection } from '@/api/jmap/mapdraft';
export default { export default {
name: 'RouteDetail', name: 'RouteDetail',
@ -55,30 +55,40 @@ export default {
{ {
title: this.$t('map.signalCodeName'), title: this.$t('map.signalCodeName'),
prop: 'signalCode', 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', type: 'tag',
width: '80', columnValue: (row) => { return this.$convertField(row.signalCode, this.signalList, ['code', 'name']); },
columnValue: (row) => { return row.releaseTime; },
tagType: (row) => { return ''; } 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', type: 'button',
title: this.$t('map.operation'), title: this.$t('map.operation'),
@ -147,27 +157,12 @@ export default {
this.mapList = response.data; 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) { editObj(index, row) {
getApproachSectionDetail(row.id).then(response => { // getApproachSectionDetail(row.id).then(response => {
const data = response.data; // const data = response.data;
this.$emit('autoMaticoSelected', data); this.$emit('autoMaticoSelected', row);
this.doClose(); this.doClose();
}); // });
}, },
deleteObj(index, row) { deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && 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 :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">{{ $t('map.activate') }}
</el-button> </el-button>
</el-form-item> </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-form-item label="进路解锁时间:" prop="releaseTime">
<el-input-number v-model="addModel.releaseTime" /> <el-input-number v-model="addModel.releaseTime" />
</el-form-item> </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-form-item>
<el-button-group> <el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }} <el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
@ -64,7 +131,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid'; 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 { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/jmapNew/theme/parser/util'; import { formatName } from '@/jmapNew/theme/parser/util';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
@ -98,38 +165,50 @@ export default {
isSave: true, isSave: true,
loading: false, loading: false,
editModel: {}, editModel: {},
overlapCode: '',
overlapType: '',
cardMode: 'generate',
addModel: { addModel: {
id: '', id: '',
code: '', code: '',
mapId: '', mapId: '',
signalCode: '', signalCode: '',
routeSectionList: [], releaseTime: 0,
blockSectionList: [], sectionPathList: []
releaseTime: 0 },
addOverlapModel: {
parentIndex: '',
sectionList: [], //
switchPositionList: [] //
}, },
rules: { rules: {
signalCode: [ signalCode: [
{ required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' } { 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: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'signalList', 'signalList',
'switchList',
'sectionList' 'sectionList'
]), ]),
newRouteSectionList() { cardTitle() {
return JSON.stringify(this.addModel.routeSectionList); if (this.cardMode === 'generate') {
}, return '生成信号机接近区段';
newBlockSectionList() { } else if (this.cardMode === 'edit') {
return JSON.stringify(this.addModel.blockSectionList); return '编辑信号机接近区段';
} else {
return '';
}
} }
}, },
watch: { watch: {
@ -141,41 +220,20 @@ export default {
routeData(val, old) { routeData(val, old) {
if (val) { if (val) {
this.addModel = deepAssign(this.addModel, 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) { 'addModel.signalCode': function (val, old) {
if (old) { if (old) {
this.changeSignalSelected(old, false, 'routeSignal'); this.changeSignalSelected(old, false, 'routeSignal');
} }
if (val) { if (val) {
this.changeSignalSelected(val, true, 'routeSignal'); this.changeSignalSelected(val, true, 'routeSignal');
this.changeSignal(val);
} }
} }
}, },
@ -189,44 +247,40 @@ export default {
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
changeSignal(val) { pushSwitch(list, data) {
if (val && this.mapInfo && this.mapInfo.id) { const index = list.findIndex(elem => { return elem.switchCode == data.switchCode; });
const params = { if (index < 0) {
signalCode : val, list.push(data);
pageSize: 10, } else {
pageNum: 1 this.$messageBox(this.$t('tip.routeSameID'));
};
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);
});
} }
}, },
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) { setSelected(selected) {
if (selected) { if (selected) {
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'signalCode'.toUpperCase()) { if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'signalCode'.toUpperCase()) {
this.addModel.signalCode = selected.code; this.addModel.signalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeSectionList'.toUpperCase()) { } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSectionList'.toUpperCase()) {
if ((selected.type === '01' || selected.type === '03' || selected.type === '02') && this.addModel.routeSectionList.indexOf(selected.code) === -1) { const sectionIndex = this.addOverlapModel.sectionList.indexOf(selected.code);
this.addModel.routeSectionList.push(selected.code); if ((selected.type === '01' || selected.type === '03' || selected.type === '02') && sectionIndex === -1) {
} this.addOverlapModel.sectionList.push(selected.code);
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'blockSectionList'.toUpperCase()) { } else if ( sectionIndex !== -1 ) {
if ((selected.type === '01' || selected.type === '03') && this.addModel.blockSectionList.indexOf(selected.code) === -1) { this.addOverlapModel.sectionList.splice(sectionIndex, 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() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchPositionList'.toUpperCase()) {
this.overlapCode = selected.code;
} }
} }
}, },
@ -255,7 +309,8 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.loading = true; 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.$message.success(this.$t('map.signalSectionUpdateSucceeded'));
this.loading = false; this.loading = false;
this.clear(); this.clear();
@ -271,56 +326,65 @@ export default {
delete this.addModel.id; delete this.addModel.id;
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id; this.addModel.mapId = this.mapInfo.id;
this.addModel.routeSectionList = [];
this.addModel.blockSectionList = [];
this.addModel.signalCode = ''; this.addModel.signalCode = '';
this.addModel.sectionPathList = [];
this.addModel.code = ''; this.addModel.code = '';
this.isSave = true; 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) { batchSectionListFocus(flag) {
this.changeSectionSelected(this.addModel.routeSectionList, flag);
this.changeSectionSelected(this.addModel.blockSectionList, flag);
this.changeSignalSelected(this.addModel.signalCode, flag, 'routeSignal'); this.changeSignalSelected(this.addModel.signalCode, flag, 'routeSignal');
}, },
changeSignalSelected(val, flag, type) { changeSignalSelected(val, flag, type) {
const signal = this.$store.getters['map/getDeviceByCode'](val); const signal = this.$store.getters['map/getDeviceByCode'](val);
signal && signal.instance.drawBatchSelected(flag, flag ? type : ''); 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', type: 'text',
label: this.$t('system.name') label: this.$t('system.name')
}, },
id: {
type: 'text',
label: 'id'
},
roles: { roles: {
type: 'select', type: 'select',
label: this.$t('system.roles'), label: this.$t('system.roles'),
@ -71,6 +75,11 @@ export default {
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{
title: 'id',
prop: 'id',
width: 80
},
{ {
title: this.$t('system.name'), title: this.$t('system.name'),
prop: 'name' prop: 'name'