Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
This commit is contained in:
commit
eec32fea2a
@ -401,3 +401,71 @@ export function getContinueProtectList(mapId, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
// 自动折返相关接口 创建,修改,删除,根据id查询,
|
||||
export function postAutoReentry(data) {
|
||||
return request({
|
||||
url: `/api/mapBuild/autoReentry`,
|
||||
method: 'post',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
export function putAutoReentry(data) {
|
||||
return request({
|
||||
url: `/api/mapBuild/autoReentry/${data.id}`,
|
||||
method: 'put',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
export function delAutoReentry(id) {
|
||||
return request({
|
||||
url: `/api/mapBuild/autoReentry/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
export function getAutoReentryById(id) {
|
||||
return request({
|
||||
url: `/api/mapBuild/autoReentry/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
export function getAutoReentryList(mapId, params) {
|
||||
return request({
|
||||
url: `/api/mapBuild/${mapId}/autoReentry/paging`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 新版地图进路相关接口 创建,修改,删除,根据id查询,
|
||||
export function postRouteNew(data) {
|
||||
return request({
|
||||
url: `/api/mapBuild/routeNew`,
|
||||
method: 'post',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
export function putRouteNew(data) {
|
||||
return request({
|
||||
url: `/api/mapBuild/routeNew/${data.id}`,
|
||||
method: 'put',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
export function delRouteNew(id) {
|
||||
return request({
|
||||
url: `/api/mapBuild/routeNew/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
export function getRouteNewById(id) {
|
||||
return request({
|
||||
url: `/api/mapBuild/routeNew/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
export function getRouteNewList(mapId, params) {
|
||||
return request({
|
||||
url: `/api/mapBuild/${mapId}/routeNew`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ export default class Line2 extends Group {
|
||||
z: this.z,
|
||||
style: style,
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
y: model.position.y - (model.height / 2),
|
||||
width: model.width || style.StationStand.safetyDoor.width,
|
||||
height: model.height || style.StationStand.safetyDoor.height,
|
||||
show: model.hasDoor
|
||||
|
@ -33,9 +33,9 @@ class StationStand extends Group {
|
||||
const drict = 1;
|
||||
|
||||
/** 列车站台*/
|
||||
const standH = drict > 0 ? style.StationStand.safetyDoor.height : model.height;
|
||||
// const standH = drict > 0 ? style.StationStand.safetyDoor.height : model.height;
|
||||
const standX = model.position.x - model.width / 2;
|
||||
const standY = model.position.y + drict * (style.StationStand.safetyDoor.distance + standH);
|
||||
const standY = model.position.y - model.height / 2;
|
||||
this.safeStand = new ESafeStand({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -47,7 +47,7 @@ class StationStand extends Group {
|
||||
});
|
||||
this.add(this.safeStand);
|
||||
|
||||
if (model.direction != '03') {
|
||||
// if (model.direction != '03') {
|
||||
// /** 屏蔽门*/
|
||||
// this.safeDoor = new ESafeDoor({
|
||||
// zlevel: this.zlevel,
|
||||
@ -164,7 +164,7 @@ class StationStand extends Group {
|
||||
this.add(this.reentry);
|
||||
this.add(this.time);
|
||||
this.add(this.level);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
|
@ -8,7 +8,17 @@ export function getUID(type, list) {
|
||||
// if (list && list.length) {
|
||||
let name = '';
|
||||
if (type == 'T') {
|
||||
name = list.length ? Number(list[list.length - 1].code.replace('T', '')) + 1 : list.length + 1;
|
||||
if (list.length) {
|
||||
const str = list[list.length - 1].code.substr(0, 1);
|
||||
if (str == 'T') {
|
||||
name = Number(list[list.length - 1].code.replace('T', '')) + 1;
|
||||
} else {
|
||||
name = 1;
|
||||
}
|
||||
} else {
|
||||
name = list.length + 1;
|
||||
}
|
||||
// name = list.length ? Number(list[list.length - 1].code.replace('T', '')) + 1 : list.length + 1;
|
||||
} else {
|
||||
name = Math.floor((Math.random() * 100000) + 1);
|
||||
}
|
||||
|
@ -3,11 +3,11 @@ 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.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<template v-if="basicInfo">
|
||||
<el-form ref="edit" label-position="right" :model="editModel" :rules="editRules" label-width="120px" size="mini" @submit.native.prevent>
|
||||
<el-form-item :label="$t('map.lineCode')" prop="lineCode">
|
||||
<el-select v-model="editModel.lineCode" :placeholder="$t('map.pleaseSelect')" size="mini" disabled>
|
||||
<el-select v-model="editModel.lineCode" :placeholder="$t('map.pleaseSelect')" size="mini">
|
||||
<el-option
|
||||
v-for="item in lineCodeList"
|
||||
:key="item.code"
|
||||
|
@ -13,14 +13,6 @@
|
||||
<el-button type="text" class="mapEdit_box" @click="showMap">{{ $t('map.viewLayer') }}</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="enabledTab" type="card" class="map_card" @tab-click="changePane">
|
||||
<el-tab-pane :label="$t('map.continueProtect')" class="tab_pane_box" name="protect">
|
||||
<protect-operate
|
||||
ref="protectOperate"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.routeID')" class="tab_pane_box" name="route">
|
||||
<route-operate
|
||||
ref="routeOperate"
|
||||
@ -29,7 +21,15 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="折返" class="tab_pane_box" name="turned">
|
||||
<el-tab-pane :label="$t('map.continueProtect')" class="tab_pane_box" name="protect">
|
||||
<protect-operate
|
||||
ref="protectOperate"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="自动折返" class="tab_pane_box" name="turned">
|
||||
<turned-operate
|
||||
ref="trunedOperate"
|
||||
:map-info="mapInfo"
|
||||
@ -138,6 +138,9 @@ export default {
|
||||
case 'path':
|
||||
this.$refs.pathOperate.createRouteEvent();
|
||||
break;
|
||||
case 'turned':
|
||||
this.$refs.trunedOperate.createRouteEvent();
|
||||
break;
|
||||
}
|
||||
},
|
||||
previewRouteEvent() {
|
||||
@ -160,6 +163,9 @@ export default {
|
||||
case 'path':
|
||||
this.$refs.pathOperate.previewRouteEvent();
|
||||
break;
|
||||
case 'turned':
|
||||
this.$refs.trunedOperate.previewRouteEvent();
|
||||
break;
|
||||
}
|
||||
},
|
||||
changePane(data) {
|
||||
@ -185,6 +191,9 @@ export default {
|
||||
case 'path':
|
||||
this.$refs.pathOperate.setSelected(selected);
|
||||
break;
|
||||
case 'turned':
|
||||
this.$refs.trunedOperate.setSelected(selected);
|
||||
break;
|
||||
}
|
||||
},
|
||||
setCenter(code) {
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { listMap } from '@/api/jmap/mapdraft';
|
||||
import { getContinueProtectList, delContinueProtect, getContinueProtectById } from '@/api/jmap/mapdraft';
|
||||
|
||||
export default {
|
||||
@ -150,7 +149,7 @@ export default {
|
||||
}
|
||||
},
|
||||
selectedObj(index, row) {
|
||||
this.$emit('setOverlapCode', row.code);
|
||||
this.$emit('setOverlapCode', row);
|
||||
this.show = false;
|
||||
}
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ export default {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
postContinueProtect(this.buildModel(getUID('protect'))).then(resp => {
|
||||
postContinueProtect(this.buildModel(getUID('Protect'))).then(resp => {
|
||||
this.$message.success('创建延续保护成功!');
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { listMap, listRouteRoute, deleteRouteRoute, queryRouteRouteDetail, updateRouteRoute } from '@/api/jmap/mapdraft'; /** listRouteMapRoute*/
|
||||
import { listMap, getRouteNewList, delRouteNew, getRouteNewById, putRouteNew, getContinueProtectList } from '@/api/jmap/mapdraft'; /** listRouteMapRoute*/
|
||||
import PreViewField from './preview';
|
||||
|
||||
export default {
|
||||
@ -33,10 +33,13 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
showType: '',
|
||||
codeType: '',
|
||||
mapList: [],
|
||||
RouteNatureTypeList: [],
|
||||
RouteAutoTypeList: [],
|
||||
SwitchLocateTypeList: [],
|
||||
ContinueProtectList: [],
|
||||
turnBackList: [
|
||||
{ label: '是', value: true },
|
||||
{ label: '否', value: false }
|
||||
@ -106,15 +109,19 @@ export default {
|
||||
prop: 'endSignalCode'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.continueProtectSwitchData'),
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.preview'),
|
||||
handleClick: this.overlapSwitchDetail
|
||||
}
|
||||
]
|
||||
title: '延续保护',
|
||||
prop: 'overlapCode'
|
||||
},
|
||||
// {
|
||||
// type: 'button',
|
||||
// title: this.$t('map.continueProtectSwitchData'),
|
||||
// buttons: [
|
||||
// {
|
||||
// name: this.$t('map.preview'),
|
||||
// handleClick: this.overlapSwitchDetail
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.accessSideTurnoutData'),
|
||||
@ -125,16 +132,16 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.routeProtectsData'),
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.preview'),
|
||||
handleClick: this.routeOverlap
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// type: 'button',
|
||||
// title: this.$t('map.routeProtectsData'),
|
||||
// buttons: [
|
||||
// {
|
||||
// name: this.$t('map.preview'),
|
||||
// handleClick: this.routeOverlap
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
|
||||
{
|
||||
type: 'button',
|
||||
@ -173,12 +180,19 @@ export default {
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.compile'),
|
||||
handleClick: this.edit
|
||||
handleClick: this.edit,
|
||||
showControl: () => { return this.showType !== 'select'; }
|
||||
},
|
||||
{
|
||||
name: this.$t('map.deleteObj'),
|
||||
handleClick: this.deleteObj,
|
||||
type: 'danger'
|
||||
type: 'danger',
|
||||
showControl: () => { return this.showType !== 'select'; }
|
||||
},
|
||||
{
|
||||
name: '选择',
|
||||
handleClick: this.selectedObj,
|
||||
showControl: () => { return this.showType === 'select'; }
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -228,20 +242,24 @@ export default {
|
||||
this.$Dictionary.switchLocateType().then(list => {
|
||||
this.SwitchLocateTypeList = list;
|
||||
});
|
||||
|
||||
this.getProtectList();
|
||||
this.acquireMapList();
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
doShow(showType, codeType) {
|
||||
this.show = true;
|
||||
this.reloadTable();
|
||||
if (showType && codeType) {
|
||||
this.showType = showType;
|
||||
this.codeType = codeType;
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.mapInfo && this.mapInfo.id) {
|
||||
return listRouteRoute(this.mapInfo.id, params);
|
||||
return getRouteNewList(this.mapInfo.id, params);
|
||||
}
|
||||
},
|
||||
acquireMapList() {
|
||||
@ -263,6 +281,7 @@ export default {
|
||||
that.$convertSpecifiedField(elem, that.signalList, 'code', 'uniqueName', ['startSignalCode', 'endSignalCode']);
|
||||
that.$convertSpecifiedField(elem, that.stationList, 'code', 'name', ['stationCode']);
|
||||
that.$convertSpecifiedField(elem, that.sectionList, 'code', 'name', ['nearSectionCode', 'autoTriggerSectionCode', 'turnBackSectionCode']);
|
||||
that.$convertSpecifiedField(elem, that.ContinueProtectList, 'code', 'name', ['overlapCode']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -397,7 +416,7 @@ export default {
|
||||
},
|
||||
// 保存
|
||||
saveRelated(row) {
|
||||
updateRouteRoute(row).then(response => {
|
||||
putRouteNew(row).then(response => {
|
||||
this.$message.success('更新成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('操作异常');
|
||||
@ -410,7 +429,7 @@ export default {
|
||||
mapId: elem.id,
|
||||
id: row.id
|
||||
};
|
||||
queryRouteRouteDetail(model).then(response => {
|
||||
getRouteNewById(model.id).then(response => {
|
||||
const data = response.data;
|
||||
this.$emit('routeSelected', data);
|
||||
this.doClose();
|
||||
@ -425,7 +444,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRouteRoute(row.id).then(response => {
|
||||
delRouteNew(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
@ -440,6 +459,16 @@ export default {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
selectedObj(index, row) {
|
||||
this.$emit('setRouteCode', row, this.codeType);
|
||||
this.show = false;
|
||||
},
|
||||
// 获取延续保护list
|
||||
getProtectList() {
|
||||
getContinueProtectList(this.$route.params.mapId, {pageSize:9999, pageNum:1}).then((resp) => {
|
||||
this.ContinueProtectList = resp.data.list;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -189,7 +189,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联延续保护区段:" prop="overlapCode">
|
||||
<el-input v-model="addModel.overlapCode" style="width: 178px" readonly="true" />
|
||||
<el-input v-model="overlapName" style="width: 178px" readonly="true" />
|
||||
<el-button type="primary" @click="selectedOverlapCode">选择</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.hostileApproachData') + ':'" prop="conflictingRouteList">
|
||||
@ -221,7 +221,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmap/utils/Uid';
|
||||
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
|
||||
import { postRouteNew, putRouteNew, getContinueProtectList } from '@/api/jmap/mapdraft';
|
||||
import ProtectDetail from '../protectoperate/detail';
|
||||
|
||||
export default {
|
||||
@ -282,7 +282,8 @@ export default {
|
||||
espList: [], // 站台紧急停车按钮数据
|
||||
overlapCode:'',
|
||||
conflictingRouteList: [] // 敌对进路
|
||||
}
|
||||
},
|
||||
overlapName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -341,7 +342,7 @@ export default {
|
||||
},
|
||||
routeData(val, old) {
|
||||
if (val) {
|
||||
this.addModel = val;
|
||||
this.handelContinueProtectCode(val);
|
||||
this.addModel.routeFlankProtectionList.forEach(item => {
|
||||
item.normal ? item.switchType = '定位' : item.switchType = '反位';
|
||||
});
|
||||
@ -375,8 +376,9 @@ export default {
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
},
|
||||
setOverlapCode(code) {
|
||||
this.addModel.overlapCode = code;
|
||||
setOverlapCode(data) {
|
||||
this.addModel.overlapCode = data.code;
|
||||
this.overlapName = data.name;
|
||||
},
|
||||
selectedOverlapCode() {
|
||||
this.$refs.routeDetail.doShow('select');
|
||||
@ -405,7 +407,7 @@ export default {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
createRouteRoute(this.buildModel(getUID('Route'))).then(response => {
|
||||
postRouteNew(this.buildModel(getUID('Route'))).then(response => {
|
||||
this.$message.success('创建成功');
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
@ -420,7 +422,7 @@ export default {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
updateRouteRoute(this.buildModel()).then(response => {
|
||||
putRouteNew(this.buildModel()).then(response => {
|
||||
this.$message.success(this.$t('map.updateSuccessfully'));
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
@ -438,6 +440,8 @@ export default {
|
||||
this.addModel.mapId = this.mapInfo.id;
|
||||
this.addModel.routeSwitchList = [];
|
||||
this.addModel.routeFlankProtectionList = [];
|
||||
this.overlapName = '';
|
||||
this.addModel.overlapCode = '';
|
||||
if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
this.addModel.stationCode = this.selected.code;
|
||||
}
|
||||
@ -466,6 +470,13 @@ export default {
|
||||
this.flankCode = selected.code;
|
||||
}
|
||||
}
|
||||
},
|
||||
async handelContinueProtectCode(val) {
|
||||
if (val.overlapCode) {
|
||||
const resp = await getContinueProtectList(this.$route.params.mapId, {pageSize:9999, pageNum:1, code:val.overlapCode});
|
||||
this.overlapName = resp.data.list.length ? resp.data.list[0].name : '';
|
||||
}
|
||||
this.addModel = val;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="$t('map.automaticSignalList')" :visible.sync="show" width="85%" :before-do-close="doClose">
|
||||
<el-dialog v-dialogDrag title="自动折返列表" :visible.sync="show" width="85%" :before-do-close="doClose">
|
||||
<div>
|
||||
<QueryListPage
|
||||
ref="queryListPage"
|
||||
@ -13,8 +13,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { listMap } from '@/api/jmap/mapdraft';
|
||||
import { getAutoSignalList, delAutoSignal, getAutoSignalDetail } from '@/api/jmap/mapdraft';
|
||||
import { getAutoReentryList, delAutoReentry, getAutoReentryById, getRouteNewList } from '@/api/jmap/mapdraft';
|
||||
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
@ -29,20 +28,17 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
routeList: [],
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
signalCode: {
|
||||
type: 'select',
|
||||
label: this.$t('map.signal'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '自动折返名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -53,29 +49,20 @@ export default {
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('map.signalCodeName'),
|
||||
prop: 'signalCode'
|
||||
title: '自动折返名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.interlockingBlocks'),
|
||||
prop: 'sectionList',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.sectionList, this.sectionList, ['code', 'name'], true); },
|
||||
tagType: (row) => { return ''; }
|
||||
title: '折返进路',
|
||||
prop: 'turnBackRouteCode'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.psdList'),
|
||||
prop: 'psdList',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.psdList, this.psdList, ['code', 'name'], true); },
|
||||
tagType: (row) => { return ''; }
|
||||
title: '基础进路',
|
||||
prop: 'basicRouteCode'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.espList'),
|
||||
prop: 'espList',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.espList, this.espList, ['code', 'name'], true); },
|
||||
tagType: (row) => { return ''; }
|
||||
title: '折返区段',
|
||||
prop: 'reentryTrackCode'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -99,79 +86,52 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'signalList',
|
||||
'espList',
|
||||
'psdList'
|
||||
'sectionList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
signalList: function (val, old) {
|
||||
const list = [];
|
||||
if (val && val.length) {
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
list.push({ label: val[i].uniqueName, value: val[i].code });
|
||||
}
|
||||
this.queryForm.queryObject.signalCode.config.data = list;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.acquireMapList();
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.show = true;
|
||||
this.getRouteList();
|
||||
this.reloadTable();
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
formatName(code) {
|
||||
let name = '';
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
name = device.uniqueName;
|
||||
}
|
||||
|
||||
return name;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.mapInfo && this.mapInfo.id) {
|
||||
return getAutoSignalList(this.mapInfo.id, params);
|
||||
return getAutoReentryList(this.mapInfo.id, params);
|
||||
}
|
||||
},
|
||||
acquireMapList() {
|
||||
// 地图名称列表
|
||||
listMap({ drawWay:'1'}).then(response => {
|
||||
this.mapList = response.data;
|
||||
});
|
||||
},
|
||||
afterQuery(data) {
|
||||
if (data && data.list) {
|
||||
const that = this;
|
||||
const list = data.list;
|
||||
if (list) {
|
||||
list.map(elem => {
|
||||
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
|
||||
elem.code = elem.signalCode;
|
||||
elem.signalCode = that.formatName(elem.signalCode);
|
||||
that.$convertSpecifiedField(elem, that.sectionList, 'code', 'name', ['reentryTrackCode']);
|
||||
that.$convertSpecifiedField(elem, that.routeList, 'code', 'name', ['turnBackRouteCode', 'basicRouteCode']);
|
||||
});
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
editObj(index, row) {
|
||||
getAutoSignalDetail(row.id).then(response => {
|
||||
getAutoReentryById(row.id).then(response => {
|
||||
const data = response.data;
|
||||
this.$emit('autoMaticoSelected', data);
|
||||
this.$emit('autoReentrySelected', data);
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
deleteObj(index, row) {
|
||||
if (this.mapInfo && this.mapInfo.id && row) {
|
||||
// 删除
|
||||
delAutoSignal(row.id).then(response => {
|
||||
delAutoReentry(row.id).then(response => {
|
||||
this.$message.success(this.$t('map.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
@ -183,6 +143,11 @@ export default {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
getRouteList() {
|
||||
getRouteNewList(this.$route.params.mapId, {pageSize:9999, pageNum:1}).then((resp) => {
|
||||
this.routeList = resp.data.list;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
/>
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" />
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @autoReentrySelected="autoReentrySelected" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -57,7 +57,7 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
autoMaticoSelected: function (data) {
|
||||
autoReentrySelected: function (data) {
|
||||
this.routeData = data;
|
||||
if (this.$refs && this.$refs.routeEdit) {
|
||||
this.$refs.routeEdit.isSave = false;
|
||||
|
@ -4,15 +4,29 @@
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini">
|
||||
<div class="definition">
|
||||
<el-form-item label="折返名称:" prop="name">
|
||||
<el-input v-model="addModel.name" />
|
||||
<el-input v-model="addModel.name" style="width: 178px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="折返进路" prop="turnBackRouteCode">
|
||||
<el-input v-model="addModel.turnBackRouteName" />
|
||||
<el-button type="primary">选择</el-button>
|
||||
<el-form-item label="折返进路:" prop="turnBackRouteName">
|
||||
<el-input v-model="addModel.turnBackRouteName" readonly="true" style="width: 178px" />
|
||||
<el-button type="primary" @click="selectedRoute('turnBackRoute')">选择</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="基础进路" prop="basicRouteCode">
|
||||
<el-input v-model="addModel.basicRouteName" />
|
||||
<el-button type="primary">选择</el-button>
|
||||
<el-form-item label="基础进路:" prop="basicRouteName">
|
||||
<el-input v-model="addModel.basicRouteName" readonly="true" style="width: 178px" />
|
||||
<el-button type="primary" @click="selectedRoute('basicRoute')">选择</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="折返区段:" prop="reentryTrackCode">
|
||||
<el-select v-model="addModel.reentryTrackCode">
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
:label="item.name + ' (' + item.code+ ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'reentryTrackCode' ? 'danger' : 'primary'"
|
||||
@click="hover('reentryTrackCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
@ -25,17 +39,23 @@
|
||||
</div>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @setRouteCode="setRouteCode" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmap/utils/Uid';
|
||||
import { postAutoSignal, putAutoSignal } from '@/api/jmap/mapdraft';
|
||||
import { postAutoReentry, putAutoReentry, getRouteNewList } from '@/api/jmap/mapdraft';
|
||||
import { ViewMode } from '@/scripts/ConstDic';
|
||||
import { formatName } from '@/utils/runPlan';
|
||||
import RouteDetail from '../routeoperate/detail';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
components: {
|
||||
RouteDetail
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
@ -70,25 +90,29 @@ export default {
|
||||
turnBackRouteName: '',
|
||||
basicRouteName:'',
|
||||
turnBackRouteCode: '',
|
||||
basicRouteCode:''
|
||||
basicRouteCode:'',
|
||||
priority: '',
|
||||
reentryTrackCode: ''
|
||||
},
|
||||
editShow: false,
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入折返名称', trigger: 'blur' }
|
||||
],
|
||||
turnBackRouteCode: [
|
||||
turnBackRouteName: [
|
||||
{ required: true, message: '请选择折返进路', trigger: 'blur' }
|
||||
],
|
||||
basicRouteCode: [
|
||||
basicRouteName: [
|
||||
{ required: true, message: '请选择基础进路', trigger: 'blur'}
|
||||
],
|
||||
reentryTrackCode: [
|
||||
{ required: true, message: '请选择折返区段', trigger: 'change'}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList',
|
||||
'sectionList'
|
||||
])
|
||||
},
|
||||
@ -100,7 +124,7 @@ export default {
|
||||
},
|
||||
routeData(val, old) {
|
||||
if (val) {
|
||||
this.addModel = val;
|
||||
this.handelRouteName(val);
|
||||
this.editShow = true;
|
||||
}
|
||||
}
|
||||
@ -115,14 +139,13 @@ export default {
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
selectedRoute(codeType) {
|
||||
this.$refs.routeDetail.doShow('select', codeType);
|
||||
},
|
||||
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() === 'sectionList'.toUpperCase()) {
|
||||
if (this.addModel.sectionList.indexOf(selected.code) === -1) {
|
||||
this.addModel.sectionList.push(selected.code);
|
||||
}
|
||||
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'reentryTrackCode'.toUpperCase()) {
|
||||
this.addModel.reentryTrackCode = selected.code;
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -130,19 +153,18 @@ export default {
|
||||
const model = Object.assign({}, this.addModel);
|
||||
if (code) { model['code'] = code; }
|
||||
model['mapId'] = this.mapInfo.id;
|
||||
model['autoSignalId'] = this.addModel.id;
|
||||
return model;
|
||||
},
|
||||
save() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
postAutoSignal(this.buildModel(getUID('autoSingle'))).then(resp => {
|
||||
this.$message.success(this.$t('map.automaticSignalSuccessful'));
|
||||
postAutoReentry(this.buildModel(getUID('TurnedAround'))).then(resp => {
|
||||
this.$message.success('创建折返成功!');
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('map.failedCreateSignal'));
|
||||
this.$messageBox('创建折返失败!');
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
@ -152,12 +174,12 @@ export default {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
putAutoSignal(this.buildModel()).then(resp => {
|
||||
this.$message.success(this.$t('map.automaticSignalUpdateSucceeded'));
|
||||
putAutoReentry(this.buildModel()).then(resp => {
|
||||
this.$message.success('更新折返成功!');
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('map.automaticSignalUpdateFailed'));
|
||||
this.$messageBox('更新折返失败!');
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
@ -166,13 +188,34 @@ export default {
|
||||
clear() {
|
||||
if (this.$refs && this.$refs.form && this.mapInfo) {
|
||||
delete this.addModel.id;
|
||||
this.$refs.form.resetFields();
|
||||
this.addModel.basicRouteName = '';
|
||||
this.addModel.basicRouteCode = '';
|
||||
this.addModel.turnBackRouteName = '';
|
||||
this.addModel.turnBackRouteCode = '';
|
||||
this.addModel.mapId = this.mapInfo.id;
|
||||
this.addModel.sectionList = [];
|
||||
this.addModel.signalCode = '';
|
||||
this.addModel.code = '';
|
||||
this.$refs.form.resetFields();
|
||||
this.isSave = true;
|
||||
}
|
||||
},
|
||||
setRouteCode(data, type) {
|
||||
if (type === 'basicRoute') {
|
||||
this.addModel.basicRouteName = data.name;
|
||||
this.addModel.basicRouteCode = data.code;
|
||||
} else if (type === 'turnBackRoute') {
|
||||
this.addModel.turnBackRouteName = data.name;
|
||||
this.addModel.turnBackRouteCode = data.code;
|
||||
}
|
||||
},
|
||||
async handelRouteName(data) {
|
||||
const model = {};
|
||||
const resp1 = await getRouteNewList(this.$route.params.mapId, {pageSize:10, pageNum:1, code: data.basicRouteCode});
|
||||
model.basicRouteName = resp1.data.list.length ? resp1.data.list[0].name : '';
|
||||
|
||||
const resp2 = await getRouteNewList(this.$route.params.mapId, {pageSize:10, pageNum:1, code: data.turnBackRouteCode});
|
||||
model.turnBackRouteName = resp2.data.list.length ? resp2.data.list[0].name : '';
|
||||
|
||||
this.addModel = deepAssign(model, data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -261,7 +261,8 @@ export default {
|
||||
mapEditShow: false,
|
||||
mapPaintShow: true
|
||||
},
|
||||
oldDevice: null
|
||||
oldDevice: null,
|
||||
isSwitchSection: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -320,9 +321,25 @@ export default {
|
||||
} else {
|
||||
this.enabledTab = type;
|
||||
if (this.oldDevice && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') {
|
||||
if (this.isSwitchSection) {
|
||||
if (this.oldDevice._type == 'Section' && this.oldDevice.type == '04') {
|
||||
this.oldDevice.relevanceSectionList.forEach(item => {
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||
sectionModel.instance.drawSelected(false);
|
||||
});
|
||||
this.isSwitchSection = false;
|
||||
}
|
||||
}
|
||||
this.oldDevice.instance.drawSelected(false);
|
||||
}
|
||||
if (device && device.instance && typeof device.instance.drawSelected === 'function' ) {
|
||||
if (device._type == 'Section' && device.type == '04') {
|
||||
this.isSwitchSection = true;
|
||||
device.relevanceSectionList.forEach(item => {
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||
sectionModel.instance.drawSelected(true);
|
||||
});
|
||||
}
|
||||
device.instance.drawSelected(true);
|
||||
}
|
||||
this.oldDevice = device;
|
||||
|
@ -17,21 +17,6 @@
|
||||
<div style="height: calc(100% - 46px);">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
|
||||
<el-form-item label="关联站台" prop="standCode">
|
||||
<el-select v-model="addModel.standCode" filterable>
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name + ' (' + item.code+ ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type="field === 'standSelectStationCode' ? 'danger' : 'primary'"
|
||||
size="small"
|
||||
@click="hover('standSelectStationCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联站台轨:" prop="standTrackCode">
|
||||
<el-select v-model="addModel.standTrackCode" filterable>
|
||||
<el-option
|
||||
@ -47,6 +32,27 @@
|
||||
@click="hover('sectionSelectCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联站台:" prop="standCode">
|
||||
<el-select v-model="addModel.standCode" filterable>
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name + ' (' + item.code+ ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type="field === 'standSelectStationCode' ? 'danger' : 'primary'"
|
||||
size="small"
|
||||
@click="hover('standSelectStationCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="屏蔽门宽度:" prop="width">
|
||||
<el-input-number v-model="addModel.width" style="width: 140px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="屏蔽门高度:" prop="height">
|
||||
<el-input-number v-model="addModel.height" style="width: 140px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.stationstandDirection')" prop="doorLocationType">
|
||||
<el-radio-group v-model="addModel.doorLocationType">
|
||||
<el-radio v-for="item in DoorLocationTypeList" :key="item.code" :label="item.code" border>{{ item.name }}</el-radio>
|
||||
@ -92,14 +98,16 @@ export default {
|
||||
name: '',
|
||||
standCode: '', // 关联站台唯一code
|
||||
standTrackCode: '', // 关联站台轨编码
|
||||
width: 80,
|
||||
height: 5,
|
||||
width: 60,
|
||||
height: 3,
|
||||
position: { x: 0, y: 0 },
|
||||
doorLocationType: '01' // 显示方向朝上或朝下
|
||||
},
|
||||
field: '',
|
||||
addModel: {
|
||||
standCode: '',
|
||||
width: 60,
|
||||
height: 3,
|
||||
standTrackCode: '',
|
||||
doorLocationType: '01' // 显示方向朝上或朝下
|
||||
}
|
||||
@ -250,9 +258,9 @@ export default {
|
||||
};
|
||||
this.stationStandList.forEach(elem => {
|
||||
if (elem.code === this.addModel.standCode) {
|
||||
model.position = { x: elem.position.x, y: elem.position.y };
|
||||
model.position = { x: elem.position.x, y: elem.position.y - (elem.height / 2) - 8 };
|
||||
if (this.addModel.doorLocationType == '01') { // 朝下
|
||||
model.position = { x: elem.position.x, y: elem.position.y + ( 2 * elem.height) };
|
||||
model.position = { x: elem.position.x, y: elem.position.y + (elem.height / 2) + 8 };
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -438,8 +438,8 @@ export default {
|
||||
map: {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
|
||||
{ prop: 'lengthFact', label: this.$t('map.actualLength'), type: 'number', min: 0, placeholder: this.$t('map.meter'), isHidden: !this.isPhysicalSection },
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
|
||||
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter') },
|
||||
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
||||
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
||||
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
|
||||
|
@ -16,7 +16,8 @@
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second">
|
||||
<div style="height: calc(100% - 46px);">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
|
||||
<config-list ref="make" :form="addForm" :form-model="addModel" :rules="createRules" />
|
||||
<!-- <el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
|
||||
<el-form-item :label="$t('map.stationstandName')" prop="stationCode">
|
||||
<el-select v-model="addModel.stationCode" filterable @change="changeStation">
|
||||
<el-option
|
||||
@ -32,20 +33,7 @@
|
||||
@click="hover('standSelectStationCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('map.stationstandDirection')" prop="doorLocationType">
|
||||
<el-select v-model="addModel.doorLocationType" filterable :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in DoorLocationTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item :label="$t('map.stationstandHasDoor')" prop="hasDoor">
|
||||
<el-checkbox v-model="addModel.hasDoor" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-form> -->
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="button_box">
|
||||
@ -100,10 +88,16 @@ export default {
|
||||
},
|
||||
field: '',
|
||||
addModel: {
|
||||
stationCode: '',
|
||||
// doorLocationType: '01',
|
||||
deviceStationCode: ''
|
||||
// hasDoor: true
|
||||
stationCode: '', // 所属车站
|
||||
deviceStationCode: '', // 设备集中站
|
||||
pointY: 0, // y坐标
|
||||
width: 60,
|
||||
height: 20,
|
||||
doorType: '01', // 屏蔽门类型
|
||||
standTrackCode: '', // 关联站台轨
|
||||
standTrackUpCode: '', // 上行站台轨
|
||||
standTrackDownCode: '', // 下行站台轨
|
||||
stationstandDirection: '02' // 屏蔽门方向
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -111,7 +105,8 @@ export default {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationStandList',
|
||||
'lineCode'
|
||||
'sectionList',
|
||||
'psdList'
|
||||
]),
|
||||
form() {
|
||||
const form = {
|
||||
@ -178,12 +173,84 @@ export default {
|
||||
|
||||
return rules;
|
||||
},
|
||||
addForm() {
|
||||
return {
|
||||
labelWidth: '130px',
|
||||
items: {
|
||||
stand: {
|
||||
name: '站台数据',
|
||||
item: [
|
||||
{ prop: 'stationCode', label: this.$t('map.stationstandName'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, hover: this.hover, buttonType: 'standSelectStationCode', buttonShowType: this.isButtonType },
|
||||
{ prop: 'pointY', label: 'Y 坐标:', type: 'number' },
|
||||
{ prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
|
||||
{ prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' }
|
||||
]
|
||||
},
|
||||
door: {
|
||||
name: '屏蔽门数据',
|
||||
item: [
|
||||
{ prop: 'doorType', label: '屏蔽门类型:', type: 'radio', radioList: [
|
||||
{value: '01', label: '单侧屏蔽门' },
|
||||
{value: '02', label: '双侧屏蔽门' }
|
||||
] },
|
||||
{ prop: 'standTrackCode', label: '站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectCode', buttonShowType: this.isButtonTypeS, isHidden: !this.doorTypeOne },
|
||||
{ prop: 'stationstandDirection', label: '屏蔽门朝向:', type: 'radio', radioList: this.DoorLocationTypeList, isHidden: !this.doorTypeOne },
|
||||
{ prop: 'standTrackUpCode', label: '上行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectUpCode', buttonShowType: this.isButtonTypeU, isHidden: !this.doorTypeTwo },
|
||||
{ prop: 'standTrackDownCode', label: '下行站台轨:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.PhysicalSectionList, hover: this.hover, buttonType: 'sectionSelectDownCode', buttonShowType: this.isButtonTypeD, isHidden: !this.doorTypeTwo }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
createRules() {
|
||||
return {
|
||||
stationCode: [
|
||||
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
|
||||
],
|
||||
pointY: [
|
||||
{ required: true, message: '请输入y坐标', trigger: 'blur' }
|
||||
],
|
||||
width: [
|
||||
{ required: true, message: '请输入站台宽度', trigger: 'blur' }
|
||||
],
|
||||
height: [
|
||||
{ required: true, message: '请输入站台高度', trigger: 'blur' }
|
||||
],
|
||||
standTrackCode: [
|
||||
{ required: true, message: '请选择关联站台轨', trigger: 'change' }
|
||||
],
|
||||
standTrackUpCode: [
|
||||
{ required: true, message: '请选择站台轨', trigger: 'change' }
|
||||
],
|
||||
standTrackDownCode: [
|
||||
{ required: true, message: '请选择站台轨', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
},
|
||||
isButtonType() {
|
||||
return this.field == 'standSelectStationCode';
|
||||
},
|
||||
isButtonTypeS() {
|
||||
return this.field == 'sectionSelectCode';
|
||||
},
|
||||
isButtonTypeU() {
|
||||
return this.field == 'sectionSelectUpCode';
|
||||
},
|
||||
isButtonTypeD() {
|
||||
return this.field == 'sectionSelectDownCode';
|
||||
},
|
||||
doorTypeOne() {
|
||||
return this.addModel.doorType == '01';
|
||||
},
|
||||
doorTypeTwo() {
|
||||
return this.addModel.doorType == '02';
|
||||
},
|
||||
PhysicalSectionList() {
|
||||
let list = [];
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
list = this.sectionList.filter(elem => { return elem.type === '01'; });
|
||||
}
|
||||
return list;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -193,7 +260,11 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.$Dictionary.doorLocationType().then(list => {
|
||||
this.DoorLocationTypeList = list;
|
||||
this.DoorLocationTypeList = [];
|
||||
list.forEach(item => {
|
||||
const param = { value: item.code, label: item.name };
|
||||
this.DoorLocationTypeList.push(param);
|
||||
});
|
||||
});
|
||||
this.$Dictionary.runDirectionType().then(list => {
|
||||
this.RunDirectionTypeList = list;
|
||||
@ -220,7 +291,6 @@ export default {
|
||||
this.$emit('standStationCode', this.field);
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
// this.$refs.make.resetFields();
|
||||
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.$refs.dataform.resetFields();
|
||||
this.activeName = 'first';
|
||||
@ -231,32 +301,99 @@ export default {
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('standStationCode', '');
|
||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectCode'.toUpperCase()) {
|
||||
this.addModel.standTrackCode = selected.code;
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('standStationCode', '');
|
||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectUpCode'.toUpperCase()) {
|
||||
this.addModel.standTrackUpCode = selected.code;
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('standStationCode', '');
|
||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionSelectDownCode'.toUpperCase()) {
|
||||
this.addModel.standTrackDownCode = selected.code;
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('standStationCode', '');
|
||||
}
|
||||
},
|
||||
create() {
|
||||
this.$refs.make.validate((valid) => {
|
||||
if (valid) {
|
||||
const uid = getUID('PF', this.stationStandList);
|
||||
const models = [];
|
||||
const space = 8;
|
||||
const Standuid = getUID('PF', this.stationStandList);
|
||||
const model = {
|
||||
_type: 'StationStand',
|
||||
code: uid,
|
||||
code: Standuid,
|
||||
name: `PF${this.stationStandList.length + 1}`,
|
||||
width: 40,
|
||||
height: 20,
|
||||
// doorLocationType: this.addModel.doorLocationType,
|
||||
width: this.addModel.width,
|
||||
height: this.addModel.height,
|
||||
deviceStationCode: this.addModel.deviceStationCode,
|
||||
visible: true
|
||||
// direction: '01',
|
||||
// hasDoor: this.addModel.hasDoor
|
||||
visible: true,
|
||||
position: {
|
||||
x: 0,
|
||||
y: this.addModel.pointY
|
||||
}
|
||||
};
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.code === this.addModel.stationCode) {
|
||||
model.position = { x: elem.position.x, y: elem.position.y + 40 };
|
||||
if (elem.code == this.addModel.stationCode) {
|
||||
model.position.x = elem.position.x;
|
||||
model.stationCode = elem.code;
|
||||
}
|
||||
});
|
||||
|
||||
this.$emit('updateMapModel', model);
|
||||
models.push(model);
|
||||
if (this.addModel.doorType == '01') {
|
||||
const uid = getUID('Psd', this.psdList);
|
||||
const param = {
|
||||
_type: 'Psd',
|
||||
code: uid,
|
||||
name: `Psd${this.psdList.length + 1}`,
|
||||
width: this.addModel.width,
|
||||
height: 3,
|
||||
standCode: Standuid, // 关联站台唯一code
|
||||
standTrackCode: this.addModel.standTrackCode, // 关联站台轨编码
|
||||
position: {
|
||||
x: models[0].position.x,
|
||||
y: this.addModel.pointY - (this.addModel.height / 2) - space
|
||||
}
|
||||
};
|
||||
if (this.addModel.stationstandDirection == '01') { // 朝下
|
||||
param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space;
|
||||
}
|
||||
models.push(param);
|
||||
} else if (this.addModel.doorType == '02') {
|
||||
const arr = [];
|
||||
for (let index = 0; index < 2; index++) {
|
||||
const uid = getUID('Psd', [...this.psdList, ...arr]);
|
||||
const param = {
|
||||
_type: 'Psd',
|
||||
code: uid,
|
||||
name: `Psd${[...this.psdList, ...arr].length + 1}`,
|
||||
width: this.addModel.width,
|
||||
height: 3,
|
||||
standCode: Standuid, // 关联站台唯一code
|
||||
standTrackCode: '', // 关联站台轨编码
|
||||
position: {
|
||||
x: models[0].position.x,
|
||||
y: this.addModel.pointY
|
||||
}
|
||||
};
|
||||
if (index == 0) {
|
||||
param.standTrackCode = this.addModel.standTrackUpCode;
|
||||
param.position.y = this.addModel.pointY - (this.addModel.height / 2) - space;
|
||||
} else {
|
||||
param.standTrackCode = this.addModel.standTrackDownCode;
|
||||
param.position.y = this.addModel.pointY + (this.addModel.height / 2) + space;
|
||||
}
|
||||
arr.push(param);
|
||||
}
|
||||
arr.forEach(item => {
|
||||
models.push(item);
|
||||
});
|
||||
}
|
||||
this.$emit('updateMapModel', models);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user