This commit is contained in:
sunzhenyu 2020-12-10 11:29:23 +08:00
commit 72abaf9643
60 changed files with 3635 additions and 1257 deletions

View File

@ -152,6 +152,23 @@ export function deleteRoutingData(routingId) {
});
}
/** 保存用户配置 (新版)*/
export function addRunplanConfig(mapId, data) {
return request({
url: `/api/runPlan/userData/${mapId}/config`,
method: 'post',
data: data
});
}
/** 获取用户配置(新版)*/
export function getRunplanConfig(mapId) {
return request({
url: `/api/runPlan/userData/${mapId}/config`,
method: 'get'
});
}
/** 获取交路详情(新版)*/
export function getRoutingData(routingId) {
return request({

View File

@ -147,10 +147,19 @@ export function checkServiceNumberExist({ planId, serviceNumber }) {
});
}
/** 查询交路列表*/
export function getRoutingList(planId) {
// /** 查询交路列表*/
// export function getRoutingList(planId) {
// return request({
// url: `/api/runPlan/draft/${planId}/routingList`,
// method: 'get'
// });
// }
/** 查询用户交路数据 (新版)*/
export function listUserRoutingData(mapId) {
return request({
url: `/api/runPlan/draft/${planId}/routingList`,
// url: `/api/mapBuild/${mapId}/routingData`,
url: `/api/runPlan/userData/${mapId}/routing`,
method: 'get'
});
}
@ -233,10 +242,19 @@ export function updatePlanTrip(data) {
});
}
/** 根据车次号查询交路*/
/** 根据车次号查询交路 */
export function getRoutingBySDTNumber(params) {
// 旧版
// return request({
// url: `/api/runPlan/draft/${params.planId}/routing`,
// method: 'get',
// params: {
// SDTNumber: params.SDTNumber
// }
// });
// 新版
return request({
url: `/api/runPlan/draft/${params.planId}/routing`,
url: `/api/runPlan/draft/${params.planId}/userRouting`,
method: 'get',
params: {
SDTNumber: params.SDTNumber
@ -252,6 +270,15 @@ export function updateServiceNumber(planId, serviceNumber, newServiceNumber) {
});
}
/** 生成计划(新版)*/
export function generatePlanTrain(planId, data) {
return request({
url: `/api/runPlan/draft/${planId}/service/generate`,
method: 'post',
data
});
}
/** 修改任务车次号*/
export function updateTripNumber(planId, SDTNumber, tripNumber) {
return request({

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

View File

@ -1,5 +1,5 @@
<template>
<el-form ref="form" :rules="rules" :model="formModel" :inline="inline" :label-width="form.labelWidth" @submit.native.prevent>
<el-form ref="form" :rules="rules" :model="formModel" :inline="inline" :label-width="form.labelWidth" :size="form.size?form.size:'medium'" @submit.native.prevent>
<template v-for="item in form.items">
<template v-if="checkFieldType(item, 'text')">
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
@ -199,6 +199,7 @@
v-model="formModel[item.prop]"
filterable
:placeholder="item.placeholder"
:no-data-text="item.noDataText?item.noDataText:'无数据'"
:disabled="item.disabled"
@change="item.onChange"
>
@ -215,6 +216,7 @@
<el-select
v-model="formModel[item.prop]"
filterable
:no-data-text="item.noDataText?item.noDataText:'无数据'"
:clearable="item.clearable"
:placeholder="item.placeholder"
:disabled="item.disabled"

View File

@ -81,6 +81,7 @@ export default {
modifySuccess: 'Modify Success',
modifyFailed: 'Modify Failed',
modifyRunLevel: 'Modify run level',
modifyStopTime:'Modify stop time',
startStationTips: 'Start station departure time unchanged',
endStationTips: 'End station departure time unchanged',
@ -142,7 +143,7 @@ export default {
afterTheTrainHasBackInterval: 'After the train has a back interval',
secondsCanBeRunnedByTrain: 'seconds can be runned by train',
defaultStopTime: 'Default stop time:',
defaultRunLevel: 'Default run level:',
defaultRunLevel: 'Run level:',
stopTime: 'Stop time',
runLevel: 'Run level',
platform: 'Platform',
@ -236,5 +237,6 @@ export default {
modifyName: 'Modify name',
applyRelease:'Apply for release',
preview:'Preview',
revoke:'Revoke'
revoke:'Revoke',
gerneratePlan:'Gernerate plan'
};

View File

@ -39,7 +39,7 @@ export default {
continuationPlan: '延续计划',
firstTrain: '首班车',
serialNumber: '序列号:',
defaultRunLevel: '缺省运行等级:',
defaultRunLevel: '运行等级:',
startTime: '开始时间',
selectTime: '选择时间',
inStock: '入库',
@ -81,6 +81,7 @@ export default {
modifySuccess: '修改成功!',
modifyFailed: '修改失败',
modifyRunLevel: '修改运行等级',
modifyStopTime:'修改停站时间',
startStationTips: '起始站发车时间不变',
endStationTips: '终到站到达时间不变',
@ -239,5 +240,6 @@ export default {
modifyName: '修改名称',
applyRelease:'申请发布',
preview:'预览',
revoke:'撤回'
revoke:'撤回',
gerneratePlan:'生成计划'
};

View File

@ -336,6 +336,26 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.StationTurnBack] = { // 站后折返
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示
lamp: {
fill: '#f1f1f1', // 填充色
radiusR: 7 // 控制灯大小
},
text: {
titleTextShow: false,
fontWeight: 580,
fontSize: 10,
distance: 10
},
rect: {
fill: 'rgba(0,0,0,0)',
stroke: '#fff',
lineWidth: 0,
padding: 6
}
};
this[deviceType.Station] = {
// 成都三号线车站元素 车站名称
elemnetType:['stationText'],

View File

@ -90,7 +90,7 @@ class SkinCode extends defaultStyle {
faultLockColor: '#81007F', // 区段故障锁定颜色
undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FFFFFF', // 保护区段锁闭
blockColor: '#d659d6', // 区段封锁颜色(淡紫色)
blockColor: '#FE0000', // 区段封锁颜色(淡紫色)
atcExcisionColor: '#A0522D', // 区段atc切除颜色
atsExcisionColor: '#A0522D', // 区段ats切除颜色
invalidColor: '#AC8F40', // 计轴故障颜色
@ -146,7 +146,7 @@ class SkinCode extends defaultStyle {
halfHeight: 8 // 区段分隔符高度的一半
},
block: {
blockGlint: true // 区段封锁闪烁显示
blockGlint: false // 区段封锁闪烁显示
},
trainPosition:{
display: true, // 列车实时位置显示
@ -414,8 +414,9 @@ class SkinCode extends defaultStyle {
position: 1, // 扣车标识在站台上显示方向
text: 'H', // 扣车显示内容
offset: { x: -8, y: 10 }, // 扣车偏移量
centerTrainColor: '#00FF00', // 中心扣车颜色
andCenterTrainColor: '#00FF00', // 车站+中心扣车颜色
centerTrainColor: ['#FFFF00', '#0000FF'], // 中心扣车颜色
localTrainColor: ['#FFFF00', '#0000FF'], // 车站扣车颜色
andCenterTrainColor: ['#FFFF00', '#0000FF'], // 车站+中心扣车颜色
detainTrainTextColor: '#FFFF00', // 车站扣除文字颜色
spareStrokeColor: '#000000', // 扣车描边颜色
lineWidth: 3, // 扣车线宽
@ -566,7 +567,7 @@ class SkinCode extends defaultStyle {
this[deviceType.ZcControl] = {
// 是否显示
visible: true,
visible: false,
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细

View File

@ -15,22 +15,27 @@ class EDetainCircle extends Group {
const standX = model.position.x - model.width / 2;
const standY = model.position.y - model.height / 2;
let y;
let y1;
let y2;
if (model.right && model.inside) {
y = standY + model.height / 2;
y1 = standY + model.height / 2;
y2 = standY;
} else if (model.right && !model.inside) {
y = standY;
y1 = standY;
y2 = standY + model.height / 2;
} else if (!model.right && model.inside) {
y = standY;
y1 = standY;
y2 = standY + model.height / 2;
} else if (!model.right && !model.inside) {
y = standY + model.height / 2;
y1 = standY + model.height / 2;
y2 = standY;
}
this.detainRect = new Rect({
this.detainRectTop = new Rect({
zlevel: this.model.zlevel,
z: this.model.z + 1,
shape: {
x: standX,
y: y,
y: y1,
width: model.width,
height: model.height / 2
},
@ -40,18 +45,38 @@ class EDetainCircle extends Group {
fill: '#000'
}
});
this.add(this.detainRect);
this.detainRect.hide();
this.detainRectBottom = new Rect({
zlevel: this.model.zlevel,
z: this.model.z + 1,
shape: {
x: standX,
y: y2,
width: model.width,
height: model.height / 2
},
style: {
lineWidth: style.StationStand.detainRect.lineWidth || 0,
stroke: style.StationStand.detainRect.spareStrokeColor,
fill: '#000'
}
});
this.add(this.detainRectTop);
this.add(this.detainRectBottom);
this.detainRectTop.hide();
this.detainRectBottom.hide();
}
setColor(color) {
this.detainRect.setStyle('stroke', color);
setColor(color1, color2) {
this.detainRectTop.setStyle('fill', color1);
this.detainRectBottom.setStyle('fill', color2);
}
setShow() {
this.detainRect.show();
this.detainRectTop.show();
this.detainRectBottom.show();
}
setHide() {
this.detainRect.hide();
this.detainRectTop.hide();
this.detainRectBottom.hide();
}
recover() {
this.setHide();
@ -61,14 +86,14 @@ class EDetainCircle extends Group {
const style = this.model.style;
/** 设置扣车*/
if (model.stationHoldTrain && model.centerHoldTrain) {
this.showMode();
this.setColor(style.StationStand.detainRect.centerTrainColor);
this.setShow();
this.setColor(...style.StationStand.detainRect.centerTrainColor);
} else if (model.stationHoldTrain) {
this.showMode();
this.setColor(style.StationStand.detainRect.detainTrainTextColor);
this.setShow();
this.setColor(...style.StationStand.detainRect.localTrainColor);
} else if (model.centerHoldTrain) {
this.showMode();
this.setColor(style.StationStand.detainRect.centerTrainColor);
this.setShow();
this.setColor(...style.StationStand.detainRect.centerTrainColor);
}
}
}

View File

@ -71,7 +71,8 @@ export default class ETriangle extends Group {
zlevel: model.zlevel,
z: model.z,
shape: {
points:[[model.point.x + 10 * right, model.point.y], [model.point.x, model.point.y - 6], [model.point.x, model.point.y + 6]]
// points:[[model.point.x + 10 * right, model.point.y], [model.point.x, model.point.y - 6], [model.point.x, model.point.y + 6]]
points:[[model.point.x, model.point.y], [model.point.x - 10 * right, model.point.y - 6], [model.point.x - 10 * right, model.point.y + 6]]
},
style: {
stroke:'#00FF00',
@ -88,9 +89,12 @@ export default class ETriangle extends Group {
if (this.angle) {
const trainRight = right == 1 ? 1 : -1;
let data = [
[model.x + 10 * trainRight, model.y],
[model.x, model.y - 6],
[model.x, model.y + 6]
// [model.x + 10 * trainRight, model.y],
// [model.x, model.y - 6],
// [model.x, model.y + 6]
[model.x, model.y],
[model.x - 10 * trainRight, model.y - 6],
[model.x - 10 * trainRight, model.y + 6]
];
if (this.style.Section.trainPosition.specialShow) {
data = [

View File

@ -143,7 +143,7 @@ export default class Train extends Group {
});
oldPoint = 0;
this.pointList.forEach(point => {
point.percentStart = oldPoint / this.lineLength;
point.percentStart = (oldPoint / this.lineLength) < 0.001 ? 0 : (oldPoint / this.lineLength);
oldPoint += point.length;
point.percentEnd = oldPoint / this.lineLength;
});
@ -190,8 +190,10 @@ export default class Train extends Group {
if (train.physicalCode && train.offsetp && this.triangle) {
this.pointList.forEach(point => {
if (train.offsetp > point.percentStart && train.offsetp <= point.percentEnd) {
this.startX = point.pointStart.x + (point.pointEnd.x - point.pointStart.x) * (train.offsetp - point.percentStart);
this.startY = point.pointStart.y + (point.pointEnd.y - point.pointStart.y) * (train.offsetp - point.percentStart);
let offsetp = train.offsetp;
if (train.offsetp > 0.99) { offsetp = 1; }
this.startX = point.pointStart.x + (point.pointEnd.x - point.pointStart.x) * (offsetp - point.percentStart);
this.startY = point.pointStart.y + (point.pointEnd.y - point.pointStart.y) * (offsetp - point.percentStart);
}
});
const point = { x: this.startX, y: this.startY };

View File

@ -131,6 +131,7 @@
<train-detail ref="trainDetail" />
<all-train-detail ref="allTrainDetail" />
<route-detail ref="routeDetail" />
<init-section-open ref="initSectionOpen" />
</div>
</template>
<script>
@ -184,7 +185,7 @@ import TrainRunType from './menuDialog/trainRunType';
import TrainDetail from './menuDialog/trainDetail';
import AllTrainDetail from './menuDialog/allTrainDetail';
import RouteDetail from './menuDialog/routeDetail';
import Route from '../../../../views/newMap/newMapdraft/dataRelation/runLeveloperate/route';
import InitSectionOpen from './menuDialog/initSectionOpen';
export default {
name: 'MenuBar',
@ -232,7 +233,8 @@ export default {
TrainRunType,
TrainDetail,
AllTrainDetail,
RouteDetail
RouteDetail,
InitSectionOpen
},
props: {
selected: {
@ -1471,7 +1473,7 @@ export default {
setBlockSwitch() {
const operate = {
type: 'bar',
operation: OperationEvent.Switch.block.init.operation
operation: OperationEvent.Switch.block.button.operation
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
@ -1485,7 +1487,7 @@ export default {
setUnblockSwitch() {
const operate = {
type: 'bar',
operation: OperationEvent.Switch.unblock.init.operation
operation: OperationEvent.Switch.unblock.button.operation
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
@ -1565,26 +1567,26 @@ export default {
handleOpenSection() {
const operate = {
type: 'bar',
operation: ''
operation: OperationEvent.Section.unlock.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.sectionOpen.doShow();
this.$refs.initSectionOpen.doShow(operate);
}
});
},
handleCloseSection() {
const operate = {
type: 'bar',
operation: ''
operation: OperationEvent.Section.lock.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.sectionOpen.doShow();
this.$refs.initSectionOpen.doShow(operate);
}
});
},
@ -1701,20 +1703,20 @@ export default {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.signalBlock.doShow(operate);
this.$refs.initSignalBlock.doShow(operate);
}
});
},
setSignalCancelBlock() {
const operate = {
type: 'bar',
operation: OperationEvent.Signal.lock.menu.operation
operation: OperationEvent.Signal.unlock.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.signalBlock.doShow(operate);
this.$refs.initSignalBlock.doShow(operate);
}
});
},

View File

@ -1,13 +1,23 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table :data="stationStandList" height="150px">
<el-table
ref="singleTable"
:data="stationStandList"
highlight-current-row
height="150px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="站台" />
<el-table-column prop="minTime" label="最小停站时间" />
<el-table-column prop="time" label="规定停站时间" />
<el-table-column prop="parkingTime" label="规定停站时间">
<template slot-scope="scope">
<span>{{ getParkingTime(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="maxTime" label="最大停站时间" />
</el-table>
<el-checkbox v-model="checkAll">所有站台(L)</el-checkbox>
<el-checkbox v-model="checkAll" :disabled="true">所有站台(L)</el-checkbox>
</el-row>
<el-row>
<el-col :span="12">
@ -20,19 +30,19 @@
<el-row style="text-align: center">
<el-col :span="8">最小值</el-col>
<el-col :span="8">
<el-input-number v-model="minTime" controls-position="right" size="mini" :min="0" :max="999" style="width: 100px;" />
<el-input-number v-model="minTime" :disabled="true" controls-position="right" size="mini" :min="0" :max="999" style="width: 100px;" />
</el-col>
<el-col :span="8">
<el-input v-model="minTimeValue" size="mini" style="width: 80px;" />
<el-input v-model="minTimeValue" size="mini" :disabled="true" style="width: 80px;" />
</el-col>
</el-row>
<el-row style="text-align: center">
<el-col :span="8">最大值</el-col>
<el-col :span="8">
<el-input-number v-model="maxTime" controls-position="right" size="mini" :min="0" :max="999" style="width: 100px;" />
<el-input-number v-model="maxTime" :disabled="true" controls-position="right" size="mini" :min="0" :max="999" style="width: 100px;" />
</el-col>
<el-col :span="8">
<el-input v-model="maxTimeValue" size="mini" style="width: 80px;" />
<el-input v-model="maxTimeValue" size="mini" :disabled="true" style="width: 80px;" />
</el-col>
</el-row>
</div>
@ -53,15 +63,15 @@
<el-row style="text-align: center;">
<el-col :span="8">额定值</el-col>
<el-col :span="8">
<el-input-number v-model="ratedValue" controls-position="right" size="mini" :min="0" :max="999" style="width: 100px;" />
<el-input-number v-model="ratedValue" :disabled="true" controls-position="right" size="mini" :min="0" :max="999" style="width: 100px;" />
</el-col>
<el-col :span="8">
<el-input v-model="ratedValue11" size="mini" style="width: 80px;" />
<el-input v-model="ratedValue11" :disabled="true" size="mini" style="width: 80px;" />
</el-col>
</el-row>
</div>
<el-row style="padding: 10px 0;">
<el-button @click="handleReset">复位</el-button>
<el-button @click="handleReset">复位(R)</el-button>
</el-row>
<el-row>
<div style="padding: 2px 20px;border: 1px solid #ADADAD;width: 180px;text-align: center;">停站时间范围1-999</div>
@ -70,7 +80,7 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>应用(A)</el-button>
@ -89,7 +99,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'AllocateTime',
@ -156,9 +166,29 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
commitOperate(menuOperate.StationStand.setStopTime, {standCode: this.selected.code, parkingTime: this.currentTime, parkingAlwaysValid: false}, 3).then(({valid})=>{
if (valid) {
this.doClose();
}
});
},
handleCurrentChange(val) {
if (!val) { return; }
commitOperate(menuOperate.StationStand.setStopTime, {code:val.code}).then(({valid, operate})=>{
if (valid) {
const stand = this.$store.getters['map/getDeviceByCode'](val.code);
this.currentTime = stand.parkingTime;
this.selected = val;
}
});
},
getParkingTime(code) {
const stand = this.$store.getters['map/getDeviceByCode'](code);
return stand.parkingTime;
},
handleReset() {
},

View File

@ -0,0 +1,196 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="1000px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table ref="singleTable1" :data="sectionList" highlight-current-row height="300px" @current-change="selectLine1">
<el-table-column prop="name" label="轨道" />
<el-table-column prop="blockStatus" label="MAU">
<template slot-scope="scope">
<span>{{ getStationName(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="临时限速">
<template slot-scope="scope">
<span>{{ getLimitSpeed(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="PM临时限速" width="110">
<template slot-scope="scope">
<span>{{ getIsLimit(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置临时限速进程" width="140" />
<el-table-column prop="unblockProcess" label="用户里程起点" width="110" />
<el-table-column prop="unblockProcess" label="用户里程终点" width="110" />
</el-table>
</el-col>
<el-col :span="3">
<el-table ref="singleTable1" :data="limitList" highlight-current-row height="300px" @current-change="selectLine2">
<el-table-column prop="name" label="速度" />
</el-table>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
name: 'SwitchActive',
components: {
NoticeInfo
},
data() {
return {
status: false,
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
selected: null,
active: false,
activeName: 'first',
tempData: [],
radio: '1',
limitList: [
{ name: '5', value: 5 },
{ name: '10', value: 10 },
{ name: '15', value: 15 },
{ name: '20', value: 20 },
{ name: '25', value: 25 },
{ name: '30', value: 30 },
{ name: '35', value: 35 },
{ name: '40', value: 40 },
{ name: '45', value: 45 },
{ name: '50', value: 50 },
{ name: '55', value: 55 },
{ name: '60', value: 60 },
{ name: '65', value: 65 },
{ name: '70', value: 70 },
{ name: '75', value: 75 },
{ name: '80', value: 80 }
]
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '确认/取消设置临时限速区域';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
selectLine1(val) {
},
selectLine2(val) {
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getIsLimit(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit ? '开启' : '关闭';
},
getLimitSpeed(code) {
const sectionEle = this.$store.getters['map/getDeviceByCode'](code);
return sectionEle.speedUpLimit;
},
commit() {
},
handleClick() {
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -0,0 +1,225 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table ref="singleTable" :data="sectionList" highlight-current-row height="300px" @current-change="selectLine">
<el-table-column prop="name" label="轨道" />
<el-table-column prop="blockStatus" label="MAU">
<template slot-scope="scope">
<span>{{ getStationName(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="状态">
<template slot-scope="scope">
<span>{{ getSectionStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" :label="isBlock?'关闭进程':'打开进程'">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="commitDisabled" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<section-open ref="sectionOpen" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import SectionOpen from './sectionOpen';
export default {
name: 'SwitchActive',
components: {
NoticeInfo,
SectionOpen
},
data() {
return {
status: false,
operate: {},
standStatus: true,
allChecked: false,
dialogShow: false,
loading: false,
selected: null,
active: false,
selectShow: false,
activeName: 'first',
tempData: [],
radio: '1',
initEle: null,
commandEleCode: null
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
isBlock() {
return !!this.operate && this.operate.operation === OperationEvent.Section.lock.menu.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return this.isBlock ? '初始化关闭轨道' : '初始化开放轨道';
},
commitDisabled() {
return !this.selected || (this.selected.blockade && this.isBlock) || (!this.selected.blockade && !this.isBlock);
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
this.commit();
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected;
this.operate = operate;
//
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
selectLine(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: `${val.code}`,
operation: this.isBlock ? OperationEvent.Section.lock.choose.operation : OperationEvent.Section.unlock.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = this.$store.getters['map/getDeviceByCode'](val.code);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getProcess(code) {
if (this.commandEleCode && this.commandEleCode === code) {
return this.isBlock ? '已完成关闭' : '已完成打开';
} else if (this.initEle && this.initEle.code === code) {
return '已初始化';
} else {
return '';
}
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getSectionStatus(code) {
const sectionElm = this.$store.getters['map/getDeviceByCode'](code);
if (this.commandEleCode && this.commandEleCode === code && this.isBlock) {
return '关闭双向:所有列车';
} else if (this.commandEleCode && this.commandEleCode === code && !this.isBlock) {
return '打开';
}
return sectionElm.blockade ? '关闭双向:所有列车' : '打开';
},
commit() {
const step = {
code: `${this.selected.code}`,
operation: this.isBlock ? OperationEvent.Section.lock.confirm.operation : OperationEvent.Section.unlock.confirm.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.sectionOpen.doShow(step, this.selected);
this.initEle = this.selected;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menu-li {
height: 30px;
line-height: 30px;
text-align: left;
list-style:none;
padding-left: 5px;
border-right: 2px solid #696969;
color: #000;
}
/deep/ {
.el-radio {
color: #000;
font-weight: bold;
}
.el-cascader-node>.el-radio, .el-radio:last-child{
margin-right: 20px;
}
}
</style>

View File

@ -1,16 +1,34 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table :data="signalList" height="350px">
<el-table
ref="singleTable"
:data="signalList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="status" label="信号机封锁状态" />
<el-table-column prop="status" label="设置封锁进程" />
<el-table-column prop="status" label="解除封锁进程" />
<el-table-column prop="status" label="信号机封锁状态">
<template slot-scope="scope">
<span>{{ getSignalStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'lock') }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="解除封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'unlock') }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !!initEle" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>应用(A)</el-button>
@ -23,6 +41,7 @@
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<signal-block ref="signalBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog>
</template>
@ -31,11 +50,13 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import SignalBlock from './signalBlock';
export default {
name: 'InitSignalBlock',
components: {
NoticeInfo
NoticeInfo,
SignalBlock
},
data() {
return {
@ -45,13 +66,18 @@ export default {
dialogShow: false,
loading: false,
selected: null,
operate: {}
operate: {},
initEle: null,
commandEleCode: null
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Signal.lock.menu.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -82,6 +108,8 @@ export default {
},
methods: {
doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected;
this.operate = operate;
//
@ -93,12 +121,68 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const step = {
code: `${this.selected.code}`,
operation: this.isBlock ? OperationEvent.Signal.lock.confirm.operation : OperationEvent.Signal.unlock.confirm.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalBlock.doShow(step, this.selected);
this.initEle = this.selected;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: `${val.code}`,
operation: this.isBlock ? OperationEvent.Signal.lock.choose.operation : OperationEvent.Signal.unlock.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (this.commandEleCode === code) {
return this.isBlock ? '锁闭的' : '未锁闭的';
}
if (signalEle.blockade) {
return '锁闭的';
} else {
return '未设锁闭';
}
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
getProcess(code, type) {
if (this.commandEleCode && this.commandEleCode === code && ((type === 'lock' && this.isBlock) || (type === 'unlock' && !this.isBlock))) {
return this.isBlock ? '已完成封锁' : '已完成解封';
} else if (this.initEle && this.initEle.code === code && ((type === 'lock' && this.isBlock) || (type === 'unlock' && !this.isBlock))) {
return '已初始化';
} else {
return '';
}
},
cancel() {
const operate = {

View File

@ -1,16 +1,30 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table :data="signalList" height="300px">
<el-table
ref="singleTable"
:data="signalList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="blockStatus" label="允许锁闭" />
<el-table-column prop="blockProcess" label="同意取消" />
<el-table-column prop="unblockProcess" label="取消进程" />
<el-table-column prop="blockStatus" label="允许锁闭">
<template slot-scope="scope">
<span>{{ getSignalBlock(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="同意取消"></el-table-column>
<el-table-column prop="unblockProcess" label="取消进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -23,6 +37,7 @@
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<signal-can-block ref="signalCanBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog>
</template>
@ -31,11 +46,13 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import SignalCanBlock from './signalCanBlock';
export default {
name: 'StandDetain',
components: {
NoticeInfo
NoticeInfo,
SignalCanBlock
},
data() {
return {
@ -45,7 +62,9 @@ export default {
dialogShow: false,
loading: false,
selected: null,
operate: ''
operate: '',
initEle: null,
commandEleCode: null
};
},
computed: {
@ -82,6 +101,8 @@ export default {
},
methods: {
doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected;
this.operate = operate;
//
@ -93,12 +114,65 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const step = {
code: `${this.selected.code}`,
operation: OperationEvent.Signal.lock.confirm.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalCanBlock.doShow(step, this.selected);
this.initEle = this.selected;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
getSignalBlock(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '关闭';
} else {
return '开启';
}
},
getProcess(code) {
if (this.commandEleCode === code) {
return '完成';
} else if (this.initEle && this.initEle.code === code) {
return '已初始化';
} else {
return '';
}
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: `${val.code}`,
operation: OperationEvent.Signal.lock.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {

View File

@ -1,17 +1,35 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table :data="signalList" height="300px">
<el-table
ref="singleTable"
:data="signalList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="blockStatus" label="显示" />
<el-table-column prop="blockProcess" label="可引导" />
<el-table-column prop="unblockProcess" label="引导过程" />
<el-table-column prop="blockStatus" label="显示">
<template slot-scope="scope">
<span>{{ getSignalShow(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="可引导">
<template slot-scope="scope">
<span>{{ getCanGuide(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="引导过程" width="120">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" width="150" label="区间信号引导过程" />
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !selected.callOn" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -24,6 +42,7 @@
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<signal-guide ref="signalGuide" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog>
</template>
@ -31,11 +50,13 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import SignalGuide from './signalGuide';
import { mapGetters } from 'vuex';
export default {
name: 'StandDetain',
components: {
SignalGuide,
NoticeInfo
},
data() {
@ -46,7 +67,9 @@ export default {
dialogShow: false,
loading: false,
selected: null,
operate: ''
operate: '',
initEle: null,
commandEleCode: null
};
},
computed: {
@ -83,6 +106,8 @@ export default {
},
methods: {
doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected;
this.operate = operate;
//
@ -94,12 +119,79 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '引导';
} else {
return '';
}
},
handleClick() {
getCanGuide(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.callOn) {
return '是';
} else {
return '否';
}
},
getProcess(code) {
if (this.commandEleCode === code) {
return '完成';
} else if (this.initEle && this.initEle.code === code) {
return '等待确认/取消';
} else {
return '';
}
},
commit() {
const step = {
code: `${this.selected.code}`,
operation: OperationEvent.Signal.guide.confirm.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalGuide.doShow(step, this.selected);
this.initEle = this.selected;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: `${val.code}`,
operation: OperationEvent.Signal.guide.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
commandSuccess(code) {
this.commandEleCode = code;
},
cancelCommand() {
this.initEle = null;
},
cancel() {
const operate = {

View File

@ -1,16 +1,34 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table :data="switchList" height="350px">
<el-table
ref="singleTable"
:data="switchList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="道岔" />
<el-table-column prop="blockStatus" label="道岔封锁状态" />
<el-table-column prop="blockProcess" label="设置封锁进程" />
<el-table-column prop="unblockProcess" label="解除封锁进程" />
<el-table-column prop="blockStatus" label="道岔封锁状态">
<template slot-scope="scope">
<span>{{ getSwitchStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'block') }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="解除封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'unblock') }}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected || !!initEle" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -23,19 +41,22 @@
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<switch-block ref="switchBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import SwitchBlock from './switchBlock';
export default {
name: 'StandDetain',
components: {
NoticeInfo
NoticeInfo,
SwitchBlock
},
data() {
return {
@ -48,7 +69,9 @@ export default {
mode: '',
position: '',
reserved: '',
operate: ''
operate: '',
initEle: null,
commandEleCode: null
};
},
computed: {
@ -56,7 +79,7 @@ export default {
'switchList'
]),
isBlock() {
return this.operate === OperationEvent.Switch.block.init.operation;
return this.operate && this.operate.operation === OperationEvent.Switch.block.button.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -88,6 +111,8 @@ export default {
},
methods: {
doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected;
this.operate = operate;
//
@ -99,12 +124,69 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const step = {
code: `${this.selected.code}`,
operation: this.isBlock ? OperationEvent.Switch.block.confirm.operation : OperationEvent.Switch.unblock.confirm.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchBlock.doShow(step, this.selected);
this.initEle = this.selected;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
handleCurrentChange(val) {
if (!val) { return; }
this.initEle = null;
this.commandEleCode = null;
const step = {
code: `${val.code}`,
operation: this.isBlock ? OperationEvent.Switch.block.choose.operation : OperationEvent.Switch.unblock.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (this.commandEleCode === code) {
return this.isBlock ? '锁闭的' : '未锁闭的';
}
if (switchEle.blockade) {
return '锁闭的';
} else {
return '未锁闭的';
}
},
getProcess(code, type) {
if (this.commandEleCode && this.commandEleCode === code && ((type === 'block' && this.isBlock) || (type === 'unblock' && !this.isBlock))) {
return this.isBlock ? '已完成封锁' : '已完成解封';
} else if (this.initEle && this.initEle.code === code && ((type === 'block' && this.isBlock) || (type === 'unblock' && !this.isBlock))) {
return '已初始化';
} else {
return '';
}
},
commandSuccess(code) {
this.commandEleCode = code;
this.$refs.singleTable.setCurrentRow();
},
cancelCommand() {
this.initEle = null;
},
cancel() {
const operate = {

View File

@ -33,7 +33,15 @@
<el-col :span="18">
<div class="border-box">
<div class="border-box-title">CBTC</div>
<el-table :data="routeList" height="120px" style="position: relative;top: -15px;">
<!--<el-table :data="routeList" height="120px" style="position: relative;top: -15px;">-->
<el-table
ref="singleTable1"
:data="routeList"
highlight-current-row
style="position: relative;top: -15px;"
height="120px"
@current-change="handleCurrentChange1"
>
<el-table-column prop="name" width="130" label="进路" />
<el-table-column prop="area" label="区域" />
<el-table-column prop="status" label="状态" />
@ -50,9 +58,20 @@
</el-row>
<el-row class="border-box">
<div class="border-box-title">后备</div>
<el-table :data="routeList" height="160px" style="position: relative;top: -15px;">
<el-table
ref="singleTable2"
:data="routeList"
highlight-current-row
style="position: relative;top: -15px;"
height="160px"
@current-change="handleCurrentChange2"
>
<el-table-column prop="name" width="130" label="进路" />
<el-table-column prop="direction" label="运行方向" />
<el-table-column prop="direction" label="运行方向">
<template slot-scope="scope">
<span>{{ getRouteDirection(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" />
<el-table-column prop="pmi" width="50" label="PMI" />
<el-table-column prop="signalModel" width="80" label="信号模式" />
@ -64,7 +83,15 @@
<el-row>
<div class="border-box">
<div class="border-box-title">CBTC</div>
<el-table :data="routeList" height="120px" style="position: relative;top: -15px;">
<!--<el-table :data="routeList" height="120px" style="position: relative;top: -15px;">-->
<el-table
ref="singleTable3"
:data="routeList"
highlight-current-row
style="position: relative;top: -15px;"
height="120px"
@current-change="handleCurrentChange3"
>
<el-table-column prop="name" width="130" label="进路" />
<el-table-column prop="area" label="区域" />
<el-table-column prop="status" label="状态" />
@ -73,9 +100,21 @@
</el-row>
<el-row class="border-box">
<div class="border-box-title">后备</div>
<el-table :data="routeList" height="160px" style="position: relative;top: -15px;">
<!--<el-table :data="routeList" height="160px" style="position: relative;top: -15px;">-->
<el-table
ref="singleTable4"
:data="routeList"
highlight-current-row
style="position: relative;top: -15px;"
height="160px"
@current-change="handleCurrentChange4"
>
<el-table-column prop="name" width="130" label="进路" />
<el-table-column prop="direction" label="运行方向" />
<el-table-column prop="direction" label="运行方向">
<template slot-scope="scope">
<span>{{ getRouteDirection(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" />
<el-table-column prop="pmi" width="50" label="PMI" />
<el-table-column prop="signalModel" width="80" label="信号模式" />
@ -83,28 +122,39 @@
<el-input placeholder="PMI进路选择" size="mini" style="position: relative;top: -10px;" />
</el-row>
</el-tab-pane>
<el-tab-pane label="禁止进路" name="third">
<el-row class="border-box">
<el-col :span="18">
<div class="border-box-title">后备</div>
<el-table :data="routeList" height="332px" style="position: relative;top: -15px;">
<el-table-column prop="name" width="130" label="进路" />
<el-table-column prop="direction" label="运行方向" />
<el-table-column prop="status" label="状态" />
<el-table-column prop="pmi" width="50" label="PMI" />
<el-table-column prop="signalModel" width="80" label="信号模式" />
</el-table>
</el-col>
<el-col :span="6">
<div class="radio-box-title">禁止进路</div>
<div class="radio-box">
<el-radio v-model="forbidRoute" :label="true" style="display: block;margin-bottom: 10px;">设置(S)</el-radio>
<el-radio v-model="forbidRoute" :label="false" style="display: block;">取消(N)</el-radio>
</div>
</el-col>
<el-input placeholder="PMI进路选择" size="mini" style="position: relative;top: -10px;" />
</el-row>
</el-tab-pane>
<!--<el-tab-pane label="禁止进路" name="third">-->
<!--<el-row class="border-box">-->
<!--<el-col :span="18">-->
<!--<div class="border-box-title">后备</div>-->
<!--<el-table-->
<!--ref="singleTable5"-->
<!--:data="routeList"-->
<!--highlight-current-row-->
<!--style="position: relative;top: -15px;"-->
<!--height="332px"-->
<!--@current-change="handleCurrentChange5"-->
<!--&gt;-->
<!--<el-table-column prop="name" width="130" label="进路" />-->
<!--<el-table-column prop="direction" label="运行方向">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ getRouteDirection(scope.row) }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column prop="status" label="状态" />-->
<!--<el-table-column prop="pmi" width="50" label="PMI" />-->
<!--<el-table-column prop="signalModel" width="80" label="信号模式" />-->
<!--</el-table>-->
<!--</el-col>-->
<!--<el-col :span="6">-->
<!--<div class="radio-box-title">禁止进路</div>-->
<!--<div class="radio-box">-->
<!--<el-radio v-model="forbidRoute" :label="true" style="display: block;margin-bottom: 10px;">设置(S)</el-radio>-->
<!--<el-radio v-model="forbidRoute" :label="false" style="display: block;">取消(N)</el-radio>-->
<!--</div>-->
<!--</el-col>-->
<!--<el-input placeholder="PMI进路选择" size="mini" style="position: relative;top: -10px;" />-->
<!--</el-row>-->
<!--</el-tab-pane>-->
</el-tabs>
</el-col>
</el-row>
@ -131,6 +181,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchActive',
@ -149,7 +200,7 @@ export default {
activeName: 'first',
tempData: [],
checked: false,
unlockType: '',
unlockType: 'auto',
forbidRoute: false
};
},
@ -199,11 +250,118 @@ export default {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$refs.singleTable1.setCurrentRow();
this.$refs.singleTable2.setCurrentRow();
this.$refs.singleTable3.setCurrentRow();
this.$refs.singleTable4.setCurrentRow();
},
commit() {
const step = {
over: true,
param: {routeCode: this.selected.code, signalCode: this.selected.startSignalCode}
};
if (this.activeName === 'first') {
if (this.unlockType === 'auto') {
step.operation = OperationEvent.Signal.atsAutoControl.confirm.operation;
step.cmdType = CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING;
} else if (this.unlockType === 'artificial') {
step.operation = OperationEvent.Signal.humanControl.confirm.operation;
step.cmdType = CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING;
}
} else if (this.activeName === 'second') {
step.operation = OperationEvent.Signal.cancelTrainRoute.confirm.operation;
step.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE;
}
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch((error) => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
handleCurrentChange1(val) {
this.$refs.singleTable2.setCurrentRow();
this.$refs.singleTable1.setCurrentRow(val);
if (!val) { return; }
const step = {
code: `${val.code}`,
operation: OperationEvent.Signal.atsAutoControl.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleCurrentChange2(val) {
this.$refs.singleTable1.setCurrentRow();
this.$refs.singleTable2.setCurrentRow(val);
if (!val) { return; }
const step = {
code: `${val.code}`,
operation: OperationEvent.Signal.atsAutoControl.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleCurrentChange3(val) {
this.$refs.singleTable4.setCurrentRow();
this.$refs.singleTable3.setCurrentRow(val);
if (!val) { return; }
const step = {
code: `${val.code}`,
operation: OperationEvent.Signal.cancelTrainRoute.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleCurrentChange4(val) {
this.$refs.singleTable3.setCurrentRow();
this.$refs.singleTable4.setCurrentRow(val);
const step = {
code: `${val.code}`,
operation: OperationEvent.Signal.cancelTrainRoute.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleCurrentChange5(val) {
},
getRouteDirection(route) {
const signalEle = this.$store.getters['map/getDeviceByCode'](route.startSignalCode);
if (signalEle.right) {
return '0';
} else {
return '1';
}
},
cancel() {
const operate = {

View File

@ -2,19 +2,31 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :data="sectionList" highlight-current-row height="300px" @current-change="selectLine">
<el-table ref="singleTable" :data="sectionList" highlight-current-row height="300px" @current-change="selectLine">
<el-table-column prop="name" label="轨道" />
<el-table-column prop="blockStatus" label="MAU" />
<el-table-column prop="blockProcess" label="状态" />
<el-table-column prop="unblockProcess" label="打开进程" />
<el-table-column prop="blockStatus" label="MAU">
<template slot-scope="scope">
<span>{{ getStationName(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" width="150" label="状态">
<template slot-scope="scope">
<span>{{ getSectionStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" :label="isBlock?'关闭进程':'打开进程'">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col v-if="selectShow" :span="5" :offset="1">
<el-col :span="5" :offset="1">
<fieldset>
<legend class="card_title">命令</legend>
<el-radio-group v-model="radio">
<el-radio label="1" style="margin-bottom: 10px;">确认(F)</el-radio>
<el-radio label="2">取消(N)</el-radio>
<el-radio-group v-model="command">
<el-radio :label="true" style="margin-bottom: 10px;">确认(F)</el-radio>
<el-radio :label="false">取消(N)</el-radio>
</el-radio-group>
</fieldset>
</el-col>
@ -42,6 +54,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchActive',
@ -57,16 +70,20 @@ export default {
loading: false,
selected: null,
active: false,
selectShow: false,
activeName: 'first',
tempData: [],
radio: '1'
radio: '1',
operate: {},
command: true
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
isBlock() {
return !!this.operate && this.operate.operation === OperationEvent.Section.lock.confirm.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -80,7 +97,7 @@ export default {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return '初始化开放轨道';
return this.isBlock ? '初始化关闭轨道' : '初始化开放轨道';
}
},
watch: {
@ -98,9 +115,10 @@ export default {
methods: {
doShow(operate, selected) {
this.selected = selected;
//
this.operate = operate;
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(this.selected);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -110,13 +128,42 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
selectLine(val) {
// console.log(val);
this.selectShow = true;
this.$refs.singleTable.setCurrentRow(this.selected);
},
getProcess(code) {
if (this.selected && this.selected.code === code) {
return '等待确认/取消';
} else {
return '';
}
},
getStationName(val) {
const stationElm = this.$store.getters['map/getDeviceByCode'](val.stationCode);
return stationElm.name;
},
getSectionStatus(code) {
const sectionElm = this.$store.getters['map/getDeviceByCode'](code);
return sectionElm.blockade ? '关闭双向:所有列车' : '打开';
},
commit() {
},
handleClick() {
if (this.command) {
const operate = {
cmdType: this.isBlock ? CMD.Section.CMD_SECTION_BLOCK : CMD.Section.CMD_SECTION_UNBLOCK,
operation: this.isBlock ? OperationEvent.Section.lock.confirm1.operation : OperationEvent.Section.unlock.confirm1.operation,
over: true,
param: {sectionCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
} else {
this.cancel();
}
},
cancel() {
const operate = {

View File

@ -2,17 +2,35 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="750px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :data="signalList" height="350px">
<el-table
ref="singleTable"
:data="signalList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="status" label="信号机封锁状态" />
<el-table-column prop="status" label="设置封锁进程" />
<el-table-column prop="status" label="解除封锁进程" />
<el-table-column prop="status" label="信号机封锁状态">
<template slot-scope="scope">
<span>{{ getSignalStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'lock') }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="解除封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'unlock') }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="5" :offset="1">
<div class="set-status-title">命令</div>
<div class="set-status-box">
<el-radio v-model="command" :disabled="true" :label="true">确认</el-radio>
<el-radio v-model="command" :label="true">确认</el-radio>
<br>
<el-radio v-model="command" :label="false">取消</el-radio>
</div>
@ -41,6 +59,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalBlock',
@ -55,13 +74,17 @@ export default {
dialogShow: false,
loading: false,
selected: null,
operate: {}
operate: {},
title: ''
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Signal.lock.confirm.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -73,10 +96,10 @@ export default {
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return this.operate.operation === OperationEvent.Signal.lock.menu.operation ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁';
}
// title() {
// return this.operate.operation === OperationEvent.Signal.lock.menu.operation ? '/' : '/';
// }
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
@ -95,8 +118,10 @@ export default {
this.selected = selected;
this.operate = operate;
//
this.title = this.operate && this.operate.operation === OperationEvent.Switch.block.confirm.operation ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁';
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -106,9 +131,42 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
if (this.command) {
const operate = {
cmdType: this.isBlock ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK,
operation: this.isBlock ? OperationEvent.Signal.lock.confirm1.operation : OperationEvent.Signal.unlock.confirm1.operation,
over: true,
param: {signalCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
} else {
this.cancel();
}
},
handleClick() {
handleCurrentChange(val) {
this.$refs.singleTable.setCurrentRow(this.selected);
},
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '锁闭的';
} else {
return '未设锁闭';
}
},
getProcess(code, type) {
if (this.selected.code === code && ((type === 'lock' && this.isBlock) || (type === 'unlock' && !this.isBlock))) {
return '等待确认/取消';
} else {
return '';
}
},
cancel() {
const operate = {
@ -116,6 +174,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$emit('cancelCommand');
this.doClose();
}
}).catch(() => {

View File

@ -1,19 +1,33 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :data="signalList" height="300px">
<el-table
ref="singleTable"
:data="signalList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="blockStatus" label="允许锁闭" />
<el-table-column prop="blockProcess" label="同意取消" />
<el-table-column prop="unblockProcess" label="取消进程" />
<el-table-column prop="blockStatus" label="允许锁闭">
<template slot-scope="scope">
<span>{{ getSignalBlock(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="同意取消"></el-table-column>
<el-table-column prop="unblockProcess" label="取消进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="6">
<div class="radio-box-title">命令</div>
<div class="radio-box">
<el-radio v-model="command" label="normal" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" label="reverse" style="display: block;">取消</el-radio>
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" :label="false" style="display: block;">取消</el-radio>
</div>
</el-col>
</el-row>
@ -40,6 +54,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalCanBlock',
@ -55,7 +70,7 @@ export default {
loading: false,
selected: null,
operate: '',
command: ''
command: true
};
},
computed: {
@ -97,6 +112,7 @@ export default {
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -106,9 +122,38 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
cmdType: this.command ? CMD.Signal.CMD_SIGNAL_BLOCK : CMD.Signal.CMD_SIGNAL_UNBLOCK,
operation: this.command ? OperationEvent.Signal.lock.confirm1.operation : OperationEvent.Signal.unlock.confirm1.operation,
over: true,
param: {signalCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
handleCurrentChange(val) {
this.$refs.singleTable.setCurrentRow(this.selected);
},
getSignalBlock(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '关闭';
} else {
return '开启';
}
},
getProcess(code) {
if (this.selected && this.selected.code === code) {
return '等待确认/取消';
} else {
return '';
}
},
cancel() {
const operate = {

View File

@ -3,7 +3,11 @@
<el-row>
<el-table :data="signalList" height="350px">
<el-table-column prop="name" label="信号机" />
<el-table-column prop="status" label="显示" />
<el-table-column prop="show" label="显示">
<template slot-scope="scope">
<span>{{ getSignalShow(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="错误代码" />
<el-table-column prop="status" label="引导过程" />
<el-table-column prop="status" width="160" label="区间信号机引导过程" />
@ -14,20 +18,24 @@
<el-table-column prop="allowSpeed" label="允许速度" />
<el-table-column prop="canOrdered" label="可命令" />
<el-table-column prop="confirmProcess" label="确认进程" />
<el-table-column prop="signalBlockState" width="160" label="信号机封锁状态" />
<el-table-column prop="status" label="信号机封锁状态">
<template slot-scope="scope">
<span>{{ getSignalStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="setBlockProcess" width="160" label="信号机封锁进程" />
<el-table-column prop="cancelBlockProcess" width="160" label="解除封锁进程" />
</el-table>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="6" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">打印(P)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="true" @click="commit">打印(P)</el-button>
</el-col>
<el-col :span="6" :offset="2">
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
</el-col>
<el-col :span="6" :offset="2">
<el-button>帮助(H)</el-button>
<el-button :disabled="true">帮助(H)</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
@ -111,8 +119,27 @@ export default {
}
});
},
handleClick() {
getSignalStatus(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.blockade) {
return '锁闭的';
} else {
return '未设锁闭';
}
},
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '引导';
} else {
return '';
}
},
cancel() {
const operate = {

View File

@ -2,19 +2,37 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :data="signalList" height="300px">
<el-table
ref="singleTable"
:data="signalList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="信号机" />
<el-table-column prop="blockStatus" label="显示" />
<el-table-column prop="blockProcess" label="可引导" />
<el-table-column prop="unblockProcess" label="引导过程" />
<el-table-column prop="blockStatus" label="显示">
<template slot-scope="scope">
<span>{{ getSignalShow(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="可引导">
<template slot-scope="scope">
<span>{{ getCanGuide(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="引导过程" width="120">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" width="150" label="区间信号引导过程" />
</el-table>
</el-col>
<el-col :span="6">
<div class="radio-box-title">命令</div>
<div class="radio-box">
<el-radio v-model="command" label="normal" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" label="reverse" style="display: block;">取消</el-radio>
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" :label="false" style="display: block;">取消</el-radio>
</div>
</el-col>
</el-row>
@ -41,6 +59,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SignalGuide',
@ -55,7 +74,7 @@ export default {
dialogShow: false,
loading: false,
selected: null,
command: '',
command: true,
operate: ''
};
},
@ -98,6 +117,7 @@ export default {
//
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -107,9 +127,52 @@ export default {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
cmdType: this.command ? CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE : CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE,
operation: this.command ? OperationEvent.Signal.guide.confirm1.operation : OperationEvent.Signal.cancelGuide.confirm1.operation,
over: true,
param: {signalCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '引导';
} else {
return '';
}
},
getCanGuide(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.callOn) {
return '是';
} else {
return '否';
}
},
getProcess(code) {
if (this.selected && this.selected.code === code) {
return '等待确认/取消';
} else {
return '';
}
},
handleCurrentChange(val) {
this.$refs.singleTable.setCurrentRow(this.selected);
},
cancel() {
const operate = {
@ -117,6 +180,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$emit('cancelCommand');
this.doClose();
}
}).catch(() => {

View File

@ -2,10 +2,18 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="16">
<el-table :data="stationStandList" height="350px">
<el-table
ref="singleTable"
:data="stationStandList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="站台" />
<el-table-column prop="groupNumber" label="状态">
<span>打开</span>
<template slot-scope="scope">
<span>{{ getStandStatus(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
@ -16,7 +24,7 @@
<br>
<el-radio v-model="status" :disabled="!standStatus" :label="false">关闭</el-radio>
</div>
<el-checkbox v-model="allChecked" style="position: relative; top: 220px;">所有站台(F)</el-checkbox>
<el-checkbox v-model="allChecked" :disabled="true" style="position: relative; top: 220px;">所有站台(F)</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
@ -40,8 +48,8 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandControl',
@ -102,12 +110,51 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const step = {
over: true,
cmdType:this.status ? CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP : CMD.Stand.CMD_STAND_SET_JUMP_STOP,
operation:this.status ? OperationEvent.StationStand.cancelJumpStop.confirm.operation : OperationEvent.StationStand.setJumpStop.confirm.operation,
param: {standCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch((error) => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
getStandStatus(code) {
const standEle = this.$store.getters['map/getDeviceByCode'](code);
if (standEle.allSkip) {
return '关闭';
} else {
return '打开';
}
},
handleCurrentChange(val) {
if (!val) { return; }
const standEle = this.$store.getters['map/getDeviceByCode'](val.code);
const step = {
code: `${val.code}`,
operation:standEle.allSkip ? OperationEvent.StationStand.setJumpStop.choose.operation : OperationEvent.StationStand.cancelJumpStop.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
this.standStatus = !standEle.allSkip;
this.status = !!standEle.allSkip;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {

View File

@ -1,15 +1,23 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row style="width: 100%;overflow-x: auto;">
<el-table :data="stationStandList" border height="350px">
<el-table :data="stationStandList" height="350px">
<el-table-column prop="name" width="80" label="站台" />
<el-table-column prop="status" width="80" label="状态" />
<el-table-column prop="minTime" width="130" label="最小停站时间" />
<el-table-column prop="time" width="130" label="规定停站时间" />
<el-table-column prop="maxTime" width="130" label="最大停站时间" />
<el-table-column prop="hold" width="80" label="扣车" />
<el-table-column prop="status" width="80" label="状态">打开</el-table-column>
<el-table-column prop="minTime" width="110" label="最小停站时间" />
<el-table-column prop="parkingTime" width="110" label="规定停站时间">
<template slot-scope="scope">
<span>{{ getParkingTime(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="maxTime" width="110" label="最大停站时间" />
<el-table-column prop="detain" label="扣车">
<template slot-scope="scope">
<span>{{ getDetainStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="section" width="80" label="轨道" />
<el-table-column prop="parkTime" width="130" label="当前停站时间" />
<el-table-column prop="parkTime" width="110" label="当前停站时间" />
<el-table-column prop="emergencyButton" width="80" label="紧急按钮" />
<el-table-column prop="setting" width="80" label="门设置" />
<el-table-column prop="bypass" width="80" label="门旁路" />
@ -101,6 +109,18 @@ export default {
},
handleClick() {
},
getDetainStatus(code) {
const stand = this.$store.getters['map/getDeviceByCode'](code);
if (!stand.stationHoldTrain && !stand.centerHoldTrain) {
return '未扣车';
} else {
return '扣车';
}
},
getParkingTime(code) {
const stand = this.$store.getters['map/getDeviceByCode'](code);
return stand.parkingTime;
},
cancel() {
const operate = {

View File

@ -4,7 +4,13 @@
<el-col :span="16">
<el-tabs type="border-card">
<el-tab-pane label="站台">
<el-table :data="stationStandList" height="350px">
<el-table
ref="singleTable"
:data="stationStandList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="站台" />
<el-table-column prop="detain" label="扣车">
<template slot-scope="scope">
@ -19,7 +25,7 @@
<!--</template>-->
</el-table-column>
</el-table>
<el-checkbox v-model="allChecked">所有站台(F)</el-checkbox>
<el-checkbox v-model="allChecked" :disabled="true">所有站台(F)</el-checkbox>
</el-tab-pane>
<el-tab-pane label="系统">系统</el-tab-pane>
</el-tabs>
@ -35,7 +41,7 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button>应用(A)</el-button>
@ -54,7 +60,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
@ -97,6 +103,18 @@ export default {
if (this.show) {
this.commit();
}
},
selected(val) {
if (val) {
const stand = this.$store.getters['map/getDeviceByCode'](val.code);
if (stand && !stand.stationHoldTrain && !stand.centerHoldTrain) {
this.status = true;
this.standStatus = false;
} else {
this.status = false;
this.standStatus = true;
}
}
}
},
mounted() {
@ -119,12 +137,32 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let cmdCommand = menuOperate.StationStand.setDetainTrain;
if (this.standStatus) {
cmdCommand = menuOperate.StationStand.cancelDetainTrain;
}
commitOperate(cmdCommand, {standCode: this.selected.code}, 3).then((valid)=>{
if (valid) {
this.doClose();
}
});
},
handleClick() {
handleCurrentChange(val) {
if (!val) { return; }
const stand = this.$store.getters['map/getDeviceByCode'](val.code);
let cmdCommand = menuOperate.StationStand.cancelDetainTrain;
if (stand && !stand.stationHoldTrain && !stand.centerHoldTrain) {
cmdCommand = menuOperate.StationStand.setDetainTrain;
}
commitOperate(cmdCommand, {code:val.code}).then(({valid, operate})=>{
if (valid) {
this.selected = val;
}
});
},
getDetainStatus(code) {
const stand = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -2,24 +2,34 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :data="switchList" height="300px">
<el-table-column prop="name" label="道岔" />
<el-table-column prop="blockStatus" label="请求或允许动岔" />
<el-table-column prop="blockProcess" label="请求或允许动岔输出错" />
<el-table
ref="singleTable"
:data="switchList"
highlight-current-row
height="300px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" width="80" label="道岔" />
<el-table-column prop="blockStatus" label="请求或允许动岔">
<template slot-scope="scope">
<span>{{ getSignalLock(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" width="170" label="请求或允许动岔输出错">正确</el-table-column>
</el-table>
</el-col>
<el-col :span="6">
<div class="radio-box-title">设置状态</div>
<div class="radio-box">
<el-radio v-model="active" :label="true" style="display: block;margin-bottom: 10px;">(A)激活</el-radio>
<el-radio v-model="active" :label="false" style="display: block;">(I)取消激活</el-radio>
<el-radio v-model="active" :label="true" style="display: block;margin-bottom: 10px;" :disabled="!active">(A)激活</el-radio>
<el-radio v-model="active" :label="false" style="display: block;" :disabled="active">(I)取消激活</el-radio>
</div>
<el-checkbox v-model="allChecked" style="position: relative;top: 100px;left: 8px;">(A)全部</el-checkbox>
<el-checkbox v-model="allChecked" :disabled="true" style="position: relative;top: 100px;left: 8px;">(A)全部</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="6" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!selected" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="6" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -37,6 +47,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'SwitchActive',
@ -98,12 +109,50 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const step = {
over: true,
cmdType: this.active ? CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK : CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
operation: this.active ? OperationEvent.Switch.unlock.confirm.operation : OperationEvent.Switch.lock.confirm.operation,
param: { switchCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
handleClick() {
handleCurrentChange(val) {
if (!val) { return; }
const step = {
code: `${val.code}`,
operation: OperationEvent.Switch.lock.choose.operation,
param: {}
};
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.selected = val;
const signalEle = this.$store.getters['map/getDeviceByCode'](val.code);
this.active = !!signalEle.singleLock;
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
getSignalLock(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.singleLock) {
return '未激活';
} else {
return '激活';
}
},
cancel() {
const operate = {

View File

@ -1,19 +1,37 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :data="switchList" height="350px">
<el-table
ref="singleTable"
:data="switchList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" width="80" label="道岔" />
<el-table-column prop="blockStatus" label="道岔封锁状态" />
<el-table-column prop="blockProcess" label="设置封锁进程" />
<el-table-column prop="unblockProcess" label="解除封锁进程" />
<el-table-column prop="blockStatus" label="道岔封锁状态">
<template slot-scope="scope">
<span>{{ getSwitchStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockProcess" label="设置封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'block') }}</span>
</template>
</el-table-column>
<el-table-column prop="unblockProcess" label="解除封锁进程">
<template slot-scope="scope">
<span>{{ getProcess(scope.row.code, 'unblock') }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="6">
<div class="radio-box-title">命令</div>
<div class="radio-box">
<el-radio v-model="command" label="normal" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" label="reverse" style="display: block;">取消</el-radio>
<el-radio v-model="command" :label="true" style="display: block;margin-bottom: 10px;">确认</el-radio>
<el-radio v-model="command" :label="false" style="display: block;">取消</el-radio>
</div>
</el-col>
</el-row>
@ -40,6 +58,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StandDetain',
@ -54,7 +73,8 @@ export default {
dialogShow: false,
loading: false,
selected: null,
command: '',
command: true,
title: ''
};
},
computed: {
@ -62,7 +82,7 @@ export default {
'switchList'
]),
isBlock() {
return this.operate === OperationEvent.Switch.block.menu.operation;
return this.operate && this.operate.operation === OperationEvent.Switch.block.confirm.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -75,9 +95,6 @@ export default {
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return this.isBlock ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁';
}
},
watch: {
@ -96,8 +113,11 @@ export default {
doShow(operate, selected) {
this.selected = selected;
//
this.operate = operate;
this.title = this.operate && this.operate.operation === OperationEvent.Switch.block.confirm.operation ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁';
this.dialogShow = true;
this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh');
});
},
@ -106,10 +126,43 @@ export default {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
return '锁闭的';
} else {
return '未锁闭的';
}
},
handleClick() {
commit() {
if (this.command) {
const operate = {
cmdType: this.isBlock ? CMD.Switch.CMD_SWITCH_BLOCK : CMD.Switch.CMD_SWITCH_UNBLOCK,
operation: this.isBlock ? OperationEvent.Switch.block.confirm1.operation : OperationEvent.Switch.unblock.confirm1.operation,
over: true,
param: {switchCode: this.selected.code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
this.$emit('commandSuccess', this.selected.code);
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
} else {
this.cancel();
}
},
handleCurrentChange(val) {
this.$refs.singleTable.setCurrentRow(this.selected);
},
getProcess(code, type) {
if (this.selected.code === code && ((type === 'block' && this.isBlock) || (type === 'unblock' && !this.isBlock))) {
return '等待确认/取消';
} else {
return '';
}
},
cancel() {
const operate = {
@ -117,6 +170,7 @@ export default {
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$emit('cancelCommand');
this.doClose();
}
}).catch(() => {

View File

@ -2,36 +2,51 @@
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="650px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-col :span="18">
<el-table :data="stationStandList" height="350px">
<!--<el-table :data="switchList" height="350px">-->
<el-table
ref="singleTable"
:data="switchList"
highlight-current-row
height="350px"
@current-change="handleCurrentChange"
>
<el-table-column prop="name" label="道岔" />
<el-table-column prop="mode" label="模式" />
<el-table-column prop="position" label="位置" />
<el-table-column prop="reserved" label="预留" />
<el-table-column prop="status" label="状态" />
<el-table-column prop="position" label="位置">
<template slot-scope="scope">
<span>{{ getSwitchPosition(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="reserved" label="预留">未预留</el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<span>{{ getSwitchStatus(scope.row.code) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="6">
<div class="radio-box-title">设置模式</div>
<div class="radio-box">
<el-radio v-model="mode" label="auto" style="display: block;margin-bottom: 10px;">自动</el-radio>
<el-radio v-model="mode" label="artificial" style="display: block;">人工</el-radio>
<el-radio v-model="mode" label="auto" :disabled="true" style="display: block;margin-bottom: 10px;">自动</el-radio>
<el-radio v-model="mode" label="artificial" :disabled="true" style="display: block;">人工</el-radio>
</div>
<div class="radio-box-title">设置位置</div>
<div class="radio-box">
<el-radio v-model="position" label="normal" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reverse" style="display: block;">反位</el-radio>
<el-radio v-model="position" label="normal" :disabled="!selected" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reverse" :disabled="!selected" style="display: block;">反位</el-radio>
</div>
<div class="radio-box-title">设置预留</div>
<div class="radio-box">
<el-radio v-model="position" label="normal" style="display: block;margin-bottom: 10px;">自动与预留</el-radio>
<el-radio v-model="position" label="reverse" style="display: block;margin-bottom: 10px;">预留</el-radio>
<el-radio v-model="position" label="reverse" style="display: block;">释放</el-radio>
<el-radio v-model="reserved" label="auto" :disabled="true" style="display: block;margin-bottom: 10px;">自动与预留</el-radio>
<el-radio v-model="reserved" label="reversed" :disabled="true" style="display: block;margin-bottom: 10px;">预留</el-radio>
<el-radio v-model="reserved" label="release" :disabled="true" style="display: block;">释放</el-radio>
</div>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="4" :offset="1">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
<el-button :id="domIdConfirm" type="primary" :disabled="!selected" :loading="loading" :selected="true" @click="commit">确定(O)</el-button>
</el-col>
<el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -50,7 +65,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {
@ -68,12 +83,13 @@ export default {
selected: null,
mode: '',
position: '',
reserved: ''
reserved: 'reversed'
};
},
computed: {
...mapGetters('map', [
'stationStandList'
'switchList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
@ -115,12 +131,48 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
commit() {
commitOperate(menuOperate.Switch.turnout, {switchCode: this.selected.code}, 3).then(({valid})=>{
if (valid) {
this.doClose();
}
});
},
handleClick() {
handleCurrentChange(val) {
if (!val) { return; }
commitOperate(menuOperate.Switch.turnout, {code:val.code}).then(({valid, operate})=>{
if (valid) {
const switchEle = this.$store.getters['map/getDeviceByCode'](val.code);
this.position = '';
if (switchEle.normalPosition) {
this.position = 'reverse';
} else if (switchEle.reversePosition) {
this.position = 'normal';
}
this.selected = val;
}
});
},
getSwitchPosition(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.normalPosition) {
return '定位';
} else if (switchEle.reversePosition) {
return '反位';
} else {
return '';
}
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
return '锁闭的';
} else {
return '未锁闭的';
}
},
cancel() {
const operate = {

View File

@ -1,11 +1,19 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="700px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-table :data="switchList" height="350px">
<el-table-column prop="name" width="80" label="道岔" />
<el-table-column prop="position" width="80" label="位置" />
<el-table-column prop="position" width="80" label="位置">
<template slot-scope="scope">
<span>{{ getSwitchPosition(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockStatus" width="80" label="预留" />
<el-table-column prop="blockStatus" width="80" label="状态" />
<el-table-column prop="blockStatus" width="80" label="状态">
<template slot-scope="scope">
<span>{{ getSwitchStatus(scope.row.code) }}</span>
</template>
</el-table-column>
<el-table-column prop="blockStatus" width="120" label="道岔封锁状态" />
<el-table-column prop="blockProcess" width="120" label="设置封锁进程" />
<el-table-column prop="unblockProcess" width="120" label="解除封锁进程" />
@ -55,9 +63,6 @@ export default {
...mapGetters('map', [
'switchList'
]),
isBlock() {
return this.operate === OperationEvent.Switch.block.init.operation;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
@ -71,7 +76,7 @@ export default {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return this.isBlock ? '初始化道岔封锁' : '初始化道岔解除封锁';
return '道岔信息显示';
}
},
watch: {
@ -105,6 +110,24 @@ export default {
},
handleClick() {
},
getSwitchPosition(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.normalPosition) {
return '定位';
} else if (switchEle.reversePosition) {
return '反位';
} else {
return '';
}
},
getSwitchStatus(code) {
const switchEle = this.$store.getters['map/getDeviceByCode'](code);
if (switchEle.blockade) {
return '锁闭的';
} else {
return '未锁闭的';
}
},
cancel() {
const operate = {

View File

@ -216,8 +216,8 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(data.indicatorLightList || [], elem => {
mapDevice[elem.code] = createDevice(elem.type, elem, propConvert, showConfig);
if (elem.type == 'SwitchFault') {
mapDevice[elem.switchCode].switchFaultCode = elem.code; // 道岔数据上关联道岔故障表示灯需保证该数据在switchList之后处理
if (elem.type == 'SwitchFault' && mapDevice[elem.switchCode]) {
mapDevice[elem.switchCode]['switchFaultCode'] = elem.code; // 道岔数据上关联道岔故障表示灯需保证该数据在switchList之后处理
}
}, this);

View File

@ -140,8 +140,8 @@ export default {
showConditionsList: [
{ enlabel:'Local&Center', label: '现地&行调', value: '01'},
{ enlabel:'Local', label: '现地', value: '02' },
{ enlabel:'Center', label: '行调', value: '03'}
{ enlabel:'Local', label: '现地', value: '03' },
{ enlabel:'Center', label: '行调', value: '02'}
],
QuestionTypeList: [

View File

@ -13,6 +13,7 @@ import FaviconBxkc from '@/assets/icon/favicon_bxkc.png';
import FaviconCrsc from '@/assets/icon/favicon_crsc.png';
import FaviconNty from '@/assets/icon/favicon_nty.png';
import FaviconBjd from '@/assets/icon/favicon_bjd.png';
import FaviconJdy from '@/assets/icon/favicon_jdy.png';
import Link_Bxkc from '@/assets/icon/link_bxkc.png';
import Link_Crsc from '@/assets/icon/link_crsc.png';
import Link_Hls from '@/assets/icon/link_hls.png';
@ -44,6 +45,15 @@ export const loginInfo = {
navigationMarginLeft: '175px',
systemType: '011'
},
jdy: {
title: '江苏电子信息职业学院城市轨道交通实训平台',
loginPath: '/login?project=jdy',
loginParam: 'DEFAULT',
titleDistance: '-150px',
navigationLogoWidth: '40px',
navigationMarginLeft: '60px',
systemType: '011'
},
nty: {
title: '南京铁道职业技术学院城市轨道交通实训平台',
loginPath:'/login?project=nty',
@ -117,6 +127,15 @@ export const loginInfo = {
navigationMarginLeft: '60px',
systemType: '011'
},
designjdy: {
title: '江苏电子信息职业学院城市轨道交通设计平台',
loginPath: '/design/login?project=jdy',
loginParam: 'DEFAULT',
titleDistance: '-150px',
navigationLogoWidth: '40px',
navigationMarginLeft: '60px',
systemType: '011'
},
gzb: {
title: '贵州装备制造职业学院城市轨道交通实训平台',
loginPath:'/login?project=gzb',
@ -361,7 +380,9 @@ export const ProjectIcon = {
nty: FaviconNty,
designnty: FaviconNty,
bjd: FaviconBjd,
designbjd: FaviconBjd
designbjd: FaviconBjd,
jdy: FaviconJdy,
designjdy: FaviconJdy
};
export const ProjectCode = {
@ -378,14 +399,16 @@ export const ProjectCode = {
nty: 'NTY',
designnty: 'NTY',
bjd: 'BJD',
designbjd: 'BJD'
designbjd: 'BJD',
jdy: 'JDY',
designjdy: 'JDY'
};
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd']; // 底部栏仅展示公司信息不展示备案号
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'nty', 'designnty']; // 实训设计平台通过项目code获取地图列表的项目
export const CaseHideProjectList = ['heb', 'designheb']; // 案例展示隐藏的项目
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'hyd', 'designhyd']; // 登录页右下角版本开发基于不展示
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd']; // 登录页右下角主体不展示
export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式
export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'jdy', 'designjdy']; // 登录页样式
export const NoQrcodeList = ['heb', 'designheb'];
export const NoSimulationQrCodeList = ['heb', 'bjd'];
export const goOtherPlatformMenu = { // 导航栏快速切换平台
@ -414,7 +437,9 @@ export const goOtherPlatformMenu = { // 导航栏快速切换平台
nty: '/design/login?project=nty',
designnty: '/login?project=nty',
bjd: '/design/login?project=bjd',
designbjd: '/login?project=bjd'
designbjd: '/login?project=bjd',
jdy: '/design/login?project=jdy',
designjdy: '/login?project=jdy'
};
export const ProjectList = [
{value:'xty', label:'西铁院'},
@ -424,5 +449,6 @@ export const ProjectList = [
{value: 'drts', label: '调度大赛'},
{value: 'nty', label: '南铁院'},
{value: 'bjd', label: '北交大'},
{value: 'urtss', label: '陪标项目'}
{value: 'urtss', label: '陪标项目'},
{value: 'jdy', label: '江苏电子'}
];

View File

@ -294,6 +294,14 @@ export const OperationEvent = {
menuButton: {
operation: '1031',
domId: '_Tips-Switch-Lock-Menu{BOTTOM}'
},
choose: {
operation: '1032',
domId: '_Tips-Switch-Lock-Choose'
},
confirm: {
operation: '1033',
domId: '_Tips-Switch-Lock-confirm'
}
},
// 道岔解锁
@ -356,6 +364,14 @@ export const OperationEvent = {
init: {
operation: '1053',
domId: '_Tips-Switch-Block-Init'
},
choose: {
operation: '1054',
domId: '_Tips-Switch-Block-Choose'
},
confirm1: {
operation: '1055',
domId: '_Tips-Switch-Block-Confirm1'
}
},
// 道岔解封
@ -806,6 +822,10 @@ export const OperationEvent = {
menuButton: {
operation: '3032',
domId: '_Tips-Signal-CancelTrainRoute-Menu{BOTTOM}'
},
choose: {
operation: '3033',
domId: '_Tips-Signal-CancelTrainRoute-Choose'
}
},
// 信号重开
@ -863,6 +883,14 @@ export const OperationEvent = {
menuButton:{
operation: '3062',
domId: '_Tips-Signal-Lock-Menu{BOTTOM}'
},
choose: {
operation: '3063',
domId: '_Tips-Signal-Lock-Choose'
},
confirm1: {
operation: '3064',
domId: '_Tips-Signal-Lock-Confirm1'
}
},
// 解锁
@ -1099,6 +1127,10 @@ export const OperationEvent = {
menuButton: {
operation: '3182',
domId: '_Tips-Signal-cancelGuide-Menu{BOTTOM}'
},
confirm1: {
operation: '3183',
domId: '_Tips-Signal-cancelGuide-Confirm1'
}
},
// 联锁进路
@ -1201,6 +1233,18 @@ export const OperationEvent = {
menuButton: {
operation: '4031',
domId: '_Tips-Section-Lock-Menu{BOTTOM}'
},
choose: {
operation: '4032',
domId: '_Tips-Section-Lock-Choose'
},
confirm: {
operation: '4033',
domId: '_Tips-Section-Lock-Confirm'
},
confirm1: {
operation: '4034',
domId: '_Tips-Section-Lock-Confirm1'
}
},
// 解锁
@ -1542,6 +1586,10 @@ export const OperationEvent = {
menuButton: {
operation: '5025',
domId: '_Tips-Stand-SetJumpStop-Menu{BOTTOM}'
},
confirm: {
operation: '5036',
domId: '_Tip-Stand-SetJumpStop-Confirm'
}
},
// 取消跳停
@ -1569,6 +1617,10 @@ export const OperationEvent = {
menuButton: {
operation: '5035',
domId: '_Tips-Stand-CancelJumpStop-Menu{BOTTOM}'
},
confirm: {
operation: '5036',
domId: '_Tip-Stand-CancelJumpStop-Confirm'
}
},
// 设置扣车

View File

@ -57,7 +57,7 @@ service.interceptors.response.use(
// eslint-disable-next-line no-undef
EventBus.$emit('clearCheckLogin');
// 断开连接
store.dispatch('disconnect').then(()=>{
store.dispatch('disconnect');
MessageBox.confirm(i18n.t('tip.logoutTips'), i18n.t('tip.hint'), {
confirmButtonText: i18n.t('tip.confirmLogin'),
showCancelButton: false,
@ -67,7 +67,6 @@ service.interceptors.response.use(
location.reload();// 为了重新实例化vue-router对象 避免bug
});
});
});
return response.data;
} else if (res.code === 500) {
const defaultError = { type: '服务异常:', message: '未知错误!'};

View File

@ -108,7 +108,7 @@
</el-col>
<el-col :span="18" style="text-align: left">
<div style="margin-top: 10px">服务电话13289398171</div>
<div style="margin-top: 10px">截止日期2020年12月31日</div>
<!--<div style="margin-top: 10px">截止日期2020年12月31日</div>-->
</el-col>
</el-row>
</div>

View File

@ -26,11 +26,11 @@ export default {
return {
offsetY: 15,
offsetX: 150,
swch: '03',
swch: '02',
rightWidth: 0,
swchList: [
{ value: '03', name: '现地' },
{ value: '02', name: '行调' },
{ value: '03', name: '现地' },
{ value: '04', name: '大屏' }
]
};
@ -85,6 +85,7 @@ export default {
}
},
switchMode(val) {
// 03 02
if (val === '03' && this.localStationShow) {
if (this.$route.path.indexOf('mapPreviewNew') !== -1) {
this.offsetX = 150 + this.rightWidth;

View File

@ -429,7 +429,7 @@ export default {
this.handleInit();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.oldPoint = selected.points;
this.oldPoint = JSON.parse(JSON.stringify(selected.points));
this.oldLeftSectionCode = selected.leftSectionCode;
this.oldRightSectionCode = selected.rightSectionCode;
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
@ -540,7 +540,8 @@ export default {
copySection.stationCode = model.stationCode; //
if (this.checkPointsCoincide(this.oldPoint[0], copySection.points[0])) {
copySection.points[0] = model.points[0];
} else if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], copySection.points[copySection.points.length - 1])) {
}
if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], copySection.points[copySection.points.length - 1])) {
copySection.points[copySection.points.length - 1] = model.points[model.points.length - 1];
}
models.push(copySection);
@ -653,6 +654,9 @@ export default {
!sectionMap[startPoint].deepFlag && models.push(model);
startOffset = (startOffset * 1000 + model.lengthFact * 1000) / 1000;
startPoint = model.points[model.points.length - 1].x + 's' + model.points[model.points.length - 1].y;
if (model.points[model.points.length - 1].x == model.points[0].x && model.points[model.points.length - 1].y == model.points[0].y) {
return models;
}
}
}
return models;

View File

@ -69,8 +69,8 @@
</div>
<el-form ref="signalCiStation1" label-width="130px" :model="ciModelForm" size="mini" :rules="ciModelFormRules" style="margin-top: 15px;">
<el-form-item label="信号机选择:" prop="signalList">
<el-select v-model="ciModelForm.signalList" multiple placeholder="请选择">
<el-option v-for="item in signalList" :key="item.code" :label="item.name" :value="item.code" />
<el-select v-model="ciModelForm.signalList" multiple filterable placeholder="请选择">
<el-option v-for="item in filterSignalList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
<el-button
:type="field == 'signalCodes' ? 'danger' : 'primary'"
@ -296,6 +296,17 @@ export default {
}
return list;
},
//
filterSignalList() {
let list = [];
if (this.signalList && this.signalList.length) {
list = this.signalList.filter(elem => {
return !elem.interlockStationCode;
});
}
console.log(list, '过滤信号机联锁');
return list;
},
form() {
return {
labelWidth: '150px',
@ -348,7 +359,7 @@ export default {
name: this.$t('map.mapData'),
item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList },
{ prop: 'interlockStationCode', label: '所属联锁站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.ciStationList},
{ prop: 'interlockStationCode', label: '所属联锁站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.ciStationList},
{ prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' },
{ prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList, hover: this.hover, buttonType: 'signalSection', buttonShowType: this.signalSectionShow },
{ prop: 'sectionOffset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }

View File

@ -198,9 +198,10 @@ export default {
{ prop: 'controlModePoint', label: this.$t('map.stationControlPosition'), type: 'coordinate', width: '120px', isHidden:!this.editModel.createControlMode, children: [
{ prop: 'controlModePoint.x', firstLevel: 'controlModePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px'},
{ prop: 'controlModePoint.y', firstLevel: 'controlModePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px'}
] }
// { prop: 'createTurnBack', label: ':', type: 'checkbox' },
// { prop: 'turnBackPoint', label: ':', type: 'coordinate', width: '120px', isHidden: !this.isPointsShow, children: [
] },
{ prop: 'createTurnBack', label: '按图折返', type: 'checkbox' }
// { prop: 'createTurnBack', label: ':', type: 'checkbox' }
// { prop: 'turnBackPoint', label: ':', type: 'coordinate', width: '120px', isHidden: !this.editModel.createTurnBack, children: [
// { prop: 'turnBackPoint.x', firstLevel: 'turnBackPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
// { prop: 'turnBackPoint.y', firstLevel: 'turnBackPoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
// ] }
@ -248,9 +249,6 @@ export default {
return this.sectionList.filter(elem => { return elem.type === '01' && !elem.switchSection; });
},
isPointsShow() {
return this.editModel.createTurnBack;
},
isZcCode() {
return this.editModel.centralized;
},
@ -284,6 +282,7 @@ export default {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
//
console.log(selected, selected.createTurnBack);
const beCentralizedStation = {};
this.relStationList = JSON.parse(JSON.stringify(this.stationList));
this.stationList.forEach(data=>{

View File

@ -0,0 +1,86 @@
<template>
<el-dialog title="参数配置" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
<div class="content-box">
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" />
<div style="width: 29%;float: right;" :style="{height: $store.state.app.height-54+'px' }" />
</div>
</el-dialog>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { loadMapDataById } from '@/utils/loaddata';
export default {
name: 'RunplanParams',
components: {
JlmapVisual
},
props:{
},
data() {
return {
dialogShow: false
};
},
methods:{
async doShow() {
this.dialogShow = true;
await this.setWindowSize();
await this.loadInitPage();
},
setWindowSize() {
this.$nextTick(() => {
const width = this.$store.state.app.width * 0.7;
const height = this.$store.state.app.height - 54;
this.$store.dispatch('config/resize', { width, height });
});
},
async loadInitPage() {
await this.$store.dispatch('training/changeMode', { mode: null });
loadMapDataById(this.$route.query.mapId).then(()=>{
this.$store.dispatch('training/over');
this.$store.dispatch('training/setMapDefaultState');
this.$store.dispatch('map/clearJlmapTrainView');
});
},
clickEvent(em) {
const device = this.getDeviceByEm(em);
this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(device, true);
this.oldDevice = device;
this.setSelected(device);
},
onContextmenu() {
},
close() {
this.dialogShow = false;
},
//
getDeviceByEm(em) {
var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null;
if (device) {
device._viewVal = em.val;
}
return device;
},
//
deviceHighLight(device, flag) {
if (device && device.instance && typeof device.instance.drawSelected === 'function' ) {
if (device._type === 'Section' && device.type === '04') {
device.relevanceSectionList.forEach(item => {
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
sectionModel && sectionModel.instance.drawSelected(flag);
});
} else if (device._type === 'Section' && device.type === '01' && device.logicSectionCodeList && device.logicSectionCodeList.length) {
device.logicSectionCodeList.forEach(item => {
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
sectionModel && sectionModel.instance.drawSelected(flag);
});
} else {
device.instance.drawSelected(flag);
}
}
}
}
};
</script>

View File

@ -45,6 +45,7 @@
<populating-generic-data ref="populatingGenericData" :load-run-plan-id="loadRunPlanId" />
<create-empty-plan ref="createEmptyPlan" @refresh="refreshRunPlanList" />
<edit-plan-name ref="editPlan" @renewal="refreshRunPlanName" />
<gernarate-plan ref="gernaratePlanTrain" />
</div>
</template>
@ -65,6 +66,7 @@ import ModifyingTask from './menus/modifyingTask';
import ModifyingRouting from './menus/modifyingRouting';
import ModifyingBeginTime from './menus/modifyingBeginTime';
import EditStationBetweenTime from './menus/editStationBetweenTime';
import GernaratePlan from './menus/gernaratePlanTrain';
// import AddSmoothRunTime from './menus/addSmoothRunTime';
// import EditSmoothRunTime from './menus/editSmoothRunTime';
import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
@ -100,7 +102,8 @@ export default {
ModifyingStationIntervalTime,
ModifyingStationStopTime,
CreateEmptyPlan,
EditPlanName
EditPlanName,
GernaratePlan
},
data() {
return {

View File

@ -116,6 +116,7 @@
<script>
import { mapGetters } from 'vuex';
import routeMap from './routingoperate/routeMap';
// import RunplanParams from './config/index';
import { planEffectiveCheck, runPlanNotify } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic';
@ -177,18 +178,14 @@ export default {
{
title: this.$t('planMonitor.tool'),
children: [
{
title: this.$t('planMonitor.validityCheck'),
click: this.handlePlanEffectiveCheck
},
{
title: this.$t('planMonitor.testRunningDiagram'),
click: this.handleTestRunPlan
},
{
title: '交路设置',
click: this.handleRoutingSettings
},
{
title: '参数配置',
click: this.handleRunplanParams
},
{
title: '停站时间',
click: this.handleDwellTime
@ -196,6 +193,14 @@ export default {
{
title: '运行等级',
click: this.handleRoutingLevel
},
{
title: this.$t('planMonitor.validityCheck'),
click: this.handlePlanEffectiveCheck
},
{
title: this.$t('planMonitor.testRunningDiagram'),
click: this.handleTestRunPlan
}
]
},
@ -213,6 +218,10 @@ export default {
// {
// type: 'separator'
// },
{
title: '生成计划',
click: this.handleGernaratePlanningTrain
},
{
title: this.$t('planMonitor.addPlan'),
click: this.handleAddPlanningTrain
@ -436,7 +445,11 @@ export default {
},
//
handleRoutingSettings() {
this.$refs.routeMap.doShow();
this.$refs.routeMap.doShow('routeMap');
},
//
handleRunplanParams() {
this.$refs.routeMap.doShow('runplanParams');
},
//
handleDwellTime() {
@ -446,6 +459,10 @@ export default {
handleRoutingLevel() {
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
},
//
handleGernaratePlanningTrain() {
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
},
//
handlePlanEffectiveCheck() {
const planId = this.$route.query.planId;

View File

@ -12,14 +12,14 @@
:close-on-click-modal="false"
>
<el-row>
<el-col :span="3" style="height: 28px;line-height: 28px;">
<!-- <el-col :span="3" style="height: 28px;line-height: 28px;">
<el-radio v-model="addModel.forward" :label="true">{{ $t('planMonitor.addToTheFront') }}</el-radio>
</el-col>
</el-col> -->
<el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.tripNumber')+$t('global.colon') }}</span>
</el-col>
<el-col :span="5">
<el-select v-model="addModel.tripNumber" size="mini" :placeholder="this.$t('global.choose')">
<el-select v-model="addModel.tripNumber" size="mini" :placeholder="this.$t('global.choose')" disabled>
<el-option
v-for="item in tripNumberList"
:key="item.value"
@ -36,14 +36,14 @@
</el-col>
</el-row>
<el-row style="margin-top: 5px;height: 28px;line-height: 28px;">
<el-col :span="3">
<!-- <el-col :span="3">
<el-radio v-model="addModel.forward" :label="false">{{ $t('planMonitor.addToTheEnd') }}</el-radio>
</el-col>
<el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
</el-col> -->
<!-- <el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.defaultStopTime') }}</span>
</el-col>
<el-col :span="5">
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" />
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" /> -->
<!-- <el-select v-model="defaultStopTime" size="mini" :placeholder="this.$t('global.choose')">
<el-option
v-for="item in defaultStopTimeList"
@ -52,8 +52,8 @@
:value="item.value"
/>
</el-select> -->
</el-col>
<el-col :span="3" style="margin-left: 20px;height: 28px;line-height: 28px;">
<!-- </el-col> -->
<el-col :span="3" style="margin-left:10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.defaultRunLevel') }}</span>
</el-col>
<el-col :span="5">
@ -129,27 +129,38 @@
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" width="100px" />
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')" width="100px">
<template slot-scope="scope">
<el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" />
<!-- prop="arriveTime" -->
<el-table-column :label="this.$t('planMonitor.arriveTime')" width="100px">
<template v-if="scope.$index!=0" slot-scope="scope">
{{ scope.row.arriveTime }}
</template>
</el-table-column>
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')" width="100px">
<template v-if="scope.$index!=0&&scope.$index!=addModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.stopTime+'s' }}
<!-- <el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" /> -->
</template>
</el-table-column>
<el-table-column :label="this.$t('planMonitor.departureTime')" width="100px">
<template v-if="scope.$index!=addModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.departureTime }}
</template>
</el-table-column>
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" width="100px" />
<el-table-column :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope">
<span style="font-size:13px;">{{ scope.row.speedLevel }}</span>
<el-input v-model="scope.row.speedLevelTime" style="width:70px" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" />
<span>{{ '('+scope.row.speedLevelTime+'s)' }}</span>
<!-- <el-input v-model="scope.row.speedLevelTime" style="width:70px" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" /> -->
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<!-- <el-row>
<el-col :offset="16">
<el-checkbox v-model="showDefault">{{ $t('planMonitor.showDefaultStopTimeAndRunLevel') }}</el-checkbox>
</el-col>
</el-row>
</el-row> -->
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
@ -158,7 +169,7 @@
</template>
<script>
import { getRoutingList, addPlanTrip, getMapStationRun } from '@/api/runplan';
import { listUserRoutingData, addPlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan';
export default {
@ -170,16 +181,17 @@ export default {
dialogShow: false,
loading: false,
isPlan: false,
showDefault: true,
// showDefault: true,
stopStationMap: {},
stopTimeMap:{},
params: {},
routingList: [],
startStationFilters:[],
endStationFilters:[],
defaultStopTime: '30',
defaultSpeedLevel: 'l3',
// defaultStopTime: '30',
defaultSpeedLevel: 'l1',
addModel: {
forward: false,
// forward: false,
routingCode: '',
endStationCode: '',
startStationCode: '',
@ -215,9 +227,9 @@ export default {
'addModel.startTime': function () {
this.computedDetailList();
},
'defaultStopTime': function () {
this.computedDetailList('defaultStopTime');
},
// 'defaultStopTime': function () {
// this.computedDetailList('defaultStopTime');
// },
'defaultSpeedLevel': function () {
this.computedDetailList('defaultSpeedLevel');
}
@ -225,15 +237,14 @@ export default {
methods: {
loadInitData(params) {
this.isPlan = params.isPlan;
// this.addModel.taskIndex = getUID('task_');
this.addModel.serviceNumber = params.serviceNumber;
this.addModel.planId = this.$route.query.planId;
this.addModel.arriveConfigList = [];
const planId = this.$route.query.planId;
if (planId) {
getRoutingList(planId).then(resp => {
const mapId = this.$route.query.mapId;
listUserRoutingData(mapId).then(resp => {
this.routingList = resp.data;
// debugger;
const startStationFilterMap = {};
const endStationFilterMap = {};
this.routingList.forEach(routing=>{
@ -263,11 +274,17 @@ export default {
const mapId = this.$route.query.mapId;
if (mapId) {
getMapStationRun(mapId).then(resp =>{
const list = resp.data;
getMapStationRunUser(mapId).then(resp =>{
const list = resp.data.list;
list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
});
getStationStopTime(mapId).then(response=>{
const stopTimeList = response.data.list;
stopTimeList.forEach(element=>{
this.stopTimeMap[element.stationCode] = {parkingTime:element.parkingTime};
});
});
// if (list && list.length) {
// list.forEach(elem => {
// if (!elem.runPlanLevelVO) {
@ -321,73 +338,92 @@ export default {
}
return runTime;
},
changeSpeedLevelTime(indexs, speedLevelTime) {
const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
arriveConfigList.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.addModel.arriveConfigList = arriveConfigList;
this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
},
changeStopTime(indexs, time) {
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
// const runLevel = this.defaultSpeedLevel || 'l3'; //
const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
arriveConfigList.forEach((elem, index) => {
if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
// const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.addModel.arriveConfigList = arriveConfigList;
this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
},
// changeSpeedLevelTime(indexs, speedLevelTime) {
// const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
// let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
// arriveConfigList.forEach((elem, index) => {
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.addModel.arriveConfigList = arriveConfigList;
// this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
// },
// changeStopTime(indexs, time) {
// let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
// // const runLevel = this.defaultSpeedLevel || 'l3'; //
// const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
// arriveConfigList.forEach((elem, index) => {
// if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// // const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// // elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.addModel.arriveConfigList = arriveConfigList;
// this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
// },
computedDetailList(type = null) {
if (this.addModel.routingCode) {
const list = Object.assign([], this.addModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
const runLevel = this.defaultSpeedLevel || 'l3'; //
const runLevel = this.defaultSpeedLevel || 'l1'; //
list.forEach((elem, index) => {
if (type == 'defaultStopTime' || type == 'routingCode') {
elem.stopTime = parseInt(this.defaultStopTime);
// type == 'defaultStopTime' ||
if (type == 'routingCode') {
// elem.stopTime = parseInt(this.defaultStopTime);
if (this.stopTimeMap[elem.stationCode]) {
// if (index == 0 || index == list.length - 1) {
// elem.stopTime = 0;
// } else {
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
// }
} else {
elem.stopTime = 0;
}
}
// elem.arriveTime = index ? formatTime(tempTime) : '';
if (index) {
elem.arriveTime = formatTime(tempTime);
} else {
const time = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(time - elem.stopTime);
}
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
elem.departureTime = formatTime(tempTime + elem.stopTime);
// elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
// if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
}
elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// }
// this.defaultSpeedLevel == 'l1' ? `(${runLevelObj.label})` : runLevelObj.label
elem.speedLevel = runLevelObj.label;
// elem.speedLevelTime = realRunlevel;
if (index > 0) {
tempTime = tempTime + elem.stopTime + elem.speedLevelTime;
} else {
@ -406,8 +442,8 @@ export default {
this.$set(this.addModel, 'arriveConfigList', arriveConfigList);
this.addModel.startStationCode = row.startStationCode;
this.addModel.endStationCode = row.endStationCode;
// this.addModel.endSectionCode = row.endSectionCode;
// this.addModel.startSectionCode = row.startSectionCode;
this.addModel.endSectionCode = row.endSectionCode;
this.addModel.startSectionCode = row.startSectionCode;
this.addModel.routingCode = row.code;
this.computedDetailList('routingCode');
},

View File

@ -15,9 +15,9 @@
<el-col :span="4">
<el-input v-model="model.serviceNumber" disabled size="mini" />
</el-col>
<el-col :span="4" :offset="1">
<!-- <el-col :span="4" :offset="1">
<el-checkbox v-model="model.debugTrain">{{ $t('planMonitor.commissioningTrain') }}</el-checkbox>
</el-col>
</el-col> -->
</el-row>
<el-row style="margin-top: 5px">
{{ $t('planMonitor.task') }}
@ -74,7 +74,7 @@ export default {
isNew:true,
model: {
serviceNumber: '',
debugTrain: false,
// debugTrain: false,
tripConfigList: []
}
};
@ -107,9 +107,9 @@ export default {
id:index + 1,
tripNumber: tripNumber,
startStationCode: resp.data.startStationCode,
startTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
startTime: formatTime(trainInfo.stationTimeList[1].secondTime + 7200),
endStationCode: resp.data.endStationCode,
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime + 7200),
endTime: formatTime(trainInfo.stationTimeList[lastIndex - 1].secondTime + 7200),
routingCode : resp.data.code,
endSectionCode:resp.data.endSectionCode,
startSectionCode:resp.data.startSectionCode,
@ -142,13 +142,14 @@ export default {
const newModel = {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode,
speedLevel:'默认',
// speedLevel:'',
arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime
};
if (index < newstationTimeList.length - 1) {
newModel.speedLevelTime = newstationTimeList[index + 1].arriveTime - newstationTime.departureTime;
// newModel.speedLevel=
}
taskObj.arriveConfigList.push(newModel);
});
@ -279,14 +280,18 @@ export default {
if (this.isNew) {
if (this.model.tripConfigList.length > 0) {
this.doClose();
this.model.tripConfigList.map(each=>{
each.startTime = each.arriveConfigList[0].arriveTime;
each.endTime = each.arriveConfigList[each.arriveConfigList.length - 1].departureTime;
});
addPlanService(this.model).then(() => {
this.$emit('refresh');
// this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// });
this.$message.success(this.$t('tip.planCreationSuccessful'));
}).catch(() => {
this.$messageBox(this.$t('tip.createPlanFailed'));
}).catch((error) => {
this.$messageBox(this.$t('tip.createPlanFailed') + error.message);
});
} else {
this.$messageBox('请增加任务');
@ -294,6 +299,10 @@ export default {
} else {
if (this.model.tripConfigList.length > 0) {
this.doClose();
this.model.tripConfigList.map(each=>{
each.startTime = each.arriveConfigList[0].arriveTime;
each.endTime = each.arriveConfigList[each.arriveConfigList.length - 1].departureTime;
});
updatePlanService(this.$route.query.planId, this.model.serviceNumber, this.model).then(() => {
this.$emit('refresh');
// this.$emit('dispatchOperate', {

View File

@ -0,0 +1,176 @@
<template>
<el-dialog
v-dialogDrag
class="planEdit__tool gernarate-plan-train"
:title="title"
:visible.sync="dialogShow"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
top="10vh"
:close-on-click-modal="false"
>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="small" :loading="loading" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { generatePlanTrain, listUserRoutingData } from '@/api/runplan';
export default {
props: {
loadRunPlanId: {
type: String,
default() {
return '';
}
}
},
data() {
return {
dialogShow: false,
routingList: [],
loading: false,
runLevelList: [
{ value: 1, label: '等级一' },
{ value: 2, label: '等级二' },
{ value: 3, label: '等级三'},
{ value: 4, label: '等级四' },
{ value: 5, label: '等级五' }
],
formModel: {
serviceNumber:'', //
beginTime: '', //
overTime: '', //
runLevel:'', //
inboundRouting:'', // code
outboundRouting:'', // code
runningRouting1: '', // code1
runningRouting2: '' // code2
},
rules: {
serviceNumber:[
{required: true, validator: this.validateServiceNumber, trigger: 'blur'}
],
beginTime: [
{ required: true, message: '请填写开始时间', trigger: 'blur' }
],
overTime: [
{ required: true, message: '请填写结束时间', trigger: 'blur' }
],
runLevel: [
{ required: true, message: '请选择运行等级', trigger: 'change' }
],
inboundRouting: [
{ required: true, message: '请选择回库交路', trigger: 'change' }
],
outboundRouting: [
{ required: true, message: '请选择出库交路', trigger: 'change' }
],
runningRouting1: [
// message: '',
{ required: true, validator: this.validateRunningRouting, trigger: 'change' },
{ required: true, validator: this.validateRunningRouting, trigger: 'blur' }
],
runningRouting2: [
{ required: true, validator: this.validateRunningRouting, trigger: 'change' },
{ required: true, validator: this.validateRunningRouting, trigger: 'blur' }
]
}
};
},
computed: {
title() {
return '生成计划';
},
form() {
return {
labelWidth: '100px',
size:'small',
items: [
{ prop: 'serviceNumber', label: '服务号', type: 'text', rightWidth:true, maxlength:3 },
{ prop: 'beginTime', label: '开始时间', type: 'timePicker'},
{ prop: 'overTime', label: '结束时间', type: 'timePicker'},
{ prop: 'runLevel', label: '运行等级', type: 'select', options: this.runLevelList },
{ prop: 'outboundRouting', label: '出库交路', type: 'select', options: this.covertRouting('OUTBOUND'), noDataText:'请先设置交路' },
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', options: this.covertRouting('LOOP'), noDataText:'请先设置交路', change:true, onChange:this.changeRoute('runningRouting2')},
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', options: this.covertRouting('LOOP'), noDataText:'请先设置交路', change:true, onChange:this.changeRoute('runningRouting1')},
{ prop: 'inboundRouting', label: '入库交路', type: 'select', options: this.covertRouting('INBOUND'), noDataText:'请先设置交路' }
]
};
}
},
methods: {
doShow(params) {
this.loading = false;
const mapId = this.$route.query.mapId;
if (mapId) {
listUserRoutingData(mapId).then(response => {
this.routingList = response.data.map(elem => { return { value: elem.code, label: elem.name, routingType:elem.routingType }; });
}).catch(() => {
this.$messageBox(`获取交路列表失败`);
});
}
this.dialogShow = true;
},
validateServiceNumber(rule, value, callback) {
if (value.trim().length == 0) {
return callback(new Error('请填写服务号'));
} else {
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
if (serviceNumberList.includes(value.trim())) {
return callback(new Error('该服务号已存在,请重新填写'));
} else {
return callback();
}
}
},
validateRunningRouting(rule, value, callback) {
if (value.trim().length == 0) {
return callback(new Error('请选择环路'));
} else {
if (this.formModel.runningRouting1 == this.formModel.runningRouting2) {
return callback(new Error('环路交路1和环路交路2不能相同'));
} else {
return callback();
}
}
},
changeRoute(runningRouting) {
if (this.formModel[runningRouting]) { this.$refs.dataform.validateField([runningRouting]); }
},
doClose() {
this.loading = false;
this.$refs.dataform.resetForm();
this.dialogShow = false;
},
covertRouting(routingType) {
return this.routingList.filter(route=>{ return route.routingType == routingType; });
},
handleCommit() {
this.$refs.dataform.validateForm(() => {
if (this.formModel.overTime <= this.formModel.beginTime) {
this.$messageBox('结束时间必须大于开始时间');
return false;
}
this.loading = true;
generatePlanTrain(this.$route.query.planId || this.loadRunPlanId, this.formModel).then(res => {
this.loading = false;
this.doClose();
this.$store.dispatch('runPlan/refresh');
}).catch(error => {
console.log(error);
this.doClose();
});
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -24,7 +24,8 @@
</el-table-column>
<el-table-column prop="right" label="所属站台">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ formatSelect(scope.row.sectionCode) ?'上行站台':'下行站台' }}</span>
<!-- ?'上行站台':'下行站台' -->
<span style="margin-left: 10px">{{ formatSelect(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="parkingTime" label="停站时间" width="90">
@ -59,7 +60,7 @@ export default {
},
computed: {
title() {
return this.$t('planMonitor.modifying.modifyRunLevel');
return this.$t('planMonitor.modifying.modifyStopTime');
}
},
mounted() {
@ -71,6 +72,7 @@ export default {
},
formatSelect(code) {
const device = this.$store.state.map.map && this.$store.state.map.map.stationStandList.find(ele => ele.standTrackCode == code);
console.log(device.right);
if (device) {
return device.right ? '上行站台' : '下行站台';
}

View File

@ -12,7 +12,88 @@
:close-on-click-modal="false"
>
<el-row>
<el-col :span="4">
<!-- <el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.trainManual">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col> -->
<!-- <el-col :span="6">
<el-row>
<el-col :span="11" :offset="1" class="lineHeight">
<span>{{ $t('planMonitor.modifying.defaultStopTime') }}</span>
</el-col>
<el-col :span="12">
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" /> -->
<!-- <el-select
v-model="editModel.defaultStopTime"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultStopTimeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<!-- </el-col>
</el-row>
</el-col> -->
<el-col :span="6">
<el-row>
<el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.serviceNumber') }}</span>
</el-col>
<el-col :span="15">
<el-input v-model="serviceNumber" size="mini" disabled />
</el-col>
</el-row>
</el-col>
<!-- <el-col :span="7" class="lineHeight">
<el-row>
<el-col :span="22" :offset="2">
<el-row>
<el-col :span="6">
<el-checkbox v-model="editModel.clearGuest">{{ $t('planMonitor.modifying.clearGuest') }}</el-checkbox>
</el-col>
<el-col :span="8">
<el-checkbox v-model="editModel.continuationPlan">{{ $t('planMonitor.modifying.continuationPlan') }}</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="editModel.firstTrain">{{ $t('planMonitor.modifying.firstTrain') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
</el-row>
</el-col> -->
<el-col :span="6" class="lineHeight">
<el-row>
<el-col :span="10" :offset="1">
<span>{{ $t('planMonitor.modifying.defaultRunLevel') }}</span>
</el-col>
<el-col :span="12">
<el-select
v-model="defaultSpeedLevel"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultSpeedLevelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-row>
<el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.tripNumber') }}</span>
@ -29,72 +110,13 @@
</el-col>
</el-row>
</el-col>
<el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.trainManual">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
<el-col :span="6">
<el-row>
<el-col :span="11" :offset="1" class="lineHeight">
<span>{{ $t('planMonitor.modifying.defaultStopTime') }}</span>
</el-col>
<el-col :span="12">
<el-input-number v-model="defaultStopTime" placeholder="请输入时间" size="mini" :controls="false" :min="0" />
<!-- <el-select
v-model="editModel.defaultStopTime"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultStopTimeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
</el-col>
</el-row>
</el-col>
<el-col :span="5">
<el-row>
<el-col :span="9" :offset="2" class="lineHeight">
<span>{{ $t('planMonitor.modifying.serviceNumber') }}</span>
</el-col>
<el-col :span="13">
<el-input v-model="serviceNumber" size="mini" disabled />
</el-col>
</el-row>
</el-col>
<el-col :span="7" class="lineHeight">
<el-row>
<el-col :span="22" :offset="2">
<el-row>
<el-col :span="6">
<el-checkbox v-model="editModel.clearGuest">{{ $t('planMonitor.modifying.clearGuest') }}</el-checkbox>
</el-col>
<el-col :span="8">
<el-checkbox v-model="editModel.continuationPlan">{{ $t('planMonitor.modifying.continuationPlan') }}</el-checkbox>
</el-col>
<el-col :span="6">
<el-checkbox v-model="editModel.firstTrain">{{ $t('planMonitor.modifying.firstTrain') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<!-- <el-col :span="6">
<el-row>
<el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.serialNumber') }}</span>
</el-col>
<el-col :span="15">
<el-select v-model="editModel.serialNumber" size="mini" style="display: inline-black" :placeholder="$t('planMonitor.modifying.pleaseSelect')">
<el-select v-model="editModel.serialNumber" size="mini" style="display: inline-black" disabled :placeholder="$t('planMonitor.modifying.pleaseSelect')">
<el-option
v-for="item in serialNumberList"
:key="item.value"
@ -104,42 +126,20 @@
</el-select>
</el-col>
</el-row>
</el-col>
<el-col :span="2">
</el-col> -->
<!-- <el-col :span="2">
<el-row>
<el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.serialManual" size="mini">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col>
</el-row>
</el-col>
</el-col> -->
<el-col :span="6" class="lineHeight">
<el-row>
<el-col :span="11" :offset="1">
<span>{{ $t('planMonitor.modifying.defaultRunLevel') }}</span>
</el-col>
<el-col :span="12">
<el-select
v-model="editModel.defaultSpeedLevel"
style="display: inline-black"
size="mini"
:placeholder="$t('planMonitor.modifying.pleaseSelect')"
>
<el-option
v-for="item in defaultSpeedLevelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
</el-col>
<el-col :span="5" class="lineHeight">
<el-row>
<el-col :span="9" :offset="2">
<el-col :span="10" :offset="1">
<span>{{ $t('planMonitor.modifying.startTime') }}</span>
</el-col>
<el-col :span="13">
<el-col :span="12">
<el-time-picker
v-model="editModel.startTime"
:placeholder="$t('planMonitor.modifying.selectTime')"
@ -150,7 +150,7 @@
</el-col>
</el-row>
</el-col>
<el-col :span="7" class="lineHeight">
<!-- <el-col :span="7" class="lineHeight">
<el-row>
<el-col :span="22" :offset="2">
<el-row>
@ -166,7 +166,7 @@
</el-row>
</el-col>
</el-row>
</el-col>
</el-col> -->
</el-row>
<el-row style="margin-bottom: 5px;">
{{ $t('planMonitor.modifying.route') }}
@ -212,27 +212,37 @@
{{ formatName(scope.row.sectionCode) }}
</template>
</el-table-column>
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" />
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')">
<template slot-scope="scope">
<el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" />
<el-table-column :label="this.$t('planMonitor.arriveTime')">
<template v-if="scope.$index!=0" slot-scope="scope">
{{ scope.row.arriveTime }}
</template>
</el-table-column>
<!-- prop="stopTime" -->
<el-table-column :label="this.$t('planMonitor.stopTime')">
<template v-if="scope.$index!=0&&scope.$index!=editModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.stopTime+'s' }}
<!-- <el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" /> -->
</template>
</el-table-column>
<el-table-column :label="this.$t('planMonitor.departureTime')">
<template v-if="scope.$index!=editModel.arriveConfigList.length-1" slot-scope="scope">
{{ scope.row.departureTime }}
</template>
</el-table-column>
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" />
<el-table-column :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope">
{{ scope.row.speedLevel }}
<el-input v-model="scope.row.speedLevelTime" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" />
<span style="font-size:13px;"> {{ scope.row.speedLevel }}</span>
<span>{{ '('+scope.row.speedLevelTime+'s)' }}</span>
<!-- <el-input v-model="scope.row.speedLevelTime" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" /> -->
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<!-- <el-row>
<el-col :offset="16">
<el-checkbox v-model="editModel.default">{{ $t('planMonitor.modifying.showDefaultTime') }}</el-checkbox>
</el-col>
</el-row>
</el-row> -->
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
@ -240,7 +250,7 @@
</el-dialog>
</template>
<script>
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRun } from '@/api/runplan';
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan';
export default {
@ -263,8 +273,9 @@ export default {
PlanConvert: {},
parkSectionCodeList:[],
stopStationMap: {},
defaultStopTime: 0,
defaultSpeedLevel: 'l3',
stopTimeMap:{},
// defaultStopTime: 0,
defaultSpeedLevel: 'l1',
routingList: [],
tripNumber: '',
serviceNumber: '',
@ -289,7 +300,7 @@ export default {
tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }],
// defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
// defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
serialNumberList: [],
// serialNumberList: [],
defaultSpeedLevelList: [
{ value: 'l1', label: '等级一' },
{ value: 'l2', label: '等级二' },
@ -308,9 +319,9 @@ export default {
'editModel.startTime': function () {
this.computedDetailList();
},
'defaultStopTime': function () {
this.computedDetailList('defaultStopTime');
},
// 'defaultStopTime': function () {
// this.computedDetailList('defaultStopTime');
// },
'defaultSpeedLevel': function () {
this.computedDetailList('defaultSpeedLevel');
}
@ -334,35 +345,50 @@ export default {
if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else if (stopStationObj['l3']) {
runTime = parseInt(stopStationObj['l3']);
} else if (stopStationObj[runLevel]) {
runTime = parseInt(stopStationObj[runLevel]);
}
}
}
return runTime;
},
computedDetailList(type = null) {
if (this.editModel.routingCode) {
const list = Object.assign([], this.editModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
const runLevel = this.defaultSpeedLevel || 'l3'; //
const runLevel = this.defaultSpeedLevel || 'l1'; //
list.forEach((elem, index) => {
if (type == 'defaultStopTime' || type == 'routingCode') {
elem.stopTime = parseInt(this.defaultStopTime);
// type == 'defaultStopTime' ||
if (type == 'routingCode') {
// elem.stopTime = parseInt(this.defaultStopTime);
if (this.stopTimeMap[elem.stationCode]) {
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
} else {
elem.stopTime = 0;
}
}
// elem.arriveTime = index ? formatTime(tempTime) : '';
if (index) {
elem.arriveTime = formatTime(tempTime);
} else {
const time = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(time - elem.stopTime);
}
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
elem.departureTime = formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
// if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel;
}
elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// }
// this.defaultSpeedLevel == 'l1' ? `(${runLevelObj.label})` : runLevelObj.label
elem.speedLevel = runLevelObj.label;
// elem.speedLevelTime = realRunlevel;
if (index > 0) {
tempTime = tempTime + elem.stopTime + elem.speedLevelTime;
} else {
@ -382,34 +408,46 @@ export default {
this.planId = this.$route.query.planId;
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
if (mapId) {
getMapStationRun(mapId).then(resp => {
const list = resp.data;
getMapStationRunUser(mapId).then(resp => {
const list = resp.data.list;
list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
});
getStationStopTime(mapId).then(response=>{
const stopTimeList = response.data.list;
stopTimeList.forEach(element=>{
this.stopTimeMap[element.stationCode] = {parkingTime:element.parkingTime};
});
this.initTaskData(params);
this.dialogShow = true;
});
});
}
// this.routingList
},
initTaskData(params) {
if (params.rowData && params.rowData.arriveConfigList.length > 0) {
this.editModel.arriveConfigList = params.rowData.arriveConfigList;
this.editModel.routingCode = params.rowData.routingCode;
this.editModel.startStationCode = params.rowData.startStationCode;
this.editModel.endStationCode = params.rowData.endStationCode;
this.editModel.startTime = params.rowData.startTime;
this.editModel.endTime = params.rowData.endTime;
this.editModel.endSectionCode = params.rowData.endSectionCode;
this.editModel.startSectionCode = params.rowData.startSectionCode;
this.editModel.id = params.rowData.id;
const paramData = params.rowData;
this.initRunlevel(paramData);
// const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.label == ; });
this.editModel.arriveConfigList = paramData.arriveConfigList;
this.editModel.routingCode = paramData.routingCode;
this.editModel.startStationCode = paramData.startStationCode;
this.editModel.endStationCode = paramData.endStationCode;
this.editModel.startTime = paramData.startTime;
this.editModel.endTime = paramData.endTime;
this.editModel.endSectionCode = paramData.endSectionCode;
this.editModel.startSectionCode = paramData.startSectionCode;
this.editModel.id = paramData.id;
this.routingList = [];
this.routingList.push({
code:params.rowData.routingCode,
startStationCode:params.rowData.startStationCode,
endStationCode:params.rowData.endStationCode,
endSectionCode:params.rowData.endSectionCode,
startSectionCode:params.rowData.startSectionCode
code:paramData.routingCode,
startStationCode:paramData.startStationCode,
endStationCode:paramData.endStationCode,
endSectionCode:paramData.endSectionCode,
startSectionCode:paramData.startSectionCode
});
this.computedDetailList();
this.dialogShow = true;
} else {
const model = {
planId: this.$route.query.planId || this.loadRunPlanId,
@ -467,7 +505,7 @@ export default {
const newModel = {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode,
speedLevel:'默认',
// speedLevel:'',
arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime
@ -477,58 +515,88 @@ export default {
}
this.editModel.arriveConfigList.push(newModel);
});
this.initRunlevel(this.editModel);
this.dialogShow = true;
this.computedDetailList();
}
});
}
},
changeStopTime(indexs, time) {
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
// const runLevel = this.defaultSpeedLevel || 'l3'; //
const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
arriveConfigList.forEach((elem, index) => {
if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
// const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
initRunlevel(paramData) {
const speedLevelData = this.stopStationMap[[paramData.arriveConfigList[0].sectionCode, paramData.arriveConfigList[1].sectionCode].toString()];
switch (paramData.arriveConfigList[0].speedLevelTime) {
case speedLevelData.l1: {
this.defaultSpeedLevel = 'l1';
break;
}
case speedLevelData.l2: {
this.defaultSpeedLevel = 'l2';
break;
}
case speedLevelData.l3: {
this.defaultSpeedLevel = 'l3';
break;
}
case speedLevelData.l4: {
this.defaultSpeedLevel = 'l4';
break;
}
case speedLevelData.l5: {
this.defaultSpeedLevel = 'l5';
break;
}
default: {
this.defaultSpeedLevel = 'l1';
break;
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.editModel.arriveConfigList = arriveConfigList;
this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
},
changeSpeedLevelTime(indexs, speedLevelTime) {
const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
arriveConfigList.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
elem.arriveTime = index ? formatTime(tempTime) : '';
if (index > 0) {
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
} else {
elem.departureTime = formatTime(tempTime);
}
const realRunlevel = elem.speedLevelTime;
if (index > 0) {
tempTime = tempTime + elem.stopTime + realRunlevel;
} else {
tempTime = tempTime + realRunlevel;
}
});
this.editModel.arriveConfigList = arriveConfigList;
this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
},
// changeStopTime(indexs, time) {
// let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
// // const runLevel = this.defaultSpeedLevel || 'l3'; //
// const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
// arriveConfigList.forEach((elem, index) => {
// if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// // const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
// // elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.editModel.arriveConfigList = arriveConfigList;
// this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
// },
// changeSpeedLevelTime(indexs, speedLevelTime) {
// const arriveConfigList = Object.assign([], this.editModel.arriveConfigList);
// let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
// arriveConfigList.forEach((elem, index) => {
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
// elem.arriveTime = index ? formatTime(tempTime) : '';
// if (index > 0) {
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
// } else {
// elem.departureTime = formatTime(tempTime);
// }
// const realRunlevel = elem.speedLevelTime;
// if (index > 0) {
// tempTime = tempTime + elem.stopTime + realRunlevel;
// } else {
// tempTime = tempTime + realRunlevel;
// }
// });
// this.editModel.arriveConfigList = arriveConfigList;
// this.editModel.endTime = formatTime(tempTime - this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].stopTime);
// },
doShow(params) {
this.loadInitData(params);
},
@ -541,8 +609,10 @@ export default {
planId: this.$route.query.planId || this.loadRunPlanId,
routingCode: this.editModel.routingCode,
tripNumber: this.tripNumber,
startTime: this.editModel.startTime,
endTime: this.editModel.endTime,
// startTime: this.editModel.startTime,
startTime:this.editModel.arriveConfigList[0].arriveTime,
// endTime: this.editModel.endTime,
endTime: this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].departureTime,
arriveConfigList: this.editModel.arriveConfigList,
SDTNumber: `${this.serviceNumber}${this.tripNumber}`
};

View File

@ -0,0 +1,644 @@
<template>
<div class="routeConfig">
<div>
<div class="clearfix" style="padding-right: 20px;">
<el-button type="text" class="mapEdit_box" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
<el-button type="text" class="mapEdit_box" @click="createRouteEvent">{{ $t('map.newConstruction') }}</el-button>
</div>
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
<div class="definition">
<el-form-item :label="$t('map.routingName')" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode">
<el-select v-model="addModel.startStationCode" clearable :filterable="true" @change="changeStartStation">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'startStationCode' ? 'danger' : 'primary'"
@click="hover('startStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode">
<el-select v-model="addModel.startSectionCode" clearable :filterable="true" :disabled="editShow" @change="changeStartSection">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="editShow"
:type=" field === 'startSectionCode' ? 'danger' : 'primary'"
@click="hover('startSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endStationColon')" prop="endStationCode">
<el-select v-model="addModel.endStationCode" clearable :filterable="true" :disabled="!isStartSelected" @change="changeEndStation">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="!isStartSelected"
:type=" field === 'endStationCode' ? 'danger' : 'primary'"
@click="hover('endStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode">
<el-select v-model="addModel.endSectionCode" clearable :filterable="true" :disabled="editShow || !isStartSelected" @change="changeEndSection">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="editShow || !isStartSelected"
:type=" field === 'endSectionCode' ? 'danger' : 'primary'"
@click="hover('endSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.destinationCode')" prop="destinationCode" :disabled="editShow">
<el-input v-model="addModel.destinationCode" />
</el-form-item>
<el-form-item :label="$t('map.routingDirection')" prop="directionCode">
<el-select v-model="addModel.right" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in DirectionCodeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="!editShow" label="是否生成回路" prop="withLoop">
<el-checkbox v-model="addModel.withLoop" />
</el-form-item> -->
<el-form-item :label="$t('map.remarksColon')" prop="remarks">
<el-input v-model="addModel.remarks" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
</el-form-item>
<el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">
<el-table
:data="addModel.parkSectionCodeList"
border
style="width:97%"
height="300"
class="el-parkSectionCode-table"
>
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.stationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
type="text"
size="small"
@click.native.prevent="deleteSection(addModel.parkSectionCodeList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top:10px;">
<span>车站:</span>
<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:disabled="!allowSelect"
:type="field === 'routingStation' ? 'danger' : 'primary'"
@click="hover('routingStation')"
>{{ $t('map.activate') }}</el-button>
</div>
<div style="margin-top:10px;">
<span>区段:</span>
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in filterStandSection"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routingSection' ? 'danger' : 'primary'"
:disabled="!allowSelect"
@click="hover('routingSection')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
:disabled="!allowSelect"
@click="pushSection({stationCode: stationCode, sectionCode: sectionCode},'center')"
>
{{ $t('map.add') }}
</el-button>
</div>
</el-form-item>
<el-form-item>
<el-button-group style="padding-bottom:10px">
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button>
</el-button-group>
</el-form-item>
</div>
</el-form>
</div>
<route-operate ref="routeOperate" @routingSelected="routingSelected" />
</div>
</template>
<script>
import RouteOperate from './routeOperate';
import { setUID } from '@/jmapNew/utils/Uid';
import { addRoutingData, updateRoutingData } from '@/api/jmap/mapdraft';
import { mapGetters } from 'vuex';
import { formatName } from '@/utils/runPlan';
import Sortable from 'sortablejs';
export default {
name:'RouteConfig',
components: {
RouteOperate
},
data() {
return {
field: '',
editShow: false,
isSave: true,
isStartSelected:false,
allowSelect:false,
loading: false,
stationCode: '',
sectionCode: '',
DirectionCodeList: [{label: '右行', value: true}, {label: '左行', value: false}],
addModel: {
name: '',
mapId: '',
code: '',
// withLoop:false,
right: true,
destinationCode: '',
startStationCode: '',
startSectionCode: '',
endStationCode: '',
endSectionCode: '',
remarks: '',
userId: '',
parkSectionCodeList: []
},
rules: {
name: [
{ required: true, message: '请输入交路名称', trigger: 'change' }
],
startStationCode: [
{ required: true, message: '请选择起始站', trigger: 'change' }
],
startSectionCode: [
{ required: true, message: '请选择起始区段', trigger: 'change' }
],
endStationCode: [
{ required: true, message: '请选择终到站', trigger: 'change' }
],
endSectionCode: [
{ required: true, message: '请选择终到区段', trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList'
]),
filterSectionList() {
if (this.sectionList) {
// || elem.reentryTrack
return this.sectionList.filter(elem => { return elem.standTrack || elem.transferTrack; });
} else {
return [];
}
},
filterStandSection() {
if (this.sectionList) {
// || elem.reentryTrack
return this.sectionList.filter(elem => { return elem.standTrack; });
} else {
return [];
}
},
filterStationList() {
if (this.stationList) {
return this.stationList.filter(elem => { return true; });
} else {
return [];
}
},
routeName: {
get() {
var name = '';
if (this.isSave) {
let begStation = ''; let endStation = '';
let begSection = ''; let endSection = '';
if (this.stationList) {
this.stationList.forEach(elem => {
if (elem.code === this.addModel.startStationCode) begStation = elem.name;
if (elem.code === this.addModel.endStationCode) endStation = elem.name;
});
}
if (this.sectionList) {
this.sectionList.forEach(elem => {
if (elem.code === this.addModel.startSectionCode) begSection = '(' + elem.name + ')';
if (elem.code === this.addModel.endSectionCode) endSection = '(' + elem.name + ')';
});
}
name = begStation + begSection + '-' + endStation + endSection;
}
return name;
}
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
'addModel.parkSectionCodeList':function(val, old) {
if (val.length > 0) {
this.changeSectionSelected(val, true);
}
},
routeName(val, old) {
if (val) {
this.addModel.name = val;
}
},
sectionCode(val) {
val && this.changeBelongSection(val);
}
},
mounted() {
this.rowDrop();
},
methods:{
previewRouteEvent() {
this.$refs.routeOperate.doShow();
},
createRouteEvent() {
this.clear();
},
routingSelected(data) {
this.editData(data);
},
editData(data) {
this.isSave = false;
this.allowSelect = true;
this.isStartSelected = true;
this.editShow = true;
this.addModel = data;
},
clear() {
if (this.$refs && this.$refs.form) {
this.changeSectionSelected(this.addModel.parkSectionCodeList, false);
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.$route.query.mapId;
this.addModel.parkSectionCodeList = [];
this.addModel.code = '';
this.stationCode = '';
this.sectionCode = '';
this.isSave = true;
this.allowSelect = false;
this.isStartSelected = false;
// this.addModel.withLoop = false;
this.editShow = false;
this.field = '';
}
},
setSelected(selected) {
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'startStationCode'.toUpperCase()) {
this.addModel.startStationCode = selected.code;
this.judgeAllowSelected();
this.addStartSectionData(true);
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'endStationCode'.toUpperCase()) {
this.addModel.endStationCode = selected.code;
this.judgeAllowSelected();
this.addEndSectionData(true);
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
// selected.reentryTrack ||
if (selected.standTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.startStationCode = selected.belongStation;
}
this.addModel.startSectionCode = selected.code;
this.judgeAllowSelected();
this.addStartSectionData(false);
} else {
// (//)
this.$message.error('请选择正确的起始区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
// selected.reentryTrack ||
if (selected.standTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.endStationCode = selected.belongStation;
}
this.addModel.endSectionCode = selected.code;
this.judgeAllowSelected();
this.addEndSectionData(false);
this.addModel.destinationCode = selected.destinationCode || '';
} else {
this.$message.error('请选择正确的终到区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) {
if (selected.standTrack) {
// || selected.reentryTrack || selected.transferTrack
this.sectionCode = selected.code;
} else {
this.$message.error('请选择正确的区段');
}
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) {
this.stationCode = selected.code;
}
},
changeBelongSection(code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section && section.belongStation) {
this.stationCode = section.belongStation;
}
},
changeSectionSelected(selectedList, flag) {
if (this.addModel.parkSectionCodeList && this.addModel.parkSectionCodeList.length > 0) {
if (flag) {
if (this.oldsection && this.oldsection.length > 0) {
this.oldsection.forEach((section)=>{
section.instance.drawBatchSelected(section, '');
});
this.oldsection = [];
}
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
const list = section.logicSectionCodeList;
if (list && list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
this.oldsection && this.oldsection.push(logicSection);
logicSection.instance.drawBatchSelected(section, 'routingSection');
});
} else {
this.oldsection && this.oldsection.push(section);
section.instance.drawBatchSelected(section, 'routingSection');
}
});
} else {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
const list = section.logicSectionCodeList;
if (list && list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection.instance.drawBatchSelected(section, '');
});
} else {
section.instance.drawBatchSelected(section, '');
}
});
}
}
},
changeStartStation() {
this.judgeAllowSelected();
this.addStartSectionData(true);
},
changeStartSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.startStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addStartSectionData(false);
},
changeEndStation() {
this.judgeAllowSelected();
this.addEndSectionData(true);
},
changeEndSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.endStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addEndSectionData(false);
},
judgeAllowSelected() {
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '' && this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
this.allowSelect = true;
} else {
this.allowSelect = false;
}
},
addStartSectionData(isStation) {
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '') {
this.isStartSelected = true;
const result = this.pushSection({stationCode: this.addModel.startStationCode, sectionCode: this.addModel.startSectionCode}, 'top', isStation);
return result;
}
return false;
},
addEndSectionData(isStation) {
if (this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
const result = this.pushSection({stationCode: this.addModel.endStationCode, sectionCode: this.addModel.endSectionCode}, 'bottom', isStation);
return result;
}
return false;
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
// if (model.withLoop) { model.withLoop = true; } else { model.withLoop = false; }
model['mapId'] = this.$route.query.mapId;
model['userId'] = this.$store.state.user.id;
if (code) { model['code'] = code; }
return model;
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
const data = this.buildModel();
// delete data.withLoop;
updateRoutingData(data).then(resp => {
this.$message.success(this.$t('tip.pathUpdataSuccessful'));
this.loading = false;
this.clear();
}).catch((error) => {
this.$messageBox(this.$t('tip.pathUpdataFailed') + ':' + error.message);
this.loading = false;
});
}
});
},
save() {
this.addModel;
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
addRoutingData(this.buildModel(setUID('Routing'))).then(resp => {
this.$message.success(this.$t('tip.pathCreationSuccessful'));
this.loading = false;
this.clear();
}).catch((error) => {
this.$messageBox(this.$t('tip.createRoutingFailed') + ':' + error.message);
this.loading = false;
});
}
});
},
formatName(code) {
return formatName(code);
},
deleteSection(list, index) {
const data = list.splice(index, 1);
if (data.length > 0) {
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
section.instance.drawBatchSelected(section, '');
}
},
hover(field) {
this.field = field === this.field ? '' : field;
},
//
rowDrop() {
const that = this;
const tbody = document.querySelector('.el-parkSectionCode-table tbody', {filter:'.ignoreDrag'});
if (tbody) {
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
const length = that.addModel.parkSectionCodeList.length - 1;
if (newIndex != 0 && oldIndex != 0 && newIndex != length && oldIndex != length) {
that.addModel.parkSectionCodeList.splice(newIndex, 0, that.addModel.parkSectionCodeList.splice(oldIndex, 1)[0]);
const newArray = that.addModel.parkSectionCodeList.slice(0);
that.addModel.parkSectionCodeList = [];
that.$nextTick(function () {
that.addModel.parkSectionCodeList = newArray;
});
} else {
const newArray = that.addModel.parkSectionCodeList.slice(0);
that.addModel.parkSectionCodeList = [];
that.$nextTick(function () {
that.addModel.parkSectionCodeList = newArray;
});
}
}
});
}
},
pushSection(data, type, isStation) {
const list = this.addModel.parkSectionCodeList;
if (data && data.stationCode && data.sectionCode) {
const index = list.findIndex(elem => { return elem.sectionCode == data.sectionCode; });
switch (type) {
case 'center': {
if (index < 0) {
list.splice(list.length - 1, 0, data);
} else {
this.$messageBox('该区段已经在交路区段中存在');
}
break;
}
case 'top': {
if (isStation) {
list.splice(0, 1, data);
} else {
if (index < 0) {
list.splice(0, 1, data);
} else {
if (index == list.length - 1 && list.length >= 2) {
this.addModel.startSectionCode = list[0].sectionCode;
this.addModel.startStationCode = list[0].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
}
}
break;
}
case 'bottom': {
if (isStation) {
if (list.length >= 2) {
list.splice(list.length - 1, 1, data);
} else {
if (index < 0) {
list.push(data);
}
}
} else {
if (index < 0) {
if (list.length >= 2) {
list.splice(list.length - 1, 1, data);
} else {
list.push(data);
}
} else {
if (index == 0 && list.length >= 2) {
this.addModel.endSectionCode = list[list.length - 1].sectionCode;
this.addModel.endStationCode = list[list.length - 1].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
}
}
break;
}
default: {
if (index < 0) {
list.splice(list.length - 1, 0, data);
} else {
this.$messageBox(this.$t('tip.routeSameID'));
}
break;
}
}
this.sectionCode = '';
this.stationCode = '';
}
}
}
};
</script>
<style lang="scss" scoped>
.mapEdit_box{
float: right;
padding: 3px 0;
margin-right: 5px;
}
</style>

View File

@ -1,180 +1,13 @@
<template>
<el-dialog title="交路配置" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
<el-dialog :title="title" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
<div class="content-box">
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" />
<div style="width: 29%;float: right;" :style="{height: $store.state.app.height-54+'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div class="clearfix" style="padding-right: 20px;">
<el-button type="text" class="mapEdit_box" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
<el-button type="text" class="mapEdit_box" @click="createRouteEvent">{{ $t('map.newConstruction') }}</el-button>
</div>
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
<div class="definition">
<el-form-item :label="$t('map.routingName')" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode">
<el-select v-model="addModel.startStationCode" clearable :filterable="true" @change="changeStartStation">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'startStationCode' ? 'danger' : 'primary'"
@click="hover('startStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode">
<el-select v-model="addModel.startSectionCode" clearable :filterable="true" :disabled="editShow" @change="changeStartSection">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="editShow"
:type=" field === 'startSectionCode' ? 'danger' : 'primary'"
@click="hover('startSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endStationColon')" prop="endStationCode">
<el-select v-model="addModel.endStationCode" clearable :filterable="true" :disabled="!isStartSelected" @change="changeEndStation">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="!isStartSelected"
:type=" field === 'endStationCode' ? 'danger' : 'primary'"
@click="hover('endStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode">
<el-select v-model="addModel.endSectionCode" clearable :filterable="true" :disabled="editShow || !isStartSelected" @change="changeEndSection">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:disabled="editShow || !isStartSelected"
:type=" field === 'endSectionCode' ? 'danger' : 'primary'"
@click="hover('endSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.destinationCode')" prop="destinationCode" :disabled="editShow">
<el-input v-model="addModel.destinationCode" />
</el-form-item>
<el-form-item :label="$t('map.routingDirection')" prop="directionCode">
<el-select v-model="addModel.right" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in DirectionCodeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="!editShow" label="是否生成回路" prop="withLoop">
<el-checkbox v-model="addModel.withLoop" />
</el-form-item> -->
<el-form-item :label="$t('map.remarksColon')" prop="remarks">
<el-input v-model="addModel.remarks" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
</el-form-item>
<el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">
<el-table
:data="addModel.parkSectionCodeList"
border
style="width: 97%"
class="el-parkSectionCode-table"
>
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.stationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
type="text"
size="small"
@click.native.prevent="deleteSection(addModel.parkSectionCodeList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top:10px;">
<span>车站:</span>
<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:disabled="!allowSelect"
:type="field === 'routingStation' ? 'danger' : 'primary'"
@click="hover('routingStation')"
>{{ $t('map.activate') }}</el-button>
</div>
<div style="margin-top:10px;">
<span>区段:</span>
<el-select v-model="sectionCode" clearable :filterable="true" :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 === 'routingSection' ? 'danger' : 'primary'"
:disabled="!allowSelect"
@click="hover('routingSection')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
:disabled="!allowSelect"
@click="pushSection({stationCode: stationCode, sectionCode: sectionCode},'center')"
>
{{ $t('map.add') }}
</el-button>
</div>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button>
</el-button-group>
</el-form-item>
</div>
</el-form>
</el-scrollbar>
<!-- :style="{height: $store.state.app.height-54+'px' }" -->
<div class="routeMap">
<route-config v-if="type=='routeMap'" ref="routeConfig" />
<runplan-config v-if="type=='runplanParams'" ref="runPlanConfig" />
</div>
</div>
<route-operate ref="routeOperate" @routingSelected="routingSelected" />
</el-dialog>
</template>
@ -182,150 +15,54 @@
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import RouteOperate from './routeOperate';
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { addRoutingData, updateRoutingData } from '@/api/jmap/mapdraft';
import { formatName } from '@/utils/runPlan';
import Sortable from 'sortablejs';
import RouteConfig from './routeConfig';
import RunplanConfig from './runplanConfig';
export default {
name: 'RouteMap',
components: {
JlmapVisual,
RouteOperate
RouteConfig,
RunplanConfig
},
props:{
},
data() {
return {
type:'',
title:'',
dialogShow: false,
oldDevice: null,
field: '',
allowSelect:false,
isStartSelected:false,
stationCode: '',
sectionCode: '',
isSave: true,
loading: false,
oldsection:[],
DirectionCodeList: [{label: '右行', value: true}, {label: '左行', value: false}],
addModel: {
name: '',
mapId: '',
code: '',
// withLoop:false,
right: true,
destinationCode: '',
startStationCode: '',
startSectionCode: '',
endStationCode: '',
endSectionCode: '',
remarks: '',
userId: '',
parkSectionCodeList: []
},
editShow: false,
rules: {
name: [
{ required: true, message: '请输入交路名称', trigger: 'change' }
],
startStationCode: [
{ required: true, message: '请选择起始站', trigger: 'change' }
],
startSectionCode: [
{ required: true, message: '请选择起始区段', trigger: 'change' }
],
endStationCode: [
{ required: true, message: '请选择终到站', trigger: 'change' }
],
endSectionCode: [
{ required: true, message: '请选择终到区段', trigger: 'change' }
]
}
isFirst:true
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList'
]),
filterSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.standTrack || elem.reentryTrack || elem.transferTrack; });
} else {
return [];
}
},
filterStationList() {
if (this.stationList) {
return this.stationList.filter(elem => { return true; });
} else {
return [];
}
},
routeName: {
get() {
var name = '';
if (this.isSave) {
let begStation = ''; let endStation = '';
let begSection = ''; let endSection = '';
if (this.stationList) {
this.stationList.forEach(elem => {
if (elem.code === this.addModel.startStationCode) begStation = elem.name;
if (elem.code === this.addModel.endStationCode) endStation = elem.name;
});
}
if (this.sectionList) {
this.sectionList.forEach(elem => {
if (elem.code === this.addModel.startSectionCode) begSection = '(' + elem.name + ')';
if (elem.code === this.addModel.endSectionCode) endSection = '(' + elem.name + ')';
});
}
name = begStation + begSection + '-' + endStation + endSection;
}
return name;
}
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
'addModel.parkSectionCodeList':function(val, old) {
this.changeSectionSelected(val, true);
},
'$store.state.app.width': function(val) {
this.setWindowSize();
},
routeName(val, old) {
if (val) {
this.addModel.name = val;
}
},
sectionCode(val) {
val && this.changeBelongSection(val);
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
}
},
mounted() {
this.rowDrop();
},
methods: {
async doShow() {
async doShow(type) {
this.type = type;
if (this.type == 'routeMap') {
this.title = '交路配置';
} else if (this.type == 'runplanParams') {
this.title = '参数配置';
}
this.dialogShow = true;
await this.setWindowSize();
if (this.isFirst) {
await this.loadInitPage();
},
previewRouteEvent() {
this.$refs.routeOperate.doShow();
},
createRouteEvent() {
this.clear();
}
this.isFirst = false;
if (this.type == 'runplanParams') { this.$refs.runPlanConfig.doShow(); }
},
//
getDeviceByEm(em) {
@ -384,331 +121,22 @@ export default {
EventBus.$emit('viewLoading', false);
});
},
routingSelected(data) {
this.editData(data);
},
//
rowDrop() {
const that = this;
const tbody = document.querySelector('.el-parkSectionCode-table tbody', {filter:'.ignoreDrag'});
if (tbody) {
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
const length = that.addModel.parkSectionCodeList.length - 1;
if (newIndex != 0 && oldIndex != 0 && newIndex != length && oldIndex != length) {
that.addModel.parkSectionCodeList.splice(newIndex, 0, that.addModel.parkSectionCodeList.splice(oldIndex, 1)[0]);
const newArray = that.addModel.parkSectionCodeList.slice(0);
that.addModel.parkSectionCodeList = [];
that.$nextTick(function () {
that.addModel.parkSectionCodeList = newArray;
});
} else {
const newArray = that.addModel.parkSectionCodeList.slice(0);
that.addModel.parkSectionCodeList = [];
that.$nextTick(function () {
that.addModel.parkSectionCodeList = newArray;
});
}
}
});
}
},
editData(data) {
this.isSave = false;
this.allowSelect = true;
this.isStartSelected = true;
this.editShow = true;
this.addModel = data;
},
changeStartStation() {
this.judgeAllowSelected();
this.addStartSectionData(true);
},
changeStartSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.startStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addStartSectionData(false);
},
changeEndStation() {
this.judgeAllowSelected();
this.addEndSectionData(true);
},
changeEndSection(data) {
const section = this.$store.getters['map/getDeviceByCode'](data);
if (section.belongStation) {
this.addModel.endStationCode = section.belongStation;
}
this.judgeAllowSelected();
this.addEndSectionData(false);
},
changeBelongSection(code) {
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section && section.belongStation) {
this.stationCode = section.belongStation;
}
},
judgeAllowSelected() {
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '' && this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
this.allowSelect = true;
} else {
this.allowSelect = false;
}
},
addStartSectionData(isStation) {
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '') {
this.isStartSelected = true;
const result = this.pushSection({stationCode: this.addModel.startStationCode, sectionCode: this.addModel.startSectionCode}, 'top', isStation);
return result;
}
return false;
},
addEndSectionData(isStation) {
if (this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
const result = this.pushSection({stationCode: this.addModel.endStationCode, sectionCode: this.addModel.endSectionCode}, 'bottom', isStation);
return result;
}
return false;
},
hover(field) {
this.field = field === this.field ? '' : field;
},
formatName(code) {
return formatName(code);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'startStationCode'.toUpperCase()) {
this.addModel.startStationCode = selected.code;
this.judgeAllowSelected();
this.addStartSectionData(true);
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'endStationCode'.toUpperCase()) {
this.addModel.endStationCode = selected.code;
this.judgeAllowSelected();
this.addEndSectionData(true);
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.startStationCode = selected.belongStation;
}
this.addModel.startSectionCode = selected.code;
this.judgeAllowSelected();
this.addStartSectionData(false);
} else {
// (//)
this.$message.error('请选择正确的起始区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
if (selected.belongStation) {
this.addModel.endStationCode = selected.belongStation;
}
this.addModel.endSectionCode = selected.code;
this.judgeAllowSelected();
this.addEndSectionData(false);
this.addModel.destinationCode = selected.destinationCode || '';
} else {
this.$message.error('请选择正确的终到区段');
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) {
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
this.sectionCode = selected.code;
} else {
this.$message.error('请选择正确的区段');
}
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) {
this.stationCode = selected.code;
}
}
},
pushSection(data, type, isStation) {
const list = this.addModel.parkSectionCodeList;
if (data && data.stationCode && data.sectionCode) {
const index = list.findIndex(elem => { return elem.sectionCode == data.sectionCode; });
switch (type) {
case 'center': {
if (index < 0) {
list.splice(list.length - 1, 0, data);
} else {
this.$messageBox('该区段已经在交路区段中存在');
}
break;
}
case 'top': {
if (isStation) {
list.splice(0, 1, data);
} else {
if (index < 0) {
list.splice(0, 1, data);
} else {
if (index == list.length - 1 && list.length >= 2) {
this.addModel.startSectionCode = list[0].sectionCode;
this.addModel.startStationCode = list[0].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
}
}
break;
}
case 'bottom': {
if (isStation) {
if (list.length >= 2) {
list.splice(list.length - 1, 1, data);
} else {
if (index < 0) {
list.push(data);
}
}
} else {
if (index < 0) {
if (list.length >= 2) {
list.splice(list.length - 1, 1, data);
} else {
list.push(data);
}
} else {
if (index == 0 && list.length >= 2) {
this.addModel.endSectionCode = list[list.length - 1].sectionCode;
this.addModel.endStationCode = list[list.length - 1].stationCode;
this.$messageBox('起始区段和终到区段不能相同');
} else if (index != list.length - 1 && index != 0) {
this.$messageBox('该区段已经在交路区段中存在');
}
}
}
break;
}
default: {
if (index < 0) {
list.splice(list.length - 1, 0, data);
} else {
this.$messageBox(this.$t('tip.routeSameID'));
}
break;
}
}
this.sectionCode = '';
this.stationCode = '';
}
},
deleteSection(list, index) {
const data = list.splice(index, 1);
if (data.length > 0) {
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
section.instance.drawBatchSelected(section, '');
}
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
// if (model.withLoop) { model.withLoop = true; } else { model.withLoop = false; }
model['mapId'] = this.$route.query.mapId;
model['userId'] = this.$store.state.user.id;
if (code) { model['code'] = code; }
return model;
},
save() {
this.addModel;
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
addRoutingData(this.buildModel(setUID('Routing'))).then(resp => {
this.$message.success(this.$t('tip.pathCreationSuccessful'));
this.loading = false;
this.clear();
}).catch((error) => {
this.$messageBox(this.$t('tip.createRoutingFailed') + ':' + error.message);
this.loading = false;
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
const data = this.buildModel();
// delete data.withLoop;
updateRoutingData(data).then(resp => {
this.$message.success(this.$t('tip.pathUpdataSuccessful'));
this.loading = false;
this.clear();
}).catch((error) => {
this.$messageBox(this.$t('tip.pathUpdataFailed') + ':' + error.message);
this.loading = false;
});
}
});
},
batchSectionListFocus(flag) {
this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
},
changeSectionSelected(selectedList, flag) {
if (this.addModel.parkSectionCodeList && this.addModel.parkSectionCodeList.length > 0) {
if (flag) {
if (this.oldsection.length > 0) {
this.oldsection.forEach((section)=>{
section.instance.drawBatchSelected(section, '');
});
this.oldsection = [];
}
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
const list = section.logicSectionCodeList;
if (list && list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
this.oldsection.push(logicSection);
logicSection.instance.drawBatchSelected(section, 'routingSection');
});
} else {
this.oldsection.push(section);
section.instance.drawBatchSelected(section, 'routingSection');
}
});
} else {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
const list = section.logicSectionCodeList;
if (list && list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection.instance.drawBatchSelected(section, '');
});
} else {
section.instance.drawBatchSelected(section, '');
}
});
}
}
},
clear() {
if (this.$refs && this.$refs.form) {
this.changeSectionSelected(this.addModel.parkSectionCodeList, false);
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.$route.query.mapId;
this.addModel.parkSectionCodeList = [];
this.addModel.code = '';
this.stationCode = '';
this.sectionCode = '';
this.isSave = true;
this.allowSelect = false;
this.isStartSelected = false;
// this.addModel.withLoop = false;
this.editShow = false;
this.field = '';
if (this.type == 'routeMap') { this.$refs.routeConfig.setSelected(selected); }
if (this.type == 'runplanParams') { this.$refs.runPlanConfig.setSelected(selected); }
}
},
// batchSectionListFocus(flag) {
// this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
// },
onContextmenu() {
},
close() {
this.dialogShow = false;
if (this.type == 'routeMap') { this.$refs.routeConfig.createRouteEvent(); }
if (this.type == 'runplanParams') { this.$refs.runPlanConfig.clear(); }
}
}
};
@ -716,18 +144,41 @@ export default {
<style lang="scss" scope>
.content-route{
display: flex;
flex-direction: column;
/deep/ {
.el-dialog__body{
width: 100%;
height: calc(100% - 54px);
height:100%;
flex:1;
padding: 0;
overflow: hidden;
}
}
}
.mapEdit_box{
float: right;
padding: 3px 0;
margin-right: 5px;
.content-box{
display:flex;
height:100%;
}
.routeMap{
height:100%;
overflow:auto;
width: 29%;
flex:1;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #c3c3c3;
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f0f0f0;
}
}
</style>

View File

@ -0,0 +1,212 @@
<template>
<div class="runPlanConfig">
<div class="reentryConfig">折返配置</div>
<div class="reentryConfigTable">
<div style="margin-bottom:10px;">
<span>区段:</span>
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')" size="small">
<el-option
v-for="item in filterReentrySection"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
size="small"
:type=" field === 'reentrySection' ? 'danger' : 'primary'"
@click="hover('reentrySection')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
size="small"
@click="pushSection(sectionCode)"
>
{{ $t('map.add') }}
</el-button>
</div>
<el-table
:data="sectionCodeList"
border
style="width:87%"
height="300"
class="el-parkSectionCode-table"
>
<el-table-column prop="stationCode" :label="$t('map.sectionName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.stationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('map.operation')" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSection(sectionCodeList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-button-group style="padding:10px">
<el-button type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { formatName } from '@/utils/runPlan';
import { addRunplanConfig, getRunplanConfig } from '@/api/jmap/mapdraft';
export default {
name:'RunPlanConfig',
data() {
return {
sectionCodeList:[],
sectionCode:'',
field:'',
loading:false
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
filterReentrySection() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.reentryTrack; });
} else {
return [];
}
}
},
methods:{
doShow() {
this.sectionCodeList = [];
this.sectionCode = '';
this.field = '';
this.loading = false;
getRunplanConfig(this.$route.query.mapId).then(resp => {
if (resp.data.config) {
const runPlanUserReentryData = resp.data.config.runPlanUserReentryData;
const runPlanUserReentryDataKey = Object.keys(runPlanUserReentryData);
if (runPlanUserReentryDataKey && runPlanUserReentryDataKey.length > 0) {
runPlanUserReentryDataKey.forEach(each=>{
this.sectionCodeList.push({stationCode:each, sectionCode:runPlanUserReentryData[each]});
});
//
// this.changeSectionSelected(this.sectionCodeList, true);
}
}
});
},
deleteSection(list, index) {
const data = list.splice(index, 1);
if (data.length > 0) {
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
section.instance.drawBatchSelected(section, '');
}
},
hover(field) {
this.field = field === this.field ? '' : field;
},
setSelected(selected) {
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'reentrySection'.toUpperCase()) {
if (selected.reentryTrack) {
this.sectionCode = selected.code;
} else {
this.$message.error('请选择正确的区段');
}
}
},
formatName(code) {
return formatName(code);
},
pushSection(sectionCode) {
if (sectionCode) {
const index = this.sectionCodeList.findIndex(elem => { return elem.sectionCode == sectionCode; });
if (index < 0) {
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
let stationCode = '';
if (section && section.belongStation) {
stationCode = section.belongStation;
}
const sectionState = this.sectionCodeList.find(elem => { return elem.stationCode == stationCode; });
if (!sectionState) {
this.sectionCodeList.push({'sectionCode':sectionCode, 'stationCode':stationCode});
this.setSectionColor({'sectionCode':sectionCode}, 'routingSection');
} else {
this.$messageBox('一个车站只能添加一个折返区段');
}
} else {
this.$messageBox('该折返区段已添加');
}
}
},
setSectionColor(sectionParam, type) {
const section = this.$store.getters['map/getDeviceByCode'](sectionParam.sectionCode);
console.log(this.$store.state.map.mapDevice);
const list = section.logicSectionCodeList;
if (list && list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection.instance.drawBatchSelected(section, type);
});
} else {
// this.oldsection && this.oldsection.push(section);
section.instance.drawBatchSelected(section, type);
}
},
changeSectionSelected(selectedList, flag) {
if (selectedList && selectedList.length > 0) {
if (flag) {
selectedList.forEach(each=>{
this.setSectionColor({'sectionCode':each.sectionCode}, 'routingSection');
});
} else {
selectedList.forEach(each=>{
this.setSectionColor({'sectionCode':each.sectionCode}, '');
});
}
}
},
save() {
if (this.sectionCodeList.length > 0) {
this.loading = true;
const runPlanUserReentryData = {};
this.sectionCodeList.forEach(each=>{
runPlanUserReentryData[each.stationCode] = each.sectionCode;
});
addRunplanConfig(this.$route.query.mapId, {runPlanUserReentryData:runPlanUserReentryData}).then(resp => {
this.$message.success('折返区段配置成功');
this.loading = false;
}).catch((error) => {
this.$messageBox('折返区段配置失败' + ':' + error.message);
this.loading = false;
});
} else {
this.$messageBox('该添加折返区段');
}
},
clear() {
this.changeSectionSelected(this.sectionCodeList, false);
}
}
};
</script>
<style lang="scss" scoped>
.reentryConfig{
}
.reentryConfigTable{
margin-top: 10px;
}
.runPlanConfig{padding:15px 20px}
</style>

View File

@ -361,8 +361,11 @@ export default {
.map(serviceNumber => { return { serviceNumber }; });
},
async analyticalTripNumber(data) {
// this.tripNumberConfig.data = Object.keys(data || {})
// .sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
// .map(tripNumber => { return { tripNumber }; });
this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
.map(tripNumber => { return { tripNumber }; });
},
async setPosition() {
@ -569,7 +572,6 @@ export default {
this.option.title.text = this.mapName;
}
this.myChart = echarts.init(document.getElementById(this.runPlanId));
// debugger;
// this.option;
this.myChart.setOption(this.option);
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });

View File

@ -1,15 +1,15 @@
<template>
<div class="PlanStatusBar">
<ul class="ul-box">
<div v-if="isNotUser" class="li_plan" @click="showTrain">{{ $t('planMonitor.serviceAndTripNumber') }}</div>
</ul>
<ul class="ul-box">
<div v-if="isNotUser" class="li_plan" @click="handleAddPlanningTrain">{{ $t('planMonitor.addPlan') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleDeletePlanningTrain">{{ $t('planMonitor.deletePlan') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleDuplicateTrain">{{ $t('planMonitor.duplicatePlan') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleAddTask">{{ $t('planMonitor.addTask') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleDeleteTask">{{ $t('planMonitor.deleteTask') }}</div>
<div v-if="isNotUser" class="li_plan" @click="handleModifyingTask">{{ $t('planMonitor.modifyTask') }}</div>
<!-- v-if="isNotUser" -->
<div class="li_plan" @click="showTrain">{{ $t('planMonitor.serviceAndTripNumber') }}</div>
<div class="li_plan" @click="handleGernaratePlanningTrain">{{ $t('planMonitor.gerneratePlan') }}</div>
<div class="li_plan" @click="handleAddPlanningTrain">{{ $t('planMonitor.addPlan') }}</div>
<div class="li_plan" @click="handleDeletePlanningTrain">{{ $t('planMonitor.deletePlan') }}</div>
<div class="li_plan" @click="handleDuplicateTrain">{{ $t('planMonitor.duplicatePlan') }}</div>
<div class="li_plan" @click="handleAddTask">{{ $t('planMonitor.addTask') }}</div>
<div class="li_plan" @click="handleDeleteTask">{{ $t('planMonitor.deleteTask') }}</div>
<div class="li_plan" @click="handleModifyingTask">{{ $t('planMonitor.modifyTask') }}</div>
</ul>
<ul class="ul-box tool">
<div class="li_plan" @click="handlePlanEffectiveCheck">{{ $t('planMonitor.validityCheck') }}</div>
@ -35,18 +35,18 @@ export default {
},
data() {
return {
isNotUser: true
// isNotUser: true
};
},
watch: {
},
created() {
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
this.isNotUser = false;
} else {
this.isNotUser = true;
}
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
// this.isNotUser = false;
// } else {
// this.isNotUser = true;
// }
},
methods: {
showTrain() {
@ -61,6 +61,14 @@ export default {
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
}
},
handleGernaratePlanningTrain() {
const planId = this.$route.query.planId || this.loadRunPlanId;
if (planId) {
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
} else {
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
}
},
//
handleDeletePlanningTrain() {
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;

View File

@ -88,13 +88,13 @@ export default {
if (id) {
getData(this.dicId, id).then(response => {
this.formModel = response.data;
this.$refs.dataform.resetForm();
this.$refs.dataform && this.$refs.dataform.resetForm();
this.isAdd = false;
this.title = this.$t('system.editDetail');
});
} else {
this.isAdd = true;
this.$refs.dataform.resetForm();
this.$refs.dataform && this.$refs.dataform.resetForm();
this.title = this.$t('system.createDetail');
}
this.dialogVisible = true;