大铁线路调整5

This commit is contained in:
fan 2022-04-21 10:02:13 +08:00
parent c0bbf35455
commit a045d2c776
18 changed files with 754 additions and 33 deletions

32
src/api/assist.js Normal file
View File

@ -0,0 +1,32 @@
import request from '@/utils/request';
// 查询指示灯关联信息列表
export function queryAssistListPaged(params, mapId) {
return request({
url: `/api/assist/indicator/section/list/${mapId}`,
method: 'get',
params
});
}
// 根据id查询单个指示灯关联信息
export function queryAssistById(id){
return request({
url: `/api/assist/indicator/section/${id}`,
method: 'get'
})
}
// 保存指示灯关联信息
export function saveAssist(data, mapId) {
return request({
url: `/api/assist/indicator/section/save${mapId}`,
method: 'post',
data
})
}
// 删除指示灯关联关系
export function deleteAssist(id) {
return request({
url: `/api/assist/indicator/section/delete/${id}`,
method: 'delete'
})
}

BIN
src/assets/datie/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
src/assets/datie/camera.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

BIN
src/assets/datie/link.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
src/assets/datie/picT3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

BIN
src/assets/datie/train.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

View File

@ -115,7 +115,7 @@ export default {
const date = new Date(+new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`)); const date = new Date(+new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`));
this.initDate(date); this.initDate(date);
} }
},// 138 },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('config/updateMenuBar'); this.$store.dispatch('config/updateMenuBar');

View File

@ -456,7 +456,7 @@ export default {
operate.over = true; operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
operate.code = deviceList[deviceList.length - 1].code; operate.code = deviceList[deviceList.length - 1].code;
operate.param = {routeId: route.code}; operate.param = {routeCode: route.code};
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.deviceTimeNode = 0; this.deviceTimeNode = 0;
}).catch(() => { }).catch(() => {

View File

@ -2,12 +2,12 @@
<el-dialog <el-dialog
title="车站股道图" title="车站股道图"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="96%" width="99%"
top="5vh" top="5vh"
center center
:before-close="handleClose"> :before-close="handleClose">
<div style="height: 550px; overflow-y: auto;background: #DFE3E6;padding: 7px;"> <div style="height: 500px; overflow-y: auto;background: #DFE3E6;padding: 7px;">
<div :key="item.id" v-for="item in infoList" style="display: flex; justify-content: space-between;border-top: 1px solid #fff;padding: 3px"> <div :key="item.id" v-for="item in infoList" style="display: flex; justify-content: space-between;border-top: 1px solid #fff;padding: 3px;height: 36px;align-items: center;">
<div> <div>
<el-select v-model="item.sectionCode" filterable placeholder="请选择" size="mini" style="width: 120px;"> <el-select v-model="item.sectionCode" filterable placeholder="请选择" size="mini" style="width: 120px;">
<el-option <el-option
@ -19,7 +19,7 @@
</el-select> </el-select>
</div> </div>
<div>{{item.trainCode}}</div> <div>{{item.trainCode}}</div>
<div></div> <div style="background: #FFCBEC;border: 1px solid #315FD1;border-radius: 3px;font-size: 10px;"></div>
<div>列车未接近</div> <div>列车未接近</div>
<div> <div>
<el-select v-model="item.sectionStatus" filterable placeholder="请选择" size="mini" style="width: 120px;"> <el-select v-model="item.sectionStatus" filterable placeholder="请选择" size="mini" style="width: 120px;">
@ -44,16 +44,25 @@
<div>{{ item.sectionName }}</div> <div>{{ item.sectionName }}</div>
</div> </div>
</div> </div>
<div style="display: flex;margin-top: 10px;justify-content: space-around;background: #DEE2E5;"> <div style="display: flex; justify-content: center;">
<img class="img-box" :src="arrowPic" />
<img class="img-box" :src="picT3" />
<img class="img-box" :src="controlPanelPic" />
<img class="img-box" :src="trainPic" />
<img class="img-box" :src="controlPanel2Pic"/>
<img class="img-box" :src="linkPic"/>
<img class="img-box" :src="cameraPic"/>
</div>
<div style="display: flex;margin-top: 5px;justify-content: space-around;background: #DEE2E5;">
<div style="width: 49%;margin-top: 10px;"> <div style="width: 49%;margin-top: 10px;">
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<div style="background: #0f0;">{{ '进路序列模式:&lt;可修改&gt;' }}</div> <div style="background: #0f0;">{{ '进路序列模式:&lt;可修改&gt;' }}</div>
<el-button size="mini">修改申请</el-button> <el-button size="mini" style="padding: 7px 4px;">修改申请</el-button>
<el-button size="mini">只读申请</el-button> <el-button size="mini" style="padding: 7px 4px;">只读申请</el-button>
<el-button size="mini">查找列车</el-button> <el-button size="mini" style="padding: 7px 4px;margin-left: 30px;">查找列车</el-button>
<el-input style="width: 70px;" size="mini" v-model="searchTrain" /> <el-input style="width: 70px;height: 25px;" size="mini" v-model="searchTrain" />
<div>上下行</div> <div style="margin-left: 10px;">上下行</div>
<el-select size="mini" v-model="andDown" style="width: 70px;"> <el-select size="mini" v-model="andDown" style="width: 80px;margin-left: 5px;">
<el-option <el-option
v-for="item in andDownList" v-for="item in andDownList"
:key="item.value" :key="item.value"
@ -61,8 +70,8 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<div>接车口</div> <div style="margin-left: 10px;">接车口</div>
<el-select size="mini" v-model="andDown" style="width: 100px;"> <el-select size="mini" v-model="andDown" style="width: 100px;margin-left: 5px;">
<el-option <el-option
v-for="item in andDownList" v-for="item in andDownList"
:key="item.value" :key="item.value"
@ -70,8 +79,8 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<div>发车口</div> <div style="margin-left: 10px;">发车口</div>
<el-select size="mini" v-model="andDown" style="width: 100px;"> <el-select size="mini" v-model="andDown" style="width: 100px;margin-left: 5px;">
<el-option <el-option
v-for="item in andDownList" v-for="item in andDownList"
:key="item.value" :key="item.value"
@ -85,9 +94,14 @@
style="width: 100%;margin-top: 10px;" style="width: 100%;margin-top: 10px;"
highlight-current-row highlight-current-row
:row-style="{ background: '#ff0' }" :row-style="{ background: '#ff0' }"
height="180"
border border
> >
<el-table-column type="index" width="50" label="序号" /> <el-table-column width="50" label="序号" align="center">
<template slot-scope="scope">
<div :style="{ background: scope.$index? '#f00':'#ff0' }" >{{ scope.$index }}</div>
</template>
</el-table-column>
<el-table-column property="date" label="注意确认"/> <el-table-column property="date" label="注意确认"/>
<el-table-column property="train" label="车次"/> <el-table-column property="train" label="车次"/>
<el-table-column property="sectionName" label="股道"/> <el-table-column property="sectionName" label="股道"/>
@ -128,6 +142,7 @@
style="width: 100%;margin-top: 10px;" style="width: 100%;margin-top: 10px;"
highlight-current-row highlight-current-row
border border
height="180"
> >
<el-table-column type="index" width="50" label="勾"/> <el-table-column type="index" width="50" label="勾"/>
<el-table-column property="line" label="线路"/> <el-table-column property="line" label="线路"/>
@ -147,16 +162,30 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import ArrowPic from '@/assets/datie/arrow.png';
import PicT3 from '@/assets/datie/picT3.png';
import ControlPanelPic from '@/assets/datie/controlPanel.png';
import ControlPanel2Pic from '@/assets/datie/controlPanel2.png';
import TrainPic from '@/assets/datie/train.png';
import LinkPic from '@/assets/datie/link.png';
import CameraPic from '@/assets/datie/camera.png';
export default { export default {
name: 'lineBoard', name: 'lineBoard',
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
arrowPic: ArrowPic,
picT3: PicT3,
controlPanelPic: ControlPanelPic,
trainPic: TrainPic,
controlPanel2Pic: ControlPanel2Pic,
linkPic: LinkPic,
cameraPic: CameraPic,
searchTrain: '', searchTrain: '',
andDown: 'all', andDown: 'all',
unknow: '', unknow: '',
unknow1: '', unknow1: '',
tableData: [{},{}], tableData: [{id: 1},{id: 2}],
unknowList1: [{label: '全部机车', value: 'all'}], unknowList1: [{label: '全部机车', value: 'all'}],
unknowList: [{label: 'J101-执行中', value: 'J101'}], unknowList: [{label: 'J101-执行中', value: 'J101'}],
andDownList: [{ label: '全部', value: 'all' }, { label: '上行', value: 'up' }, { label: '下行', value: 'down' }], andDownList: [{ label: '全部', value: 'all' }, { label: '上行', value: 'up' }, { label: '下行', value: 'down' }],
@ -173,7 +202,12 @@
{ id: 7 }, { id: 7 },
{ id: 8 }, { id: 8 },
{ id: 9 }, { id: 9 },
{ id: 10 } { id: 10 },
{ id: 11 },
{ id: 12 },
{ id: 13 },
{ id: 14 },
{ id: 15 }
] ]
} }
}, },
@ -188,6 +222,9 @@
}, },
doShow() { doShow() {
this.dialogVisible = true; this.dialogVisible = true;
},
getScope(scope) {
console.log(scope, '=====',scope.$index);
} }
} }
}; };
@ -201,4 +238,20 @@
background: #8D939D; background: #8D939D;
padding: 10px; padding: 10px;
} }
/deep/ .el-table td{
padding: 0;
}
/deep/ .el-table th{
padding: 0;
background: #C5CBD0;
color: #1e2024;
}
.img-box {
width: 30px;
height: 30px;
border: 1px solid #ccc;
border-radius: 4px;
margin: 10px 5px 5px 5px;
background: #FAFAFA;
}
</style> </style>

View File

@ -32,6 +32,7 @@
import RouteOperate from './routeoperate/index'; import RouteOperate from './routeoperate/index';
import RoutingOperate from './routingoperate/index'; import RoutingOperate from './routingoperate/index';
import BigRoutingOperate from './bigroutingoperate/index'; import BigRoutingOperate from './bigroutingoperate/index';
import IndicatorAssociatedInfo from './indicatorAssociatedInfo/index';
import AutomaticOperate from './automaticoperate/index'; import AutomaticOperate from './automaticoperate/index';
// import PathOperate from './pathoperate/index'; // import PathOperate from './pathoperate/index';
import RunLevelOperate from './runLeveloperate/index'; import RunLevelOperate from './runLeveloperate/index';
@ -56,7 +57,8 @@ export default {
SignalOperate, SignalOperate,
TurnedOperate, TurnedOperate,
DwellTimeOperate, DwellTimeOperate,
ContinueProtectOperate ContinueProtectOperate,
IndicatorAssociatedInfo
// DestinationOperate // DestinationOperate
}, },
props: { props: {
@ -94,10 +96,11 @@ export default {
}, },
mounted() { mounted() {
this.initLoad(); this.initLoad();
if (this.$route.query.lineCode == '15') { if (this.$route.query.lineCode == '15' || this.$route.query.lineCode == '16') {
this.tabList = [ this.tabList = [
{label: '大铁进路', name:'bigRoutingOperate', menus:BigRoutingOperate}, {label: '大铁进路', name:'bigRoutingOperate', menus:BigRoutingOperate},
{label: this.$t('map.routing'), name:'routing', menus:RoutingOperate} {label: '指示灯关联', name: 'indicatorAssociatedInfo', menus: IndicatorAssociatedInfo}
// {label: this.$t('map.routing'), name:'routing', menus:RoutingOperate}
]; ];
this.enabledTab = 'bigRoutingOperate'; this.enabledTab = 'bigRoutingOperate';
} else { } else {

View File

@ -0,0 +1,267 @@
<template>
<el-dialog v-dialogDrag :title="$t('map.routePreview')" :visible.sync="show" width="95%" :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 { getBigRouteList, deleteBigRoute } from '@/api/jmap/mapdraft';
export default {
name:'BigRouteDetail',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show:false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
filterRouteMap:{},
queryForm: {
// labelWidth: '120px',
// queryObject: {
// }
show:false
},
signalAspectList:[
{label:'红', value:1},
{label:'绿', value:2},
{label:'黄', value:3},
{label:'黄红', value:4},
{label:'绿绿', value:5},
{label:'绿黄', value:6},
{label:'黄黄', value:7},
{label:'黄闪黄', value:8},
{label:'白红', value:9},
{label:'蓝', value:10},
{label:'白', value:11},
{label:'红闪', value:12}
],
switchLocateTypeList: [
{ label: '定位', value: true },
{ label: '反位', value: false }
],
queryList: {
// query: this.queryFunction,
data:[],
// afterQuery: this.afterQuery,
height:'500px',
selectCheckShow: false,
indexShow: true,
paginationHiden:true,
columns: [
{
title: '进路名称',
prop: 'name'
},
{
title: '始端信号机',
prop: 'startSignalCode',
width: 150,
type: 'tag',
columnValue: (row) => { return this.getSignalName(row.startSignalCode, row.multiRoute); },
tagType: (row) => { return ''; }
},
{
title: '信号显示',
prop: 'signalAspect',
width: 150,
type: 'tag',
columnValue: (row) => { return this.getSignalAspect(row.signalAspect, row.multiRoute); },
tagType: (row) => { return ''; }
},
{
title: '起始区段',
prop: 'startSectionCode',
width: 150,
type: 'tag',
columnValue: (row) => { return this.getSectionName(row.startSectionCode, row.multiRoute); },
tagType: (row) => { return ''; }
},
{
title: '终到区段',
prop: 'endSectionCode',
width: 150,
type: 'tag',
columnValue: (row) => { return this.getSectionName(row.endSectionCode, row.multiRoute); },
tagType: (row) => { return ''; }
},
{
title: '途经道岔位置',
prop: 'pathSwitchPosition',
width: 200,
type: 'tag',
columnValue: (row) => { return this.getPathSwitchPosition(row.pathSwitchPosition, row.multiRoute); },
tagType: (row) => { return ''; }
},
{
title: '多进路引用进路',
prop: 'routeAspectList',
width: 300,
type: 'tagMore',
columnValue: (row) => { return this.getRouteAspectList(row.routeAspectList, row.multiRoute); },
tagType: (row) => { return ''; }
},
{
title: '排列进路按钮',
prop: 'btnCodeList',
width: 300,
type: 'tagMore',
columnValue: (row) => { return this.getBtnCodeList(row.btnCodeList); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '200',
buttons: [
{
name: '删除',
handleClick: this.deleteRoute,
type: 'danger'
}
// {
// name: this.$t('global.cancel'),
// handleClick: this.taskCancel,
// type: '',
// showControl: (row) => { return row.status == '04'; }
// },
// {
// name: this.$t('lesson.toPerform'),
// handleClick: this.taskStart,
// type: '',
// showControl: (row) => { return row.status == '03' || row.status == '05'; }
// }
]
}
// multiRoute
]
}
};
},
mounted() {
},
methods:{
doShow() {
this.show = true;
this.reloadData();
},
doClose() {
this.show = false;
},
// queryFunction(params) {
// if (this.mapInfo && this.mapInfo.id) {
// debugger;
// // this.queryList.query(this.queryData).then(response => {
// return getBigRouteList(this.mapInfo.id);
// }
// },
// reloadTable() {
// if (this.queryList && this.queryList.reload) {
// this.queryList.reload();
// }
// },
reloadData() {
if (this.mapInfo && this.mapInfo.id) {
this.queryList.data = [];
getBigRouteList(this.mapInfo.id).then(response => {
this.queryList.data = response.data;
response.data.forEach(route=>{
if (!route.multiRoute) {
this.filterRouteMap[route.code] = route.name;
}
});
}).catch(()=>{
this.queryList.data = [];
});
}
},
getSignalName(code, multiRoute) {
if (multiRoute) {
return '';
} else {
return this.formatName(code);
}
},
getSectionName(code, multiRoute) {
if (multiRoute) {
return '';
} else {
return this.formatName(code);
}
},
getSignalAspect(code, multiRoute) {
if (multiRoute) {
return '';
} else {
return this.$convertField(code, this.signalAspectList, ['value', 'label']);
}
},
getPathSwitchPosition(pathSwitchPosition, multiRoute) {
if (multiRoute) {
return '';
} else {
if (pathSwitchPosition) {
const position = this.$convertField(pathSwitchPosition.normal, this.switchLocateTypeList, ['value', 'label']);
return '' + this.formatName(pathSwitchPosition.switchCode) + ' (' + position + ')';
} else {
return '';
}
}
},
getBtnCodeList(btnCodeList) {
const nameList = [];
btnCodeList && btnCodeList.forEach(item => {
nameList.push(this.formatName(item));
});
return nameList;
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
name = device.name || '';
}
return name;
},
getRouteAspectList(routeAspectList, multiRoute) {
const nameList = [];
if (multiRoute) {
routeAspectList.forEach(item => {
const route = this.filterRouteMap[item.routeCode];
if (route) {
const signalAspect = this.$convertField(item.signalAspect, this.signalAspectList, ['value', 'label']) || '';
nameList.push(route + '(' + signalAspect + ')');
}
});
}
return nameList;
},
deleteRoute(index, row) {
deleteBigRoute(this.mapInfo.id, row.code).then(res=>{
this.$message.success('删除进路成功');
this.reloadData();
delete this.filterRouteMap[row.code];
this.$emit('refresh');
}).catch(error=>{
this.$messageBox('删除进路失败:' + error.meessage);
});
}
}
};
</script>

View File

@ -0,0 +1,97 @@
<template>
<div style="height: 100%;">
<indicator-associated-info-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
@setCenter="setCenter"
/>
<indicator-associated-info-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" @refresh="refresh" />
</div>
</template>
<script>
import IndicatorAssociatedInfoDraft from './route';
import IndicatorAssociatedInfoDetail from './detail';
export default {
name: 'IndicatorAssociatedInfoOperate',
components: {
IndicatorAssociatedInfoDraft,
IndicatorAssociatedInfoDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
enabledTab: 'Route',
routeData: null,
routeList:[]
};
},
created() {
},
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;
}
},
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

@ -0,0 +1,267 @@
<template>
<div class="BigRouteInfo">
<el-form ref="form" :model="addModel" :rules="rules" label-width="140px" size="mini" class="bigDefinition">
<el-form-item v-if="isModify" label="编号:" prop="code">
<el-input v-model="addModel.code" style="width: 220px;" disabled />
</el-form-item>
<!--<el-form-item label="名称:" prop="name">-->
<!--<el-input v-model="addModel.name" style="width: 220px;" />-->
<!--</el-form-item>-->
<el-form-item label="主设备:" prop="code">
<el-select v-model="addModel.code" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in mainDeviceList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'code' ? 'danger' : 'primary'"
@click="hover('code')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="设备分型:" prop="modelType">
<el-select v-model="addModel.modelType" :disabled="true">
<el-option
v-for="item in modelTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备类型:" prop="type" :disabled="true">
<el-select>
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="addModel.type === 'section'" label="关联区段:" prop="sectionList">
<el-select v-model="addModel.sectionList" multiple :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'sectionList' ? 'danger' : 'primary'"
@click="hover('sectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item v-if="['assist', 'main_assist', 'receive_assist', 'deliver_assist', 'change_direction'].includes(addModel.type)" label="关联站台:" prop="standCode">
<el-select v-model="standCode" clearable filterable>
<el-option
v-for="item in standList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'standCode' ? 'danger' : 'primary'"
@click="hover('standCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item v-if="addModel.type === 'receive' || addModel.type === 'deliver'" label="关联进路:" prop="routeCode">
<el-select v-model="routeCode" clearable filterable>
<el-option
v-for="item in routeList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<!--<el-button type="primary" @click="pushRouteAspect">查看</el-button>-->
</el-form-item>
</el-form>
<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 { getBigRouteList } from '@/api/jmap/mapdraft';
import { setUID } from '@/jmapNew/utils/Uid';
import { deepAssign } from '@/utils/index';
import { saveAssist } from '@/api/assist';
import { mapGetters } from 'vuex';
export default {
name:'BigRouteInfo',
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,
mainDeviceList: [],
modelTypeList: [{value: 'indicator', label: '指示灯'}, {value: 'button', label: '按钮'}],
typeList: [
{value: 'receive', label:'接'},
{value: 'deliver', label: '发'},
{value: 'section', label: '区间'},
{value: 'assist', label: '辅助'},
{value: 'main_assist', label: '总辅助'},
{value: 'receive_assist', label: '接辅助'},
{value: 'deliver_assist', label: '发辅助'},
{value: 'change_direction', label: '换方'}
],
routeList:[],
addModel:{
id: '',
code:'',
type: '',
modelType: '',
sectionList: [],
routeCode: '',
standCode: ''
},
rules: {
'code':[
{ required: true, message: '请选择主设备', trigger: 'blur' },
{ required: true, message: '请选择主设备', trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'standList',
'signalButtonList'
]),
btnList() {
return [...this.signalList, ...this.signalButtonList];
}
},
mounted() {
this.initPage();
},
methods:{
initPage() {
this.routeList = [];
getBigRouteList(this.$route.params.mapId).then(response => {
response.data.forEach(route=>{
this.routeList.push({code:route.code, name:route.name});
});
}).catch(()=>{
});
},
hover(field) {
this.field = field === this.field ? '' : field;
},
changeRadio() {
this.$refs.form.clearValidate();
},
setSelected(selected) {
if (selected) {
const deviceTypeList = ['SectionOccupied'.toUpperCase(), 'AssistStatus'.toUpperCase(), 'TotalAssist'.toUpperCase(), 'DepartAssist'.toUpperCase(),
'PickAssist'.toUpperCase(), 'Recovery'.toUpperCase(), 'Accident'.toUpperCase(), 'Occlusion'.toUpperCase(), 'PickOrDepartArrow'.toUpperCase(),
'SignalButton'.toUpperCase()];
if (deviceTypeList.includes(selected._type.toUpperCase()) && this.field.toUpperCase() === 'code'.toUpperCase()) {
this.addModel.code = selected.code;
switch (selected._type) {
case 'SectionOccupied':
this.addModel.type = 'section';
this.addModel.modelType = 'indicator';
break;
}
this.field = '';
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionList'.toUpperCase()) {
this.addModel.sectionList.push(selected.code);
} else if (selected._type.toUpperCase() === 'Stand'.toUpperCase() && this.field.toUpperCase() === 'standCode'.toUpperCase()) {
this.addModel.standCode = selected.code;
this.field = '';
}
}
},
save() {
const that = this;
that.$refs.form.validate((valid) => {
if (valid) {
const newModel = deepAssign({}, that.addModel);
// newModel.code = setUID('Route');
that.loading = true;
saveAssist(newModel, that.mapInfo.id).then(res=>{
that.$message.success(that.$t('tip.creatingSuccessful'));
that.loading = false;
that.clear();
}).catch(() => {
that.$messageBox(that.$t('tip.operationAbnormal'));
that.loading = false;
});
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
this.$refs.form.resetFields();
this.addModel = {
id: '',
code:'',
type: '',
modelType: '',
sectionList: [],
routeCode: '',
standCode: ''
};
}
}
// pushRouteAspect() {
// if (this.routeCode && this.signalAspect) {
// const index = this.addModel.routeAspectList.findIndex(routeAspect=>{ return routeAspect.routeCode == this.routeCode && routeAspect.signalAspect == this.signalAspect; });
// index < 0 && this.addModel.routeAspectList.push({routeCode:this.routeCode, signalAspect:this.signalAspect});
// }
// }
}
};
</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

@ -166,7 +166,7 @@ export default {
{ prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup' }, { prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup' },
{ prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup'}, { prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup'},
{ prop: 'right', label: '朝右:', type: 'checkbox', isHidden: this.editModel.type !== 'PickOrDepartArrow' }, { prop: 'right', label: '朝右:', type: 'checkbox', isHidden: this.editModel.type !== 'PickOrDepartArrow' },
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.hasDirectionList.includes(this.editModel.type) }, { prop: 'labelEnum', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.hasDirectionList.includes(this.editModel.type) },
{ prop: 'switchCode', label: '所属道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: this.editModel.type !== 'SwitchFault', hover: this.hover, buttonType: 'switchSelectCode', buttonShowType: this.isButtonType }, { prop: 'switchCode', label: '所属道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: this.editModel.type !== 'SwitchFault', hover: this.hover, buttonType: 'switchSelectCode', buttonShowType: this.isButtonType },
{ prop:'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList} { prop:'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList}
] ]
@ -191,7 +191,7 @@ export default {
] }, ] },
{ prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup' }, { prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup' },
{ prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup'}, { prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup'},
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.hasDirectionList.includes(this.addModel.type) }, { prop: 'labelEnum', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.hasDirectionList.includes(this.addModel.type) },
{ prop: 'switchCode', label: '所属道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: this.addModel.type !== 'SwitchFault', hover: this.hover, buttonType: 'switchSelectCode', buttonShowType: this.isButtonType } { prop: 'switchCode', label: '所属道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, isHidden: this.addModel.type !== 'SwitchFault', hover: this.hover, buttonType: 'switchSelectCode', buttonShowType: this.isButtonType }
] ]
} }
@ -222,7 +222,7 @@ export default {
switchCode: [ switchCode: [
{ required: true, message: '请选择所属道岔!', trigger: 'change'} { required: true, message: '请选择所属道岔!', trigger: 'change'}
], ],
direction: [ labelEnum: [
{ required: true, message: '请选择方向!', trigger: 'change'} { required: true, message: '请选择方向!', trigger: 'change'}
] ]
}; };
@ -478,6 +478,7 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
}, },
deviceSelect(selected) { deviceSelect(selected) {
console.log(selected, '======');
if (this.field.toUpperCase() === 'switchSelectCode'.toUpperCase() && selected._type.toUpperCase() === 'Switch'.toUpperCase()) { if (this.field.toUpperCase() === 'switchSelectCode'.toUpperCase() && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
if (this.activeName === 'first') { if (this.activeName === 'first') {
this.editModel.switchCode = selected.code; this.editModel.switchCode = selected.code;

View File

@ -201,6 +201,7 @@ class Model {
this.mfNum = 0; this.mfNum = 0;
this.pfNum = 0; this.pfNum = 0;
this.switchCode = ''; this.switchCode = '';
this.labelEnum = '';
this.right = false; this.right = false;
} }
} }

View File

@ -56,7 +56,7 @@ export default {
signalCode: '', signalCode: '',
sectionCode: '', sectionCode: '',
switchCode: '', switchCode: '',
direction: '', labelEnum: '',
position: { position: {
x: 0, x: 0,
y: 0 y: 0
@ -120,7 +120,7 @@ export default {
'position.y': [ 'position.y': [
{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }
], ],
direction: [ labelEnum: [
{ required: true, message: '请选择方向', trigger: 'change' } { required: true, message: '请选择方向', trigger: 'change' }
] ]
} }
@ -156,7 +156,7 @@ export default {
{ prop: 'signalCode', label: '关联信号机:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.signalList, hover: this.hover, buttonType: 'linkSignal', buttonShowType: this.isLinkSignalShow, isHidden: !this.isLinkSignal }, { prop: 'signalCode', label: '关联信号机:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.signalList, hover: this.hover, buttonType: 'linkSignal', buttonShowType: this.isLinkSignalShow, isHidden: !this.isLinkSignal },
{ prop: 'sectionCode', label: '关联区段:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.sectionList, hover: this.hover, buttonType: 'linkSection', buttonShowType: this.isLinkSectionShow, isHidden: !this.isLinkSection }, { prop: 'sectionCode', label: '关联区段:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.sectionList, hover: this.hover, buttonType: 'linkSection', buttonShowType: this.isLinkSectionShow, isHidden: !this.isLinkSection },
{ prop: 'switchCode', label: '关联道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchList, hover: this.hover, buttonType: 'linkSwitch', buttonShowType: this.isLinkSwitchShow, isHidden: !this.isLinkSwitch }, { prop: 'switchCode', label: '关联道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchList, hover: this.hover, buttonType: 'linkSwitch', buttonShowType: this.isLinkSwitchShow, isHidden: !this.isLinkSwitch },
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.isLinkDirection }, { prop: 'labelEnum', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.isLinkDirection },
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [ { prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
@ -242,7 +242,7 @@ export default {
this.editModel.signalCode = ''; this.editModel.signalCode = '';
this.editModel.switchCode = ''; this.editModel.switchCode = '';
this.editModel.sectionCode = ''; this.editModel.sectionCode = '';
this.editModel.direction = ''; this.editModel.labelEnum = '';
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
} else if (this.field === 'linkSignal' && selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { } else if (this.field === 'linkSignal' && selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
@ -288,11 +288,11 @@ export default {
}, },
updateMapModel(data) { updateMapModel(data) {
if (this.isLinkSignal) { if (this.isLinkSignal) {
data.sectionCode = ''; data.switchCode = ''; data.direction = ''; data.sectionCode = ''; data.switchCode = ''; data.labelEnum = '';
} else if (this.isLinkSection) { } else if (this.isLinkSection) {
data.signalCode = ''; data.switchCode = ''; data.direction = ''; data.signalCode = ''; data.switchCode = ''; data.labelEnum = '';
} else if (this.isLinkSwitch) { } else if (this.isLinkSwitch) {
data.signalCode = ''; data.sectionCode = ''; data.direction = ''; data.signalCode = ''; data.sectionCode = ''; data.labelEnum = '';
} else if (this.isLinkDirection) { } else if (this.isLinkDirection) {
data.sectionCode = ''; data.signalCode = ''; data.switchCode = ''; data.sectionCode = ''; data.signalCode = ''; data.switchCode = '';
} }