Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
bc47132b21
@ -690,3 +690,41 @@ export function createOverlap(mapId, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 创建超限区段
|
||||
export function createOverrunSection(mapId, data) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/overrun`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 分页查询超限区段
|
||||
export function queryOverrunSectionPaging(mapId, params) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/overrun/paging`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 更新超限区段
|
||||
export function updateOverrunSection(mapId, data) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/overrun/${data.code}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 删除超限区段
|
||||
export function deleteOverrunSection(mapId, code) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/overrun/${code}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
// 查询超限区段list
|
||||
export function queryOverunSectionList(mapId) {
|
||||
return request({
|
||||
url: `/api/draftMap/${mapId}/overrun/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -145,6 +145,7 @@ class SkinCode extends defaultStyle {
|
||||
defaultColor: '#FFFFFF', // 信号灯字体默认色
|
||||
blockColor: '#FFFFFF', // 信号灯字体锁定颜色
|
||||
checkColor: '#00FF00', // 信号字体
|
||||
conflictColor:'#FF0000', // 冲突进路始端信号机颜色
|
||||
nameBorderShow: true // 信号机名字边框显示
|
||||
},
|
||||
lamp: {
|
||||
|
@ -77,6 +77,7 @@ deviceState[deviceType.Signal] = {
|
||||
redOpen: 1, // 红灯开放(默认状态)
|
||||
delayTime: 0, // 信号机延迟解锁倒计时
|
||||
atsControl: 1, // 0是人工,1是自动
|
||||
checkConflict:0, // 0是不检查冲突,1是检测冲突(检测冲突进路)
|
||||
fault: 0, // 是否故障
|
||||
isStartSignal: 0, // 是否进路排列选中始端信号机
|
||||
isTerminalSignal: 0, // 是否进路排列待选终端信号机
|
||||
@ -254,5 +255,5 @@ deviceState[deviceType.Train] = {
|
||||
deviceState[deviceType.Responder] = {
|
||||
};
|
||||
deviceState[deviceType.IndicatorLight] = {
|
||||
}
|
||||
};
|
||||
export default deviceState;
|
||||
|
@ -568,11 +568,13 @@ class Jlmap {
|
||||
routeStartSignalData[item.code].forEach((elem, index)=> {
|
||||
if (index) {
|
||||
status.atsControl = status.atsControl && elem.atsControl;
|
||||
status.checkConflict = status.checkConflict || elem.checkConflict;
|
||||
status.fleetMode = status.fleetMode || elem.fleetMode;
|
||||
status.ciControl = status.ciControl || elem.ciControl;
|
||||
status.lock = status.lock || elem.lock;
|
||||
} else {
|
||||
status.atsControl = elem.atsControl;
|
||||
status.checkConflict = elem.checkConflict;
|
||||
status.fleetMode = elem.fleetMode;
|
||||
status.ciControl = elem.ciControl;
|
||||
status.lock = elem.lock;
|
||||
|
@ -994,6 +994,7 @@ class Signal extends Group {
|
||||
!model.atsControl && this.setArtificialRouteClose(); /** 进路交人工控或自动控 */
|
||||
}
|
||||
}
|
||||
|
||||
// 设置点灯类型 必须在最后设置不能放前面 logicLight 0 物理点灯 1 逻辑点灯
|
||||
if (model.logicLight) {
|
||||
this.logicalLight(); // 设置逻辑点灯
|
||||
@ -1061,6 +1062,11 @@ class Signal extends Group {
|
||||
if (model.noStatus || model.level === 0) {
|
||||
this.setAshShow();
|
||||
}
|
||||
|
||||
// 冲突检查状态
|
||||
if (this.style.Signal.text.conflictColor && model.checkConflict) {
|
||||
this.sigName.setColor(this.style.Signal.text.conflictColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,14 @@
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="控制状态" width="100">
|
||||
<el-table-column prop="status" label="控制状态" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
|
||||
<div v-if="systemName=='xian-01__systerm'">
|
||||
{{ scope.row.atsControl == '0' ? '人工' : scope.row.checkConflict?'自动 (进行冲突检查)':'自动 (不进行冲突检查)' }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -112,7 +117,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.$root.$emit('dialogOpen', selected);
|
||||
this.selected = selected;
|
||||
// 如果不是因为断点激活则需要,初始化菜单初始值
|
||||
if (!this.dialogShow) {
|
||||
@ -142,7 +147,7 @@ export default {
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$root.$emit('dialogClose', this.selected);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
// mouseCancelState(this.selected);
|
||||
},
|
||||
|
@ -48,6 +48,21 @@
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="systemName == 'xian-01__systerm'" prop="atsControl" label="控制状态" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.atsControl==0?'人工':'自动' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="systemName == 'xian-01__systerm'" prop="conflict" label="冲突检测" style="margin-left:30px">
|
||||
<template v-if="title == '进路交ATS自动控'&& scope.row.atsControl==0" slot-scope="scope">
|
||||
<el-checkbox
|
||||
v-model="checkConflictList[scope.$index].value"
|
||||
style="text-align: center; display: block;"
|
||||
/>
|
||||
<!-- @change="changeCheckConflit(checkConflictMap[scope.row.code],scope.row.code)" -->
|
||||
<!-- :disabled="scope.row.disabled" -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="systemName === 'xian-01__systerm'" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ getProtectedSectionName(scope.row) }}</span>
|
||||
@ -113,6 +128,8 @@ export default {
|
||||
signalName: '',
|
||||
allSelect: false,
|
||||
changeList:[],
|
||||
checkConflictList:[],
|
||||
selectedCheckConflict:[],
|
||||
commitDisabled: true,
|
||||
disabledLength: 0
|
||||
};
|
||||
@ -152,7 +169,12 @@ export default {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return '进路交人工控';
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return '进路交自动控';
|
||||
if (this.systemName == 'xian-01__systerm') {
|
||||
return '进路交ATS自动控';
|
||||
} else {
|
||||
return '进路交自动控';
|
||||
}
|
||||
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
@ -171,6 +193,8 @@ export default {
|
||||
this.selected = selected;
|
||||
this.allSelect = false;
|
||||
this.changeList = [];
|
||||
this.checkConflictList = [];
|
||||
// .splice(0, this.checkConflictList.length - 1);
|
||||
this.commitDisabled = true;
|
||||
this.selection = [];
|
||||
this.disabledLength = 0;
|
||||
@ -187,18 +211,28 @@ export default {
|
||||
}
|
||||
|
||||
if (tempData && tempData.length > 0) {
|
||||
const that = this;
|
||||
tempData.forEach(elem => {
|
||||
this.changeList.push(false);
|
||||
that.changeList.push(false);
|
||||
|
||||
elem.disabled = false;
|
||||
// 设置禁用状态
|
||||
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
|
||||
(elem.atsControl == '0')) {
|
||||
elem.disabled = true;
|
||||
this.disabledLength++;
|
||||
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
|
||||
(elem.atsControl == '1')) {
|
||||
elem.disabled = true;
|
||||
this.disabledLength++;
|
||||
that.disabledLength++;
|
||||
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
if (elem.atsControl == '1') {
|
||||
elem.disabled = true;
|
||||
that.disabledLength++;
|
||||
that.checkConflictList.push({code:elem.code, value:null});
|
||||
} else {
|
||||
if (that.systemName == 'xian-01__systerm') {
|
||||
that.checkConflictList.push({code:elem.code, value:false});
|
||||
// that.$set('checkConflictMap', elem.code, );
|
||||
// that.checkConflictMap[elem.code] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -224,6 +258,16 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
// mouseCancelState(this.selected);
|
||||
},
|
||||
changeCheckConflit(check, code) {
|
||||
// debugger;
|
||||
// this.checkConflictMap;
|
||||
// this.$set('checkConflictMap', code, check);
|
||||
// if (check) {
|
||||
// this.checkConflictMap[code] = false;
|
||||
// } else {
|
||||
// this.checkConflictMap[code] = true;
|
||||
// }
|
||||
},
|
||||
changeCheck(check, code) {
|
||||
if (check) {
|
||||
this.selection.push(code);
|
||||
@ -346,7 +390,7 @@ export default {
|
||||
operate.message = `命令:进路交人工控<br/>始端信号机:${this.stationName} ${this.signalName}` + msg;
|
||||
this.$refs.ningBoConfirmTip.doShow(operate);
|
||||
}
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
@ -357,7 +401,7 @@ export default {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
@ -381,13 +425,22 @@ export default {
|
||||
operate.message = `命令:进路交自动控<br/>始端信号机:${this.stationName} ${this.signalName}` + msg;
|
||||
this.$refs.ningBoConfirmTip.doShow(operate);
|
||||
}
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2, {val}).then(({valid})=>{
|
||||
const params = {routeCodeList:this.selection};
|
||||
if (this.systemName === 'xian-01__systerm') {
|
||||
const checkConflictList = [];
|
||||
this.selection.forEach(each=>{
|
||||
const checkConflict = this.checkConflictList.find(check=>{ return check.code == each; });
|
||||
if (checkConflict) { checkConflictList.push(checkConflict.value); }
|
||||
});
|
||||
params.checkConflictList = checkConflictList;
|
||||
}
|
||||
commitOperate(menuOperate.Signal.atsAutoControl, params, 2, {val}).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
|
@ -149,7 +149,12 @@ export const menuOperate = {
|
||||
signalTotalCancle:{ // 信号机总取消
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_TOTAL_CANCLE
|
||||
},
|
||||
signalConflictRoute:{ // 冲突进路办理
|
||||
operation: OperationEvent.Signal.signalConflictRoute.menu.operation,
|
||||
cmdType:CMD.Signal.CMD_SIGNAL_CONFLICT_ROUTE_SET_CONFIRM
|
||||
}
|
||||
// Signal_Conflict_Route_Set_Confirm
|
||||
},
|
||||
Switch:{
|
||||
lock:{
|
||||
|
186
src/jmapNew/theme/xian_01/menus/dialog/conflictRoute.vue
Normal file
186
src/jmapNew/theme/xian_01/menus/dialog/conflictRoute.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="conflictRoute"
|
||||
:class="systemName+' route-hand-control'"
|
||||
title="冲突进路办理确认"
|
||||
:visible.sync="show"
|
||||
width="435px"
|
||||
:before-close="closeDialog"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
<div class="conflictRoute">
|
||||
<span class="conflictRouteTitle">冲突进路:</span>
|
||||
<span class="conflictRouteName">{{ routeName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="conflictDescription">冲突描述:</div>
|
||||
<div class="context">
|
||||
{{ message }}
|
||||
</div>
|
||||
<!-- <div class="conflictTips">距离对话框关闭还有:{{ minutes }}分{{ seconds }}秒,请确认是否办理冲突进路。</div> -->
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="7" :offset="3">
|
||||
<el-button
|
||||
style="width: 115px;"
|
||||
:loading="loading"
|
||||
@click="selectConflict"
|
||||
>选排冲突进路</el-button>
|
||||
</el-col>
|
||||
<!-- :id="domIdConfirm" -->
|
||||
<!-- :disabled="commitDisabled" -->
|
||||
<!-- :id="domIdCancel" -->
|
||||
<el-col :span="7" :offset="3">
|
||||
<el-button style="width: 115px;" :loading="loading" @click="routeRunplan">按计划执行</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
export default {
|
||||
name:'ConflictRoute',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
props:{
|
||||
systemName:{
|
||||
type:String,
|
||||
required:true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
message:'',
|
||||
routeCode:'',
|
||||
routeName:'',
|
||||
// allMinutes:10 * 60,
|
||||
// minutes:10,
|
||||
// seconds:0,
|
||||
// inter:null,
|
||||
loading:false
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow({route, description}) {
|
||||
if (route) {
|
||||
this.routeCode = route.code;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](route.stationCode);
|
||||
if (station) {
|
||||
this.routeName = station.name + ' ' + route.name;
|
||||
} else {
|
||||
this.routeName = route.name;
|
||||
}
|
||||
}
|
||||
this.message = description;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
// this.inter = setInterval(()=>{
|
||||
// if (this.allMinutes <= 0) {
|
||||
// clearInterval(this.inter);
|
||||
// this.routeRunplan();
|
||||
// }
|
||||
// this.allMinutes--;
|
||||
// this.minutes = (this.allMinutes - this.allMinutes % 60) / 60;
|
||||
// this.seconds = this.allMinutes % 60;
|
||||
// }, 1000);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
closeDialog() {
|
||||
const that = this;
|
||||
// clearInterval(this.inter);
|
||||
commitOperate(menuOperate.Signal.signalConflictRoute, {routeCode:this.routeCode, way:1}, 3).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
that.doClose();
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.dialogShow = false;
|
||||
console.error(error);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
|
||||
selectConflict() {
|
||||
this.commit(2);
|
||||
},
|
||||
routeRunplan() {
|
||||
this.commit(1);
|
||||
},
|
||||
commit(way) {
|
||||
this.loading = true;
|
||||
// int way, 处理方式:1-按计划执行,2-执行冲突进路
|
||||
commitOperate(menuOperate.Signal.signalConflictRoute, {routeCode:this.routeCode, way:way}, 3).then(({valid, operate})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
// this.$refs.routeControl.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.loading = false;
|
||||
console.error(error);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.conflictRoute .context {
|
||||
margin:5px 13px 13px 13px;
|
||||
padding-bottom: 10px !important;
|
||||
border: 1px solid lightgray;
|
||||
line-height: 138%;
|
||||
font-size: 15px;
|
||||
height:115px;
|
||||
}
|
||||
.conflictDescription{
|
||||
margin-left:13px;
|
||||
font-size: 15px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.conflictRoute{
|
||||
padding-left: 13px;
|
||||
font-size: 15px;
|
||||
width: 100%;
|
||||
padding-right: 13px;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-content: center;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.conflictRouteName{
|
||||
font-size: 15px;
|
||||
height: 23px;
|
||||
border: 2px inset #E2E2E2;
|
||||
padding-left: 5px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.conflictRouteTitle{
|
||||
|
||||
}
|
||||
.conflictTips{
|
||||
margin-left: 13px;
|
||||
}
|
||||
</style>
|
@ -9,6 +9,7 @@
|
||||
<route-hand-control ref="routeHandControl" system-name="xian-01__systerm" />
|
||||
<route-detail ref="routeDetail" system-name="xian-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="xian-01__systerm" />
|
||||
<conflict-route ref="conflictRoute" system-name="xian-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -27,6 +28,7 @@ import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import ConflictRoute from './dialog/conflictRoute';
|
||||
|
||||
export default {
|
||||
name: 'SignalMenu',
|
||||
@ -39,6 +41,7 @@ export default {
|
||||
RouteHandControl,
|
||||
RouteDetail,
|
||||
NoticeInfo,
|
||||
ConflictRoute,
|
||||
SetFault
|
||||
},
|
||||
props: {
|
||||
@ -239,18 +242,39 @@ export default {
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationAlarmInfo': function(val) {
|
||||
(val || []).forEach(item => {
|
||||
if (!item.confirmed && !item.recovered) {
|
||||
if (item.level === '0') {
|
||||
if (item.type == 'Conflict_Route_Set') {
|
||||
const route = this.routeList.find(each=>{ return each.code == item.deviceCode; });
|
||||
this.$refs.conflictRoute.doShow({route:route, description:item.description});
|
||||
// doShow();
|
||||
// "":"Route205",
|
||||
// "description":"计划车(111046(322)触发的进路[X2112-X2102]与计划(311045)从节点(务庄站(22)_G2202)到节点(香湖湾站(21)_G2102)的计划冲突,无法选排"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initMenu() {
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
// 故障模式菜单列表
|
||||
const menuItem = this.menu.find( item => item.cmdType === CMD.Signal.CMD_SIGNAL_SET_CI_AUTO);
|
||||
const menuItemDisabled = menuItem.disabled;
|
||||
menuItem.disabled = true;
|
||||
const ciAutoMenuItem = this.menu.find( item => item.cmdType === CMD.Signal.CMD_SIGNAL_SET_CI_AUTO);
|
||||
const ciAutoTriggerMenuItem = this.menu.find( item => item.cmdType === CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER);
|
||||
const ciAutoMenuItemDisabled = ciAutoMenuItem.disabled;
|
||||
const ciAutoTriggerMenuItemDisabled = ciAutoTriggerMenuItem.disabled;
|
||||
ciAutoMenuItem.disabled = true;
|
||||
ciAutoTriggerMenuItem.disabled = true;
|
||||
this.routeList.forEach(route => {
|
||||
if (route.startSignalCode === this.selected.code && route.flt) {
|
||||
menuItem.disabled = menuItemDisabled;
|
||||
ciAutoMenuItem.disabled = ciAutoMenuItemDisabled;
|
||||
}
|
||||
if (route.startSignalCode === this.selected.code && route.arc ) {
|
||||
ciAutoTriggerMenuItem.disabled = ciAutoTriggerMenuItemDisabled;
|
||||
}
|
||||
});
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
@ -299,6 +323,9 @@ export default {
|
||||
commitOperate(menuOperate.Signal.arrangementRoute, { signalCode: this.selected.code }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$refs.routeSelection.doShow(operate, this.selected, this.getRouteList(this.selected));
|
||||
// const route = this.routeList.find(each=>{ return each.code == 'Route205'; });
|
||||
// this.$refs.conflictRoute.doShow({route:route, description:'计划车(111046(322)触发的进路[X2112-X2102]与计划(311045)从节点(务庄站(22)_G2202)到节点(香湖湾站(21)_G2102)的计划冲突,无法选排'});
|
||||
// this.$refs.conflictRoute.doShow({deviceCode:'Route205', });
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -126,7 +126,9 @@ export default {
|
||||
/** 信号机总取消 */
|
||||
CMD_SIGNAL_TOTAL_CANCLE:{value:'Signal_Total_Cancel', label: '信号机总取消'},
|
||||
/** 设置保护 */
|
||||
CMD_SIGNAL_SET_OVERLAP : {value: 'Signal_Set_Overlap', label: '设置保护'}
|
||||
CMD_SIGNAL_SET_OVERLAP : {value: 'Signal_Set_Overlap', label: '设置保护'},
|
||||
/** 冲突进路办理 */
|
||||
CMD_SIGNAL_CONFLICT_ROUTE_SET_CONFIRM:{value: 'Signal_Conflict_Route_Set_Confirm', label: '冲突进路办理'}
|
||||
},
|
||||
|
||||
// 物理区段操作
|
||||
|
@ -1703,6 +1703,13 @@ export const OperationEvent = {
|
||||
operation: '3211',
|
||||
domId: '_Tips-Signal-setOverlap-Menu{BOTTOM}'
|
||||
}
|
||||
},
|
||||
// 冲突进路办理
|
||||
signalConflictRoute:{
|
||||
menu: {
|
||||
operation: '322',
|
||||
domId: '_Tips-Signal-conflictRoute-Menu{TOP}'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -723,6 +723,7 @@ const map = {
|
||||
map.stationList.forEach(station => {
|
||||
if (station.ciStation) {
|
||||
const centrailzedList = [station.code];
|
||||
state.stationControlMap[station.code] = centrailzedList;
|
||||
station.relStationCodeList.forEach(relStationCode => {
|
||||
state.stationControlMap[relStationCode] = centrailzedList;
|
||||
if (state.mapDevice[relStationCode].centralized) {
|
||||
|
@ -41,6 +41,7 @@ import FlankProtectOperate from './flankProtectOperate/index';
|
||||
import DwellTimeOperate from './dwellTimeOperate/index';
|
||||
import DestinationOperate from './destinationOperate/index';
|
||||
import ContinueProtectOperate from './continueProtectOperate/index';
|
||||
import OverrunSectionOperate from './overrunSectionOperate/index';
|
||||
|
||||
export default {
|
||||
name: 'DataRelation',
|
||||
@ -110,7 +111,8 @@ export default {
|
||||
{label: this.$t('map.automaticSignal'), name:'automatic', menus:AutomaticOperate},
|
||||
{label: this.$t('map.routing'), name:'routing', menus:RoutingOperate},
|
||||
{label: '停站时间', name:'dwellTime', menus:DwellTimeOperate},
|
||||
{label: '设置运行等级', name:'runLevel', menus:RunLevelOperate}
|
||||
{label: '设置运行等级', name:'runLevel', menus:RunLevelOperate},
|
||||
{label: '超限区段', name: 'overrun', menus: OverrunSectionOperate }
|
||||
// ]
|
||||
];
|
||||
this.enabledTab = 'route';
|
||||
|
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div v-show="show">
|
||||
<el-dialog v-dialogDrag v-loading="loading" title="超限区段预览" :visible.sync="show" width="95%" top="1vh" class="dialog_content_box" :before-do-close="doClose" append-to-body>
|
||||
<div>
|
||||
<QueryListPage
|
||||
ref="queryListPage"
|
||||
:pager-config="pagerConfig"
|
||||
:query-form="queryForm"
|
||||
:query-list="queryList"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { queryOverrunSectionPaging, deleteOverrunSection} from '@/api/jmap/mapdraft';
|
||||
// import ProtectDetail from './protectDetail';
|
||||
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
props: {
|
||||
mapInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
overlapList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
sectionCode: {
|
||||
type: 'select',
|
||||
label: '区段',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
ciSwitchCode: {
|
||||
type: 'select',
|
||||
label: '道岔',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
switchCode: {
|
||||
type: 'select',
|
||||
label: '防护道岔',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'switchList',
|
||||
'sectionList'
|
||||
]),
|
||||
queryList() {
|
||||
return {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('map.code'),
|
||||
prop: 'code',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '区段',
|
||||
prop: 'sectionCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.sectionCode, this.sectionList, ['code', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '道岔',
|
||||
prop: 'ciSwitch',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.ciSwitch ? this.$convertField(row.ciSwitch.switchCode, this.switchList, ['code', 'name']) : ''; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '道岔位置',
|
||||
type: 'tag',
|
||||
prop: 'ciSwitch',
|
||||
columnValue: (row) => { return row.ciSwitch ? (row.ciSwitch.normal ? '定位' : '反位') : ''; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '防护的道岔',
|
||||
type: 'tag',
|
||||
prop: 'switchCode',
|
||||
columnValue: (row) => { return this.$convertField(row.switchCode, this.switchList, ['code', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.operation'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.compile'),
|
||||
handleClick: this.edit
|
||||
},
|
||||
{
|
||||
name: this.$t('map.deleteObj'),
|
||||
handleClick: this.deleteObj,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
sectionList: function (val, old) {
|
||||
this.initQueryObjectSectionList(val);
|
||||
},
|
||||
switchList: function (val, old) {
|
||||
this.initQueryObjectSwitchList(val);
|
||||
}
|
||||
},
|
||||
mounted() { //
|
||||
},
|
||||
methods: {
|
||||
initQueryObjectSectionList(val) {
|
||||
const list = [];
|
||||
if (val && val.length) {
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
list.push({ label: `${val[i].name}(${val[i].code})`, value: val[i].code });
|
||||
}
|
||||
}
|
||||
this.queryForm.queryObject.sectionCode.config.data = list;
|
||||
},
|
||||
initQueryObjectSwitchList(val) {
|
||||
const list = [];
|
||||
if (val && val.length) {
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
list.push({ label: `${val[i].name}(${val[i].code})`, value: val[i].code });
|
||||
}
|
||||
}
|
||||
this.queryForm.queryObject.switchCode.config.data = list;
|
||||
this.queryForm.queryObject.ciSwitchCode.config.data = list;
|
||||
},
|
||||
doShow() {
|
||||
this.show = true;
|
||||
this.$nextTick(() => {
|
||||
this.initQueryObjectSectionList(this.sectionList);
|
||||
this.initQueryObjectSwitchList(this.switchList);
|
||||
this.$refs.queryListPage && this.$refs.queryListPage.commitQuery();
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.mapInfo && this.mapInfo.id) {
|
||||
return queryOverrunSectionPaging(this.mapInfo.id, params);
|
||||
}
|
||||
},
|
||||
edit(index, row) {
|
||||
this.$emit('routeSelected', row);
|
||||
this.doClose();
|
||||
},
|
||||
deleteObj(index, row) {
|
||||
if (row) {
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteOverrunSection(this.$route.params.mapId, row.code).then(response => {
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message.info('已取消删除');
|
||||
});
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
selectedObj(index, row) {
|
||||
this.$emit('setRouteCode', row);
|
||||
this.show = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.dialog_content_box{
|
||||
.el-dialog__body{
|
||||
padding-top: 3px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<div>
|
||||
<overrun-detail ref="overrunDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
|
||||
<overrun-form
|
||||
ref="overrunForm"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
:overrun-data="overrunData"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OverrunDetail from './detail';
|
||||
import OverrunForm from './overrun';
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
OverrunDetail,
|
||||
OverrunForm
|
||||
},
|
||||
props: {
|
||||
mapInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
overrunData: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
},
|
||||
routeSelected(data) {
|
||||
this.overrunData = data;
|
||||
if (this.$refs && this.$refs.overrunForm) {
|
||||
this.$refs.overrunForm.isSave = !data.id;
|
||||
}
|
||||
},
|
||||
previewRouteEvent: function () {
|
||||
if (this.$refs && this.$refs.overrunDetail) {
|
||||
this.$refs.overrunDetail.doShow();
|
||||
}
|
||||
},
|
||||
setSelected(selected) {
|
||||
this.$refs.overrunForm.setSelected(selected);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div style="height: 100%;" class="route_box_list">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="190px" size="mini">
|
||||
<el-form-item label="区段" prop="sectionCode">
|
||||
<el-select v-model="addModel.sectionCode" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
:label="item.name + ' (' + item.code+ ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'overrunSection' ? 'danger' : 'primary'"
|
||||
@click="hover('overrunSection')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="道岔" prop="ciSwitch.switchCode">
|
||||
<el-select v-model="addModel.ciSwitch.switchCode" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in switchList"
|
||||
:key="item.code"
|
||||
:label="item.name + ' (' + item.code+ ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'overrunSwitch' ? 'danger' : 'primary'"
|
||||
@click="hover('overrunSwitch')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="道岔位置" prop="ciSwitch.normal">
|
||||
<el-select v-model="addModel.ciSwitch.normal">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="防护道岔" prop="switchCode">
|
||||
<el-select v-model="addModel.switchCode" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in switchList"
|
||||
:key="item.code"
|
||||
:label="item.name + '(' + item.code + ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'protectiveSwitch' ? 'danger' : 'primary'"
|
||||
@click="hover('protectiveSwitch')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<br>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">保存超限区段</el-button>
|
||||
<el-button v-else type="warning" size="small" :loading="loading" @click="update">修改超限区段</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { updateOverrunSection, createOverrunSection } from '@/api/jmap/mapdraft';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
mapInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
overrunData: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
var validateSection = (rule, value, callback) => {
|
||||
if (!value && !this.addModel.ciSwitch.switchCode) {
|
||||
callback(new Error('区段和道岔必须选填其一'));
|
||||
} else {
|
||||
if (!this.addModel.ciSwitch.switchCode) {
|
||||
this.$refs.form.validateField('ciSwitch.switchCode');
|
||||
}
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var validateSwitch = (rule, value, callback) => {
|
||||
if (!value && !this.addModel.sectionCode) {
|
||||
callback(new Error('区段和道岔必须选填其一'));
|
||||
} else {
|
||||
if (!this.addModel.sectionCode) {
|
||||
this.$refs.form.validateField('sectionCode');
|
||||
}
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
isSave: true,
|
||||
field: '',
|
||||
loading: false,
|
||||
SwitchLocateTypeList: [
|
||||
{ name: '定位', code: true },
|
||||
{ name: '反位', code: false }
|
||||
],
|
||||
addModel: {
|
||||
mapId: '',
|
||||
code: '',
|
||||
sectionCode: '',
|
||||
ciSwitch: {
|
||||
switchCode: '',
|
||||
normal: true
|
||||
},
|
||||
switchCode: ''
|
||||
},
|
||||
rules: {
|
||||
sectionCode: [
|
||||
{ validator: validateSection, trigger: 'change' }
|
||||
],
|
||||
'ciSwitch.switchCode': [
|
||||
{ validator: validateSwitch, trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'switchList',
|
||||
'sectionList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
mapInfo(val) {
|
||||
if (val) {
|
||||
this.addModel.mapId = val.id;
|
||||
}
|
||||
},
|
||||
overrunData(val, old) {
|
||||
if (val) {
|
||||
this.addModel = {
|
||||
mapId: val.mapId,
|
||||
code: val.code,
|
||||
sectionCode: val.sectionCode,
|
||||
ciSwitch: val.ciSwitch ? val.ciSwitch : { switchCode: '', normal: true },
|
||||
switchCode: val.switchCode
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
},
|
||||
save() {
|
||||
// console.log('暂无接口');createRoute
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const modle = {
|
||||
mapId: this.mapInfo.id,
|
||||
code: '',
|
||||
sectionCode: this.addModel.sectionCode,
|
||||
ciSwitch: this.addModel.ciSwitch.switchCode ? this.addModel.ciSwitch : null,
|
||||
switchCode: this.addModel.switchCode
|
||||
};
|
||||
createOverrunSection(this.mapInfo.id, modle).then(res => {
|
||||
this.$message.success('保存超限区段成功!');
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$message.error('保存超限区段失败!');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
update() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const modle = {
|
||||
mapId: this.mapInfo.id,
|
||||
code: this.addModel.code,
|
||||
sectionCode: this.addModel.sectionCode,
|
||||
ciSwitch: this.addModel.ciSwitch.switchCode ? this.addModel.ciSwitch : null,
|
||||
switchCode: this.addModel.switchCode
|
||||
};
|
||||
updateOverrunSection(this.mapInfo.id, modle).then(res => {
|
||||
this.$message.success('更新超限区段成功!');
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$message.error('更新超限区段失败!');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
clear() {
|
||||
if (this.$refs && this.$refs.form && this.mapInfo) {
|
||||
delete this.addModel.id;
|
||||
this.$refs.form.resetFields();
|
||||
this.addModel.mapId = this.mapInfo.id;
|
||||
this.addModel.sectionCode = '';
|
||||
this.addModel.ciSwitch = { switchCode: '', normal: true };
|
||||
this.addModel.switchCode = '';
|
||||
}
|
||||
},
|
||||
setSelected(selected) {
|
||||
if (selected) {
|
||||
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && selected._type !== '02' && this.field.toUpperCase() === 'overrunSection'.toUpperCase()) {
|
||||
this.addModel.sectionCode = selected.code;
|
||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'overrunSwitch'.toUpperCase()) {
|
||||
this.addModel.ciSwitch.switchCode = selected.code;
|
||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'protectiveSwitch'.toUpperCase()) {
|
||||
this.addModel.switchCode = selected.code;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ .el-radio {
|
||||
margin-right: 10px;
|
||||
}
|
||||
/deep/ {
|
||||
.el-select .el-tag {
|
||||
height: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-right: 15px;
|
||||
box-sizing: border-box;
|
||||
white-space: normal;
|
||||
}
|
||||
.el-input__suffix{
|
||||
right: 2px;
|
||||
}
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -149,6 +149,16 @@
|
||||
@click="hover('routeStationStandList')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联超限区段" prop="overrunList">
|
||||
<el-select v-model="addModel.overrunList" multiple clearable filterable style="width: 220px;">
|
||||
<el-option
|
||||
v-for="item in overrunSectionList"
|
||||
:key="item.code"
|
||||
:label="getOverrunName(item)"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<hostile-data ref="hostile" :conflicting-signal-list="addModel.conflictingSignalList" @hover="hover" />
|
||||
<br>
|
||||
@ -164,7 +174,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getRouteNewList, getFlankProtectionList, putSetDraftMapRouteById, createRoute } from '@/api/jmap/mapdraft';
|
||||
import { getRouteNewList, getFlankProtectionList, putSetDraftMapRouteById, createRoute, queryOverunSectionList } from '@/api/jmap/mapdraft';
|
||||
import HostileData from './hostileData';
|
||||
// import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
@ -232,9 +242,11 @@ export default {
|
||||
flankProtectionList: [],
|
||||
stationStandList: [], // 站台数据列表
|
||||
overlapCode:'',
|
||||
overrunList: [], // 超限区段数据列表
|
||||
conflictingSignalList: [] // 敌对信号数据列表
|
||||
},
|
||||
// overlapList: [], // 延续保护列表
|
||||
overrunSectionList: [], // 超限区段数据列表
|
||||
routeList: [] // 进路列表
|
||||
};
|
||||
},
|
||||
@ -343,6 +355,7 @@ export default {
|
||||
mounted() {
|
||||
this.getRouteList();
|
||||
this.getFlankProtectList();
|
||||
this.getOverrunSectionList();
|
||||
// this.initProtectData();
|
||||
// EventBus.$on('successCI', () => {
|
||||
// this.initProtectData();
|
||||
@ -354,6 +367,17 @@ export default {
|
||||
return station.ciStation;
|
||||
});
|
||||
},
|
||||
getOverrunName(overrun) {
|
||||
if (overrun.ciSwitch && overrun.ciSwitch.switchCode) {
|
||||
const switchDevice = this.$store.getters['map/getDeviceByCode'](overrun.ciSwitch.switchCode);
|
||||
return switchDevice ? overrun.code + '(' + switchDevice.name + '-' + (overrun.ciSwitch.normal ? '定位' : '反位') + ')' : overrun.code;
|
||||
} else if (overrun.sectionCode) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](overrun.sectionCode);
|
||||
return section ? overrun.code + '(' + section.name + ')' : overrun.code;
|
||||
} else {
|
||||
return overrun.code;
|
||||
}
|
||||
},
|
||||
async getRouteList() {
|
||||
const response = await getRouteNewList(this.$route.params.mapId, { pageSize: 9999, pageNum: 1 });
|
||||
this.routeList = response.data.list;
|
||||
@ -364,6 +388,11 @@ export default {
|
||||
this.$store.dispatch('map/setFlankProtectList', item);
|
||||
});
|
||||
},
|
||||
getOverrunSectionList() {
|
||||
queryOverunSectionList(this.$route.params.mapId).then(resp => {
|
||||
this.overrunSectionList = resp.data;
|
||||
});
|
||||
},
|
||||
swictchName(code) {
|
||||
let name = '';
|
||||
if (code) {
|
||||
@ -436,6 +465,7 @@ export default {
|
||||
this.addModel.overlapCode = '';
|
||||
this.addModel.code = '';
|
||||
this.addModel.conflictingSignalList = [];
|
||||
this.addModel.overrunList = [];
|
||||
this.isSave = true;
|
||||
this.routeCode = '';
|
||||
this.routeType = '';
|
||||
|
@ -50,9 +50,6 @@ export default {
|
||||
if (this.type == 'Text') {
|
||||
data.content = `${this.editModel.prepend}::${this.editModel.content}`;
|
||||
}
|
||||
if (data.type !== 'VB') {
|
||||
data.signalCode = '';
|
||||
}
|
||||
this.$emit('updateMapModel', data);
|
||||
this.$emit('clearDeviceSelect');
|
||||
} else {
|
||||
|
@ -8,7 +8,7 @@
|
||||
:centralized-station-list="centralizedStationList"
|
||||
:responder-list="responderList"
|
||||
:section-list="filterSectionList"
|
||||
:signalList="signalList"
|
||||
:signal-list="signalList"
|
||||
v-on="$listeners"
|
||||
@hover="hover"
|
||||
@deviceChange="deviceChange"
|
||||
@ -31,24 +31,25 @@
|
||||
/>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane class="view-control" label="批量创建" name="third" :lazy="lazy">
|
||||
<responder-batch
|
||||
<responder-batch
|
||||
ref="respBatch"
|
||||
:field="field"
|
||||
:responder-type-list="responderTypeList"
|
||||
:centralized-station-list="centralizedStationList"
|
||||
:responder-list="responderList"
|
||||
:section-list="filterSectionList"
|
||||
:signalList="signalList"
|
||||
:signal-list="signalList"
|
||||
v-on="$listeners"
|
||||
@hover="hover"
|
||||
@deviceChange="deviceChange"
|
||||
@deviceSelect="deviceSelect" />
|
||||
@deviceSelect="deviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" label="批量操作" name="fourth" :lazy="lazy">
|
||||
<responder-batch-operate
|
||||
<responder-batch-operate
|
||||
:responder-list="responderList"
|
||||
:signal-list="signalList"
|
||||
/>
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
@ -88,8 +89,8 @@ export default {
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'sectionList',
|
||||
'signalList',
|
||||
'sectionList',
|
||||
'signalList',
|
||||
'responderList'
|
||||
]),
|
||||
filterSectionList() {
|
||||
@ -132,18 +133,18 @@ export default {
|
||||
this.$emit('deviceSelect', '');
|
||||
} else {
|
||||
this.$message.error('请选择物理区段');
|
||||
}
|
||||
}
|
||||
|
||||
} else if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'RelModelSignalCode'.toUpperCase()) {
|
||||
this.$refs.respModel.setModelProp(selected, 'signalCode');
|
||||
this.activeName = 'first';
|
||||
this.field = '';
|
||||
this.$emit('deviceSelect', '');
|
||||
this.$refs.respModel.setModelProp(selected, 'signalCode');
|
||||
this.activeName = 'first';
|
||||
this.field = '';
|
||||
this.$emit('deviceSelect', '');
|
||||
} else if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'RelSignalCode'.toUpperCase()) {
|
||||
this.$refs.respCreate.setModelProp(selected, 'signalCode');
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('deviceSelect', '');
|
||||
this.$refs.respCreate.setModelProp(selected, 'signalCode');
|
||||
this.activeName = 'second';
|
||||
this.field = '';
|
||||
this.$emit('deviceSelect', '');
|
||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'RelSectionCode'.toUpperCase()) {
|
||||
if (['01', '03'].includes(selected.type)) {
|
||||
this.$refs.respCreate.setModelProp(selected, 'sectionCode');
|
||||
@ -154,10 +155,10 @@ export default {
|
||||
this.$message.error('请选择物理区段');
|
||||
}
|
||||
} else if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'RelBatchSignalCode'.toUpperCase()) {
|
||||
this.$refs.respBatch.setModelProp(selected, 'signalCode');
|
||||
this.activeName = 'third';
|
||||
this.field = '';
|
||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'RelBatchSectionCode'.toUpperCase()) {
|
||||
this.$refs.respBatch.setModelProp(selected, 'signalCode');
|
||||
this.activeName = 'third';
|
||||
this.field = '';
|
||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'RelBatchSectionCode'.toUpperCase()) {
|
||||
if (['01', '03'].includes(selected.type)) {
|
||||
this.$refs.respBatch.setModelProp(selected, 'sectionCode');
|
||||
this.activeName = 'third';
|
||||
@ -169,17 +170,17 @@ export default {
|
||||
} else if (!selected) {
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
},
|
||||
edit() {
|
||||
if (this.$refs.respModel) {
|
||||
this.$refs.respModel.edit()
|
||||
}
|
||||
},
|
||||
deleteObj() {
|
||||
if (this.$refs.respModel) {
|
||||
this.$refs.respModel.deleteObj()
|
||||
}
|
||||
}
|
||||
},
|
||||
edit() {
|
||||
if (this.$refs.respModel) {
|
||||
this.$refs.respModel.edit();
|
||||
}
|
||||
},
|
||||
deleteObj() {
|
||||
if (this.$refs.respModel) {
|
||||
this.$refs.respModel.deleteObj();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,314 +1,318 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
label-width="90px"
|
||||
:model="formData"
|
||||
size="mini"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="区段" prop="sectionCode">
|
||||
<el-select
|
||||
v-model="formData.sectionCode"
|
||||
filterable
|
||||
class="responderSet"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
:label="item.name + '(' + item.code + ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
@click="handleHover(-1, 'RelBatchSectionCode')"
|
||||
:type="
|
||||
field === 'RelBatchSectionCode' && row === -1
|
||||
? 'danger'
|
||||
: 'primary'
|
||||
"
|
||||
>
|
||||
激活
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select
|
||||
v-model="formData.type"
|
||||
filterable
|
||||
class="responderSet"
|
||||
placeholder="请选择"
|
||||
@change="changeSubFormType"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in responderTypeList"
|
||||
:key="item.value"
|
||||
:label="`${item.name}(${item.value})`"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="创建数量" prop="count">
|
||||
<el-input
|
||||
v-model="formData.count"
|
||||
class="responderSet"
|
||||
placeholder="请输入数量"
|
||||
type="number"
|
||||
min="1"
|
||||
max="10"
|
||||
@blur="numBlur"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="sub-form" v-if="subFormData.length">
|
||||
<template v-for="(item, index) in subFormData">
|
||||
<div :key="`subFormUnit${index}`" class="sub-form-unit">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="名称">
|
||||
<el-input
|
||||
v-model="item.name"
|
||||
placeholder="请输入名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型">
|
||||
<el-select
|
||||
v-model="item.type"
|
||||
filterable
|
||||
placeholder="请选择类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in responderTypeList"
|
||||
:key="opt.value"
|
||||
:label="`${opt.name}(${opt.value})`"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="区段偏移值">
|
||||
<el-input-number v-model="item.offset" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="14" v-if="item.type === 'VB'">
|
||||
<el-form-item label="信号机">
|
||||
<el-select
|
||||
v-model="item.signalCode"
|
||||
filterable
|
||||
placeholder="请选择信号机"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in signalList"
|
||||
:key="opt.code"
|
||||
:label="`${opt.name}(${opt.code})`"
|
||||
:value="opt.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
@click="
|
||||
handleHover(index, 'RelBatchSignalCode')
|
||||
"
|
||||
:type="
|
||||
field === 'RelBatchSignalCode' &&
|
||||
row === index
|
||||
? 'danger'
|
||||
: 'primary'
|
||||
"
|
||||
>
|
||||
激活
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="btn-area">
|
||||
<el-button size="small" type="primary" @click="doBatchCreate"
|
||||
>批量创建</el-button
|
||||
>
|
||||
<el-button size="small" type="danger" @click="resetForm"
|
||||
>重置</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-form
|
||||
ref="form"
|
||||
label-width="90px"
|
||||
:model="formData"
|
||||
size="mini"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="区段" prop="sectionCode">
|
||||
<el-select
|
||||
v-model="formData.sectionCode"
|
||||
filterable
|
||||
class="responderSet"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
:label="item.name + '(' + item.code + ')'"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type="
|
||||
field === 'RelBatchSectionCode' && row === -1
|
||||
? 'danger'
|
||||
: 'primary'
|
||||
"
|
||||
@click="handleHover(-1, 'RelBatchSectionCode')"
|
||||
>
|
||||
激活
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select
|
||||
v-model="formData.type"
|
||||
filterable
|
||||
class="responderSet"
|
||||
placeholder="请选择"
|
||||
@change="changeSubFormType"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in responderTypeList"
|
||||
:key="item.value"
|
||||
:label="`${item.name}(${item.value})`"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="创建数量" prop="count">
|
||||
<el-input
|
||||
v-model="formData.count"
|
||||
class="responderSet"
|
||||
placeholder="请输入数量"
|
||||
type="number"
|
||||
min="1"
|
||||
max="10"
|
||||
@blur="numBlur"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="subFormData.length" class="sub-form">
|
||||
<template v-for="(item, index) in subFormData">
|
||||
<div :key="`subFormUnit${index}`" class="sub-form-unit">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="名称">
|
||||
<el-input
|
||||
v-model="item.name"
|
||||
placeholder="请输入名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型">
|
||||
<el-select
|
||||
v-model="item.type"
|
||||
filterable
|
||||
placeholder="请选择类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in responderTypeList"
|
||||
:key="opt.value"
|
||||
:label="`${opt.name}(${opt.value})`"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="区段偏移值">
|
||||
<el-input-number v-model="item.offset" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="item.type === 'VB'" :span="14">
|
||||
<el-form-item label="信号机">
|
||||
<el-select
|
||||
v-model="item.signalCode"
|
||||
filterable
|
||||
placeholder="请选择信号机"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in signalList"
|
||||
:key="opt.code"
|
||||
:label="`${opt.name}(${opt.code})`"
|
||||
:value="opt.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type="
|
||||
field === 'RelBatchSignalCode' &&
|
||||
row === index
|
||||
? 'danger'
|
||||
: 'primary'
|
||||
"
|
||||
@click="
|
||||
handleHover(index, 'RelBatchSignalCode')
|
||||
"
|
||||
>
|
||||
激活
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="btn-area">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="doBatchCreate"
|
||||
>批量创建</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="danger"
|
||||
@click="resetForm"
|
||||
>重置</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as utils from "./utils";
|
||||
import * as utils from './utils';
|
||||
export default {
|
||||
name: "responderBatch",
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
field: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
responderTypeList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
sectionList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
signalList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
responderList: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
sectionCode: "",
|
||||
type: "",
|
||||
count: 0
|
||||
},
|
||||
subFormData: [],
|
||||
row: -2,
|
||||
formRules: {
|
||||
sectionCode: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择区段"
|
||||
}
|
||||
],
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择类型"
|
||||
}
|
||||
],
|
||||
count: [
|
||||
{
|
||||
validator: (rule, value, cb) => {
|
||||
value !== 0 ? cb() : cb(new Error("至少创建一个"));
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
setModelProp(selected, prop) {
|
||||
if (prop === "sectionCode") {
|
||||
//激活区段
|
||||
this.formData[prop] = selected.code;
|
||||
} else if (prop === "signalCode") {
|
||||
//激活信号机
|
||||
this.subFormData[this.row][prop] = selected.code;
|
||||
}
|
||||
},
|
||||
numBlur() {
|
||||
const oldNum = this.subFormData.length;
|
||||
const newNum = this.formData.count;
|
||||
if (oldNum < newNum) {
|
||||
this.subFormData = [
|
||||
...this.subFormData,
|
||||
...this.createSubForm(newNum - oldNum)
|
||||
];
|
||||
} else if (oldNum > newNum) {
|
||||
this.subFormData = this.subFormData.slice(0, newNum);
|
||||
}
|
||||
},
|
||||
createSubForm(length) {
|
||||
return Array.from({ length }, _ => {
|
||||
return {
|
||||
name: "",
|
||||
type: this.formData.type,
|
||||
offset: 0,
|
||||
signalCode: ""
|
||||
};
|
||||
});
|
||||
},
|
||||
changeSubFormType() {
|
||||
this.subFormData.forEach(_ => {
|
||||
_.type = this.formData.type;
|
||||
});
|
||||
},
|
||||
handleHover(row, prop) {
|
||||
this.row = row;
|
||||
this.$emit("hover", prop);
|
||||
},
|
||||
doBatchCreate() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
const groupMap = {};
|
||||
const models = [];
|
||||
// 分组
|
||||
this.subFormData.forEach(el => {
|
||||
if (el.type !== "VB") el.signalCode = "";
|
||||
el.sectionCode = this.formData.sectionCode;
|
||||
if (!groupMap[el.sectionCode]) {
|
||||
groupMap[el.sectionCode] = [];
|
||||
}
|
||||
groupMap[el.sectionCode].push(el);
|
||||
});
|
||||
name: 'ResponderBatch',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
field: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
responderTypeList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
sectionList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
signalList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
responderList: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
sectionCode: '',
|
||||
type: '',
|
||||
count: 0
|
||||
},
|
||||
subFormData: [],
|
||||
row: -2,
|
||||
formRules: {
|
||||
sectionCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择区段'
|
||||
}
|
||||
],
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择类型'
|
||||
}
|
||||
],
|
||||
count: [
|
||||
{
|
||||
validator: (rule, value, cb) => {
|
||||
value !== 0 ? cb() : cb(new Error('至少创建一个'));
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
setModelProp(selected, prop) {
|
||||
if (prop === 'sectionCode') {
|
||||
// 激活区段
|
||||
this.formData[prop] = selected.code;
|
||||
} else if (prop === 'signalCode') {
|
||||
// 激活信号机
|
||||
this.subFormData[this.row][prop] = selected.code;
|
||||
}
|
||||
},
|
||||
numBlur() {
|
||||
const oldNum = this.subFormData.length;
|
||||
const newNum = this.formData.count;
|
||||
if (oldNum < newNum) {
|
||||
this.subFormData = [
|
||||
...this.subFormData,
|
||||
...this.createSubForm(newNum - oldNum)
|
||||
];
|
||||
} else if (oldNum > newNum) {
|
||||
this.subFormData = this.subFormData.slice(0, newNum);
|
||||
}
|
||||
},
|
||||
createSubForm(length) {
|
||||
return Array.from({ length }, _ => {
|
||||
return {
|
||||
name: '',
|
||||
type: this.formData.type,
|
||||
offset: 0,
|
||||
signalCode: ''
|
||||
};
|
||||
});
|
||||
},
|
||||
changeSubFormType() {
|
||||
this.subFormData.forEach(_ => {
|
||||
_.type = this.formData.type;
|
||||
});
|
||||
},
|
||||
handleHover(row, prop) {
|
||||
this.row = row;
|
||||
this.$emit('hover', prop);
|
||||
},
|
||||
doBatchCreate() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
const groupMap = {};
|
||||
const models = [];
|
||||
// 分组
|
||||
this.subFormData.forEach(el => {
|
||||
if (el.type !== 'VB') el.signalCode = '';
|
||||
el.sectionCode = this.formData.sectionCode;
|
||||
if (!groupMap[el.sectionCode]) {
|
||||
groupMap[el.sectionCode] = [];
|
||||
}
|
||||
groupMap[el.sectionCode].push(el);
|
||||
});
|
||||
|
||||
// 绘图位置计算
|
||||
Object.keys(groupMap).forEach(code => {
|
||||
const section = this.$store.getters[
|
||||
"map/getDeviceByCode"
|
||||
](code);
|
||||
const list = groupMap[code];
|
||||
const length = list.length;
|
||||
const ox =
|
||||
// 绘图位置计算
|
||||
Object.keys(groupMap).forEach(code => {
|
||||
const section = this.$store.getters[
|
||||
'map/getDeviceByCode'
|
||||
](code);
|
||||
const list = groupMap[code];
|
||||
const length = list.length;
|
||||
const ox =
|
||||
(section.points[section.points.length - 1].x -
|
||||
section.points[0].x) /
|
||||
(length + 1);
|
||||
const oy =
|
||||
const oy =
|
||||
(section.points[section.points.length - 1].y -
|
||||
section.points[0].y) /
|
||||
(length + 1);
|
||||
list.forEach((el, i) => {
|
||||
const x = section.points[0].x + ox * (i + 1);
|
||||
const y = section.points[0].y + oy * (i + 1);
|
||||
models.push(
|
||||
utils.buildModelBySection(
|
||||
section,
|
||||
{ x, y },
|
||||
el,
|
||||
this.responderList
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
// 批量创建
|
||||
this.$emit("updateMapModel", models);
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm() {
|
||||
this.formData = {
|
||||
sectionCode: "",
|
||||
type: "",
|
||||
count: 0
|
||||
};
|
||||
this.numBlur();
|
||||
}
|
||||
}
|
||||
list.forEach((el, i) => {
|
||||
const x = section.points[0].x + ox * (i + 1);
|
||||
const y = section.points[0].y + oy * (i + 1);
|
||||
models.push(
|
||||
utils.buildModelBySection(
|
||||
section,
|
||||
{ x, y },
|
||||
el,
|
||||
this.responderList
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
// 批量创建
|
||||
this.$emit('updateMapModel', models);
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm() {
|
||||
this.formData = {
|
||||
sectionCode: '',
|
||||
type: '',
|
||||
count: 0
|
||||
};
|
||||
this.numBlur();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -1,72 +1,74 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<el-button type="primary" size="mini" @click="batchConnectHandler"
|
||||
>一键关联信号机</el-button
|
||||
>
|
||||
<div class="desc">一键将未关联信号机的可变应答器关联到最近的信号机</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="batchConnectHandler"
|
||||
>一键关联信号机</el-button>
|
||||
<div class="desc">一键将未关联信号机的可变应答器关联到最近的信号机</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "responderBatchOperate",
|
||||
props: ["responderList", "signalList"],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
batchConnectHandler() {
|
||||
try {
|
||||
let models = this.responderList.filter(
|
||||
el => el.type === "VB" && !el.signalCode
|
||||
);
|
||||
models.forEach(responder => {
|
||||
const sectionCode = responder.sectionCode;
|
||||
let signals = this.signalList.filter(
|
||||
signal => signal.sectionCode === sectionCode
|
||||
);
|
||||
if (signals.length === 1) {
|
||||
responder.signalCode = signals[0].code;
|
||||
} else if (signals.length > 1) {
|
||||
let signalsPosition = signals.map(_ => _.position);
|
||||
let nearestSignalCode =
|
||||
name: 'ResponderBatchOperate',
|
||||
props: ['responderList', 'signalList'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
batchConnectHandler() {
|
||||
try {
|
||||
const models = this.responderList.filter(
|
||||
el => el.type === 'VB' && !el.signalCode
|
||||
);
|
||||
models.forEach(responder => {
|
||||
const sectionCode = responder.sectionCode;
|
||||
const signals = this.signalList.filter(
|
||||
signal => signal.sectionCode === sectionCode
|
||||
);
|
||||
if (signals.length === 1) {
|
||||
responder.signalCode = signals[0].code;
|
||||
} else if (signals.length > 1) {
|
||||
const signalsPosition = signals.map(_ => _.position);
|
||||
const nearestSignalCode =
|
||||
signals[
|
||||
this.chooseNearestSignal(
|
||||
responder.position,
|
||||
signalsPosition
|
||||
)
|
||||
this.chooseNearestSignal(
|
||||
responder.position,
|
||||
signalsPosition
|
||||
)
|
||||
].code;
|
||||
responder.signalCode = nearestSignalCode;
|
||||
}
|
||||
});
|
||||
this.$emit("updateMapModel", models);
|
||||
this.$message.success("关联成功");
|
||||
} catch (error) {
|
||||
this.$message.info(error);
|
||||
}
|
||||
},
|
||||
responder.signalCode = nearestSignalCode;
|
||||
}
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
this.$message.success('关联成功');
|
||||
} catch (error) {
|
||||
this.$message.info(error);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* 计算最近的信号机的序号
|
||||
* @param {Object} respPos
|
||||
* @param {Number} respPos.x
|
||||
* @param {Number} respPos.y
|
||||
* @returns {Number} index of the Nearest element
|
||||
*/
|
||||
chooseNearestSignal(respPos, sigPos) {
|
||||
let [minDistance, idx] = [Infinity, -1];
|
||||
sigPos.forEach((s, i) => {
|
||||
let distance = this.distanceOf(respPos, s);
|
||||
if (distance < minDistance) [minDistance, idx] = [distance, i];
|
||||
});
|
||||
return idx;
|
||||
},
|
||||
chooseNearestSignal(respPos, sigPos) {
|
||||
let [minDistance, idx] = [Infinity, -1];
|
||||
sigPos.forEach((s, i) => {
|
||||
const distance = this.distanceOf(respPos, s);
|
||||
if (distance < minDistance) [minDistance, idx] = [distance, i];
|
||||
});
|
||||
return idx;
|
||||
},
|
||||
|
||||
// 采用合理的距离计算方式
|
||||
distanceOf(a, b) {
|
||||
return Math.hypot(b.x - a.x, b.y - a.y);
|
||||
}
|
||||
}
|
||||
// 采用合理的距离计算方式
|
||||
distanceOf(a, b) {
|
||||
return Math.hypot(b.x - a.x, b.y - a.y);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -34,11 +34,11 @@ export default {
|
||||
sectionList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
signalList: {
|
||||
},
|
||||
signalList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
responderList: {
|
||||
type: Array,
|
||||
required: true
|
||||
@ -49,8 +49,8 @@ export default {
|
||||
addModel: {
|
||||
type: '',
|
||||
name: '',
|
||||
sectionCode: '',
|
||||
signalCode: ''
|
||||
sectionCode: '',
|
||||
signalCode: ''
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
@ -61,20 +61,20 @@ export default {
|
||||
],
|
||||
sectionCode: [
|
||||
{ required: true, message: '请关联物理区段', trigger: 'blur' }
|
||||
],
|
||||
signalCode: [
|
||||
],
|
||||
signalCode: [
|
||||
{ required: true, message: '请关联信号机', trigger: 'blur' }
|
||||
]
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isSectionButtonType() {
|
||||
return this.field == 'RelSectionCode';
|
||||
},
|
||||
isSignalButtonType() {
|
||||
},
|
||||
isSignalButtonType() {
|
||||
return this.field == 'RelSignalCode';
|
||||
},
|
||||
},
|
||||
createForm() {
|
||||
const form = {
|
||||
labelWidth: '110px',
|
||||
@ -84,8 +84,8 @@ export default {
|
||||
item: [
|
||||
{ prop: 'name', label: '应答器名称', type: 'input' },
|
||||
{ prop: 'type', label: `应答器类型`, type: 'select', optionLabel: 'name&&value', optionValue: 'value', options: this.responderTypeList },
|
||||
{ prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType },
|
||||
{ prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType },
|
||||
{ prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType },
|
||||
{ prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -101,10 +101,10 @@ export default {
|
||||
this.addModel[prop] = selected.code;
|
||||
},
|
||||
create() {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
||||
const length = section.points.length;
|
||||
const x = (section.points[length - 1].x + section.points[0].x) / 2;
|
||||
const y = (section.points[length - 1].y + section.points[0].y) / 2;
|
||||
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
||||
const length = section.points.length;
|
||||
const x = (section.points[length - 1].x + section.points[0].x) / 2;
|
||||
const y = (section.points[length - 1].y + section.points[0].y) / 2;
|
||||
const model = utils.buildModelBySection(section, {x, y}, this.addModel, this.responderList);
|
||||
this.$refs.createForm.resetForm();
|
||||
this.$emit('updateMapModel', model);
|
||||
|
@ -37,11 +37,11 @@ export default {
|
||||
sectionList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
signalList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
signalList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
responderList: {
|
||||
type: Array,
|
||||
required: true
|
||||
@ -69,8 +69,8 @@ export default {
|
||||
},
|
||||
offset: 0,
|
||||
sectionCode: '',
|
||||
stationCode: '',
|
||||
signalCode: ''
|
||||
stationCode: '',
|
||||
signalCode: ''
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
@ -93,10 +93,10 @@ export default {
|
||||
],
|
||||
sectionCode: [
|
||||
{ required: true, message: '请关联物理区段', trigger: 'blur' }
|
||||
],
|
||||
signalCode: [
|
||||
],
|
||||
signalCode: [
|
||||
{ required: true, message: '请关联信号机', trigger: 'blur' }
|
||||
],
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: '请输入应答器坐标x', trigger: 'blur' }
|
||||
],
|
||||
@ -113,10 +113,10 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isSectionButtonType() {
|
||||
isSectionButtonType() {
|
||||
return this.field == 'RelModelSectionCode';
|
||||
},
|
||||
isSignalButtonType() {
|
||||
},
|
||||
isSignalButtonType() {
|
||||
return this.field == 'RelModelSignalCode';
|
||||
},
|
||||
form() {
|
||||
@ -144,9 +144,9 @@ export default {
|
||||
{ prop: 'textOffset.y', firstLevel: 'textOffset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
|
||||
] },
|
||||
{ prop:'textRotate', label: '文字旋转', type: 'number' },
|
||||
{ prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelModelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType },
|
||||
this.editModel.type === 'VB'? { prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelModelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType } :'',
|
||||
{ prop: 'stationCode', label: '关联集中站' + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }
|
||||
{ prop: 'sectionCode', label: '关联区段', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, buttonType: 'RelModelSectionCode', hover: this.hover, buttonShowType: this.isSectionButtonType },
|
||||
this.editModel.type === 'VB' || this.editModel.type === 'IB' ? { prop: 'signalCode', label: '关联信号机', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalList, buttonType: 'RelModelSignalCode', hover: this.hover, buttonShowType: this.isSignalButtonType } : '',
|
||||
{ prop: 'stationCode', label: '关联集中站' + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }
|
||||
]
|
||||
},
|
||||
map: {
|
||||
@ -160,12 +160,12 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hover(field) {
|
||||
hover(field) {
|
||||
this.$emit('hover', field);
|
||||
},
|
||||
setModelProp(selected, prop) {
|
||||
this.editModel[prop] = selected.code;
|
||||
},
|
||||
},
|
||||
setModelProp(selected, prop) {
|
||||
this.editModel[prop] = selected.code;
|
||||
},
|
||||
setModel(selected) {
|
||||
if (!selected.signalCode) selected.signalCode = '';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
@ -183,6 +183,9 @@ export default {
|
||||
this.$refs.dataform.edit();
|
||||
},
|
||||
updateMapModel(data) {
|
||||
if (data.type !== 'VB' && data.type !== 'IB') {
|
||||
data.signalCode = '';
|
||||
}
|
||||
this.$emit('updateMapModel', data);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user