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) { export function getRoutingData(routingId) {
return request({ 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({ return request({
url: `/api/runPlan/draft/${planId}/routingList`, // url: `/api/mapBuild/${mapId}/routingData`,
url: `/api/runPlan/userData/${mapId}/routing`,
method: 'get' method: 'get'
}); });
} }
@ -235,8 +244,17 @@ export function updatePlanTrip(data) {
/** 根据车次号查询交路 */ /** 根据车次号查询交路 */
export function getRoutingBySDTNumber(params) { export function getRoutingBySDTNumber(params) {
// 旧版
// return request({
// url: `/api/runPlan/draft/${params.planId}/routing`,
// method: 'get',
// params: {
// SDTNumber: params.SDTNumber
// }
// });
// 新版
return request({ return request({
url: `/api/runPlan/draft/${params.planId}/routing`, url: `/api/runPlan/draft/${params.planId}/userRouting`,
method: 'get', method: 'get',
params: { params: {
SDTNumber: params.SDTNumber 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) { export function updateTripNumber(planId, SDTNumber, tripNumber) {
return request({ return request({

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

View File

@ -1,5 +1,5 @@
<template> <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-for="item in form.items">
<template v-if="checkFieldType(item, 'text')"> <template v-if="checkFieldType(item, 'text')">
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required"> <el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
@ -199,6 +199,7 @@
v-model="formModel[item.prop]" v-model="formModel[item.prop]"
filterable filterable
:placeholder="item.placeholder" :placeholder="item.placeholder"
:no-data-text="item.noDataText?item.noDataText:'无数据'"
:disabled="item.disabled" :disabled="item.disabled"
@change="item.onChange" @change="item.onChange"
> >
@ -215,6 +216,7 @@
<el-select <el-select
v-model="formModel[item.prop]" v-model="formModel[item.prop]"
filterable filterable
:no-data-text="item.noDataText?item.noDataText:'无数据'"
:clearable="item.clearable" :clearable="item.clearable"
:placeholder="item.placeholder" :placeholder="item.placeholder"
:disabled="item.disabled" :disabled="item.disabled"

View File

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

View File

@ -39,7 +39,7 @@ export default {
continuationPlan: '延续计划', continuationPlan: '延续计划',
firstTrain: '首班车', firstTrain: '首班车',
serialNumber: '序列号:', serialNumber: '序列号:',
defaultRunLevel: '缺省运行等级:', defaultRunLevel: '运行等级:',
startTime: '开始时间', startTime: '开始时间',
selectTime: '选择时间', selectTime: '选择时间',
inStock: '入库', inStock: '入库',
@ -81,6 +81,7 @@ export default {
modifySuccess: '修改成功!', modifySuccess: '修改成功!',
modifyFailed: '修改失败', modifyFailed: '修改失败',
modifyRunLevel: '修改运行等级', modifyRunLevel: '修改运行等级',
modifyStopTime:'修改停站时间',
startStationTips: '起始站发车时间不变', startStationTips: '起始站发车时间不变',
endStationTips: '终到站到达时间不变', endStationTips: '终到站到达时间不变',
@ -239,5 +240,6 @@ export default {
modifyName: '修改名称', modifyName: '修改名称',
applyRelease:'申请发布', applyRelease:'申请发布',
preview:'预览', 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] = { this[deviceType.Station] = {
// 成都三号线车站元素 车站名称 // 成都三号线车站元素 车站名称
elemnetType:['stationText'], elemnetType:['stationText'],

View File

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

View File

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

View File

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

View File

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

View File

@ -131,6 +131,7 @@
<train-detail ref="trainDetail" /> <train-detail ref="trainDetail" />
<all-train-detail ref="allTrainDetail" /> <all-train-detail ref="allTrainDetail" />
<route-detail ref="routeDetail" /> <route-detail ref="routeDetail" />
<init-section-open ref="initSectionOpen" />
</div> </div>
</template> </template>
<script> <script>
@ -184,7 +185,7 @@ import TrainRunType from './menuDialog/trainRunType';
import TrainDetail from './menuDialog/trainDetail'; import TrainDetail from './menuDialog/trainDetail';
import AllTrainDetail from './menuDialog/allTrainDetail'; import AllTrainDetail from './menuDialog/allTrainDetail';
import RouteDetail from './menuDialog/routeDetail'; import RouteDetail from './menuDialog/routeDetail';
import Route from '../../../../views/newMap/newMapdraft/dataRelation/runLeveloperate/route'; import InitSectionOpen from './menuDialog/initSectionOpen';
export default { export default {
name: 'MenuBar', name: 'MenuBar',
@ -232,7 +233,8 @@ export default {
TrainRunType, TrainRunType,
TrainDetail, TrainDetail,
AllTrainDetail, AllTrainDetail,
RouteDetail RouteDetail,
InitSectionOpen
}, },
props: { props: {
selected: { selected: {
@ -1471,7 +1473,7 @@ export default {
setBlockSwitch() { setBlockSwitch() {
const operate = { const operate = {
type: 'bar', type: 'bar',
operation: OperationEvent.Switch.block.init.operation operation: OperationEvent.Switch.block.button.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {
@ -1485,7 +1487,7 @@ export default {
setUnblockSwitch() { setUnblockSwitch() {
const operate = { const operate = {
type: 'bar', type: 'bar',
operation: OperationEvent.Switch.unblock.init.operation operation: OperationEvent.Switch.unblock.button.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {
@ -1565,26 +1567,26 @@ export default {
handleOpenSection() { handleOpenSection() {
const operate = { const operate = {
type: 'bar', type: 'bar',
operation: '' operation: OperationEvent.Section.unlock.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {
this.closeMenu(true); this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true}); this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.sectionOpen.doShow(); this.$refs.initSectionOpen.doShow(operate);
} }
}); });
}, },
handleCloseSection() { handleCloseSection() {
const operate = { const operate = {
type: 'bar', type: 'bar',
operation: '' operation: OperationEvent.Section.lock.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {
this.closeMenu(true); this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: 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) { if (valid) {
this.closeMenu(true); this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true}); this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.signalBlock.doShow(operate); this.$refs.initSignalBlock.doShow(operate);
} }
}); });
}, },
setSignalCancelBlock() { setSignalCancelBlock() {
const operate = { const operate = {
type: 'bar', type: 'bar',
operation: OperationEvent.Signal.lock.menu.operation operation: OperationEvent.Signal.unlock.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {
this.closeMenu(true); this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: 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> <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-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-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="name" label="站台" />
<el-table-column prop="minTime" 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-column prop="maxTime" label="最大停站时间" />
</el-table> </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-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -20,19 +30,19 @@
<el-row style="text-align: center"> <el-row style="text-align: center">
<el-col :span="8">最小值</el-col> <el-col :span="8">最小值</el-col>
<el-col :span="8"> <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>
<el-col :span="8"> <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-col>
</el-row> </el-row>
<el-row style="text-align: center"> <el-row style="text-align: center">
<el-col :span="8">最大值</el-col> <el-col :span="8">最大值</el-col>
<el-col :span="8"> <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>
<el-col :span="8"> <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-col>
</el-row> </el-row>
</div> </div>
@ -53,15 +63,15 @@
<el-row style="text-align: center;"> <el-row style="text-align: center;">
<el-col :span="8">额定值</el-col> <el-col :span="8">额定值</el-col>
<el-col :span="8"> <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>
<el-col :span="8"> <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-col>
</el-row> </el-row>
</div> </div>
<el-row style="padding: 10px 0;"> <el-row style="padding: 10px 0;">
<el-button @click="handleReset">复位</el-button> <el-button @click="handleReset">复位(R)</el-button>
</el-row> </el-row>
<el-row> <el-row>
<div style="padding: 2px 20px;border: 1px solid #ADADAD;width: 180px;text-align: center;">停站时间范围1-999</div> <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>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <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>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button>应用(A)</el-button> <el-button>应用(A)</el-button>
@ -89,7 +99,7 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
export default { export default {
name: 'AllocateTime', name: 'AllocateTime',
@ -156,9 +166,29 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { 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> <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="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row> <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="name" label="信号机" />
<el-table-column prop="status" label="信号机封锁状态" /> <el-table-column prop="status" label="信号机封锁状态">
<el-table-column prop="status" label="设置封锁进程" /> <template slot-scope="scope">
<el-table-column prop="status" label="解除封锁进程" /> <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-table>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <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>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button>应用(A)</el-button> <el-button>应用(A)</el-button>
@ -23,6 +41,7 @@
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<signal-block ref="signalBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog> </el-dialog>
</template> </template>
@ -31,11 +50,13 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import SignalBlock from './signalBlock';
export default { export default {
name: 'InitSignalBlock', name: 'InitSignalBlock',
components: { components: {
NoticeInfo NoticeInfo,
SignalBlock
}, },
data() { data() {
return { return {
@ -45,13 +66,18 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null, selected: null,
operate: {} operate: {},
initEle: null,
commandEleCode: null
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'signalList' 'signalList'
]), ]),
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Signal.lock.menu.operation;
},
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
@ -82,6 +108,8 @@ export default {
}, },
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected; this.selected = selected;
this.operate = operate; this.operate = operate;
// //
@ -93,12 +121,68 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {

View File

@ -1,16 +1,30 @@
<template> <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-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="name" label="信号机" />
<el-table-column prop="blockStatus" label="允许锁闭" /> <el-table-column prop="blockStatus" label="允许锁闭">
<el-table-column prop="blockProcess" label="同意取消" /> <template slot-scope="scope">
<el-table-column prop="unblockProcess" label="取消进程" /> <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-table>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <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>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -23,6 +37,7 @@
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<signal-can-block ref="signalCanBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog> </el-dialog>
</template> </template>
@ -31,11 +46,13 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import SignalCanBlock from './signalCanBlock';
export default { export default {
name: 'StandDetain', name: 'StandDetain',
components: { components: {
NoticeInfo NoticeInfo,
SignalCanBlock
}, },
data() { data() {
return { return {
@ -45,7 +62,9 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null, selected: null,
operate: '' operate: '',
initEle: null,
commandEleCode: null
}; };
}, },
computed: { computed: {
@ -82,6 +101,8 @@ export default {
}, },
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected; this.selected = selected;
this.operate = operate; this.operate = operate;
// //
@ -93,12 +114,65 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {

View File

@ -1,17 +1,35 @@
<template> <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="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row> <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="name" label="信号机" />
<el-table-column prop="blockStatus" label="显示" /> <el-table-column prop="blockStatus" label="显示">
<el-table-column prop="blockProcess" label="可引导" /> <template slot-scope="scope">
<el-table-column prop="unblockProcess" label="引导过程" /> <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-column prop="unblockProcess" width="150" label="区间信号引导过程" />
</el-table> </el-table>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <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>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -24,6 +42,7 @@
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<signal-guide ref="signalGuide" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog> </el-dialog>
</template> </template>
@ -31,11 +50,13 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 SignalGuide from './signalGuide';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
name: 'StandDetain', name: 'StandDetain',
components: { components: {
SignalGuide,
NoticeInfo NoticeInfo
}, },
data() { data() {
@ -46,7 +67,9 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null, selected: null,
operate: '' operate: '',
initEle: null,
commandEleCode: null
}; };
}, },
computed: { computed: {
@ -83,6 +106,8 @@ export default {
}, },
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected; this.selected = selected;
this.operate = operate; this.operate = operate;
// //
@ -94,12 +119,79 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); 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() { cancel() {
const operate = { const operate = {

View File

@ -1,16 +1,34 @@
<template> <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-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="name" label="道岔" />
<el-table-column prop="blockStatus" label="道岔封锁状态" /> <el-table-column prop="blockStatus" label="道岔封锁状态">
<el-table-column prop="blockProcess" label="设置封锁进程" /> <template slot-scope="scope">
<el-table-column prop="unblockProcess" label="解除封锁进程" /> <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-table>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <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>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -23,19 +41,22 @@
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<switch-block ref="switchBlock" @commandSuccess="commandSuccess" @cancelCommand="cancelCommand" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import SwitchBlock from './switchBlock';
export default { export default {
name: 'StandDetain', name: 'StandDetain',
components: { components: {
NoticeInfo NoticeInfo,
SwitchBlock
}, },
data() { data() {
return { return {
@ -48,7 +69,9 @@ export default {
mode: '', mode: '',
position: '', position: '',
reserved: '', reserved: '',
operate: '' operate: '',
initEle: null,
commandEleCode: null
}; };
}, },
computed: { computed: {
@ -56,7 +79,7 @@ export default {
'switchList' 'switchList'
]), ]),
isBlock() { isBlock() {
return this.operate === OperationEvent.Switch.block.init.operation; return this.operate && this.operate.operation === OperationEvent.Switch.block.button.operation;
}, },
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
@ -88,6 +111,8 @@ export default {
}, },
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
this.initEle = null;
this.commandEleCode = null;
this.selected = selected; this.selected = selected;
this.operate = operate; this.operate = operate;
// //
@ -99,12 +124,69 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {

View File

@ -33,7 +33,15 @@
<el-col :span="18"> <el-col :span="18">
<div class="border-box"> <div class="border-box">
<div class="border-box-title">CBTC</div> <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="name" width="130" label="进路" />
<el-table-column prop="area" label="区域" /> <el-table-column prop="area" label="区域" />
<el-table-column prop="status" label="状态" /> <el-table-column prop="status" label="状态" />
@ -50,9 +58,20 @@
</el-row> </el-row>
<el-row class="border-box"> <el-row class="border-box">
<div class="border-box-title">后备</div> <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="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="status" label="状态" />
<el-table-column prop="pmi" width="50" label="PMI" /> <el-table-column prop="pmi" width="50" label="PMI" />
<el-table-column prop="signalModel" width="80" label="信号模式" /> <el-table-column prop="signalModel" width="80" label="信号模式" />
@ -64,7 +83,15 @@
<el-row> <el-row>
<div class="border-box"> <div class="border-box">
<div class="border-box-title">CBTC</div> <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="name" width="130" label="进路" />
<el-table-column prop="area" label="区域" /> <el-table-column prop="area" label="区域" />
<el-table-column prop="status" label="状态" /> <el-table-column prop="status" label="状态" />
@ -73,9 +100,21 @@
</el-row> </el-row>
<el-row class="border-box"> <el-row class="border-box">
<div class="border-box-title">后备</div> <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="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="status" label="状态" />
<el-table-column prop="pmi" width="50" label="PMI" /> <el-table-column prop="pmi" width="50" label="PMI" />
<el-table-column prop="signalModel" width="80" label="信号模式" /> <el-table-column prop="signalModel" width="80" label="信号模式" />
@ -83,28 +122,39 @@
<el-input placeholder="PMI进路选择" size="mini" style="position: relative;top: -10px;" /> <el-input placeholder="PMI进路选择" size="mini" style="position: relative;top: -10px;" />
</el-row> </el-row>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="禁止进路" name="third"> <!--<el-tab-pane label="禁止进路" name="third">-->
<el-row class="border-box"> <!--<el-row class="border-box">-->
<el-col :span="18"> <!--<el-col :span="18">-->
<div class="border-box-title">后备</div> <!--<div class="border-box-title">后备</div>-->
<el-table :data="routeList" height="332px" style="position: relative;top: -15px;"> <!--<el-table-->
<el-table-column prop="name" width="130" label="进路" /> <!--ref="singleTable5"-->
<el-table-column prop="direction" label="运行方向" /> <!--:data="routeList"-->
<el-table-column prop="status" label="状态" /> <!--highlight-current-row-->
<el-table-column prop="pmi" width="50" label="PMI" /> <!--style="position: relative;top: -15px;"-->
<el-table-column prop="signalModel" width="80" label="信号模式" /> <!--height="332px"-->
</el-table> <!--@current-change="handleCurrentChange5"-->
</el-col> <!--&gt;-->
<el-col :span="6"> <!--<el-table-column prop="name" width="130" label="进路" />-->
<div class="radio-box-title">禁止进路</div> <!--<el-table-column prop="direction" label="运行方向">-->
<div class="radio-box"> <!--<template slot-scope="scope">-->
<el-radio v-model="forbidRoute" :label="true" style="display: block;margin-bottom: 10px;">设置(S)</el-radio> <!--<span>{{ getRouteDirection(scope.row) }}</span>-->
<el-radio v-model="forbidRoute" :label="false" style="display: block;">取消(N)</el-radio> <!--</template>-->
</div> <!--</el-table-column>-->
</el-col> <!--<el-table-column prop="status" label="状态" />-->
<el-input placeholder="PMI进路选择" size="mini" style="position: relative;top: -10px;" /> <!--<el-table-column prop="pmi" width="50" label="PMI" />-->
</el-row> <!--<el-table-column prop="signalModel" width="80" label="信号模式" />-->
</el-tab-pane> <!--</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-tabs>
</el-col> </el-col>
</el-row> </el-row>
@ -131,6 +181,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'SwitchActive', name: 'SwitchActive',
@ -149,7 +200,7 @@ export default {
activeName: 'first', activeName: 'first',
tempData: [], tempData: [],
checked: false, checked: false,
unlockType: '', unlockType: 'auto',
forbidRoute: false forbidRoute: false
}; };
}, },
@ -199,11 +250,118 @@ export default {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$refs.singleTable1.setCurrentRow();
this.$refs.singleTable2.setCurrentRow();
this.$refs.singleTable3.setCurrentRow();
this.$refs.singleTable4.setCurrentRow();
}, },
commit() { 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() { cancel() {
const operate = { 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-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-row>
<el-col :span="18"> <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="name" label="轨道" />
<el-table-column prop="blockStatus" label="MAU" /> <el-table-column prop="blockStatus" label="MAU">
<el-table-column prop="blockProcess" label="状态" /> <template slot-scope="scope">
<el-table-column prop="unblockProcess" label="打开进程" /> <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-table>
</el-col> </el-col>
<el-col v-if="selectShow" :span="5" :offset="1"> <el-col :span="5" :offset="1">
<fieldset> <fieldset>
<legend class="card_title">命令</legend> <legend class="card_title">命令</legend>
<el-radio-group v-model="radio"> <el-radio-group v-model="command">
<el-radio label="1" style="margin-bottom: 10px;">确认(F)</el-radio> <el-radio :label="true" style="margin-bottom: 10px;">确认(F)</el-radio>
<el-radio label="2">取消(N)</el-radio> <el-radio :label="false">取消(N)</el-radio>
</el-radio-group> </el-radio-group>
</fieldset> </fieldset>
</el-col> </el-col>
@ -42,6 +54,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'SwitchActive', name: 'SwitchActive',
@ -57,16 +70,20 @@ export default {
loading: false, loading: false,
selected: null, selected: null,
active: false, active: false,
selectShow: false,
activeName: 'first', activeName: 'first',
tempData: [], tempData: [],
radio: '1' radio: '1',
operate: {},
command: true
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'sectionList' 'sectionList'
]), ]),
isBlock() {
return !!this.operate && this.operate.operation === OperationEvent.Section.lock.confirm.operation;
},
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
@ -80,7 +97,7 @@ export default {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
}, },
title() { title() {
return '初始化开放轨道'; return this.isBlock ? '初始化关闭轨道' : '初始化开放轨道';
} }
}, },
watch: { watch: {
@ -98,9 +115,10 @@ export default {
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
// this.operate = operate;
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(this.selected);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -110,13 +128,42 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
selectLine(val) { selectLine(val) {
// console.log(val); this.$refs.singleTable.setCurrentRow(this.selected);
this.selectShow = true; },
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() { commit() {
}, if (this.command) {
handleClick() { 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() { cancel() {
const operate = { 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-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-row>
<el-col :span="18"> <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="name" label="信号机" />
<el-table-column prop="status" label="信号机封锁状态" /> <el-table-column prop="status" label="信号机封锁状态">
<el-table-column prop="status" label="设置封锁进程" /> <template slot-scope="scope">
<el-table-column prop="status" label="解除封锁进程" /> <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-table>
</el-col> </el-col>
<el-col :span="5" :offset="1"> <el-col :span="5" :offset="1">
<div class="set-status-title">命令</div> <div class="set-status-title">命令</div>
<div class="set-status-box"> <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> <br>
<el-radio v-model="command" :label="false">取消</el-radio> <el-radio v-model="command" :label="false">取消</el-radio>
</div> </div>
@ -41,6 +59,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'SignalBlock', name: 'SignalBlock',
@ -55,13 +74,17 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null, selected: null,
operate: {} operate: {},
title: ''
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'signalList' 'signalList'
]), ]),
isBlock() {
return this.operate && this.operate.operation === OperationEvent.Signal.lock.confirm.operation;
},
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
@ -73,10 +96,10 @@ export default {
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; 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: { watch: {
'$store.state.map.keyboardEnterCount': function (val) { '$store.state.map.keyboardEnterCount': function (val) {
@ -95,8 +118,10 @@ export default {
this.selected = selected; this.selected = selected;
this.operate = operate; this.operate = operate;
// //
this.title = this.operate && this.operate.operation === OperationEvent.Switch.block.confirm.operation ? '确认/取消信号机封锁' : '确认/取消信号机解除封锁';
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -106,9 +131,42 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {
@ -116,6 +174,7 @@ export default {
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$emit('cancelCommand');
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {

View File

@ -1,19 +1,33 @@
<template> <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-row>
<el-col :span="18"> <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="name" label="信号机" />
<el-table-column prop="blockStatus" label="允许锁闭" /> <el-table-column prop="blockStatus" label="允许锁闭">
<el-table-column prop="blockProcess" label="同意取消" /> <template slot-scope="scope">
<el-table-column prop="unblockProcess" label="取消进程" /> <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-table>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="radio-box-title">命令</div> <div class="radio-box-title">命令</div>
<div class="radio-box"> <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="true" 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="false" style="display: block;">取消</el-radio>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -40,6 +54,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'SignalCanBlock', name: 'SignalCanBlock',
@ -55,7 +70,7 @@ export default {
loading: false, loading: false,
selected: null, selected: null,
operate: '', operate: '',
command: '' command: true
}; };
}, },
computed: { computed: {
@ -97,6 +112,7 @@ export default {
// //
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -106,9 +122,38 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {

View File

@ -3,7 +3,11 @@
<el-row> <el-row>
<el-table :data="signalList" height="350px"> <el-table :data="signalList" height="350px">
<el-table-column prop="name" label="信号机" /> <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" label="引导过程" /> <el-table-column prop="status" label="引导过程" />
<el-table-column prop="status" width="160" label="区间信号机引导过程" /> <el-table-column prop="status" width="160" label="区间信号机引导过程" />
@ -14,20 +18,24 @@
<el-table-column prop="allowSpeed" label="允许速度" /> <el-table-column prop="allowSpeed" label="允许速度" />
<el-table-column prop="canOrdered" label="可命令" /> <el-table-column prop="canOrdered" label="可命令" />
<el-table-column prop="confirmProcess" 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="setBlockProcess" width="160" label="信号机封锁进程" />
<el-table-column prop="cancelBlockProcess" width="160" label="解除封锁进程" /> <el-table-column prop="cancelBlockProcess" width="160" label="解除封锁进程" />
</el-table> </el-table>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="6" :offset="2"> <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>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button> <el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-button>帮助(H)</el-button> <el-button :disabled="true">帮助(H)</el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <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() { cancel() {
const operate = { 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-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-row>
<el-col :span="18"> <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="name" label="信号机" />
<el-table-column prop="blockStatus" label="显示" /> <el-table-column prop="blockStatus" label="显示">
<el-table-column prop="blockProcess" label="可引导" /> <template slot-scope="scope">
<el-table-column prop="unblockProcess" label="引导过程" /> <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-column prop="unblockProcess" width="150" label="区间信号引导过程" />
</el-table> </el-table>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="radio-box-title">命令</div> <div class="radio-box-title">命令</div>
<div class="radio-box"> <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="true" 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="false" style="display: block;">取消</el-radio>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -41,6 +59,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'SignalGuide', name: 'SignalGuide',
@ -55,7 +74,7 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null, selected: null,
command: '', command: true,
operate: '' operate: ''
}; };
}, },
@ -98,6 +117,7 @@ export default {
// //
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -107,9 +127,52 @@ export default {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {
@ -117,6 +180,7 @@ export default {
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$emit('cancelCommand');
this.doClose(); this.doClose();
} }
}).catch(() => { }).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-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-row>
<el-col :span="16"> <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="name" label="站台" />
<el-table-column prop="groupNumber" 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-column>
</el-table> </el-table>
</el-col> </el-col>
@ -16,7 +24,7 @@
<br> <br>
<el-radio v-model="status" :disabled="!standStatus" :label="false">关闭</el-radio> <el-radio v-model="status" :disabled="!standStatus" :label="false">关闭</el-radio>
</div> </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-col>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
@ -40,8 +48,8 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'StandControl', name: 'StandControl',
@ -102,12 +110,51 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {

View File

@ -1,15 +1,23 @@
<template> <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-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="name" width="80" label="站台" />
<el-table-column prop="status" width="80" label="状态" /> <el-table-column prop="status" width="80" label="状态">打开</el-table-column>
<el-table-column prop="minTime" width="130" label="最小停站时间" /> <el-table-column prop="minTime" width="110" label="最小停站时间" />
<el-table-column prop="time" width="130" label="规定停站时间" /> <el-table-column prop="parkingTime" width="110" label="规定停站时间">
<el-table-column prop="maxTime" width="130" label="最大停站时间" /> <template slot-scope="scope">
<el-table-column prop="hold" width="80" label="扣车" /> <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="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="emergencyButton" width="80" label="紧急按钮" />
<el-table-column prop="setting" width="80" label="门设置" /> <el-table-column prop="setting" width="80" label="门设置" />
<el-table-column prop="bypass" width="80" label="门旁路" /> <el-table-column prop="bypass" width="80" label="门旁路" />
@ -101,6 +109,18 @@ export default {
}, },
handleClick() { 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() { cancel() {
const operate = { const operate = {

View File

@ -4,7 +4,13 @@
<el-col :span="16"> <el-col :span="16">
<el-tabs type="border-card"> <el-tabs type="border-card">
<el-tab-pane label="站台"> <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="name" label="站台" />
<el-table-column prop="detain" label="扣车"> <el-table-column prop="detain" label="扣车">
<template slot-scope="scope"> <template slot-scope="scope">
@ -19,7 +25,7 @@
<!--</template>--> <!--</template>-->
</el-table-column> </el-table-column>
</el-table> </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>
<el-tab-pane label="系统">系统</el-tab-pane> <el-tab-pane label="系统">系统</el-tab-pane>
</el-tabs> </el-tabs>
@ -35,7 +41,7 @@
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <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>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button>应用(A)</el-button> <el-button>应用(A)</el-button>
@ -54,7 +60,7 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
export default { export default {
@ -97,6 +103,18 @@ export default {
if (this.show) { if (this.show) {
this.commit(); 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() { mounted() {
@ -119,12 +137,32 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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) { getDetainStatus(code) {
const stand = this.$store.getters['map/getDeviceByCode'](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-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-row>
<el-col :span="18"> <el-col :span="18">
<el-table :data="switchList" height="300px"> <el-table
<el-table-column prop="name" label="道岔" /> ref="singleTable"
<el-table-column prop="blockStatus" label="请求或允许动岔" /> :data="switchList"
<el-table-column prop="blockProcess" label="请求或允许动岔输出错" /> 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-table>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="radio-box-title">设置状态</div> <div class="radio-box-title">设置状态</div>
<div class="radio-box"> <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="true" style="display: block;margin-bottom: 10px;" :disabled="!active">(A)激活</el-radio>
<el-radio v-model="active" :label="false" style="display: block;">(I)取消激活</el-radio> <el-radio v-model="active" :label="false" style="display: block;" :disabled="active">(I)取消激活</el-radio>
</div> </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-col>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="6" :offset="2"> <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>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button> <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 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 { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'SwitchActive', name: 'SwitchActive',
@ -98,12 +109,50 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {

View File

@ -1,19 +1,37 @@
<template> <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-row>
<el-col :span="18"> <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="name" width="80" label="道岔" />
<el-table-column prop="blockStatus" label="道岔封锁状态" /> <el-table-column prop="blockStatus" label="道岔封锁状态">
<el-table-column prop="blockProcess" label="设置封锁进程" /> <template slot-scope="scope">
<el-table-column prop="unblockProcess" label="解除封锁进程" /> <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-table>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="radio-box-title">命令</div> <div class="radio-box-title">命令</div>
<div class="radio-box"> <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="true" 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="false" style="display: block;">取消</el-radio>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -40,6 +58,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
name: 'StandDetain', name: 'StandDetain',
@ -54,7 +73,8 @@ export default {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
selected: null, selected: null,
command: '', command: true,
title: ''
}; };
}, },
computed: { computed: {
@ -62,7 +82,7 @@ export default {
'switchList' 'switchList'
]), ]),
isBlock() { isBlock() {
return this.operate === OperationEvent.Switch.block.menu.operation; return this.operate && this.operate.operation === OperationEvent.Switch.block.confirm.operation;
}, },
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
@ -75,9 +95,6 @@ export default {
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
},
title() {
return this.isBlock ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁';
} }
}, },
watch: { watch: {
@ -96,8 +113,11 @@ export default {
doShow(operate, selected) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
// //
this.operate = operate;
this.title = this.operate && this.operate.operation === OperationEvent.Switch.block.confirm.operation ? '确认/取消道岔封锁' : '确认/取消道岔解除封锁';
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.singleTable.setCurrentRow(selected);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
@ -106,10 +126,43 @@ export default {
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); 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() { cancel() {
const operate = { const operate = {
@ -117,6 +170,7 @@ export default {
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$emit('cancelCommand');
this.doClose(); this.doClose();
} }
}).catch(() => { }).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-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-row>
<el-col :span="18"> <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="name" label="道岔" />
<el-table-column prop="mode" label="模式" /> <el-table-column prop="mode" label="模式" />
<el-table-column prop="position" label="位置" /> <el-table-column prop="position" label="位置">
<el-table-column prop="reserved" label="预留" /> <template slot-scope="scope">
<el-table-column prop="status" label="状态" /> <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-table>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="radio-box-title">设置模式</div> <div class="radio-box-title">设置模式</div>
<div class="radio-box"> <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="auto" :disabled="true" 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="artificial" :disabled="true" style="display: block;">人工</el-radio>
</div> </div>
<div class="radio-box-title">设置位置</div> <div class="radio-box-title">设置位置</div>
<div class="radio-box"> <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="normal" :disabled="!selected" 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="reverse" :disabled="!selected" style="display: block;">反位</el-radio>
</div> </div>
<div class="radio-box-title">设置预留</div> <div class="radio-box-title">设置预留</div>
<div class="radio-box"> <div class="radio-box">
<el-radio v-model="position" label="normal" style="display: block;margin-bottom: 10px;">自动与预留</el-radio> <el-radio v-model="reserved" label="auto" :disabled="true" 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="reserved" label="reversed" :disabled="true" 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="release" :disabled="true" style="display: block;">释放</el-radio>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="4" :offset="1"> <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>
<el-col :span="4" :offset="2"> <el-col :span="4" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
@ -50,7 +65,7 @@
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; 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 { mapGetters } from 'vuex';
export default { export default {
@ -68,12 +83,13 @@ export default {
selected: null, selected: null,
mode: '', mode: '',
position: '', position: '',
reserved: '' reserved: 'reversed'
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationStandList' 'switchList'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
@ -115,12 +131,48 @@ export default {
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$refs.singleTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { 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() { cancel() {
const operate = { const operate = {

View File

@ -1,11 +1,19 @@
<template> <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-row>
<el-table :data="switchList" height="350px"> <el-table :data="switchList" height="350px">
<el-table-column prop="name" width="80" label="道岔" /> <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="状态" /> <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="blockStatus" width="120" label="道岔封锁状态" />
<el-table-column prop="blockProcess" width="120" label="设置封锁进程" /> <el-table-column prop="blockProcess" width="120" label="设置封锁进程" />
<el-table-column prop="unblockProcess" width="120" label="解除封锁进程" /> <el-table-column prop="unblockProcess" width="120" label="解除封锁进程" />
@ -55,9 +63,6 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'switchList' 'switchList'
]), ]),
isBlock() {
return this.operate === OperationEvent.Switch.block.init.operation;
},
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
@ -71,7 +76,7 @@ export default {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
}, },
title() { title() {
return this.isBlock ? '初始化道岔封锁' : '初始化道岔解除封锁'; return '道岔信息显示';
} }
}, },
watch: { watch: {
@ -105,6 +110,24 @@ export default {
}, },
handleClick() { 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() { cancel() {
const operate = { const operate = {

View File

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

View File

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

View File

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

View File

@ -294,6 +294,14 @@ export const OperationEvent = {
menuButton: { menuButton: {
operation: '1031', operation: '1031',
domId: '_Tips-Switch-Lock-Menu{BOTTOM}' 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: { init: {
operation: '1053', operation: '1053',
domId: '_Tips-Switch-Block-Init' 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: { menuButton: {
operation: '3032', operation: '3032',
domId: '_Tips-Signal-CancelTrainRoute-Menu{BOTTOM}' domId: '_Tips-Signal-CancelTrainRoute-Menu{BOTTOM}'
},
choose: {
operation: '3033',
domId: '_Tips-Signal-CancelTrainRoute-Choose'
} }
}, },
// 信号重开 // 信号重开
@ -863,6 +883,14 @@ export const OperationEvent = {
menuButton:{ menuButton:{
operation: '3062', operation: '3062',
domId: '_Tips-Signal-Lock-Menu{BOTTOM}' 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: { menuButton: {
operation: '3182', operation: '3182',
domId: '_Tips-Signal-cancelGuide-Menu{BOTTOM}' domId: '_Tips-Signal-cancelGuide-Menu{BOTTOM}'
},
confirm1: {
operation: '3183',
domId: '_Tips-Signal-cancelGuide-Confirm1'
} }
}, },
// 联锁进路 // 联锁进路
@ -1201,6 +1233,18 @@ export const OperationEvent = {
menuButton: { menuButton: {
operation: '4031', operation: '4031',
domId: '_Tips-Section-Lock-Menu{BOTTOM}' 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: { menuButton: {
operation: '5025', operation: '5025',
domId: '_Tips-Stand-SetJumpStop-Menu{BOTTOM}' domId: '_Tips-Stand-SetJumpStop-Menu{BOTTOM}'
},
confirm: {
operation: '5036',
domId: '_Tip-Stand-SetJumpStop-Confirm'
} }
}, },
// 取消跳停 // 取消跳停
@ -1569,6 +1617,10 @@ export const OperationEvent = {
menuButton: { menuButton: {
operation: '5035', operation: '5035',
domId: '_Tips-Stand-CancelJumpStop-Menu{BOTTOM}' 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 // eslint-disable-next-line no-undef
EventBus.$emit('clearCheckLogin'); EventBus.$emit('clearCheckLogin');
// 断开连接 // 断开连接
store.dispatch('disconnect').then(()=>{ store.dispatch('disconnect');
MessageBox.confirm(i18n.t('tip.logoutTips'), i18n.t('tip.hint'), { MessageBox.confirm(i18n.t('tip.logoutTips'), i18n.t('tip.hint'), {
confirmButtonText: i18n.t('tip.confirmLogin'), confirmButtonText: i18n.t('tip.confirmLogin'),
showCancelButton: false, showCancelButton: false,
@ -67,7 +67,6 @@ service.interceptors.response.use(
location.reload();// 为了重新实例化vue-router对象 避免bug location.reload();// 为了重新实例化vue-router对象 避免bug
}); });
}); });
});
return response.data; return response.data;
} else if (res.code === 500) { } else if (res.code === 500) {
const defaultError = { type: '服务异常:', message: '未知错误!'}; const defaultError = { type: '服务异常:', message: '未知错误!'};

View File

@ -108,7 +108,7 @@
</el-col> </el-col>
<el-col :span="18" style="text-align: left"> <el-col :span="18" style="text-align: left">
<div style="margin-top: 10px">服务电话13289398171</div> <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-col>
</el-row> </el-row>
</div> </div>

View File

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

View File

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

View File

@ -69,8 +69,8 @@
</div> </div>
<el-form ref="signalCiStation1" label-width="130px" :model="ciModelForm" size="mini" :rules="ciModelFormRules" style="margin-top: 15px;"> <el-form ref="signalCiStation1" label-width="130px" :model="ciModelForm" size="mini" :rules="ciModelFormRules" style="margin-top: 15px;">
<el-form-item label="信号机选择:" prop="signalList"> <el-form-item label="信号机选择:" prop="signalList">
<el-select v-model="ciModelForm.signalList" multiple placeholder="请选择"> <el-select v-model="ciModelForm.signalList" multiple filterable placeholder="请选择">
<el-option v-for="item in signalList" :key="item.code" :label="item.name" :value="item.code" /> <el-option v-for="item in filterSignalList" :key="item.code" :label="item.name" :value="item.code" />
</el-select> </el-select>
<el-button <el-button
:type="field == 'signalCodes' ? 'danger' : 'primary'" :type="field == 'signalCodes' ? 'danger' : 'primary'"
@ -296,6 +296,17 @@ export default {
} }
return list; 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() { form() {
return { return {
labelWidth: '150px', labelWidth: '150px',
@ -348,7 +359,7 @@ export default {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }, { 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: '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: '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') } { 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', 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.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: 'controlModePoint.y', firstLevel: 'controlModePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px'}
] } ] },
// { prop: 'createTurnBack', label: ':', type: 'checkbox' }, { prop: 'createTurnBack', label: '按图折返', type: 'checkbox' }
// { prop: 'turnBackPoint', label: ':', type: 'coordinate', width: '120px', isHidden: !this.isPointsShow, children: [ // { 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.x', firstLevel: 'turnBackPoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
// { prop: 'turnBackPoint.y', firstLevel: 'turnBackPoint', secondLevel: 'y', label: 'y:', 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; }); return this.sectionList.filter(elem => { return elem.type === '01' && !elem.switchSection; });
}, },
isPointsShow() {
return this.editModel.createTurnBack;
},
isZcCode() { isZcCode() {
return this.editModel.centralized; return this.editModel.centralized;
}, },
@ -284,6 +282,7 @@ export default {
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
// //
console.log(selected, selected.createTurnBack);
const beCentralizedStation = {}; const beCentralizedStation = {};
this.relStationList = JSON.parse(JSON.stringify(this.stationList)); this.relStationList = JSON.parse(JSON.stringify(this.stationList));
this.stationList.forEach(data=>{ 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" /> <populating-generic-data ref="populatingGenericData" :load-run-plan-id="loadRunPlanId" />
<create-empty-plan ref="createEmptyPlan" @refresh="refreshRunPlanList" /> <create-empty-plan ref="createEmptyPlan" @refresh="refreshRunPlanList" />
<edit-plan-name ref="editPlan" @renewal="refreshRunPlanName" /> <edit-plan-name ref="editPlan" @renewal="refreshRunPlanName" />
<gernarate-plan ref="gernaratePlanTrain" />
</div> </div>
</template> </template>
@ -65,6 +66,7 @@ import ModifyingTask from './menus/modifyingTask';
import ModifyingRouting from './menus/modifyingRouting'; import ModifyingRouting from './menus/modifyingRouting';
import ModifyingBeginTime from './menus/modifyingBeginTime'; import ModifyingBeginTime from './menus/modifyingBeginTime';
import EditStationBetweenTime from './menus/editStationBetweenTime'; import EditStationBetweenTime from './menus/editStationBetweenTime';
import GernaratePlan from './menus/gernaratePlanTrain';
// import AddSmoothRunTime from './menus/addSmoothRunTime'; // import AddSmoothRunTime from './menus/addSmoothRunTime';
// import EditSmoothRunTime from './menus/editSmoothRunTime'; // import EditSmoothRunTime from './menus/editSmoothRunTime';
import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime'; import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
@ -100,7 +102,8 @@ export default {
ModifyingStationIntervalTime, ModifyingStationIntervalTime,
ModifyingStationStopTime, ModifyingStationStopTime,
CreateEmptyPlan, CreateEmptyPlan,
EditPlanName EditPlanName,
GernaratePlan
}, },
data() { data() {
return { return {

View File

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

View File

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

View File

@ -15,9 +15,9 @@
<el-col :span="4"> <el-col :span="4">
<el-input v-model="model.serviceNumber" disabled size="mini" /> <el-input v-model="model.serviceNumber" disabled size="mini" />
</el-col> </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-checkbox v-model="model.debugTrain">{{ $t('planMonitor.commissioningTrain') }}</el-checkbox>
</el-col> </el-col> -->
</el-row> </el-row>
<el-row style="margin-top: 5px"> <el-row style="margin-top: 5px">
{{ $t('planMonitor.task') }} {{ $t('planMonitor.task') }}
@ -74,7 +74,7 @@ export default {
isNew:true, isNew:true,
model: { model: {
serviceNumber: '', serviceNumber: '',
debugTrain: false, // debugTrain: false,
tripConfigList: [] tripConfigList: []
} }
}; };
@ -107,9 +107,9 @@ export default {
id:index + 1, id:index + 1,
tripNumber: tripNumber, tripNumber: tripNumber,
startStationCode: resp.data.startStationCode, startStationCode: resp.data.startStationCode,
startTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200), startTime: formatTime(trainInfo.stationTimeList[1].secondTime + 7200),
endStationCode: resp.data.endStationCode, endStationCode: resp.data.endStationCode,
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime + 7200), endTime: formatTime(trainInfo.stationTimeList[lastIndex - 1].secondTime + 7200),
routingCode : resp.data.code, routingCode : resp.data.code,
endSectionCode:resp.data.endSectionCode, endSectionCode:resp.data.endSectionCode,
startSectionCode:resp.data.startSectionCode, startSectionCode:resp.data.startSectionCode,
@ -142,13 +142,14 @@ export default {
const newModel = { const newModel = {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode, sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode, stationCode:newstationTime.stationCode,
speedLevel:'默认', // speedLevel:'',
arriveTime: formatTime(newstationTime.arriveTime + 7200), arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200), departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime stopTime:newstationTime.departureTime - newstationTime.arriveTime
}; };
if (index < newstationTimeList.length - 1) { if (index < newstationTimeList.length - 1) {
newModel.speedLevelTime = newstationTimeList[index + 1].arriveTime - newstationTime.departureTime; newModel.speedLevelTime = newstationTimeList[index + 1].arriveTime - newstationTime.departureTime;
// newModel.speedLevel=
} }
taskObj.arriveConfigList.push(newModel); taskObj.arriveConfigList.push(newModel);
}); });
@ -279,14 +280,18 @@ export default {
if (this.isNew) { if (this.isNew) {
if (this.model.tripConfigList.length > 0) { if (this.model.tripConfigList.length > 0) {
this.doClose(); 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(() => { addPlanService(this.model).then(() => {
this.$emit('refresh'); this.$emit('refresh');
// this.$emit('dispatchOperate', { // this.$emit('dispatchOperate', {
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query) // dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
// }); // });
this.$message.success(this.$t('tip.planCreationSuccessful')); this.$message.success(this.$t('tip.planCreationSuccessful'));
}).catch(() => { }).catch((error) => {
this.$messageBox(this.$t('tip.createPlanFailed')); this.$messageBox(this.$t('tip.createPlanFailed') + error.message);
}); });
} else { } else {
this.$messageBox('请增加任务'); this.$messageBox('请增加任务');
@ -294,6 +299,10 @@ export default {
} else { } else {
if (this.model.tripConfigList.length > 0) { if (this.model.tripConfigList.length > 0) {
this.doClose(); 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(() => { updatePlanService(this.$route.query.planId, this.model.serviceNumber, this.model).then(() => {
this.$emit('refresh'); this.$emit('refresh');
// this.$emit('dispatchOperate', { // 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>
<el-table-column prop="right" label="所属站台"> <el-table-column prop="right" label="所属站台">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="parkingTime" label="停站时间" width="90"> <el-table-column prop="parkingTime" label="停站时间" width="90">
@ -59,7 +60,7 @@ export default {
}, },
computed: { computed: {
title() { title() {
return this.$t('planMonitor.modifying.modifyRunLevel'); return this.$t('planMonitor.modifying.modifyStopTime');
} }
}, },
mounted() { mounted() {
@ -71,6 +72,7 @@ export default {
}, },
formatSelect(code) { formatSelect(code) {
const device = this.$store.state.map.map && this.$store.state.map.map.stationStandList.find(ele => ele.standTrackCode == 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) { if (device) {
return device.right ? '上行站台' : '下行站台'; return device.right ? '上行站台' : '下行站台';
} }

View File

@ -12,7 +12,88 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row> <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-row>
<el-col :span="9" class="lineHeight"> <el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.tripNumber') }}</span> <span>{{ $t('planMonitor.modifying.tripNumber') }}</span>
@ -29,72 +110,13 @@
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="2"> <!-- <el-col :span="6">
<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-row> <el-row>
<el-col :span="9" class="lineHeight"> <el-col :span="9" class="lineHeight">
<span>{{ $t('planMonitor.modifying.serialNumber') }}</span> <span>{{ $t('planMonitor.modifying.serialNumber') }}</span>
</el-col> </el-col>
<el-col :span="15"> <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 <el-option
v-for="item in serialNumberList" v-for="item in serialNumberList"
:key="item.value" :key="item.value"
@ -104,42 +126,20 @@
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col> -->
<el-col :span="2"> <!-- <el-col :span="2">
<el-row> <el-row>
<el-col :offset="8" class="lineHeight"> <el-col :offset="8" class="lineHeight">
<el-checkbox v-model="editModel.serialManual" size="mini">{{ $t('planMonitor.modifying.manual') }}</el-checkbox> <el-checkbox v-model="editModel.serialManual" size="mini">{{ $t('planMonitor.modifying.manual') }}</el-checkbox>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col> -->
<el-col :span="6" class="lineHeight"> <el-col :span="6" class="lineHeight">
<el-row> <el-row>
<el-col :span="11" :offset="1"> <el-col :span="10" :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">
<span>{{ $t('planMonitor.modifying.startTime') }}</span> <span>{{ $t('planMonitor.modifying.startTime') }}</span>
</el-col> </el-col>
<el-col :span="13"> <el-col :span="12">
<el-time-picker <el-time-picker
v-model="editModel.startTime" v-model="editModel.startTime"
:placeholder="$t('planMonitor.modifying.selectTime')" :placeholder="$t('planMonitor.modifying.selectTime')"
@ -150,7 +150,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="7" class="lineHeight"> <!-- <el-col :span="7" class="lineHeight">
<el-row> <el-row>
<el-col :span="22" :offset="2"> <el-col :span="22" :offset="2">
<el-row> <el-row>
@ -166,7 +166,7 @@
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col> -->
</el-row> </el-row>
<el-row style="margin-bottom: 5px;"> <el-row style="margin-bottom: 5px;">
{{ $t('planMonitor.modifying.route') }} {{ $t('planMonitor.modifying.route') }}
@ -212,27 +212,37 @@
{{ formatName(scope.row.sectionCode) }} {{ formatName(scope.row.sectionCode) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" /> <el-table-column :label="this.$t('planMonitor.arriveTime')">
<!-- prop="stopTime" --> <template v-if="scope.$index!=0" slot-scope="scope">
<el-table-column :label="this.$t('planMonitor.stopTime')"> {{ scope.row.arriveTime }}
<template slot-scope="scope"> </template>
<el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @input="changeStopTime(scope.$index, scope.row.stopTime)" /> </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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" />
<el-table-column :label="this.$t('planMonitor.runLevel')"> <el-table-column :label="this.$t('planMonitor.runLevel')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.speedLevel }} <span style="font-size:13px;"> {{ scope.row.speedLevel }}</span>
<el-input v-model="scope.row.speedLevelTime" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" /> <span>{{ '('+scope.row.speedLevelTime+'s)' }}</span>
<!-- <el-input v-model="scope.row.speedLevelTime" placeholder="请输入运行等级" size="mini" @input="changeSpeedLevelTime(scope.$index, scope.row.speedLevelTime)" /> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<el-row> <!-- <el-row>
<el-col :offset="16"> <el-col :offset="16">
<el-checkbox v-model="editModel.default">{{ $t('planMonitor.modifying.showDefaultTime') }}</el-checkbox> <el-checkbox v-model="editModel.default">{{ $t('planMonitor.modifying.showDefaultTime') }}</el-checkbox>
</el-col> </el-col>
</el-row> </el-row> -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button> <el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button> <el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
@ -240,7 +250,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRun } from '@/api/runplan'; import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
@ -263,8 +273,9 @@ export default {
PlanConvert: {}, PlanConvert: {},
parkSectionCodeList:[], parkSectionCodeList:[],
stopStationMap: {}, stopStationMap: {},
defaultStopTime: 0, stopTimeMap:{},
defaultSpeedLevel: 'l3', // defaultStopTime: 0,
defaultSpeedLevel: 'l1',
routingList: [], routingList: [],
tripNumber: '', tripNumber: '',
serviceNumber: '', serviceNumber: '',
@ -289,7 +300,7 @@ export default {
tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }], tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }],
// defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }], // defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
// defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }], // defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
serialNumberList: [], // serialNumberList: [],
defaultSpeedLevelList: [ defaultSpeedLevelList: [
{ value: 'l1', label: '等级一' }, { value: 'l1', label: '等级一' },
{ value: 'l2', label: '等级二' }, { value: 'l2', label: '等级二' },
@ -308,9 +319,9 @@ export default {
'editModel.startTime': function () { 'editModel.startTime': function () {
this.computedDetailList(); this.computedDetailList();
}, },
'defaultStopTime': function () { // 'defaultStopTime': function () {
this.computedDetailList('defaultStopTime'); // this.computedDetailList('defaultStopTime');
}, // },
'defaultSpeedLevel': function () { 'defaultSpeedLevel': function () {
this.computedDetailList('defaultSpeedLevel'); this.computedDetailList('defaultSpeedLevel');
} }
@ -334,35 +345,50 @@ export default {
if (stopStationObj) { if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) { if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]); runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else if (stopStationObj['l3']) { } else if (stopStationObj[runLevel]) {
runTime = parseInt(stopStationObj['l3']); runTime = parseInt(stopStationObj[runLevel]);
} }
} }
} }
return runTime; return runTime;
}, },
computedDetailList(type = null) { computedDetailList(type = null) {
if (this.editModel.routingCode) { if (this.editModel.routingCode) {
const list = Object.assign([], this.editModel.arriveConfigList); const list = Object.assign([], this.editModel.arriveConfigList);
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000; let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
const runLevel = this.defaultSpeedLevel || 'l3'; // const runLevel = this.defaultSpeedLevel || 'l1'; //
list.forEach((elem, index) => { list.forEach((elem, index) => {
if (type == 'defaultStopTime' || type == 'routingCode') { // type == 'defaultStopTime' ||
elem.stopTime = parseInt(this.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) { 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 { } else {
elem.departureTime = formatTime(tempTime); elem.departureTime = formatTime(tempTime);
} }
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; }); 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); const realRunlevel = this.compuntedRunTime(list, index, runLevel);
elem.speedLevelTime = realRunlevel; 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) { if (index > 0) {
tempTime = tempTime + elem.stopTime + elem.speedLevelTime; tempTime = tempTime + elem.stopTime + elem.speedLevelTime;
} else { } else {
@ -382,34 +408,46 @@ export default {
this.planId = this.$route.query.planId; this.planId = this.$route.query.planId;
this.PlanConvert = this.$theme.loadPlanConvert(lineCode); this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
if (mapId) { if (mapId) {
getMapStationRun(mapId).then(resp => { getMapStationRunUser(mapId).then(resp => {
const list = resp.data; const list = resp.data.list;
list.forEach(elem => { list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = 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) { if (params.rowData && params.rowData.arriveConfigList.length > 0) {
this.editModel.arriveConfigList = params.rowData.arriveConfigList; const paramData = params.rowData;
this.editModel.routingCode = params.rowData.routingCode; this.initRunlevel(paramData);
this.editModel.startStationCode = params.rowData.startStationCode; // const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.label == ; });
this.editModel.endStationCode = params.rowData.endStationCode; this.editModel.arriveConfigList = paramData.arriveConfigList;
this.editModel.startTime = params.rowData.startTime; this.editModel.routingCode = paramData.routingCode;
this.editModel.endTime = params.rowData.endTime; this.editModel.startStationCode = paramData.startStationCode;
this.editModel.endSectionCode = params.rowData.endSectionCode; this.editModel.endStationCode = paramData.endStationCode;
this.editModel.startSectionCode = params.rowData.startSectionCode; this.editModel.startTime = paramData.startTime;
this.editModel.id = params.rowData.id; this.editModel.endTime = paramData.endTime;
this.editModel.endSectionCode = paramData.endSectionCode;
this.editModel.startSectionCode = paramData.startSectionCode;
this.editModel.id = paramData.id;
this.routingList = []; this.routingList = [];
this.routingList.push({ this.routingList.push({
code:params.rowData.routingCode, code:paramData.routingCode,
startStationCode:params.rowData.startStationCode, startStationCode:paramData.startStationCode,
endStationCode:params.rowData.endStationCode, endStationCode:paramData.endStationCode,
endSectionCode:params.rowData.endSectionCode, endSectionCode:paramData.endSectionCode,
startSectionCode:params.rowData.startSectionCode startSectionCode:paramData.startSectionCode
}); });
this.computedDetailList(); this.computedDetailList();
this.dialogShow = true;
} else { } else {
const model = { const model = {
planId: this.$route.query.planId || this.loadRunPlanId, planId: this.$route.query.planId || this.loadRunPlanId,
@ -467,7 +505,7 @@ export default {
const newModel = { const newModel = {
sectionCode:resp.data.parkSectionCodeList[index].sectionCode, sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
stationCode:newstationTime.stationCode, stationCode:newstationTime.stationCode,
speedLevel:'默认', // speedLevel:'',
arriveTime: formatTime(newstationTime.arriveTime + 7200), arriveTime: formatTime(newstationTime.arriveTime + 7200),
departureTime: formatTime(newstationTime.departureTime + 7200), departureTime: formatTime(newstationTime.departureTime + 7200),
stopTime:newstationTime.departureTime - newstationTime.arriveTime stopTime:newstationTime.departureTime - newstationTime.arriveTime
@ -477,58 +515,88 @@ export default {
} }
this.editModel.arriveConfigList.push(newModel); this.editModel.arriveConfigList.push(newModel);
}); });
this.initRunlevel(this.editModel);
this.dialogShow = true; this.dialogShow = true;
this.computedDetailList(); this.computedDetailList();
} }
}); });
} }
}, },
changeStopTime(indexs, time) { initRunlevel(paramData) {
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000; const speedLevelData = this.stopStationMap[[paramData.arriveConfigList[0].sectionCode, paramData.arriveConfigList[1].sectionCode].toString()];
// const runLevel = this.defaultSpeedLevel || 'l3'; // switch (paramData.arriveConfigList[0].speedLevelTime) {
const arriveConfigList = Object.assign([], this.editModel.arriveConfigList); case speedLevelData.l1: {
arriveConfigList.forEach((elem, index) => { this.defaultSpeedLevel = 'l1';
if (index == indexs) { elem.stopTime = time ? Number(time) : 0; } break;
elem.arriveTime = index ? formatTime(tempTime) : ''; }
// const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; }); case speedLevelData.l2: {
// elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label; this.defaultSpeedLevel = 'l2';
if (index > 0) { break;
elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime); }
} else { case speedLevelData.l3: {
elem.departureTime = formatTime(tempTime); 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) { doShow(params) {
this.loadInitData(params); this.loadInitData(params);
}, },
@ -541,8 +609,10 @@ export default {
planId: this.$route.query.planId || this.loadRunPlanId, planId: this.$route.query.planId || this.loadRunPlanId,
routingCode: this.editModel.routingCode, routingCode: this.editModel.routingCode,
tripNumber: this.tripNumber, tripNumber: this.tripNumber,
startTime: this.editModel.startTime, // startTime: this.editModel.startTime,
endTime: this.editModel.endTime, startTime:this.editModel.arriveConfigList[0].arriveTime,
// endTime: this.editModel.endTime,
endTime: this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].departureTime,
arriveConfigList: this.editModel.arriveConfigList, arriveConfigList: this.editModel.arriveConfigList,
SDTNumber: `${this.serviceNumber}${this.tripNumber}` 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> <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"> <div class="content-box">
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" /> <jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" />
<div style="width: 29%;float: right;" :style="{height: $store.state.app.height-54+'px' }"> <!-- :style="{height: $store.state.app.height-54+'px' }" -->
<el-scrollbar wrap-class="scrollbar-wrapper"> <div class="routeMap">
<div class="clearfix" style="padding-right: 20px;"> <route-config v-if="type=='routeMap'" ref="routeConfig" />
<el-button type="text" class="mapEdit_box" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button> <runplan-config v-if="type=='runplanParams'" ref="runPlanConfig" />
<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>
</div> </div>
</div> </div>
<route-operate ref="routeOperate" @routingSelected="routingSelected" />
</el-dialog> </el-dialog>
</template> </template>
@ -182,150 +15,54 @@
import JlmapVisual from '@/views/newMap/jlmapNew/index'; import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { loadMapDataById } from '@/utils/loaddata'; import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import RouteConfig from './routeConfig';
import RouteOperate from './routeOperate'; import RunplanConfig from './runplanConfig';
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';
export default { export default {
name: 'RouteMap', name: 'RouteMap',
components: { components: {
JlmapVisual, JlmapVisual,
RouteOperate RouteConfig,
RunplanConfig
}, },
props:{ props:{
}, },
data() { data() {
return { return {
type:'',
title:'',
dialogShow: false, dialogShow: false,
oldDevice: null, oldDevice: null,
field: '',
allowSelect:false,
isStartSelected:false,
stationCode: '',
sectionCode: '',
isSave: true,
loading: false,
oldsection:[], oldsection:[],
DirectionCodeList: [{label: '右行', value: true}, {label: '左行', value: false}], isFirst:true
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' }
]
}
}; };
}, },
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: { 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) { '$store.state.app.width': function(val) {
this.setWindowSize(); this.setWindowSize();
}, },
routeName(val, old) { '$store.state.app.windowSizeCount': function() {
if (val) { this.setWindowSize();
this.addModel.name = val;
}
},
sectionCode(val) {
val && this.changeBelongSection(val);
} }
}, },
mounted() { mounted() {
this.rowDrop();
}, },
methods: { 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; this.dialogShow = true;
await this.setWindowSize(); await this.setWindowSize();
if (this.isFirst) {
await this.loadInitPage(); await this.loadInitPage();
}, }
previewRouteEvent() { this.isFirst = false;
this.$refs.routeOperate.doShow(); if (this.type == 'runplanParams') { this.$refs.runPlanConfig.doShow(); }
},
createRouteEvent() {
this.clear();
}, },
// //
getDeviceByEm(em) { getDeviceByEm(em) {
@ -384,331 +121,22 @@ export default {
EventBus.$emit('viewLoading', false); 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) { setSelected(selected) {
if (selected) { if (selected) {
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'startStationCode'.toUpperCase()) { if (this.type == 'routeMap') { this.$refs.routeConfig.setSelected(selected); }
this.addModel.startStationCode = selected.code; if (this.type == 'runplanParams') { this.$refs.runPlanConfig.setSelected(selected); }
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 = '';
} }
}, },
// batchSectionListFocus(flag) {
// this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
// },
onContextmenu() { onContextmenu() {
}, },
close() { close() {
this.dialogShow = false; 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> <style lang="scss" scope>
.content-route{ .content-route{
display: flex;
flex-direction: column;
/deep/ { /deep/ {
.el-dialog__body{ .el-dialog__body{
width: 100%; width: 100%;
height: calc(100% - 54px); height:100%;
flex:1;
padding: 0; padding: 0;
overflow: hidden;
} }
} }
} }
.mapEdit_box{ .content-box{
float: right; display:flex;
padding: 3px 0; height:100%;
margin-right: 5px; }
.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> </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 }; }); .map(serviceNumber => { return { serviceNumber }; });
}, },
async analyticalTripNumber(data) { 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 || {}) 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 }; }); .map(tripNumber => { return { tripNumber }; });
}, },
async setPosition() { async setPosition() {
@ -569,7 +572,6 @@ export default {
this.option.title.text = this.mapName; this.option.title.text = this.mapName;
} }
this.myChart = echarts.init(document.getElementById(this.runPlanId)); this.myChart = echarts.init(document.getElementById(this.runPlanId));
// debugger;
// this.option; // this.option;
this.myChart.setOption(this.option); this.myChart.setOption(this.option);
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height }); this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });

View File

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

View File

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