Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
ba6797bbda
@ -569,7 +569,7 @@ class SkinCode extends defaultStyle {
|
||||
directionStopType:'normal', // special 西安二号线 停车 列车方向图标不消失 normal 正常
|
||||
trainHeadHeight: 'trainBox', // 列车车头高度取决于trainBox高度
|
||||
trainHeadArrowWidth: 5, // 列车车头三角宽度
|
||||
trainHeadArrowOffsetX: 2 // 列车车头三角偏移
|
||||
trainHeadArrowOffsetX: 6 // 列车车头三角偏移
|
||||
},
|
||||
common: {
|
||||
trainHeight: 20, // 列车高度
|
||||
|
@ -433,17 +433,24 @@ class Jlmap {
|
||||
this.$painter.update(cycleButton);
|
||||
}
|
||||
} else if (elem.deviceType === 'STATION') {
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
const guideLock = this.mapDevice[oDevice.guideLockCode];
|
||||
const guideLockStatus = {totalGuideLock: elem.totalGuideLock};
|
||||
if (guideLock && this.hookHandle(guideLock, guideLockStatus)) {
|
||||
this.$painter.update(guideLock);
|
||||
// 如果是控制权转移消息
|
||||
if (elem.hasOwnProperty('applicantIdOfControlTransfer')) {
|
||||
store.dispatch('map/setControlTransfer', elem);
|
||||
}
|
||||
if (elem.dispose) {
|
||||
this.$painter.delete(oDevice);
|
||||
} else {
|
||||
this.$painter.update(oDevice);
|
||||
if (!elem.applicantIdOfControlTransfer) {
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
const guideLock = this.mapDevice[oDevice.guideLockCode];
|
||||
const guideLockStatus = {totalGuideLock: elem.totalGuideLock};
|
||||
if (guideLock && this.hookHandle(guideLock, guideLockStatus)) {
|
||||
this.$painter.update(guideLock);
|
||||
}
|
||||
if (elem.dispose) {
|
||||
this.$painter.delete(oDevice);
|
||||
} else {
|
||||
this.$painter.update(oDevice);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (elem.deviceType === 'TRAIN') {
|
||||
this.isUpdateShowTrainList = true;
|
||||
|
@ -9,7 +9,7 @@ import ESingleControl from './ESingleControl';
|
||||
import EArrow from './EArrow';
|
||||
import { arrow } from '../utils/ShapePoints';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
// import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
// import {isShowThePrdType} from '../../utils/handlePath';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
@ -36,78 +36,81 @@ export default class Station extends Group {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
|
||||
if (model.visible) {
|
||||
// 公里标名称是否显示
|
||||
this.stationText = new ETextName({
|
||||
// 公里标名称是否显示
|
||||
this.stationText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
fontWeight: style.Station.text.fontWeight,
|
||||
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.number ? model.number + model.name : model.name,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFill: model.nameFontColor
|
||||
});
|
||||
this.add(this.stationText);
|
||||
if (style.Station.text.borderShow) {
|
||||
this.stationText.setStyle('textPadding', [2, 6]);
|
||||
this.stationText.setStyle('textBorderColor', model.nameFontColor);
|
||||
this.stationText.setStyle('textBorderWidth', 1);
|
||||
}
|
||||
const path = window.location.href;
|
||||
if (style.Station.kmPostShow || path.includes('/map/draw')) {
|
||||
// 公里标是否显示
|
||||
let direction = 1;
|
||||
if (this.style.Station.kilometerPosition == 'up') {
|
||||
direction = -1;
|
||||
}
|
||||
const offset = { x: 0, y: 0 };
|
||||
if (model.kilometerPosition) {
|
||||
offset.x = model.kilometerPosition.x;
|
||||
offset.y = model.kilometerPosition.y;
|
||||
}
|
||||
this.mileageText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
fontWeight: style.Station.text.fontWeight,
|
||||
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
|
||||
position: [0, 0],
|
||||
x: model.position.x + offset.x,
|
||||
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.kmPostFont || 18,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.number ? model.number + model.name : model.name,
|
||||
text: model.kmPost,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFill: model.nameFontColor
|
||||
textFill: model.kmPostFontColor
|
||||
});
|
||||
this.add(this.stationText);
|
||||
this.add(this.mileageText);
|
||||
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
|
||||
}
|
||||
if (model.subheadDisplay) { // 副标题
|
||||
this.subheadText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
x: model.subheadPosition.x,
|
||||
y: model.subheadPosition.y,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.subheadFont || 18,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.subhead,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFill: model.subheadFontColor
|
||||
});
|
||||
this.add(this.subheadText);
|
||||
if (style.Station.text.borderShow) {
|
||||
this.stationText.setStyle('textPadding', [2, 6]);
|
||||
this.stationText.setStyle('textBorderColor', model.nameFontColor);
|
||||
this.stationText.setStyle('textBorderWidth', 1);
|
||||
}
|
||||
const path = window.location.href;
|
||||
if (style.Station.kmPostShow || path.includes('/map/draw')) {
|
||||
// 公里标是否显示
|
||||
let direction = 1;
|
||||
if (this.style.Station.kilometerPosition == 'up') {
|
||||
direction = -1;
|
||||
}
|
||||
const offset = { x: 0, y: 0 };
|
||||
if (model.kilometerPosition) {
|
||||
offset.x = model.kilometerPosition.x;
|
||||
offset.y = model.kilometerPosition.y;
|
||||
}
|
||||
this.mileageText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: [0, 0],
|
||||
x: model.position.x + offset.x,
|
||||
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.kmPostFont || 18,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.kmPost,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFill: model.kmPostFontColor
|
||||
});
|
||||
this.add(this.mileageText);
|
||||
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
|
||||
}
|
||||
if (model.subheadDisplay) { // 副标题
|
||||
this.subheadText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
x: model.subheadPosition.x,
|
||||
y: model.subheadPosition.y,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.subheadFont || 18,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.subhead,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFill: model.subheadFontColor
|
||||
});
|
||||
this.add(this.subheadText);
|
||||
if (style.Station.text.borderShow) {
|
||||
this.subheadText.setStyle('textPadding', [2, 6]);
|
||||
this.subheadText.setStyle('textBorderColor', model.nameFontColor);
|
||||
this.subheadText.setStyle('textBorderWidth', 1);
|
||||
}
|
||||
this.subheadText.setStyle('textPadding', [2, 6]);
|
||||
this.subheadText.setStyle('textBorderColor', model.nameFontColor);
|
||||
this.subheadText.setStyle('textBorderWidth', 1);
|
||||
}
|
||||
}
|
||||
if (!model.visible) { // 隐藏车站
|
||||
this.subheadText && this.subheadText.setStyle('textFill', 'rgba(0,0,0,0)');
|
||||
this.mileageText && this.mileageText.setStyle('textFill', 'rgba(0,0,0,0)');
|
||||
this.stationText && this.stationText.setStyle('textFill', 'rgba(0,0,0,0)');
|
||||
}
|
||||
}
|
||||
createTurnBack() { // 创建按图折返
|
||||
const model = this.model;
|
||||
@ -171,22 +174,22 @@ export default class Station extends Group {
|
||||
}
|
||||
// 创建控制模式
|
||||
createControlMode() {
|
||||
const model = this.model;
|
||||
if (!this.style.Station.StationControl.disPlayNone) {
|
||||
if (model.visible && model.createControlMode) {
|
||||
// 紧急站控
|
||||
this.createEmergencyControl();
|
||||
const model = this.model;
|
||||
if (!this.style.Station.StationControl.disPlayNone) {
|
||||
if (model.visible && model.createControlMode) {
|
||||
// 紧急站控
|
||||
this.createEmergencyControl();
|
||||
|
||||
// 中控按钮
|
||||
this.createCenterControl();
|
||||
// 中控按钮
|
||||
this.createCenterControl();
|
||||
|
||||
// 站控按钮
|
||||
this.createSubstationControl();
|
||||
// 站控按钮
|
||||
this.createSubstationControl();
|
||||
|
||||
// 联锁控
|
||||
this.createInterconnectedControl();
|
||||
}
|
||||
}
|
||||
// 联锁控
|
||||
this.createInterconnectedControl();
|
||||
}
|
||||
}
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
@ -292,7 +295,7 @@ export default class Station extends Group {
|
||||
}
|
||||
});
|
||||
this.add(this.arcBorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
createSubstationControl() { // 站控按钮
|
||||
@ -330,7 +333,7 @@ export default class Station extends Group {
|
||||
});
|
||||
this.add(this.substationArrowsControl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
createInterconnectedControl() { // 联锁控
|
||||
@ -356,13 +359,13 @@ export default class Station extends Group {
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.lamp.greenColor); // 文字颜色
|
||||
if (this.style.Station.StationControl.disPlayNone) {
|
||||
this.stationText && this.stationText.setStyle('textFill', '#1fdc1f');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#1fdc1f');
|
||||
}
|
||||
}
|
||||
this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.lamp.greenColor); // 文字颜色
|
||||
if (this.style.Station.StationControl.disPlayNone) {
|
||||
this.stationText && this.stationText.setStyle('textFill', '#1fdc1f');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#1fdc1f');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleLocal() { // 站控
|
||||
@ -370,13 +373,13 @@ export default class Station extends Group {
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.yellowColor); // 文字颜色
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
if (this.style.Station.StationControl.disPlayNone) {
|
||||
this.stationText && this.stationText.setStyle('textFill', '#fff');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#fff');
|
||||
}
|
||||
}
|
||||
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
if (this.style.Station.StationControl.disPlayNone) {
|
||||
this.stationText && this.stationText.setStyle('textFill', '#fff');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#fff');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleEmergency() { // 紧急站控
|
||||
@ -384,22 +387,22 @@ export default class Station extends Group {
|
||||
this.emergencyControl && this.emergencyControl.setTextColor(this.style.Station.StationControl.lamp.redColor); // 紧急 颜色
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
if (this.style.Station.StationControl.disPlayNone) {
|
||||
this.stationText && this.stationText.setStyle('textFill', '#fff');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#fff');
|
||||
}
|
||||
}
|
||||
}
|
||||
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
if (this.style.Station.StationControl.disPlayNone) {
|
||||
this.stationText && this.stationText.setStyle('textFill', '#fff');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#fff');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleNone() { // 空
|
||||
handleNone() { // 空
|
||||
if (this.style.Station.StationControl.disPlayNone) { // 没有控制时显示 黄色
|
||||
this.stationText && this.stationText.setStyle('textFill', '#FFFF00');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#FFFF00');
|
||||
}
|
||||
}
|
||||
this.stationText && this.stationText.setStyle('textFill', '#FFFF00');
|
||||
if (this.model.subheadDisplay) { // 副标题
|
||||
this.subheadText && this.subheadText.setStyle('textFill', '#FFFF00');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
recover() {
|
||||
@ -417,8 +420,7 @@ export default class Station extends Group {
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
this.recover();
|
||||
// console.log(model.controlMode, model);
|
||||
this.recover();
|
||||
model.controlMode && this['handle' + model.controlMode]();
|
||||
if (model.tbStrategyId) {
|
||||
store.state.map.map.tbStrategyList.forEach(item => {
|
||||
@ -444,18 +446,18 @@ export default class Station extends Group {
|
||||
}
|
||||
|
||||
getBoundingRect() {
|
||||
if (this.model.visible) {
|
||||
const rect = this.stationText.getBoundingRect().clone();
|
||||
if (this.model.subheadDisplay) {
|
||||
const subheadText = this.subheadText.getBoundingRect().clone();
|
||||
rect.union(subheadText);
|
||||
return rect;
|
||||
} else {
|
||||
return rect;
|
||||
}
|
||||
// if (this.model.visible) {
|
||||
const rect = this.stationText.getBoundingRect().clone();
|
||||
if (this.model.subheadDisplay) {
|
||||
const subheadText = this.subheadText.getBoundingRect().clone();
|
||||
rect.union(subheadText);
|
||||
return rect;
|
||||
} else {
|
||||
return new BoundingRect(0, 0, 0, 0);
|
||||
return rect;
|
||||
}
|
||||
// } else {
|
||||
// return new BoundingRect(0, 0, 0, 0);
|
||||
// }
|
||||
}
|
||||
|
||||
drawSelected(selected) {
|
||||
|
@ -11,7 +11,7 @@
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-limit ref="menuLimit" :selected="selected" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-contorl ref="passiveControl" pop-class="beijing-01__systerm" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
</div>
|
||||
</template>
|
||||
@ -29,7 +29,7 @@ import MenuStation from './menuStation';
|
||||
import MenuBar from './menuBar';
|
||||
import MenuLimit from './menuLimit';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
|
@ -1,304 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm passive-control"
|
||||
title="控制模式请求"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" label="操作区域">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" label="当前控制模式" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" label="请求控制模式" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" label="是否同意" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">距离对话还有{{ count }}秒,请应答。</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="beijing-01__systerm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: '调度员1工作站',
|
||||
controlProps: {
|
||||
'01': '中控',
|
||||
'02': '站控'
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return '01';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return '02';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && !elem.hasOwnProperty('success') && !elem.hasOwnProperty('timeout')) {
|
||||
if (elem.stationControlCode) {
|
||||
this.doShow(elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(code) {
|
||||
this.tableData = [];
|
||||
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).state;
|
||||
if (control) {
|
||||
model.control = { status: control.status, name: this.controlProps[control.status] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (station) {
|
||||
model.operate = station.name || '';
|
||||
}
|
||||
}
|
||||
|
||||
this.tableData.push(model);
|
||||
},
|
||||
doShow(msgHead) {
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.stationControlCode);
|
||||
|
||||
const operate = {
|
||||
start: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: this.serializeCodeListWithSeparator('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox('请选择一条数据');
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
val: this.selection[0].code,
|
||||
prdType: this.$store.state.training.prdType
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
val: this.tableData[0].code,
|
||||
prdType: this.$store.state.training.prdType
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.control-label {
|
||||
line-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
@ -11,7 +11,7 @@
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-station-platform ref="menuStationPlatform" :selected="selected" @popMenuStationStand="popMenuStationStand" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-contorl ref="passiveControl" pop-class="chengdou-01__system" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
</div>
|
||||
</template>
|
||||
@ -28,7 +28,7 @@ import MenuTrain from './menuTrain';
|
||||
import MenuStation from './menuStation';
|
||||
import MenuBar from './menuBar';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
import MenuStationPlatform from './menuStationPlatform';
|
||||
|
||||
|
@ -1,305 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-01__system passive-control"
|
||||
title="控制模式请求"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%; height: 250px"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" label="操作区域">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" label="当前控制模式" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" label="请求控制模式" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" label="是否同意" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">距离对话还有{{ count }}秒,请应答。</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { mapGetters } from 'vuex';
|
||||
// import { TrainingMode } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
// import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: '调度员1工作站',
|
||||
controlProps: {
|
||||
'01': '中控',
|
||||
'02': '站控'
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return '01';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return '02';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && !elem.hasOwnProperty('success') && !elem.hasOwnProperty('timeout')) {
|
||||
if (elem.stationControlCode) {
|
||||
this.doShow(elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(code) {
|
||||
this.tableData = [];
|
||||
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).state;
|
||||
if (control) {
|
||||
model.control = { status: control.status, name: this.controlProps[control.status] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (station) {
|
||||
model.operate = station.name || '';
|
||||
}
|
||||
}
|
||||
|
||||
this.tableData.push(model);
|
||||
},
|
||||
doShow(msgHead) {
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.stationControlCode);
|
||||
|
||||
const operate = {
|
||||
start: true,
|
||||
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: this.serializeCodeListWithSeparator('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox('请选择一条数据');
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
val: this.selection[0].code,
|
||||
prdType: this.$store.state.training.prdType
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
val: this.tableData[0].code,
|
||||
prdType: this.$store.state.training.prdType
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.control-label {
|
||||
line-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
@ -10,7 +10,7 @@
|
||||
<menu-train ref="menuTrain" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-contorl ref="passiveControl" pop-class="chengdou-03__systerm" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
</div>
|
||||
</template>
|
||||
@ -27,7 +27,7 @@ import MenuTrain from './menuTrain';
|
||||
import MenuStation from './menuStation';
|
||||
import MenuBar from './menuBar';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
|
@ -1,325 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-03__systerm passive-control"
|
||||
title="控制模式请求"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" label="操作区域">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" label="当前控制模式" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" label="请求控制模式" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" label="是否同意" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">距离对话还有{{ count }}秒,请应答。</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import {SimulationType} from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: '调度员1工作站',
|
||||
controlProps: {
|
||||
'Center': '中控',
|
||||
'Local': '站控',
|
||||
'Emergency': '紧急站控'
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0,
|
||||
targetStatus: '',
|
||||
sourceMemberId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control')) {
|
||||
this.doShow(elem);
|
||||
this.sourceMemberId = elem.sourceMemberId;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(data) {
|
||||
this.tableData = [];
|
||||
this.targetStatus = 'Center';
|
||||
if (data.operateType == 'CM_Apply_For_Station_Control') {
|
||||
this.targetStatus = 'Local';
|
||||
} else if (data.operateType == 'CM_Emergency_Station_Control') {
|
||||
this.targetStatus = 'Emergency';
|
||||
}
|
||||
data.params.stationCodes.forEach(code => {
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (station) {
|
||||
const control = (station || {}).controlMode;
|
||||
if (control) {
|
||||
model.control = { status: control, name: this.controlProps[control] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
|
||||
if (station) {
|
||||
model.operate = station.name || '';
|
||||
}
|
||||
}
|
||||
|
||||
this.tableData.push(model);
|
||||
});
|
||||
},
|
||||
doShow(msgHead) {
|
||||
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
|
||||
const simulationUserList = this.$store.state.training.simulationUserList;
|
||||
if (member) {
|
||||
let info = SimulationType[member.type];
|
||||
if (member.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
info = info + `(${device.name})`;
|
||||
}
|
||||
if (member.userId) {
|
||||
simulationUserList.forEach(item => {
|
||||
if (item.userId === member.userId) {
|
||||
info = info + '-' + item.nickName;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.requestInfo = info;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead);
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: this.serializeCodeListWithSeparator('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox('请选择一条数据');
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: true
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
send: true,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: false
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.control-label {
|
||||
line-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm passive-control"
|
||||
:class="popClass+' passive-control'"
|
||||
title="控制模式请求"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
@ -54,7 +54,8 @@
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
<!-- ningbo-01__systerm -->
|
||||
<notice-info ref="noticeInfo" :pop-class="popClass" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -62,13 +63,21 @@
|
||||
import {OperationEvent } from '@/scripts/ConstDic';
|
||||
import {SimulationType} from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import NoticeInfo from '../childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
popClass: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -109,15 +118,8 @@ export default {
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (!this.dialogShow && elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control') && !elem.success) {
|
||||
if (elem.params.stationCodes && elem.params.stationCodes.length) {
|
||||
this.doShow(elem);
|
||||
this.sourceMemberId = elem.sourceMemberId;
|
||||
}
|
||||
} else {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
'$store.state.map.controlTransfer':function (elem) {
|
||||
this.doShow(elem);
|
||||
},
|
||||
'$store.state.map.keyboardEnterCount': function (val) {
|
||||
if (this.show && !this.disabledAgree) {
|
||||
@ -131,22 +133,6 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
@ -170,79 +156,83 @@ export default {
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(msgHead) {
|
||||
const codes = msgHead.params.stationCodes;
|
||||
updateTableData(controlTransfer) {
|
||||
const code = controlTransfer.code;
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
this.tableData = [];
|
||||
(codes || []).forEach(code=> {
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: true,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).controlMode;
|
||||
if (control) {
|
||||
model.control = { status: control, name: this.controlProps[control] };
|
||||
this.targetStatus = 'Center';
|
||||
if (msgHead.operateType == 'CM_Apply_For_Center_Control') {
|
||||
this.targetStatus = 'Center';
|
||||
} else if (msgHead.operateType == 'CM_Apply_For_Station_Control') {
|
||||
this.targetStatus = 'Local';
|
||||
}
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
model.operate = device.name || '';
|
||||
}
|
||||
this.tableData.push(model);
|
||||
});
|
||||
},
|
||||
doShow(msgHead) {
|
||||
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
|
||||
const simulationUserList = this.$store.state.training.simulationUserList;
|
||||
if (member) {
|
||||
let info = SimulationType[member.type];
|
||||
if (member.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
info = info + `(${device.name})`;
|
||||
}
|
||||
if (member.userId) {
|
||||
simulationUserList.forEach(item => {
|
||||
if (item.userId === member.userId) {
|
||||
info = info + '-' + item.nickName;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.requestInfo = info;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead);
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: true,
|
||||
disabled: false
|
||||
};
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (device) {
|
||||
const control = (device || {}).controlMode;
|
||||
if (control) {
|
||||
model.control = { status: control, name: this.controlProps[control] };
|
||||
this.targetStatus = controlTransfer.apply2TheControlMode;
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
});
|
||||
model.operate = device.name || '';
|
||||
}
|
||||
this.tableData.push(model);
|
||||
},
|
||||
doShow(controlTransfer) {
|
||||
if (controlTransfer.applicantIdOfControlTransfer) {
|
||||
const member = this.$store.state.training.memberData[controlTransfer.applicantIdOfControlTransfer];
|
||||
const simulationUserList = this.$store.state.training.simulationUserList;
|
||||
// 不给自己弹窗,如果申请人是行值的话,只允许给所有行调弹窗,如果申请人是行调的话,只给特定的行值弹窗
|
||||
if (member && member.userId != this.$store.state.user.id &&
|
||||
((member.type == 'STATION_SUPERVISOR' && this.$store.state.training.roles == 'DISPATCHER') ||
|
||||
(member.type == 'DISPATCHER' && this.$store.state.training.roleDeviceCode == controlTransfer.code))) {
|
||||
if (!this.dialogShow) {
|
||||
let info = SimulationType[member.type];
|
||||
if (member.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
info = info + `(${device.name})`;
|
||||
}
|
||||
if (member.userId) {
|
||||
simulationUserList.forEach(item => {
|
||||
if (item.userId === member.userId) {
|
||||
info = info + '-' + item.nickName;
|
||||
}
|
||||
});
|
||||
}
|
||||
// 后端倒计时
|
||||
if (controlTransfer.validDurationOfControlTransferApplication) {
|
||||
this.count = controlTransfer.validDurationOfControlTransferApplication;
|
||||
this.dialogShow = true;
|
||||
this.requestInfo = info;
|
||||
this.disabledAgree = true;
|
||||
this.updateTableData(controlTransfer);
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 后端倒计时
|
||||
this.count = controlTransfer.validDurationOfControlTransferApplication;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
// this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
@ -271,10 +261,10 @@ export default {
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const stationCodes = [];
|
||||
const replyVOList = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
replyVOList.push({stationCode:item.code, agree:true });
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
@ -283,13 +273,10 @@ export default {
|
||||
send: true,
|
||||
cmdType: this.targetStatus == 'Center' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: true
|
||||
replyVOList: replyVOList
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
@ -301,10 +288,10 @@ export default {
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const stationCodes = [];
|
||||
const replyVOList = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
replyVOList.push({stationCode:item.code, agree:false });
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
@ -313,13 +300,9 @@ export default {
|
||||
send: true,
|
||||
cmdType: this.targetStatus == 'Center' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: false
|
||||
replyVOList: replyVOList
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
@ -13,7 +13,7 @@
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-limit ref="menuLimit" :selected="selected" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-contorl ref="passiveControl" pop-class="foshan-01__systerm" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
</div>
|
||||
</template>
|
||||
@ -33,7 +33,7 @@ import MenuStation from './menuStation';
|
||||
import MenuBar from './menuBar';
|
||||
import MenuLimit from './menuLimit';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
|
@ -1,335 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="foshan-01__systerm passive-control"
|
||||
:title="$t('menu.passiveDialog.controlModeRequest')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="foshan-01__systerm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import {SimulationType} from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
|
||||
controlProps: {
|
||||
'Center': this.$t('menu.passiveDialog.inTheControl'),
|
||||
'Local': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 55,
|
||||
count: 0,
|
||||
sourceMemberId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return 'Center';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return 'Local';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control' || elem.operateType == 'CM_Force_Station_Control')) {
|
||||
if (elem.params.stationCodes && elem.params.stationCodes.length) {
|
||||
this.doShow(elem);
|
||||
this.sourceMemberId = elem.sourceMemberId;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
// if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
let result = false;
|
||||
selection.forEach(select=>{
|
||||
if (select.control.status != select.target.status) {
|
||||
result = result || true;
|
||||
}
|
||||
});
|
||||
if (result) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(codes) {
|
||||
this.tableData = [];
|
||||
(codes || []).forEach(code=> {
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).controlMode;
|
||||
if (control) {
|
||||
model.control = { status: control, name: this.controlProps[control] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
model.operate = device.name || '';
|
||||
}
|
||||
this.tableData.push(model);
|
||||
});
|
||||
},
|
||||
doShow(msgHead) {
|
||||
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
|
||||
const simulationUserList = this.$store.state.training.simulationUserList;
|
||||
if (member) {
|
||||
let info = SimulationType[member.type];
|
||||
if (member.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
info = info + `(${device.name})`;
|
||||
}
|
||||
if (member.userId) {
|
||||
simulationUserList.forEach(item => {
|
||||
if (item.userId === member.userId) {
|
||||
info = info + '-' + item.nickName;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.requestInfo = info;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.params.stationCodes);
|
||||
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const codeList = selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: codeList.join('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
|
||||
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
send: true,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: true
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
send: true,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: false
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.control-label {
|
||||
line-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
@ -9,7 +9,7 @@
|
||||
<menu-train ref="menuTrain" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-contorl ref="passiveControl" pop-class="fuzhou-01__systerm" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
</div>
|
||||
</template>
|
||||
@ -25,7 +25,7 @@ import MenuTrain from './menuTrain';
|
||||
import MenuStation from './menuStation';
|
||||
import MenuBar from './menuBar';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
|
@ -1,328 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm passive-control"
|
||||
:title="$t('menu.passiveDialog.controlModeRequest')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="fuzhou-01__systerm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import {SimulationType} from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
|
||||
controlProps: {
|
||||
'Center': this.$t('menu.passiveDialog.inTheControl'),
|
||||
'Local': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0,
|
||||
sourceMemberId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return 'Center';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return 'Local';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control' || elem.operateType == 'CM_Force_Station_Control')) {
|
||||
if (elem.params.stationCodes && elem.params.stationCodes.length) {
|
||||
this.doShow(elem);
|
||||
this.sourceMemberId = elem.sourceMemberId;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(codes) {
|
||||
this.tableData = [];
|
||||
(codes || []).forEach(code=> {
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).controlMode;
|
||||
if (control) {
|
||||
model.control = { status: control, name: this.controlProps[control] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
model.operate = device.name || '';
|
||||
}
|
||||
this.tableData.push(model);
|
||||
});
|
||||
},
|
||||
doShow(msgHead) {
|
||||
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
|
||||
const simulationUserList = this.$store.state.training.simulationUserList;
|
||||
if (member) {
|
||||
let info = SimulationType[member.type];
|
||||
if (member.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
info = info + `(${device.name})`;
|
||||
}
|
||||
if (member.userId) {
|
||||
simulationUserList.forEach(item => {
|
||||
if (item.userId === member.userId) {
|
||||
info = info + '-' + item.nickName;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.requestInfo = info;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.params.stationCodes);
|
||||
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const codeList = selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: codeList.join('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
|
||||
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
send: true,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: true
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const stationCodes = [];
|
||||
this.tableData.forEach(item => {
|
||||
if (item.agree) {
|
||||
stationCodes.push(item.code);
|
||||
}
|
||||
});
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
send: true,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
sourceMemberId: this.sourceMemberId,
|
||||
stationCodes: stationCodes,
|
||||
agree: false
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.control-label {
|
||||
line-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
@ -2,15 +2,15 @@
|
||||
<div class="menus" :style="{width: width + 'px'}">
|
||||
<menu-cancel ref="menuCancel" />
|
||||
<menu-bar v-if="$store.state.training.prdType === '01'" ref="menuBar" :selected="selected" />
|
||||
<menu-station-stand ref="menuStationStand" :selected="selected" />
|
||||
<menu-station-stand ref="menuStationStand" :selected="selected" />
|
||||
<menu-train ref="menuTrain" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-section ref="menuSection" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-section ref="menuSection" :selected="selected" />
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-button v-if="isShowButton" ref="menuButton" :selected="selected" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-contorl ref="passiveControl" pop-class="haerbin-01__systerm" />
|
||||
<passive-Timeout ref="passiveTimeout" />
|
||||
</div>
|
||||
</template>
|
||||
@ -27,7 +27,7 @@ import MenuSection from './menuSection';
|
||||
import MenuStation from './menuStation';
|
||||
import MenuStationStand from './menuStationStand';
|
||||
import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
@ -36,13 +36,13 @@ export default {
|
||||
MenuBar,
|
||||
MenuButton,
|
||||
MenuCancel,
|
||||
MenuTrain,
|
||||
MenuSignal,
|
||||
MenuSwitch,
|
||||
MenuSection,
|
||||
MenuStation,
|
||||
MenuStationStand,
|
||||
PassiveAlarm,
|
||||
MenuTrain,
|
||||
MenuSignal,
|
||||
MenuSwitch,
|
||||
MenuSection,
|
||||
MenuStation,
|
||||
MenuStationStand,
|
||||
PassiveAlarm,
|
||||
PassiveContorl,
|
||||
PassiveTimeout
|
||||
},
|
||||
|
@ -1,309 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="haerbin-01__systerm passive-control"
|
||||
:title="$t('menu.passiveDialog.controlModeRequest')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
|
||||
controlProps: {
|
||||
'01': this.$t('menu.passiveDialog.inTheControl'),
|
||||
'02': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0,
|
||||
commandId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return '01';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return '02';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'req') {
|
||||
if (elem.stationControlCode) {
|
||||
this.doShow(elem);
|
||||
this.commandId = elem.commandId;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(code) {
|
||||
this.tableData = [];
|
||||
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).state;
|
||||
if (control) {
|
||||
model.control = { status: control.status, name: this.controlProps[control.status] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
|
||||
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (station) {
|
||||
model.operate = station.name || '';
|
||||
}
|
||||
}
|
||||
|
||||
this.tableData.push(model);
|
||||
},
|
||||
doShow(msgHead) {
|
||||
this.requestInfo = `${msgHead.fromMember.deviceName}`;
|
||||
if (msgHead.fromMember.nickName) {
|
||||
this.requestInfo = `${msgHead.fromMember.deviceName}(${msgHead.fromMember.nickName})`;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.stationControlCode);
|
||||
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const codeList = selection.map(elem => { return elem.code; });
|
||||
const operate = {
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: codeList.join('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
|
||||
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
code: this.tableData[0].code,
|
||||
val: this.commandId,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
ControlMode_Code: this.tableData[0].code,
|
||||
Reply_Command_Id: this.commandId,
|
||||
ControlMode_Reply: true
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const operate = {
|
||||
start: true,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
code: this.tableData[0].code,
|
||||
val: this.commandId,
|
||||
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
|
||||
param: {
|
||||
ControlMode_Code: this.tableData[0].code,
|
||||
Reply_Command_Id: this.commandId,
|
||||
ControlMode_Reply: false
|
||||
}
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.control-label {
|
||||
line-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
@ -286,7 +286,6 @@ export default {
|
||||
|
||||
/** 添加车组号数据到对应的服务图数据中*/
|
||||
serie.data.push(nextPoint);
|
||||
|
||||
/** 保证原始数据排序*/
|
||||
serie.data.sort((a, b) => {
|
||||
return parseInt(a[0]) - parseInt(b[0]);
|
||||
|
@ -14,7 +14,7 @@
|
||||
<menu-station ref="menuStation" :selected="selected" />
|
||||
<menu-limit ref="menuLimit" :selected="selected" />
|
||||
<!--<passive-alarm ref="passiveAlarm" />-->
|
||||
<passive-contorl ref="passiveControl" />
|
||||
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" />
|
||||
<!--<passive-Timeout ref="passiveTimeout" />-->
|
||||
</div>
|
||||
</template>
|
||||
@ -35,7 +35,7 @@ import MenuBar from './menuBar';
|
||||
import MenuLimit from './menuLimit';
|
||||
import MenuStationTurnBack from './menuStationTurnBack';
|
||||
// import PassiveAlarm from './passiveDialog/alarm';
|
||||
import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
|
||||
// import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
|
@ -234,7 +234,8 @@ const map = {
|
||||
jumpStandList: [], // 跳停站台列表
|
||||
jumpStatus: false, // 是否有跳停状态
|
||||
selectDeviceFlag: false, // 设备管理激活判断
|
||||
keyboardEnterCount: 0 // 键盘enter键触发
|
||||
keyboardEnterCount: 0, // 键盘enter键触发
|
||||
controlTransfer:{} // 控制权转移消息
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -871,6 +872,9 @@ const map = {
|
||||
},
|
||||
setKeyboardEnter: (state) => {
|
||||
state.keyboardEnterCount++;
|
||||
},
|
||||
setControlTransfer:(state, controlTransfer)=> {
|
||||
state.controlTransfer = controlTransfer;
|
||||
}
|
||||
},
|
||||
|
||||
@ -1072,6 +1076,9 @@ const map = {
|
||||
},
|
||||
setKeyboardEnter: ({ commit }) => {
|
||||
commit('setKeyboardEnter');
|
||||
},
|
||||
setControlTransfer:({ commit }, data) => {
|
||||
commit('setControlTransfer', data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -102,7 +102,7 @@ const runPlan = {
|
||||
}
|
||||
},
|
||||
clear: (state) => {
|
||||
state.stations = [];
|
||||
// state.stations = [];
|
||||
state.planData = {};
|
||||
state.editData = {};
|
||||
state.selected = {};
|
||||
|
@ -66,9 +66,11 @@ function handle(state, data) {
|
||||
case 'Simulation_PlayBack_Conversation': // 回放-用户交互消息
|
||||
handleSimulationInfo(state, msg);
|
||||
break;
|
||||
case 'Simulation_ApplyHandle': // 请求处理消息
|
||||
|
||||
case 'Simulation_ApplyHandle': // 请求处理消息(旧版可能在用,新版地图不用这个)
|
||||
handlePushMsgQueue(state, msg);
|
||||
break;
|
||||
|
||||
case 'JointTraining_User_Permit': // 综合演练室-用户获取权限消息
|
||||
state.userPermit = msg;
|
||||
break;
|
||||
@ -183,6 +185,7 @@ function handleSimulationUserinfo(state, data) {
|
||||
state.simulationRoleList = (data instanceof Array) ? data : [data];
|
||||
}
|
||||
|
||||
// (旧版可能在用,新版地图不用这个)
|
||||
function handlePushMsgQueue(state, msg) {
|
||||
if (msg instanceof Array) {
|
||||
state.msgQueue.concat(msg);
|
||||
@ -224,8 +227,8 @@ const socket = {
|
||||
conversationInfo: {}, // 仿真会话消息
|
||||
|
||||
message: {}, // 仿真聊天
|
||||
msgQueue: [], // 命令请求列表
|
||||
msgHead: null, // 消息头
|
||||
msgQueue: [], // 命令请求列表(旧版控制权转移可能在用,新版不用这个)
|
||||
msgHead: null, // 消息头(旧版控制权转移可能在用,新版不用这个)
|
||||
|
||||
userPermit: {}, // 用户获取权限消息
|
||||
userRoomKickOut: {}, // 用户被踢出房间消息
|
||||
@ -279,11 +282,14 @@ const socket = {
|
||||
state.payOrder = payOrder;
|
||||
},
|
||||
|
||||
// (旧版可能在用,新版地图不用这个)
|
||||
shiftMsgQueue: (state) => {
|
||||
state.msgHead = null;
|
||||
state.msgQueue.shift();
|
||||
state.msgHead = state.msgQueue[0];
|
||||
},
|
||||
|
||||
// (旧版可能在用,新版地图不用这个)
|
||||
pushMsgQueue: (state, msg) => {
|
||||
handlePushMsgQueue(state, msg);
|
||||
},
|
||||
@ -355,9 +361,9 @@ const socket = {
|
||||
commit('shiftMsgQueue');
|
||||
},
|
||||
|
||||
pushMsgQueue: ({ commit }, msg) => {
|
||||
commit('pushMsgQueue', msg);
|
||||
},
|
||||
// pushMsgQueue: ({ commit }, msg) => {
|
||||
// commit('pushMsgQueue', msg);
|
||||
// },
|
||||
setRoomSubscribe:({ commit }, msg) => {
|
||||
commit('setRoomSubscribe', msg);
|
||||
},
|
||||
|
@ -34,6 +34,7 @@ const training = {
|
||||
initTime: 0, // 当前系统时间
|
||||
prdType: '', // 产品类型
|
||||
roles: '', // 角色权限类型
|
||||
roleDeviceCode:'', // 当前角色对应的deviceCode
|
||||
group: '', // 设置全局 group
|
||||
centerStationCode:'', // 当前居中的集中站code
|
||||
memberList: [], // 综合仿真成员列表
|
||||
@ -282,6 +283,9 @@ const training = {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
setRoleDeviceCode :(state, roleDeviceCode) => {
|
||||
state.roleDeviceCode = roleDeviceCode;
|
||||
}
|
||||
},
|
||||
|
||||
@ -698,6 +702,10 @@ const training = {
|
||||
/** 更新剧本所有成员列表 */
|
||||
updateMemberListInScript:({ commit }, data) => {
|
||||
commit('updateMemberListInScript', data);
|
||||
},
|
||||
/** 更新当前角色的deviceCode */
|
||||
setRoleDeviceCode:({ commit }, roleDeviceCode) => {
|
||||
commit('setRoleDeviceCode', roleDeviceCode);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="icon-box" :style="{top: offset+'px'}">
|
||||
<div id="textStatus" class="icon-box" :style="{top: offset+'px'}">
|
||||
<div class="textStatus" :style="{background: holdBackground}" @mouseenter="showHoldStatus" @mouseleave="hideHoldStatus">H</div>
|
||||
<div class="textStatus" :style="{background: jumpBackground}" @mouseenter="showJumpStatus" @mouseleave="hideJumpStatus">S</div>
|
||||
<pop-tip v-show="popShow" :position="position" :tip="tip" />
|
||||
|
@ -41,7 +41,6 @@ import DataTable from '@/views/planSchedule/menusPlan/components/dataTable';
|
||||
import echarts from 'echarts';
|
||||
import {toTimeStamp, formatDuring} from '@/utils/date';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'PlanSchedule',
|
||||
@ -98,13 +97,10 @@ export default {
|
||||
indexKmRangeMap: {},
|
||||
dialogLoading: false,
|
||||
dialogShow: false,
|
||||
series: [],
|
||||
oldseries:[],
|
||||
trainLabelPosition:0,
|
||||
updateCount: 0,
|
||||
op: null,
|
||||
updateData: [],
|
||||
seriesMap: {}
|
||||
seriesMap: {},
|
||||
staticSeries: [],
|
||||
runSeries: [],
|
||||
selectSeries: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -128,17 +124,11 @@ export default {
|
||||
maxHeight() {
|
||||
this.setPosition();
|
||||
},
|
||||
updateCount() {
|
||||
if (this.updateCount > 0) {
|
||||
this.myChart && this.myChart.setOption(this.op, true);
|
||||
this.updateCount = 0;
|
||||
}
|
||||
},
|
||||
'$store.state.runPlan.planLoadedCount': async function () {
|
||||
try {
|
||||
await this.loadChartPage();
|
||||
if (this.dialogShow) {
|
||||
await this.loadInitData(this.series);
|
||||
await this.loadInitData();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
@ -156,10 +146,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(res=>{
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(res.data.lineCode);
|
||||
// this.loadChartPage();
|
||||
});
|
||||
this.staticSeries = []; this.selectSeries = []; this.runSeries = [];
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.lineCode);
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroy();
|
||||
@ -170,7 +158,7 @@ export default {
|
||||
this.dialogLoading = true;
|
||||
this.dialogShow = true;
|
||||
this.setPosition();
|
||||
this.loadInitData(this.series);
|
||||
this.loadInitData();
|
||||
this.inter && clearInterval(this.inter);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
@ -227,36 +215,10 @@ export default {
|
||||
});
|
||||
},
|
||||
updateRunPlanData(data) {
|
||||
if (this.myChart) {
|
||||
const stations = this.$store.state.runPlan.stations;
|
||||
const planData = this.$store.state.runPlan.planData;
|
||||
const initialPlanData = this.$store.state.runPlan.initialPlanData;
|
||||
data.forEach(item => {
|
||||
if (item && initialPlanData[item.serviceNumber]) {
|
||||
Object.keys(initialPlanData[item.serviceNumber].trainMap).forEach(ele => {
|
||||
if (initialPlanData[item.serviceNumber].trainMap[ele + ''].tripNumber == item.tripNumber) {
|
||||
item.directionCode = initialPlanData[item.serviceNumber].trainMap[ele + ''].directionCode;
|
||||
}
|
||||
});
|
||||
item.secondTime = item.second;
|
||||
}
|
||||
});
|
||||
const op = this.myChart.getOption();
|
||||
op.series = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
|
||||
planData, op.series, { color: '#FF00DE', width: 2 }
|
||||
);
|
||||
this.series = op.series;
|
||||
this.op = op;
|
||||
this.updateCount++;
|
||||
} else {
|
||||
this.updateData = [...this.updateData, ...data];
|
||||
}
|
||||
},
|
||||
handlerUpdateData() {
|
||||
const stations = this.$store.state.runPlan.stations;
|
||||
const planData = this.$store.state.runPlan.planData;
|
||||
const initialPlanData = this.$store.state.runPlan.initialPlanData;
|
||||
this.updateData.forEach(item => {
|
||||
data.forEach(item => {
|
||||
if (item && initialPlanData[item.serviceNumber]) {
|
||||
Object.keys(initialPlanData[item.serviceNumber].trainMap).forEach(ele => {
|
||||
if (initialPlanData[item.serviceNumber].trainMap[ele + ''].tripNumber == item.tripNumber) {
|
||||
@ -266,25 +228,23 @@ export default {
|
||||
item.secondTime = item.second;
|
||||
}
|
||||
});
|
||||
const op = this.myChart.getOption();
|
||||
op.series = this.PlanConvert.updateDataToModels(this.updateData, stations, this.kmRangeCoordMap,
|
||||
planData, op.series, { color: '#FF00DE', width: 2 }
|
||||
this.runSeries = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
|
||||
planData, this.runSeries, { color: '#FF00DE', width: 2 }
|
||||
);
|
||||
this.series = op.series;
|
||||
this.op = op;
|
||||
this.updateCount++;
|
||||
this.updateData = [];
|
||||
if (this.myChart) {
|
||||
const series = [...this.staticSeries, ...this.runSeries, ... this.selectSeries];
|
||||
this.myChart && this.myChart.setOption({series: series});
|
||||
}
|
||||
},
|
||||
async loadChartPage() {
|
||||
try {
|
||||
this.series = [];
|
||||
this.seriesMap = {};
|
||||
const stations = this.$store.state.runPlan.stations;
|
||||
const planData = this.$store.state.runPlan.planData;
|
||||
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
|
||||
this.pushModels(this.series, [this.PlanConvert.initializeYaxis(stations)]);
|
||||
this.oldseries = this.pushModels(this.series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { color: '#000', width: 1 }));
|
||||
this.oldseries.forEach(item => {
|
||||
this.pushModels(this.staticSeries, [this.PlanConvert.initializeYaxis(stations)]);
|
||||
this.staticSeries = this.pushModels(this.staticSeries, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { color: '#000', width: 0.5 }));
|
||||
this.staticSeries.forEach(item => {
|
||||
this.seriesMap[item.name] = item;
|
||||
});
|
||||
await this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
@ -293,7 +253,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async loadInitData(series) {
|
||||
async loadInitData() {
|
||||
this.myChart && this.myChart.showLoading();
|
||||
const option = {
|
||||
title: {
|
||||
@ -398,9 +358,8 @@ export default {
|
||||
};
|
||||
await this.xAxisInit(option);
|
||||
await this.yAxisInit(option);
|
||||
await this.loadInitChart(series, option);
|
||||
await this.loadInitChart(option);
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
this.handlerUpdateData();
|
||||
},
|
||||
|
||||
pushModels(series, models) {
|
||||
@ -425,7 +384,7 @@ export default {
|
||||
}
|
||||
return series;
|
||||
},
|
||||
loadInitChart(series, option) {
|
||||
loadInitChart(option) {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
this.destroy();
|
||||
@ -435,7 +394,7 @@ export default {
|
||||
startValue = initTime - this.PlanConvert.TranslationTime;
|
||||
option.dataZoom[0].startValue = option.dataZoom[1].startValue = startValue - offsetTime;
|
||||
option.dataZoom[0].endValue = option.dataZoom[1].endValue = startValue + offsetTime;
|
||||
option.series = series;
|
||||
option.series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries];
|
||||
this.myChart = echarts.init(document.getElementById(this.runPlanId));
|
||||
if (this.myChart) {
|
||||
this.myChart.setOption(option);
|
||||
@ -500,11 +459,6 @@ export default {
|
||||
const tripNumber = params.tripNumber; // 车次号
|
||||
const serviceNumber = params.serviceNumber; // 服务号
|
||||
let data, markPoint;
|
||||
const op = this.myChart.getOption();
|
||||
if (this.trainLabelPosition > 0) {
|
||||
op.series.splice(this.trainLabelPosition - 1, 1);
|
||||
this.myChart && this.myChart.setOption(op, true);
|
||||
}
|
||||
if (tripNumber && this.seriesMap[serviceNumber]) {
|
||||
const temp = this.seriesMap[serviceNumber].data.filter(elem => elem[3] == tripNumber);
|
||||
if (temp.length) {
|
||||
@ -525,31 +479,7 @@ export default {
|
||||
});
|
||||
data = this.seriesMap[serviceNumber].data;
|
||||
}
|
||||
// this.oldseries.forEach((item, index) => {
|
||||
// if (item.name == serviceNumber && item.data) {
|
||||
// if (tripNumber) {
|
||||
// const temp = item.data.filter(elem => elem[3] == tripNumber);
|
||||
// if (temp.length) {
|
||||
// data = temp;
|
||||
// item.markPoint.data.forEach(each=>{
|
||||
// if (each.name == temp[0][4]) {
|
||||
// markPoint = deepAssign({}, {data:[each]});
|
||||
// markPoint.symbol = 'roundRect';
|
||||
// markPoint.symbolSize = 1;
|
||||
// markPoint.data[0].label.color = '#f00';
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
// markPoint = deepAssign({}, item.markPoint);
|
||||
// markPoint.data.forEach(each=>{
|
||||
// each.label.color = '#f00';
|
||||
// });
|
||||
// data = item.data;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
op.series.push({
|
||||
this.selectSeries = [{
|
||||
name: 'trainLabel',
|
||||
lineStyle: {
|
||||
color: '#f00',
|
||||
@ -559,11 +489,11 @@ export default {
|
||||
z: 10,
|
||||
type: 'line',
|
||||
markPoint:markPoint,
|
||||
animation: false,
|
||||
data: data
|
||||
});
|
||||
this.trainLabelPosition = op.series.length;
|
||||
this.op = op;
|
||||
this.updateCount++;
|
||||
}];
|
||||
const series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries];
|
||||
this.myChart && this.myChart.setOption({series: series});
|
||||
},
|
||||
mouseClick(params) {
|
||||
const model = {
|
||||
|
@ -13,6 +13,7 @@
|
||||
:data-error="dataError"
|
||||
:script-id="scriptId"
|
||||
:show-station="showStation"
|
||||
:text-status-height="textStatusHeight"
|
||||
@hidepanel="hidepanel"
|
||||
@passflow="passflow"
|
||||
@quitQuest="quitQuest"
|
||||
@ -161,7 +162,8 @@ export default {
|
||||
'04': '02', // 司机 => 行调
|
||||
'05': '' // 派班 => null
|
||||
},
|
||||
planRunning:false
|
||||
planRunning:false,
|
||||
textStatusHeight: 0
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
@ -521,6 +523,7 @@ export default {
|
||||
const menuTool = document.getElementById('menuTool');
|
||||
const menuBottom = document.getElementById('menuButton');
|
||||
const menuButtonsBox = document.getElementById('menuButtons_box');
|
||||
const textStatus = document.getElementById('textStatus');
|
||||
if (menuBar) {
|
||||
this.offset = (menuBar.offsetHeight || 0) + 15;
|
||||
}
|
||||
@ -534,6 +537,9 @@ export default {
|
||||
if (menuButtonsBox) {
|
||||
this.tipBottom = (menuButtonsBox.offsetHeight || 0) + 15;
|
||||
}
|
||||
if (textStatus) {
|
||||
this.textStatusHeight = textStatus.offsetHeight || 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
setCenter(code) {
|
||||
|
@ -6,9 +6,10 @@
|
||||
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-if="!dataError" class="display_top_draft" :style="{top: offset+'px'}">
|
||||
<div v-if="!dataError" class="display_top_draft" :style="{top: offset+textStatusHeight+'px'}">
|
||||
<div class="btn_hover" @click="menuClick">菜单</div>
|
||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`transform: translateX(-${btnWidth}px)`">
|
||||
<!-- :style="`transform: translateX(-${btnWidth}px)`" -->
|
||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
||||
<!-- 地图错误判断 -->
|
||||
<!-- 设备视图 -->
|
||||
<el-button v-if="isShow3dmodel && !isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
|
||||
@ -84,6 +85,12 @@ export default {
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
textStatusHeight: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -357,6 +364,7 @@ export default {
|
||||
// this.$refs.button_group_box.$el.clientWidth ||
|
||||
this.btnWidth = 500; // 默认宽度
|
||||
} else {
|
||||
// button_group_box
|
||||
this.btnWidth = 0;
|
||||
}
|
||||
}
|
||||
@ -451,7 +459,8 @@ export default {
|
||||
float: left;
|
||||
transition: all 0.5s;
|
||||
overflow: hidden;
|
||||
transform: translateX(0px);
|
||||
margin-left: -500px;
|
||||
// transform: translateX(0px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -13,8 +13,8 @@
|
||||
<!-- 加载剧本 -->
|
||||
<el-button v-if="isDemon && !isDesignPlatform && !isScheduling" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
|
||||
<!-- 运行图加载 -->
|
||||
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
|
||||
<el-button v-if="notScript && !runing" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
|
||||
<el-button v-if="notScript && running" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
|
||||
<el-button v-if="notScript && !running" size="small" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
|
||||
<el-button v-if="faultMode" size="small" type="danger" @click="setFault">自动故障设置</el-button>
|
||||
</el-button-group>
|
||||
<el-button v-if="!isScheduling" size="small" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
|
||||
@ -83,7 +83,6 @@ export default {
|
||||
mode: OperateMode.NORMAL,
|
||||
OperateMode: OperateMode,
|
||||
viewDisabled: true,
|
||||
runing: false,
|
||||
swch: '02',
|
||||
showStationContent:'',
|
||||
isScriptCommand:false,
|
||||
@ -120,20 +119,15 @@ export default {
|
||||
drawWay() {
|
||||
const drawWay = this.$route.query.drawWay;
|
||||
return drawWay && JSON.parse(drawWay);
|
||||
},
|
||||
running() {
|
||||
return this.$store.state.training.started;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.simulationStart':function(val) {
|
||||
if (val) {
|
||||
this.setRuning(true);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationReset':function(val) {
|
||||
this.setRuning(false);
|
||||
},
|
||||
'$store.state.training.switchcount': async function () {
|
||||
if (this.group) {
|
||||
if (this.$store.state.training.started) {
|
||||
if (this.$store.state.training.started && !this.firstLoad) {
|
||||
await this.loadRunData();
|
||||
} else if (this.firstLoad) {
|
||||
await this.loadRunData(this.$route.query);
|
||||
@ -200,14 +194,6 @@ export default {
|
||||
// }
|
||||
// this.$store.dispatch('training/changeOperateMode', { mode: mode });
|
||||
// },
|
||||
setRuning(run) {
|
||||
this.runing = run;
|
||||
if (run) {
|
||||
this.$refs.runPlanLoad.doClose();
|
||||
} else {
|
||||
this.$refs.runPlanView.doClose();
|
||||
}
|
||||
},
|
||||
setFault() {
|
||||
this.$refs.faultChoose.doShow();
|
||||
},
|
||||
|
@ -69,7 +69,7 @@ import menuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
||||
import IbpPlate from '@/views/ibp/ibpsystem/index';
|
||||
import MenuTrainList from './menuTrainList';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||
import { clearSimulation, getSimulationInfoNew, getSimulationUserInfo, getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
|
||||
import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
|
||||
@ -322,6 +322,8 @@ export default {
|
||||
} else {
|
||||
this.$store.dispatch('training/over');// 仿真按计划行车结束
|
||||
}
|
||||
this.$store.dispatch('training/changeMode', {mode:TrainingMode.NORMAL});
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
|
||||
this.dataError = true;
|
||||
this.$messageBox('此地图数据正在维护中,无法运行!');
|
||||
@ -333,6 +335,7 @@ export default {
|
||||
const data = res.data || {};
|
||||
this.userRole = data.type || 'AUDIENCE';
|
||||
this.deviceCode = data.deviceCode;
|
||||
this.$store.dispatch('training/setRoleDeviceCode', data.deviceCode);
|
||||
this.isAdmin = data.admin;
|
||||
|
||||
const deviceVO = this.$store.state.user.projectDevice;
|
||||
@ -347,9 +350,6 @@ export default {
|
||||
},
|
||||
// 仿真系统
|
||||
async initLoadDemonData() {
|
||||
// this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
|
||||
if (this.lineCode) {
|
||||
// 01 现地 02 行调 '' 观众
|
||||
let resp = {data: {}};
|
||||
@ -613,6 +613,7 @@ export default {
|
||||
this.$refs.demonMenu.back();
|
||||
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
|
||||
this.userRole = item.type || 'AUDIENCE';
|
||||
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
||||
this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
|
||||
this.$nextTick(() => {
|
||||
if (item.deviceCode) { this.setCenter(item.deviceCode); }
|
||||
|
@ -5,7 +5,8 @@
|
||||
<!-- 地图错误判断 -->
|
||||
<div v-if="!dataError&&hasOneButton" class="display_top_draft" :style="{top: offset+'px'}">
|
||||
<div class="btn_hover" @click="menuClick">菜单</div>
|
||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`transform: translateX(-${btnWidth}px)`">
|
||||
<!-- transform: translateX(-${btnWidth}px) -->
|
||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
||||
<!-- 设备视图 -->
|
||||
<el-button v-if="isShow3dmodel && isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
|
||||
<!-- 三维视图 / 司机视角 -->
|
||||
@ -190,12 +191,30 @@ export default {
|
||||
this.menuClick();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
async beforeDestroy() {
|
||||
this.$store.dispatch('training/setGroup', '');
|
||||
if (this.project === 'jsxt') {
|
||||
quitCurrentRace(this.$route.query.raceId, {group:this.group}).then(res=>{
|
||||
});
|
||||
}
|
||||
// 返回 销毁仿真 重置状态
|
||||
this.isGoback = true;
|
||||
if (this.isAdmin) {
|
||||
await clearSimulation(this.group);
|
||||
}
|
||||
this.$store.dispatch('training/setMemberList', {memberList:[], userId: this.$store.state.user.id});
|
||||
this.$store.dispatch('training/setSimulationUserList', []);
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.backLoading = true;
|
||||
this.$store.dispatch('map/resetActiveTrainList');
|
||||
if (this.$route.query.projectDevice) {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
exitFullscreen();
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 设置用户角色 Admin 管理员 Instructor 教员 Dispatcher 行调 Attendant 车站 Audience 观众 Driver 司机 MAINTAINER 通号
|
||||
@ -550,7 +569,8 @@ export default {
|
||||
float: left;
|
||||
transition: all 0.5s;
|
||||
overflow: hidden;
|
||||
transform: translateX(0px);
|
||||
// transform: translateX(0px);
|
||||
margin-left: -500px;
|
||||
}
|
||||
}
|
||||
.haerbin_btn_box{
|
||||
|
@ -141,9 +141,6 @@ export default {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Map)) {
|
||||
this.menu = [...this.menuMap];
|
||||
// if (this.hasRelease) {
|
||||
// this.menu.push(this.publishMapMenu);
|
||||
// }
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
|
||||
this.initCancelMenu();
|
||||
|
@ -16,7 +16,7 @@
|
||||
<jlmap-visual ref="jlmapVisual" :draft-show="draftShow" @onSelect="clickEvent" @onMenu="onContextmenu" />
|
||||
</div>
|
||||
<div class="map-draft" :class="{'hide': draftShow}">
|
||||
<div class="btn_left_box" @click="clickRightBtn"><i class="el-icon-arrow-left" /></div>
|
||||
<div class="btn_left_box" @click="clickRightBtn"><i :class="draftShow?'el-icon-arrow-right':'el-icon-arrow-left'" /></div>
|
||||
<div v-show="viewDraft == 'draft'" class="box">
|
||||
<map-operate
|
||||
ref="mapOperate"
|
||||
|
@ -114,6 +114,7 @@ class Model {
|
||||
this.visible = true;
|
||||
this.runPlanName = '';
|
||||
this.name = '';
|
||||
this.sn = '';
|
||||
this.jp = ''; // 车站简写编码
|
||||
this.nameFont = '22';
|
||||
this.nameFontColor = '#FFFFFF';
|
||||
@ -129,7 +130,8 @@ class Model {
|
||||
this.kmPostFontColor = '#FFFFFF';
|
||||
this.isShowControlMode = '';
|
||||
this.chargeStationCodeList = [];
|
||||
this.relStationCodeList = []; // 联锁站关联车站列表
|
||||
this.relStationCodeList = []; // 生成交路车站列表
|
||||
this.routingStationList = []; // 联锁站关联车站列表
|
||||
this.position = { x: 0, y: 0 };
|
||||
this.kilometerPosition = { x: 0, y: 0 }; // 公里标偏移坐标
|
||||
this.createControlMode = false;
|
||||
|
@ -63,24 +63,31 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.batchSettings')" name="three" :lazy="lazy">
|
||||
<div style="height: 100%;overflow:auto">
|
||||
<el-form ref="oprt" :model="allModel" label-width="130px" size="mini">
|
||||
<el-form-item label="车站字体大小:" prop="nameFont">
|
||||
<el-font v-model="allModel.nameFont" :placeholder="this.$t('tip.stationFont')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公里标字体大小:" prop="kmPostFont">
|
||||
<el-font v-model="allModel.kmPostFont" :placeholder="this.$t('tip.stationFont')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车站Y坐标:" prop="positionY">
|
||||
<el-input-number v-model="allModel.positionY" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="batchSettings">{{ $t('global.set') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-collapse v-model="collapseActive" accordion style="margin-left: 20px; height: 100%; overflow: auto;">
|
||||
<el-collapse-item title="车站字体设置" name="1">
|
||||
<el-form ref="oprt" :model="allModel" label-width="130px" size="mini">
|
||||
<el-form-item label="车站字体大小:" prop="nameFont">
|
||||
<el-font v-model="allModel.nameFont" :placeholder="this.$t('tip.stationFont')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公里标字体大小:" prop="kmPostFont">
|
||||
<el-font v-model="allModel.kmPostFont" :placeholder="this.$t('tip.stationFont')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车站Y坐标:" prop="positionY">
|
||||
<el-input-number v-model="allModel.positionY" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="batchSettings">{{ $t('global.set') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="批量设置车站序号" name="2">
|
||||
<el-button-group>
|
||||
<el-button type="primary" size="mini" style="margin-left: 130px;" @click="setAllStationSn">设置</el-button>
|
||||
</el-button-group>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
@ -102,8 +109,8 @@ export default {
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return null;
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -111,7 +118,8 @@ export default {
|
||||
return {
|
||||
activeName: 'first',
|
||||
lazy: true,
|
||||
// field: '',
|
||||
field: '',
|
||||
collapseActive: '',
|
||||
chargeStation:[],
|
||||
relStationList: [], // 车站列表
|
||||
controlled:false,
|
||||
@ -155,6 +163,7 @@ export default {
|
||||
{ prop: 'code', label: this.$t('map.stationCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.stationName'), type: 'input' },
|
||||
{ prop: 'number', label: this.$t('map.stationNumber'), type: 'input' },
|
||||
{ prop: 'sn', label: '车站序号', type: 'input' },
|
||||
{ prop: 'position', label: this.$t('map.stationPosition'), type: 'coordinate', width: '120px', children: [
|
||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||
@ -203,6 +212,7 @@ export default {
|
||||
{ prop: 'zcCode', label: this.$t('map.zcCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList, isHidden: !this.isZcCode, disabled:true },
|
||||
{ prop: 'chargeStationCodeList', label: '管理车站列表:', type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.chargeStation, isHidden: !this.isZcCode },
|
||||
{ prop: 'relStationCodeList', label: '联锁站关联车站:', type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.relStationList, isHidden: !this.idCiStation},
|
||||
{ prop: 'routingStationList', label: '生成交路的车站:', type: 'multiSelectHover', optionLabel: 'name', optionValue: 'code', options: this.stationList, hover: this.hover, buttonType: 'routingStation', buttonShowType: this.routingStationButtonShow },
|
||||
{ prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' },
|
||||
{ prop: 'jp', label: '车站简称', type: 'input' }
|
||||
]
|
||||
@ -247,15 +257,26 @@ export default {
|
||||
},
|
||||
isReentry() {
|
||||
return this.editModel.reentry;
|
||||
},
|
||||
routingStationButtonShow() {
|
||||
return this.field === 'routingStation';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hover(field) {
|
||||
this.field = field == this.field ? '' : field;
|
||||
if (this.field) {
|
||||
this.$emit('deviceSelect', 'Station');
|
||||
} else {
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
},
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field != 'routingStation') {
|
||||
this.editModel = getModel('Station');
|
||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||
this.activeName = 'first';
|
||||
@ -269,7 +290,7 @@ export default {
|
||||
beCentralizedStation[charge] = data.code;
|
||||
});
|
||||
}
|
||||
if (data.ciStation && data.code != this.selected.code) {
|
||||
if (data.ciStation && this.selected && data.code != this.selected.code) {
|
||||
const arr = data.relStationCodeList || [];
|
||||
arr.forEach(stationCode => {
|
||||
this.relStationList.forEach((data, index) => {
|
||||
@ -285,6 +306,11 @@ export default {
|
||||
return !data.centralized && data.code != this.editModel.code && !(beCentralizedStation[data.code] && beCentralizedStation[data.code] != this.editModel.code);
|
||||
});
|
||||
this.controlled = !!beCentralizedStation[selected.code];
|
||||
} else if (selected && selected._type === 'Station' && this.field == 'routingStation') {
|
||||
this.activeName = 'first';
|
||||
if (!this.editModel.routingStationList.includes(selected.code) && this.editModel.code != selected.code) {
|
||||
this.editModel.routingStationList.push(selected.code);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 选择管理车站
|
||||
@ -422,6 +448,18 @@ export default {
|
||||
handleDelete(index, row) {
|
||||
this.addModel.modelList.splice(index, 1);
|
||||
},
|
||||
setAllStationSn() {
|
||||
const arr = [];
|
||||
this.stationList.forEach(station => {
|
||||
const stationModel = deepAssign({}, station);
|
||||
arr.push(stationModel);
|
||||
});
|
||||
arr.sort((a, b) => a.position.x - b.position.x);
|
||||
arr.forEach((item, index) => {
|
||||
item.sn = index + 1;
|
||||
});
|
||||
this.$emit('updateMapModel', arr);
|
||||
},
|
||||
addModelList() {
|
||||
this.addModel.modelList.push({
|
||||
sectionCode: '',
|
||||
|
@ -121,6 +121,7 @@ export default {
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
font-size: smaller !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ export default {
|
||||
}
|
||||
if (item.name == 'trainLabel') {
|
||||
op.series.pop();
|
||||
this.myChart && this.myChart.setOption(op, true);
|
||||
this.myChart && this.myChart.setOption(op);
|
||||
}
|
||||
});
|
||||
op.series.push({
|
||||
@ -453,11 +453,12 @@ export default {
|
||||
z: 10,
|
||||
type: 'line',
|
||||
markPoint:markPoint,
|
||||
animation: false,
|
||||
data: data
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.myChart && this.myChart.setOption(op, true);
|
||||
this.myChart && this.myChart.setOption(op);
|
||||
}, 50);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user