Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2023-05-30 17:55:25 +08:00
commit ca329a4db7
57 changed files with 920 additions and 156 deletions

9
.env.sai Normal file
View File

@ -0,0 +1,9 @@
# just a flag
NODE_ENV = 'production'
VUE_APP_PRO = 'common'
# base api
# VUE_APP_BASE_API = 'http://160.20.60.15:9000'
# VUE_APP_VOICE_API = 'http://160.20.60.15/oss/joylink'
# VUE_APP_UPLOAD_API = 'http://160.20.60.15'
# VUE_APP_BASE_SITE='http://160.20.60.15'

View File

@ -166,3 +166,19 @@ export function clearDesignTraining(trainingId, group) {
method: 'delete'
});
}
/** 导出实训数据 */
export function exportTrainingData(data) {
return request({
url: `/api/v2/training/published/export`,
method: 'post',
data
});
}
/** 导入实训数据 */
export function importTrainingData(data) {
return request({
url: `/api/v2/training/published/import`,
method: 'post',
data
});
}

View File

@ -635,6 +635,19 @@ class SkinCode extends defaultStyle {
controlColor: 'red' // 控制灯颜色 (灰色)
}
};
/* 上电解锁 */
this[deviceType.PowerUnLock] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小
controlColor: 'red' // 控制灯颜色 (灰色)
}
};
/** 引导总锁 */
this[deviceType.GuideLock] = {

View File

@ -347,4 +347,9 @@ deviceRender[deviceType.Counter] = {
_type: deviceType.Counter,
zlevel: 1
};
/** PowerUnLock 上电解锁*/
deviceRender[deviceType.PowerUnLock] = {
_type: deviceType.PowerUnLock,
zlevel: 1
};
export default deviceRender;

View File

@ -63,6 +63,7 @@ const deviceType = {
SectionOccupied: 'SectionOccupied',
ThroatRoute: 'ThroatRoute',
NoStatusLamp: 'NoStatusLamp',
Counter: 'Counter'
Counter: 'Counter',
PowerUnLock: 'PowerUnLock'
};
export default deviceType;

View File

@ -122,6 +122,11 @@ export function parser(data, skinCode, showConfig) {
mapDevice[elem.code] = createDevice(deviceType.AxleReset, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.powerUnLockButtonList || [], elem => { // 上电解锁列表
mapDevice[elem.code] = createDevice(deviceType.PowerUnLock, elem, propConvert, showConfig);
mapDevice[elem.stationCode].powerUnLockCode = elem.code;
}, this);
zrUtil.each(data.totalGuideLockButtonVOList || [], elem => { // 引导总锁列表
mapDevice[elem.code] = createDevice(deviceType.GuideLock, elem, propConvert, showConfig);
if (!elem.direction) {
@ -342,6 +347,7 @@ export function updateMapData(state, model) {
case deviceType.Esp: updateForList(model, state, 'espList'); break;
case deviceType.AutoTurnBack: updateForList(model, state, 'cycleButtonList'); break;
case deviceType.AxleReset: updateForList(model, state, 'axleCounterResetButtonList'); break;
case deviceType.PowerUnLock: updateForList(model, state, 'powerUnLockButtonList'); break;
case deviceType.GuideLock: updateForList(model, state, 'totalGuideLockButtonVOList'); break;
case deviceType.OutFrame: updateForList(model, state, 'outerFrameList'); break;
case deviceType.AutomaticRoute: updateForList(model, state, 'automaticRouteButtonList'); break;

View File

@ -0,0 +1,57 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.create();
}
create() {
this.text = new Text({
zlevel: this.device.zlevel,
z: this.device.z + 1,
position: [0, 0],
style: {
x: this.device.computedPosition.x,
y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30,
fontWeight: 'normal',
fontSize: this.device.style.LcControl.mouseOverStyle.fontSize,
fontFamily: this.device.style.fontFamily,
text: this.device.model.name,
textFill: this.device.style.LcControl.mouseOverStyle.fontColor,
textAlign: this.device.style.LcControl.mouseOverStyle.textAlign,
textVerticalAlign: this.device.style.LcControl.mouseOverStyle.textVerticalAlign
}
});
this.add(this.text);
this.text.hide();
}
mouseover(e) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.show();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor);
// this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor);
// this.device.control.setTextBorder(true);
// this.device.control.setArcBorder(true);
}
}
mouseout(e) {
if (!this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide();
} else {
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor);
// this.device.control.setTextColor('#FFFFFF');
// this.device.control.setTextBorder(false);
// this.device.control.setArcBorder(false);
}
}
}
}

View File

@ -0,0 +1,165 @@
/*
* 上电解锁 控制器
*/
import Group from 'zrender/src/container/Group';
import Arc from 'zrender/src/graphic/shape/Arc';
import Text from 'zrender/src/graphic/Text';
import EMouse from './EMouse';
import BoundingRect from 'zrender/src/core/BoundingRect';
import store from '@/store/index';
export default class PowerUnLock extends Group {
constructor(model, {style}) {
super();
this.z = 20;
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code);
if (pictureDevice) {
this.computedPosition = pictureDevice.position;
} else {
this.computedPosition = model.position;
}
this.model = model;
this.style = style;
this.isShowShape = true;
this.create();
this.createMouseEvent();
this.setState(model);
}
create() {
const powerUnLockStyle = this.style.PowerUnLock ? this.style.PowerUnLock : { lamp: {}, text: {}, subtitleText: {} };
const model = this.model;
this.control = new Arc({
_subType: 'Control',
zlevel: this.zlevel,
z: this.z,
shape: {
cx: this.computedPosition.x,
cy: this.computedPosition.y,
r: powerUnLockStyle.lamp.radiusR
},
style: {
stroke: '##b5b3b3',
lineWidth: 1.5,
fill: powerUnLockStyle.lamp.controlColor
}
});
this.text = new Text({
_subType: 'Text',
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
x: this.computedPosition.x,
y: this.computedPosition.y + powerUnLockStyle.lamp.radiusR + powerUnLockStyle.text.distance,
fontWeight: powerUnLockStyle.text.fontWeight,
fontSize: powerUnLockStyle.text.fontSize,
fontFamily: this.style.fontFamily,
text: model.name,
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
}
});
if (this.model.subtitleName) {
this.subtitleText = new Text({
_subType: 'Text',
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
style: {
x: this.computedPosition.x,
y: this.computedPosition.y + powerUnLockStyle.lamp.radiusR + powerUnLockStyle.subtitleText.distance,
fontWeight: powerUnLockStyle.subtitleText.fontWeight,
fontSize: powerUnLockStyle.subtitleText.fontSize,
fontFamily: this.style.fontFamily,
text: model.subtitleName,
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
}
});
this.add(this.subtitleText);
}
this.add(this.control);
this.add(this.text);
}
setAshShow() {
this.control && this.control.setStyle({fill:'#FFF'});
}
// 设置状态
setState(model) {
this.recover();
// 只响应前端自定义类型的状态变化
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
} else if (model._free) {
this.setAshShow();
}
}
handleShowHide(powerUnLockCode) {
const path = window.location.href;
if (powerUnLockCode || path.includes('/map/draw')) {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
} else {
this.control && this.control.hide();
this.text && this.text.hide();
this.subtitleText && this.subtitleText.hide();
}
}
recover() {
this.control && this.control.show();
this.text && this.text.show();
this.subtitleText && this.subtitleText.show();
}
createMouseEvent() {
if (this.style.LcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
getShapeTipPoint() {
if (this.control) {
var distance = 2;
var rect = this.control.getBoundingRect();
return {
x: rect.x + rect.width / 2,
y: rect.y - distance
};
}
return null;
}
getBoundingRect() { // 计算自动折返包围框
if (this.control) {
const rect = this.control.getBoundingRect().clone();
if (this.text) {
const text = this.text.getBoundingRect().clone();
rect.union(text);
return rect;
} else {
return rect;
}
} else {
return new BoundingRect(0, 0, 0, 0);
}
}
getAnchorPoint() {
return this.computedPosition;
}
}

View File

@ -75,6 +75,9 @@ export default class Line2 extends Group {
currentTypeList.forEach(element => {
this[element].setState(model);
});
if (model.noStatus) {
this.setAshShow();
}
}
}

View File

@ -446,6 +446,10 @@ export default class Section extends Group {
this.line && this.line.setStyle({stroke: '#7F7F7F'});
this.line && this.line.setCross({fill: '#7F7F7F'});
this.name && this.name.setStyle({textFill: '#7F7F7f'});
this.standTrackText && this.standTrackText.setStyle({textFill: '#7F7F7f'});
this.reentryTrackText && this.reentryTrackText.setStyle({textFill: '#7F7F7f'});
this.transferTrackText && this.transferTrackText.setStyle({textFill: '#7F7F7f'});
this.destinationText && this.destinationText.setStyle({textFill: '#7F7F7f'});
}
/** 计轴预复位 */
preReset(blockade) {

View File

@ -21,7 +21,7 @@ class EStationText extends Group {
x: model.computedPosition.x,
y: model.computedPosition.y,
fontWeight: style.Station.stationText.fontWeight,
fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont),
fontSize: model.nameFont || 20,
fontFamily: style.fontFamily,
text: model.number ? model.number + model.name : model.name,
textAlign: 'middle',

View File

@ -1008,6 +1008,7 @@ export default class Station extends Group {
model.emergencyController != undefined && this.handleEmergencyChange(model.emergencyController);
model.controlApplicant && this.handleControlApplicant(model);
model.allowAutonomy && this.handleAllowAutonomy(model);
// this.handlePowerUnlockShow(model);
this.handleGuideLock(model);
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller || model.emergencyController != undefined) && model.centralized) {
model.chargeStationCodeList.forEach(item => {
@ -1062,6 +1063,12 @@ export default class Station extends Group {
handleAllowAutonomy() {
this.selfDiscipline && this.selfDiscipline.setColor(this.style.Station.StationControl.selfDiscipline.lightColor);
}
// handlePowerUnlockShow(model) {
// if (model.powerUnLockCode) {
// const powerUnLock = store.getters['map/getDeviceByCode'](model.powerUnLockCode);
// powerUnLock && powerUnLock.instance && powerUnLock.instance.handleShowHide(model.powerUnlockButtonShow);
// }
// }
handleControlApplicant(model) {
if (this.style.Station.stationText.isSpecialType) {

View File

@ -1,5 +1,6 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import store from '@/store/index';
class EHollowStand extends Group {
constructor(model) {
@ -52,6 +53,9 @@ class EHollowStand extends Group {
model.trainParking && this.setColor(style.StationStand.hollowStand.doorOpenColor);
// 紧急停车
model.emergencyClosed && this.setColor(style.StationStand.hollowStand.spareColor);
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === '02')) {
this.setColor('#7F7F7F');
}
}
}

View File

@ -2,6 +2,7 @@ import Group from 'zrender/src/container/Group';
import Polyline from 'zrender/src/graphic/shape/Polyline';
// import Rect from 'zrender/src/graphic/shape/Rect';
// import Text from 'zrender/src/graphic/Text';
import store from '@/store/index';
class ESolidStand extends Group {
constructor(model) {
@ -65,6 +66,9 @@ class ESolidStand extends Group {
}
setState(model) {
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === '02')) {
this.setColor('#7F7F7F');
}
}
}

View File

@ -145,6 +145,10 @@ class ESolidStand extends Group {
model.sysHoldTrain && this.setHoldTrain('System');
// 站台关闭
model.closed && this.setColor(style.StationStand.solidStand.closeColor);
if (model.noStatus || (model.atsNoStatus && store.state.map.picture === '02')) {
this.setColor('#7F7F7F');
}
} else {
this.handlePassagerColor(model.num);
}

View File

@ -17,6 +17,7 @@ import Train from './Train/index.js';
import Line from './Line/index.js';
import Text2 from './Text/index.js';
import AxleReset from './AxleReset/index';
import PowerUnLock from './PowerUnLock/index';
import GuideLock from './GuideLock/index';
import AutoTurnBack from './AutoTurnBack/index.js';
import OutFrame from './OutFrame/index.js';
@ -99,5 +100,6 @@ mapShape[deviceType.FloodGate] = FloodGate;
mapShape[deviceType.DirectionRod] = DirectionRod;
mapShape[deviceType.Responder] = Responder;
mapShape[deviceType.SignalButton] = SignalButton;
mapShape[deviceType.PowerUnLock] = PowerUnLock;
export default mapShape;

View File

@ -79,14 +79,14 @@ export default {
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => section.speedUpLimit !== -1,
isDisabled: (section, work) => section.speedUpLimit > 0,
isShow: (section, work) => work === 'dispatchWork' && section.type !== '04'
},
{
label: '取消临时限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
isDisabled: (section, work) => section.speedUpLimit === -1,
isDisabled: (section, work) => section.speedUpLimit <= 0,
isShow: (section, work) => work === 'dispatchWork' && section.type !== '04'
}
],

View File

@ -289,6 +289,10 @@ export default {
{label: '计轴受扰', value: 'ARB'},
{label:'无数据故障', value:'UNABLE_COLLECT_STATUS'}
];
} else if (selected._type === 'Station' && ['ningbo-01__systerm', 'fuzhou-01__systerm'].includes(this.popClass)) {
this.faultList = [
{label: '联锁故障', value: 'INTERLOCK_FAULT'}
];
}
if (this.faultList && this.faultList.length) {
this.form.faultType = this.faultList[0].value;

View File

@ -105,14 +105,14 @@ export default {
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => section.speedUpLimit !== -1,
isDisabled: (section, work) => section.speedUpLimit > 0,
isShow: (section, work) => section.type === '02'
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED,
isDisabled: (section, work) => section.speedUpLimit === -1,
isDisabled: (section, work) => section.speedUpLimit <= 0,
isShow: (section, work) => section.type === '02'
}
],

View File

@ -78,6 +78,13 @@ export default {
isDisabled: (station, work) => false,
isShow: (station, work) => work === 'dispatchWork'
},
{
label: '上电解锁',
handler: this.powerUnLock,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
isDisabled: (station, work) => false,
isShow: (station, work) => work === 'localWork'
},
{
label: this.$t('menu.menuStation.execKeyOperationTest'),
handler: this.execKeyOperationTest,
@ -97,6 +104,11 @@ export default {
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
},
{
label: '设置车站故障',
handler: this.setStationStoppage,
cmdType: CMD.Station.CMD_SET_FAULT
},
{
label: '重启联锁机',
handler: this.restartInterlock,
@ -229,6 +241,20 @@ export default {
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
}
});
},
setStationStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
cancelStationStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
}
});
}
}
};

View File

@ -275,6 +275,16 @@ export default {
this.doClose();
}
}).catch(() => { this.doClose(); this.$refs.noticeInfo.doShow(); });
} else if (this.operation === OperationEvent.Station.powerUnLock.confirm1.operation) {
const step = {
operation: OperationEvent.Command.common.affirm.operation,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK
};
commitOperate(step, {}, 2).then(({valid}) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); this.$refs.noticeInfo.doShow(); });
}
},
doClose() {

View File

@ -13,7 +13,7 @@
>
<el-row justify="center" style="height: 40px;">
<el-col :span="8">
<div style="height: 40px;line-height: 40px;color: #000;">密码</div>
<div style="height: 40px;line-height: 40px;color: #000;">密码(root)</div>
</el-col>
<el-col :span="16">
<el-input ref="passwordBox" v-model="password" size="mini" show-password />

View File

@ -64,7 +64,7 @@ export default {
switchAndPhySicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01' || elem.type === '03'; });
list = this.sectionList.filter(elem => { return elem.type === '01' || elem.type === '04'; });
}
return list;
},

View File

@ -0,0 +1,143 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm section-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="24">
<span style="margin-right: 10px;">车站:</span>
<el-select
:id="domIdChoose"
v-model="stationCode"
:disabled="true"
size="mini"
>
<el-option v-for="(option,index) in stationList" :key="index" :label="option.name" :value="option.code" />
</el-select>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
<confirm-tip ref="confirmTip" @close="doClose" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import ConfirmTip from './childDialog/confirmTip';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'StationPowerUnLock',
components: {
NoticeInfo,
ConfirmTip
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationCode: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.AxleReset.SetAxleReset.choose.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '上电解锁';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show && !this.loading) {
this.commit();
}
}
},
methods: {
doShow(operate, selected) {
this.$root.$emit('dialogOpen', selected);
if (!this.dialogShow) {
this.selected = selected;
this.stationCode = selected.stationCode;
this.operation = operate.operation || '';
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
},
commit() {
this.loading = true;
const step = {
operation: OperationEvent.Station.powerUnLock.confirm1.operation,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK
};
commitOperate(step, {stationCode:this.stationCode}, 1).then(({valid, operate})=>{
this.loading = false;
if (valid) {
const station = this.$store.getters['map/getDeviceByCode'](this.stationCode);
operate.message = `命令:上电解锁<br/>车站:${station.name}`;
this.$refs.confirmTip.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -16,6 +16,7 @@
<menu-station-pre-reset ref="menuStationPreReset" :selected="selected" :work="work" />
<!--<passive-alarm ref="passiveAlarm" />-->
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" :selected="selected" />
<menu-power-un-lock ref="menuPowerUnLock" pop-class="ningbo-01__systerm" :selected="selected" :work="work" />
<alarm-detail ref="alarmDetail" />
<!--<passive-Timeout ref="passiveTimeout" />-->
</div>
@ -37,6 +38,7 @@ import MenuLimit from './menuLimit';
import MenuStationTurnBack from './menuStationTurnBack';
import MenuStationLight from './menuStationLight';
import MenuStationPreReset from './menuStationPreReset';
import MenuPowerUnLock from './menuPowerUnLock';
// import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import AlarmDetail from './alarmDetail';
@ -61,7 +63,8 @@ export default {
PassiveContorl,
MenuStationLight,
MenuStationPreReset,
AlarmDetail
AlarmDetail,
MenuPowerUnLock
// PassiveTimeout
},
props: {

View File

@ -0,0 +1,115 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<station-power-un-lock ref="stationPowerUnLock" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import StationPowerUnLock from './dialog/stationPowerUnLock';
import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { DeviceMenu, OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'MenuLimit',
components: {
PopMenu,
StationPowerUnLock
},
props: {
selected: {
type: Object,
default() {
return null;
}
},
work: {
type: String,
default() {
return '';
}
}
},
data() {
return {
menu: [],
menuForce:[],
menuNormal: [
{
label: '上电解锁',
handler: this.handlePowerUnLock,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
isShow: (selected, work) => work == 'localWork'
}
]
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.PowerUnLock) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
initMenu() {
//
this.menu = [];
this.menuNormal.forEach(menuItem => {
const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
menuItem.disabled = !status;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
const memberData = this.$store.state.training.memberData;
const userId = this.$store.state.user.id;
if (!station.controller || !memberData[station.controller] || memberData[station.controller].userId != userId) {
this.menu.forEach(item => {
item.disabled = true;
});
}
}
},
doShow(point) {
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
handlePowerUnLock() {
commitOperate(menuOperate.Station.powerUnLock, { stationCode: this.selected.stationCode }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.stationPowerUnLock.doShow(operate, this.selected);
}
});
}
}
};
</script>

View File

@ -61,12 +61,12 @@ export default {
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
isShow: (selected, work) => work == 'localWork'
},
{
label: '上电解锁',
handler: this.powerUnLock,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
isShow: (selected, work) => work == 'localWork'
},
// {
// label: '',
// handler: this.powerUnLock,
// cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
// isShow: (selected, work) => work == 'localWork'
// },
// {
// label: '',
// handler: this.execKeyOperationTest,
@ -101,6 +101,11 @@ export default {
handler: this.cancelStoppage,
cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT
},
{
label: '设置车站故障',
handler: this.setStationStoppage,
cmdType: CMD.Station.CMD_SET_FAULT
},
{
label: '重启联锁机',
handler: this.restartInterlock,
@ -186,6 +191,13 @@ export default {
}
});
},
setStationStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
}
});
},
//
cancelStoppage() {
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{

View File

@ -214,7 +214,7 @@ export default {
if (this.operatemode === OperateMode.FAULT) {
// if (!this.$store.state.scriptRecord.bgSet) {
const menuHook = [{
label: '道岔钩锁',
label: '手摇道岔钩锁',
handler: this.hookLock
}];
this.menu = [...this.menuForce, ...menuHook];

View File

@ -105,14 +105,14 @@ export default {
label: '设置临时限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => section.speedUpLimit !== -1,
isDisabled: (section, work) => section.speedUpLimit > 0,
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'dispatchWork'
},
{
label: '取消临时限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
isDisabled: (section, work) => section.speedUpLimit === -1,
isDisabled: (section, work) => section.speedUpLimit <= 0,
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'dispatchWork'
}
],

View File

@ -111,7 +111,6 @@
import { mapGetters } from 'vuex';
import SystemTitle from './Title';
import {getSessionStorage } from '@/utils/auth';
import { ThirdLoginList } from '@/scripts/ProjectConfig';
export default {
components: {
@ -131,7 +130,7 @@ export default {
'routers'
]),
thirdLogin() {
return ThirdLoginList.includes(getSessionStorage('project'));
return this.$store.state.user.thirdLogin;
},
username() {
return this.$store.state.user.nickname;

View File

@ -1948,6 +1948,16 @@ export const asyncRouter = [
path: 'publishIscs',
component: PublishISCS,
hidden: true
},
{ // ibp列表
path: 'ibp/home/:mapId',
component: IbpHome,
hidden: true
},
{
path: 'ibp/edit',
component: IbpDraw,
hidden: true
}
]
},

View File

@ -80,7 +80,7 @@ export default {
{label: 'NCC调度', value: 'NCC_DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '信息调度', value: 'OCC_DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '行调', value: 'DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '行值', value: 'STATION_SUPERVISOR', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '行值', value: 'STATION_SUPERVISOR', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']}, // 大铁:车站值班员
{label: '司机', value: 'DRIVER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '通号', value: 'MAINTAINER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
{label: '车辆段/停车场调度', value: 'DEPOT_DISPATCHER', simTypeList: ['METRO']},
@ -94,7 +94,7 @@ export default {
{label: '车站工务工', value: 'STATION_WORKER', simTypeList: ['RAILWAY']},
{label: '车务段段长', value: 'TRAIN_MASTER', simTypeList: ['METRO']},
{label: '工电调度', value: 'ELECTRIC_DISPATCHER', simTypeList: ['METRO']},
{label: '电力工务', value: 'STATION_ELECTRIC_WORKER', simTypeList: ['METRO']},
{label: '电力工务', value: 'STATION_ELECTRIC_WORKER', simTypeList: ['METRO', 'RAILWAY']}, // 大铁:车站电务
{label: '上级部分', value: 'PARENT_DEPARTMENT', simTypeList: ['METRO']},
{label: '派班员', value: 'SCHEDULING', simTypeList: ['METRO']},
{label: '设备管理员', value: 'DEVICE_MANAGER', simTypeList: ['RAILWAY']},

View File

@ -99,6 +99,7 @@ export const DeviceMenu = {
Power:'15',
StationLight: '16',
StationPreReset: '17',
PowerUnLock: '18',
Map: '100',
PrdCategory: '101',

View File

@ -891,7 +891,7 @@
// jjjlm: 'JJJLM'
// };
// /** 嵌入第三方平台 导航栏右上角 清空 */
export const ThirdLoginList = ['richor', 'designrichor', 'richorygy', 'designrichorygy', 'richorcxjs', 'designrichorcxjs', 'richorgscm'];
// export const ThirdLoginList = ['richor', 'designrichor', 'richorygy', 'designrichorygy', 'richorcxjs', 'designrichorcxjs', 'richorgscm'];
// /** 底部栏仅展示公司信息不展示备案号 */
// export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls',
// 'designhls', 'hyd', 'designhyd', 'hydrailway', 'designhydrailway', 'cgy', 'designcgy', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint', 'nologo', 'designnologo', 'richorygy',

View File

@ -144,17 +144,17 @@ class Handler {
const stepInfo = store.state.trainingNew.stepInfo;
const operateOrder = store.state.trainingNew.operateOrder;
const operation = stepInfo.operations[operateOrder];
const operation1 = {
userOperationType: UserOperationType.LEFTCLICK,
domId: OperationEvent.Conversation.Chat.sideButton.operation,
params: { chatBoxMin: true }
};
const step1 = {
description: '点击打开聊天室',
memberId: stepInfo.memberId,
operations: [operation1],
tipPosition: { deviceCode: '', domId: operation1.domId, operateIndex: 0 }
};
// const operation1 = {
// userOperationType: UserOperationType.LEFTCLICK,
// domId: OperationEvent.Conversation.Chat.sideButton.operation,
// params: { chatBoxMin: true }
// };
// const step1 = {
// description: '点击打开聊天室',
// memberId: stepInfo.memberId,
// operations: [operation1],
// tipPosition: { deviceCode: '', domId: operation1.domId, operateIndex: 0 }
// };
const operation2 = {
userOperationType: UserOperationType.LEFTCLICK,
domId: OperationEvent.Conversation.Chat.record.operation,
@ -192,11 +192,11 @@ class Handler {
operations: [operation3],
tipPosition: { deviceCode: '', domId: operation3.domId, operateIndex: 0 }
};
if (store.state.training.chatBoxMin) {
store.dispatch('trainingNew/setVoiceStepList', [step1, step2, step3]);
} else {
// if (store.state.training.chatBoxMin) {
// store.dispatch('trainingNew/setVoiceStepList', [step1, step2, step3]);
// } else {
// }
store.dispatch('trainingNew/setVoiceStepList', [step2, step3]);
}
}
}
export default new Handler();

View File

@ -446,6 +446,13 @@ const map = {
return [];
}
},
powerUnLockButtonList: state => {
if (state.map) {
return state.map.powerUnLockButtonList || [];
} else {
return [];
}
},
totalGuideLockButtonVOList: state => {
if (state.map) {
return state.map.totalGuideLockButtonVOList || [];

View File

@ -1,4 +1,4 @@
import { login, logout, getInfo, preLogout } from '@/api/login';
import { login, logout, getInfo, preLogout, getLoginInfo } from '@/api/login';
import { getToken, setToken, removeToken } from '@/utils/auth';
import { LoginParams } from '@/utils/login';
import { creatSubscribe, clearSubscribe, perpetualTopic, disconnect} from '@/utils/stomp';
@ -146,8 +146,8 @@ const user = {
// 获取用户信息
GetInfo({ commit }, token) {
return new Promise((resolve, reject) => {
getInfo(token).then(response => {
const user = response.data;
getLoginInfo(token).then(response => {
const user = response.data.accountVO;
if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', user.roles);
} else {
@ -163,7 +163,7 @@ const user = {
commit('SET_COMPANYADMIN', user.companyAdmin);
commit('SET_COMPANYNAME', user.companyName);
commit('SET_COMPANYPROJECTLIST', user.projectCodes);
commit('SET_THIRDLOGIN', user.thirdLogin);
commit('SET_THIRDLOGIN', response.data.thirdLogin);
resolve(user);
}).catch(error => {
reject(error);

View File

@ -52,6 +52,11 @@ export function handlerUrl() {
BASE_API = 'http://160.20.60.15:9000';
BASE_SITE = 'http://160.20.60.15';
OSS_URL = 'https://joylink.club/oss-rtss';
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'sai') {
// 本地打包分支
BASE_API = 'http://192.168.53.10/jcloud';
BASE_SITE = 'http://192.168.53.10';
OSS_URL = 'https://192.168.53.10/oss-rtss';
} else if (process.env.NODE_ENV === 'production') {
// 远程发布分支
BASE_API = 'https://joylink.club/jlcloud';

View File

@ -2,6 +2,7 @@
<div class="joylink-card">
<div class="scriptHeader">
<div class="scriptList">IBP盘列表</div>
<el-button size="small" type="primary" class="createScript" style="margin-top: 5px" @click="goBack">返回</el-button>
<el-button size="small" type="primary" class="createScript" style="margin-top: 5px" @click="handleCreate">{{ $t('scriptRecord.scriptCreate') }}</el-button>
<el-button size="small" type="primary" class="createScript" @click="createByPublish">发布数据创建</el-button>
</div>
@ -142,7 +143,7 @@ export default {
//
handleModify(index, row) {
const query = { mapId: this.$route.params.mapId, stationCode: row.stationCode, ibpId: row.id };
this.$router.push({ path: `/design/ibp/edit`, query: query });
this.$router.push({ path: `/systemManagement/lineDataManage/ibp/edit`, query: query });
},
//
editInfo(index, row) {
@ -184,6 +185,9 @@ export default {
},
createByPublish() {
this.$refs.copyIbp.doShow(null);
},
goBack() {
this.$router.go(-1);
}
}
};

View File

@ -14,6 +14,7 @@
:value="item.value"
/>
</el-select> -->
<el-button type="text" style="float: right; padding: 15px 0; margin-right: 5px;" @click="goBack">返回</el-button>
<el-button type="text" style="float: right; padding: 15px 0; margin-right: 5px;" @click="handleSave">{{ $t('ibp.save') }}</el-button>
</div>
<el-tabs v-model="enabledTab" class="ibpEdit" type="card" @tab-click="handleTabClick">
@ -140,6 +141,9 @@ export default {
deleteDataModel(model) {
this.$store.dispatch('ibp/deleteIbpDevices', model);
},
goBack() {
this.$router.go(-1);
},
async handleSave() {
if (this.$store.state.ibp.ibp.background) {
try {

View File

@ -13,7 +13,6 @@
<script>
import IbpPlate from '@/views/ibp/ibpsystem/index';
import IbpOperate from './ibpOperate/index';
import localStore from 'storejs';
import { parser } from '@/ibp/utils/parser';
import { mapGetters } from 'vuex';
@ -25,9 +24,8 @@ export default {
},
data() {
return {
widthLeft: Number(localStore.get('LeftWidth')) || 450,
size: {
width: this.$store.state.app.width - 521 - (Number(localStore.get('LeftWidth')) || 450),
width: this.$store.state.app.width - 521,
height: this.$store.state.app.height - 60
}
};
@ -40,12 +38,12 @@ export default {
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.size = { width: this.$store.state.app.width - 521 - this.widthLeft, height: this.$store.state.app.height - 60 };
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521 - this.widthLeft, height: this.$store.state.app.height - 60 });
this.size = { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 };
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
}
},
created() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521 - this.widthLeft, height: this.$store.state.app.height - 60 });
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
},
mounted() {
this.$refs.ibpPlate.show();

View File

@ -283,6 +283,7 @@ export default {
},
onMouseDown(em) {
if (['SquareButton', 'Key'].includes(em.deviceType)) {
setTimeout(() => {
const operate = {
start: true,
send: true,
@ -295,10 +296,12 @@ export default {
};
this.$store.dispatch('trainingNew/next', operate).catch(error => { this.$message.error(error.message); });
// handleIbpPress(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); });
}, 500);
}
},
onMouseUp(em) {
if (['SquareButton'].includes(em.deviceType)) {
setTimeout(() => {
const operate = {
start: true,
send: true,
@ -311,6 +314,7 @@ export default {
};
this.$store.dispatch('trainingNew/next', operate).catch(error => { this.$message.error(error.message); });
// handleIbpRelease(this.$route.query.group, this.stationCode, em.deviceCode).catch(error => { this.$message.error(error.message); });
}, 500);
}
},
//

View File

@ -99,6 +99,9 @@ export default {
if (item.value == 'STATION_SUPERVISOR' && this.simType == 'RAILWAY') {
obj.label = '车站值班员';
}
if (item.value == 'STATION_ELECTRIC_WORKER' && this.simType == 'RAILWAY') {
obj.label = '车站电务';
}
list.push(obj);
}
});

View File

@ -207,7 +207,8 @@ export default {
const environmentDispatherList = [];
const parentDepartmentList = [];
const schedulingList = [];
const t = this.simType == 'METRO' ? '行值-' : '值班员-';
const ss = this.simType == 'RAILWAY' ? '车站值班员' : '行值';
const sew = this.simType == 'RAILWAY' ? '车站电务' : '电力工务';
val.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
switch (item.type) {
@ -236,7 +237,7 @@ export default {
signalBuildingList.push(this.memberData[item.id]);
break;
case 'STATION_SUPERVISOR':
this.memberData[item.id].labelName = t + device.name + (item.name ? `-${item.name }` : '');
this.memberData[item.id].labelName = ss + '-' + device.name + (item.name ? `-${item.name }` : '');
stationSupervisorList.push(this.memberData[item.id]);
break;
case 'DRIVER':
@ -304,7 +305,7 @@ export default {
schedulingList.push(this.memberData[item.id]);
break;
case 'STATION_ELECTRIC_WORKER':
this.memberData[item.id].labelName = '电力工务' + (item.name || '');
this.memberData[item.id].labelName = sew + '-' + device.name + (item.name ? `-${item.name }` : '');
stationElectricWorkerList.push(this.memberData[item.id]);
break;
}
@ -325,7 +326,7 @@ export default {
memberType: 'DISPATCHER',
children: dispatcherList
}, {
labelName: this.simType == 'METRO' ? '行值' : '车站值班员',
labelName: ss,
id: 'stationSupervisor',
memberType: 'STATION_SUPERVISOR',
children: stationSupervisorList
@ -426,7 +427,7 @@ export default {
children: environmentDispatherList
},
{
labelName: '电力工务 ',
labelName: sew,
id: 'stationElectricWorker',
memberType: 'STATION_ELECTRIC_WORKER',
children: stationElectricWorkerList

View File

@ -26,7 +26,7 @@
</div>
</div>
<div class="chat-box-footer">
<el-input v-model="textContent" size="small" placeholder="请输入会话文字点击T发送" style="flex: 1; margin-left: 5px;" :rows="1" />
<el-input v-model="textContent" size="small" placeholder="请输入会话文字点击T发送" style="flex: 1; margin-left: 5px;" :rows="1" @keyup.enter.native="sendText" />
<el-button :id="sendTextId" size="mini" class="chat-box-footer-create" :disabled="contentSend || (!id && !privateChatId)" @click="sendText">T</el-button>
<el-button :id="recordVoice" class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" :disabled="audioPlay || (trainingDesign && !trainingSwitch) || (!id && !privateChatId)" size="mini" type="primary" @click="startRecording()">
<el-progress id="voice_progress_bar" type="circle" :show-text="false" :percentage="100/maxSeconds*seconds" :width="40" :stroke-width="2" status="success" />
@ -97,8 +97,11 @@ export default {
sendTextId() {
return OperationEvent.Conversation.Chat.menu.domId;
},
chatBoxMin() {
return this.$store.state.training.chatBoxMin;
},
recordVoice() {
return OperationEvent.Conversation.Chat.record.domId;
return this.chatBoxMin ? '' : OperationEvent.Conversation.Chat.record.domId;
},
sideButtonDom() {
return OperationEvent.Conversation.Chat.sideButton;
@ -194,7 +197,7 @@ export default {
return name;
},
sendText() {
if ((!this.id && !this.privateChatId) || !this.textContent) { return; }
if ((!this.id && !this.privateChatId) || this.contentSend) { return; }
const operate = {
over: true,
cmdType: CMD.Conversation.CMD_Conversation_Group_Text_Chat,

View File

@ -11,7 +11,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {UserOperationType} from '@/scripts/ConstDic';
// import {UserOperationType} from '@/scripts/ConstDic';
import chatDialog from './chatDialog';
export default {
name: 'ChatBox',
@ -32,6 +32,11 @@ export default {
}
},
watch: {
chatBoxMin() {
this.$nextTick(() => {
this.$store.dispatch('training/emitTipFresh');
});
}
},
mounted() {
},
@ -40,18 +45,18 @@ export default {
this.totalUnreadNum = val;
},
clickBtn() {
const operate = {
operation: this.sideButtonDom.operation,
param: { chatBoxMin: this.chatBoxMin },
userOperationType: UserOperationType.LEFTCLICK
};
// const operate = {
// operation: this.sideButtonDom.operation,
// param: { chatBoxMin: this.chatBoxMin },
// userOperationType: UserOperationType.LEFTCLICK
// };
this.$store.dispatch('training/setChatBoxMin', false);
this.$refs.chatDialog.dialogVisible = true;
if (this.$store.state.trainingNew.trainingSwitch) {
this.$nextTick(() => {
this.$store.dispatch('trainingNew/next', operate);
});
}
// if (this.$store.state.trainingNew.trainingSwitch) {
// this.$nextTick(() => {
// this.$store.dispatch('trainingNew/next', operate);
// });
// }
}
}
};

View File

@ -59,15 +59,18 @@ export default {
deviceShow: true,
allMenuList: [
{ label: '切换', name: 'switchOffset', click: this.switchOffset, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.ibp.moreScreen; } },
{ label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isDisabled: () => { return false; }, isShow: () => { return this.$route.query.client !== 'diagramEdit'; } },
{ label: '设备管理', name: 'deviceManage', click: this.deviceManage, isDisabled: () => { return false; }, isShow: () => { return (this.$store.state.training.domConfig.hasDeviceManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER) || (this.$route.query.client === 'interlockWork' && this.$route.query.projectDevice === 'ILW'); } },
{ label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isDisabled: () => { return false; }, isShow: () => { return this.$route.query.client !== 'diagramEdit' && this.$route.query.simType !== 'EMERGENCY'; } },
{ label: '设备管理', name: 'deviceManage', click: this.deviceManage, isDisabled: () => { return false; },
isShow: () => {
return (this.$store.state.training.domConfig.hasDeviceManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER) || (this.$route.query.client === 'interlockWork' && this.$route.query.projectDevice === 'ILW');
} },
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isDisabled: () => { return false; }, isShow: () => { return true; } },
{ label: '生成仿真号', name: 'generateQrCode', click: this.generateQrCode, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.joint && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
{ label: '切换客流数据', name: 'changeFlowData', click: this.changeFlowData, isDisabled: () => { return false; }, isShow: this.isShowLpf},
{ label: '成员管理', name: 'memberManage', click: this.memberManage, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasMemberManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
{ label: '考试', name: 'exam', click: this.goExam, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasExam && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
{ label: '按计划行车', name: 'drivingPlan', click: this.drivingPlan, isDisabled: () => { return this.$store.state.trainingNew.trainingSwitch; },
isShow: () => this.$store.state.training.simulationUserType === SimulationUserType.TEACHER && this.$store.state.map.picture !== 'diagramEdit' },
isShow: () => this.$store.state.training.simulationUserType === SimulationUserType.TEACHER && this.$store.state.map.picture !== 'diagramEdit' && this.$route.query.simType !== 'EMERGENCY' },
{ label: '初始化', name: 'initialize', click: this.initializeSim, isDisabled: () => { return this.$store.state.trainingNew.trainingSwitch; },
isShow: () => this.$store.state.training.simulationUserType === SimulationUserType.TEACHER && this.$store.state.map.picture !== 'diagramEdit' },
{ label: '退出', name: 'quit', click: this.exitSim, isDisabled: () => { return false; }, isShow: () => { return !this.$route.query.newOpen; } },

View File

@ -39,7 +39,7 @@
<driver-ats-work v-if="picture=='driverAtsWork'" ref="driverAtsWork" />
<terminal-menu
v-if="menuShow"
v-show="menuShow"
ref="terminalMenu"
:now-terminal="nowTerminal"
@pictureChange="pictureChange"

View File

@ -28,8 +28,6 @@
</div>
</template>
<script>
import { ThirdLoginList } from '@/scripts/ProjectConfig';
import { getSessionStorage } from '@/utils/auth';
export default {
name:'TerminalList',
props: {
@ -57,7 +55,7 @@ export default {
return this.$store.state.training.domConfig && this.$store.state.training.domConfig.trainingDesign;
},
thirdLogin() {
return ThirdLoginList.includes(getSessionStorage('project'));
return this.$store.state.user.thirdLogin;
}
},
watch: {
@ -163,7 +161,6 @@ export default {
findTerminalFromMapById(id) {
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
console.log(mapClientList, id, this.$route.query.simType, mapClientMap);
return mapClientList.find(item => item.id === id);
},
findTerminalFromMap(type) {

View File

@ -121,6 +121,8 @@ export default {
this.position = position;
this.position.y -= distance;
this.popTipShow();
} else {
this.popTipHide();
}
} else {
this.popTipHide();

View File

@ -41,6 +41,7 @@ export default {
'arrowList',
'automaticRouteButtonList',
'axleCounterResetButtonList',
'powerUnLockButtonList',
'cycleButtonList',
'directionRodList',
'espList',
@ -67,7 +68,7 @@ export default {
]),
deviceList () {
return [...this.sectionList, ...this.signalList, ...this.psdList, ...this.stationStandList, ...this.stationList, ...this.trainWindowList,
...this.arrowList, ...this.automaticRouteButtonList, ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.directionRodList, ...this.espList,
...this.arrowList, ...this.automaticRouteButtonList, ...this.axleCounterResetButtonList, ...this.powerUnLockButtonList, ...this.cycleButtonList, ...this.directionRodList, ...this.espList,
...this.indicatorLightList, ...this.lcList, ...this.lineList, ...this.outerFrameList, ...this.resourceList, ...this.responderList,
...this.signalButtonList, ...this.splitStationList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList,
...this.zcList];

View File

@ -112,7 +112,8 @@ export default {
{ name: '自动进路', value: 'AutomaticRoute' },
{ name: '引导总锁', value: 'GuideLock' },
{ name: '全线临时限速', value: 'LimitControl' },
{ name: '站后折返', value: 'StationTurnBack' }
{ name: '站后折返', value: 'StationTurnBack' },
{ name: '上电解锁', value: 'PowerUnLock' }
],
directionList: [
{ name: 'X方向', value: 'X' },
@ -193,7 +194,8 @@ export default {
'totalGuideLockButtonVOList',
'stationList',
'sectionList',
'tbStrategyList'
'tbStrategyList',
'powerUnLockButtonList'
]),
cardTitle() {
if (this.cardMode === 'generate') {
@ -289,7 +291,8 @@ export default {
return this.editModel.type == 'AutoTurnBack';
},
isHiddenStation() {
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset' || this.editModel.type == 'StationTurnBack' || this.editModel.type == 'AutomaticRoute';
return ['AutoTurnBack', 'GuideLock', 'AxleReset', 'StationTurnBack', 'AutomaticRoute', 'PowerUnLock'].includes(this.editModel.type);
// return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset' || this.editModel.type == 'StationTurnBack' || this.editModel.type == 'AutomaticRoute';
},
isHiddenCreateAutomaticRoute() {
@ -302,7 +305,8 @@ export default {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute';
},
isHiddenCreateStation() {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset' || this.addModel.type == 'StationTurnBack';
return ['AutoTurnBack', 'GuideLock', 'AxleReset', 'StationTurnBack', 'PowerUnLock'].includes(this.addModel.type);
// return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset' || this.addModel.type == 'StationTurnBack';
}
},
mounted() {
@ -368,6 +372,9 @@ export default {
case 'StationTurnBack':
this.selectLists = this.tbStrategyList;
break;
case 'PowerUnLock':
this.selectLists = this.powerUnLockButtonList;
break;
}
},
changeStation(code) { //
@ -396,7 +403,8 @@ export default {
this.autoList = [];
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase() || selected._type.toUpperCase() == 'StationTurnBack'.toUpperCase()) {
const list = ['AutomaticRoute'.toUpperCase(), 'AutoTurnBack'.toUpperCase(), 'AxleReset'.toUpperCase(), 'LimitControl'.toUpperCase(), 'GuideLock'.toUpperCase(), 'StationTurnBack'.toUpperCase(), 'PowerUnLock'.toUpperCase()];
if (selected && list.includes(selected._type.toUpperCase())) {
this.handleTypes(selected._type);
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
@ -479,7 +487,8 @@ export default {
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() === 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() === 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase() || selected._type.toUpperCase() == 'StationTurnBack'.toUpperCase()) {
const list = ['AutomaticRoute'.toUpperCase(), 'AutoTurnBack'.toUpperCase(), 'AxleReset'.toUpperCase(), 'LimitControl'.toUpperCase(), 'GuideLock'.toUpperCase(), 'StationTurnBack'.toUpperCase(), 'PowerUnLock'.toUpperCase()];
if (selected && list.includes(selected._type.toUpperCase())) {
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),

View File

@ -190,7 +190,7 @@ export default {
const type = device._type;
if (this.selectDevice) {
this.enabledTab = this.selectDevice;
} else if (['AutomaticRoute', 'AutoTurnBack', 'AxleReset', 'LimitControl', 'GuideLock', 'StationTurnBack'].includes(type)) {
} else if (['AutomaticRoute', 'AutoTurnBack', 'AxleReset', 'LimitControl', 'GuideLock', 'StationTurnBack', 'PowerUnLock'].includes(type)) {
this.enabledTab = 'ControlDraft';
} else if (controlLampTypeList.includes(type)) {
this.enabledTab = 'ControlLamp';

View File

@ -126,7 +126,7 @@
</el-form>
</el-collapse-item>
<el-collapse-item title="批量计算区段长度" name="8">
<el-button class="sectionSetting" @click="calculateSectionLength" type="primary" size="small">设置</el-button>
<el-button class="sectionSetting" type="primary" size="small" @click="calculateSectionLength">设置</el-button>
</el-collapse-item>
</el-collapse>
</div>
@ -402,7 +402,9 @@ export default {
models.push(deepAssign(item, { _dispose: true }));
}
});
const arrList = ['signalList', 'stationList', 'psdList', 'axleCounterResetButtonList', 'tbStrategyList', 'zcList', 'cycleButtonList', 'totalGuideLockButtonVOList', 'automaticRouteButtonList', 'outerFrameList', 'directionRodList', 'textList', 'indicatorLightList', 'splitStationList'];
const arrList = ['signalList', 'stationList', 'psdList', 'axleCounterResetButtonList', 'tbStrategyList', 'zcList', 'cycleButtonList',
'totalGuideLockButtonVOList', 'automaticRouteButtonList', 'outerFrameList', 'directionRodList', 'textList', 'indicatorLightList',
'splitStationList', 'powerUnLockButtonList'];
arrList.forEach(itemName => {
map[itemName] && map[itemName].forEach(item => {
const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX;
@ -428,23 +430,23 @@ export default {
models.push(deepAssign(section, { _type: 'Section' }));
this.$emit('updateMapModel', models);
},
calculateSectionLength(){
const precisionOf = num => num.toString().split('.').pop().length
calculateSectionLength() {
const precisionOf = num => num.toString().split('.').pop().length;
this.$confirm('确认设置所有区段的实际长度吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(()=>{
this.sectionList.forEach(section => {
const { kmMin, kmMax } = section
const { kmMin, kmMax } = section;
if (typeof kmMin === 'number' && typeof kmMax === 'number') {
const precision = Math.max(precisionOf(kmMin), precisionOf(kmMax))
section.lengthFact = Number((kmMax - kmMin).toFixed(precision))
const precision = Math.max(precisionOf(kmMin), precisionOf(kmMax));
section.lengthFact = Number((kmMax - kmMin).toFixed(precision));
}
})
this.$emit('updateMapModel', this.sectionList)
this.$message.success('区段长度设置成功!')
})
});
this.$emit('updateMapModel', this.sectionList);
this.$message.success('区段长度设置成功!');
});
}
}
};

View File

@ -16,7 +16,7 @@
</el-col>
<el-col :span="5" :offset="1">
<el-select v-model="item.type" placeholder="请选择" size="mini">
<el-option v-for="elem in roleList" :key="elem.value" :label="elem.label" :value="elem.value" />
<el-option v-for="elem in getRoleList('METRO')" :key="elem.value" :label="elem.label" :value="elem.value" />
</el-select>
</el-col>
<el-col :span="5" :offset="1">
@ -48,7 +48,7 @@
</el-col>
<el-col :span="5" :offset="1">
<el-select v-model="item.type" placeholder="请选择" size="mini">
<el-option v-for="elem in roleList" :key="elem.value" :label="elem.label" :value="elem.value" />
<el-option v-for="elem in getRoleList('RAILWAY')" :key="elem.value" :label="elem.label" :value="elem.value" />
</el-select>
</el-col>
<el-col :span="5" :offset="1">
@ -83,7 +83,7 @@
</el-col>
<el-col :span="5" :offset="1">
<el-select v-model="item.type" placeholder="请选择" size="mini">
<el-option v-for="elem in roleList" :key="elem.value" :label="elem.label" :value="elem.value" />
<el-option v-for="elem in getRoleList('EMERGENCY')" :key="elem.value" :label="elem.label" :value="elem.value" />
</el-select>
</el-col>
<el-col :span="5" :offset="1">
@ -111,7 +111,7 @@
</el-form-item>
<el-form-item label="成员类型:" prop="type">
<el-select v-model="createForm.type" placeholder="请选择">
<el-option v-for="item in roleList" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in getRoleList(createForm.systemType)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="关联设备:" prop="deviceCode">
@ -160,7 +160,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="行值:" prop="STATION_SUPERVISOR">
<el-form-item :label="batchForm.systemType == 'RAILWAY' ?'车站值班员:':'行值:'" prop="STATION_SUPERVISOR">
<el-input-number v-model="batchForm.STATION_SUPERVISOR" size="small" :min="0" :max="1" :step="1" :precision="0" />
</el-form-item>
</el-col>
@ -239,8 +239,8 @@
<el-input-number v-model="batchForm.ENVIRONMENT_DISPATCHER" size="small" :min="0" :step="1" :precision="0" />
</el-form-item>
</el-col>
<el-col v-if="batchForm.systemType === 'METRO'" :span="12">
<el-form-item label="电力工务" prop="STATION_ELECTRIC_WORKER">
<el-col v-if="batchForm.systemType === 'METRO' || batchForm.systemType === 'RAILWAY'" :span="12">
<el-form-item :label="batchForm.systemType == 'RAILWAY' ?'车站电务:':'电力工务'" prop="STATION_ELECTRIC_WORKER">
<el-input-number v-model="batchForm.STATION_ELECTRIC_WORKER" size="small" :min="0" :step="1" :precision="0" />
</el-form-item>
</el-col>
@ -320,13 +320,13 @@
</div>
</el-col>
<el-col :span="5">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberMetroList)">
<el-option v-for="elem in memberMetroList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberMetroList, 'METRO')">
<el-option v-for="elem in memberMetroList" :key="elem.id" :label="getLabel(elem, 'METRO')" :value="elem.id" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="item.memberIds" :class="{disabledClear: item.memberIds.length ==1}" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberMetroList)">
<el-option v-for="elem in memberMetroList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" :disabled="item.memberIds.length ==1 && item.memberIds.includes(elem.id)" />
<el-select v-model="item.memberIds" :class="{disabledClear: item.memberIds.length ==1}" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberMetroList, 'METRO')">
<el-option v-for="elem in memberMetroList" :key="elem.id" :label="getLabel(elem, 'METRO')" :value="elem.id" :disabled="item.memberIds.length ==1 && item.memberIds.includes(elem.id)" />
</el-select>
</el-col>
<el-col :span="3" style="text-align: center;">
@ -356,13 +356,13 @@
</div>
</el-col>
<el-col :span="5">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberRailwayList)">
<el-option v-for="elem in memberRailwayList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberRailwayList, 'RAILWAY')">
<el-option v-for="elem in memberRailwayList" :key="elem.id" :label="getLabel(elem, 'RAILWAY')" :value="elem.id" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="item.memberIds" :class="{disabledClear: item.memberIds.length ==1}" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberRailwayList)">
<el-option v-for="elem in memberRailwayList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" :disabled="item.memberIds.length ==1 && item.memberIds.includes(elem.id)" />
<el-select v-model="item.memberIds" :class="{disabledClear: item.memberIds.length ==1}" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberRailwayList, 'RAILWAY')">
<el-option v-for="elem in memberRailwayList" :key="elem.id" :label="getLabel(elem, 'RAILWAY')" :value="elem.id" :disabled="item.memberIds.length ==1 && item.memberIds.includes(elem.id)" />
</el-select>
</el-col>
<el-col :span="3" style="text-align: center;">
@ -392,13 +392,13 @@
</div>
</el-col>
<el-col :span="5">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberEmergencyList)">
<el-option v-for="elem in memberEmergencyList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberEmergencyList, 'EMERGENCY')">
<el-option v-for="elem in memberEmergencyList" :key="elem.id" :label="getLabel(elem, 'EMERGENCY')" :value="elem.id" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="item.memberIds" :class="{disabledClear: item.memberIds.length ==1}" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberEmergencyList)">
<el-option v-for="elem in memberEmergencyList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" :disabled="item.memberIds.length ==1 && item.memberIds.includes(elem.id)" />
<el-select v-model="item.memberIds" :class="{disabledClear: item.memberIds.length ==1}" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberEmergencyList, 'EMERGENCY')">
<el-option v-for="elem in memberEmergencyList" :key="elem.id" :label="getLabel(elem, 'EMERGENCY')" :value="elem.id" :disabled="item.memberIds.length ==1 && item.memberIds.includes(elem.id)" />
</el-select>
</el-col>
<el-col :span="3" style="text-align: center;">
@ -426,18 +426,18 @@
</div>
</el-form-item>
<el-form-item label="群主:" prop="leaderId">
<el-select v-model="conversationForm.leaderId" placeholder="请选择" style="width: 200px;" :title="getMemberTitle(conversationForm.leaderId, getFormMemberList)">
<el-option v-for="elem in getFormMemberList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
<el-select v-model="conversationForm.leaderId" placeholder="请选择" style="width: 200px;" :title="getMemberTitle(conversationForm.leaderId, getFormMemberList, conversationForm.systemType)">
<el-option v-for="elem in getFormMemberList" :key="elem.id" :label="getLabel(elem, conversationForm.systemType)" :value="elem.id" />
</el-select>
</el-form-item>
<el-form-item label="群成员:" prop="memberIds">
<el-select v-model="conversationForm.memberIds" :class="{disabledClear: conversationForm.memberIds.length ==1}" style="width: 200px;" multiple collapse-tags placeholder="请选择" :title="getMemberTitle(conversationForm.memberIds, getFormMemberList)">
<el-option v-for="elem in getFormMemberList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" :disabled="conversationForm.memberIds.length ==1 && conversationForm.memberIds.includes(elem.id)" />
<el-select v-model="conversationForm.memberIds" :class="{disabledClear: conversationForm.memberIds.length ==1}" style="width: 200px;" multiple collapse-tags placeholder="请选择" :title="getMemberTitle(conversationForm.memberIds, getFormMemberList, conversationForm.systemType)">
<el-option v-for="elem in getFormMemberList" :key="elem.id" :label="getLabel(elem, conversationForm.systemType)" :value="elem.id" :disabled="conversationForm.memberIds.length ==1 && conversationForm.memberIds.includes(elem.id)" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="createConversation">确定</el-button>
<el-button @click="resetConversationForm">重置</el-button>
<el-button @click="resetConversationForm()">重置</el-button>
</el-form-item>
</el-form>
</div>
@ -505,7 +505,7 @@ export default {
},
disStationList: [],
stationShow: ['STATION_SUPERVISOR', 'DEPOT_DISPATCHER', 'SIGNAL_BUILDING', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', 'STATION_PASSENGER', 'STATION_SWITCH_MAN',
'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER'],
'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER', 'STATION_WORKER', 'STATION_ELECTRIC_WORKER'],
conversationForm: {
systemType: 'METRO',
id: '',
@ -564,10 +564,27 @@ export default {
this.initDisStationList();
},
methods: {
resetConversationForm() {
this.$refs.conversationForm.resetFields();
getRoleList(type) {
const list = JSON.parse(JSON.stringify(ConstConfig.ConstSelect.roleTypeList));
if (type == 'RAILWAY') {
list.forEach(item => {
if (item.value == 'STATION_SUPERVISOR') {
item.label = '车站值班员';
}
if (item.value == 'STATION_ELECTRIC_WORKER') {
item.label = '车站电务';
}
});
}
return list;
},
getMemberTitle(val, list) {
resetConversationForm(val) {
this.$refs.conversationForm.resetFields();
if (val) {
this.conversationForm.systemType = val;
}
},
getMemberTitle(val, list, type) {
const mapList = {};
list.forEach(item => {
mapList[item.id] = item;
@ -581,7 +598,7 @@ export default {
}
valArr.forEach(id => {
if (mapList[id]) {
titleArr.push(this.getLabel(mapList[id]));
titleArr.push(this.getLabel(mapList[id], type));
}
});
return titleArr.join('\n');
@ -589,9 +606,9 @@ export default {
getImgUrl(url) {
return url ? this.$store.state.user.ossUrl + '/conversationGroup/' + url : '';
},
getLabel(obj) {
getLabel(obj, type) {
let name = '';
const findType = this.roleList.find(item => {
const findType = this.getRoleList(type).find(item => {
return item.value == obj.type;
});
if (findType) {
@ -819,7 +836,7 @@ export default {
};
memberMap[this.batchForm.systemType].push(member);
}
if (this.batchForm.STATION_ELECTRIC_WORKER && this.batchForm.systemType === 'RAILWAY') {
if (this.batchForm.STATION_ELECTRIC_WORKER && (this.batchForm.systemType === 'RAILWAY' || this.batchForm.systemType === 'METRO')) {
const member = {
id: this.getMemberId(this.batchForm.systemType),
name: '',
@ -1118,6 +1135,14 @@ export default {
deviceCode: station.code
};
memberMap[this.generationForm.systemType].push(memberSignalBuilDing);
} else {
const memberStationElectricWorker = {
id: this.getMemberId(this.generationForm.systemType),
name: '',
type: 'STATION_ELECTRIC_WORKER',
deviceCode: station.code
};
memberMap[this.generationForm.systemType].push(memberStationElectricWorker);
}
});
const memberTrainMaster = {

View File

@ -14,6 +14,7 @@ import { launchFullscreen } from '@/utils/screen';
import editTraining from './editTraining';
import { superAdmin, admin } from '@/router/index';
import { getAllPublishTrainingList, getManageTrainingListInOrg, publishTrainingPutOn, publishTrainingPutOff, publishTrainingDelete } from '@/api/jmap/training';
import { exportTrainingData, importTrainingData } from '@/api/trainingManage';
export default {
name:'TrainingManage',
components: {
@ -56,7 +57,9 @@ export default {
},
queryList:{
query: this.queryFunction,
selectCheckShow: false,
selectCheckShow: this.hasTeachingDataManage(),
selectCheckClass: 'hiddenCheckBtn',
onSelectionChange: this.onSelectionChange,
// paginationHiden: true,
indexShow: true,
columns: [
@ -133,8 +136,13 @@ export default {
}
]
}
],
actions: [
{ text: '导 入', fileType: 'file', handler: this.importTrainingData, show: this.hasTeachingDataManage() },
{ text: '导 出', handler: this.exportTrainingData, show: this.hasTeachingDataManage() }
]
}
},
checkList: []
};
},
computed: {
@ -164,6 +172,54 @@ export default {
});
},
methods: {
onSelectionChange(val) {
this.checkList = val.map(item => {
return item.id;
});
},
importTrainingData() {
const loading = this.$loading({
lock: true,
text: '正在导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
const obj = document.getElementById('queryFormFilesInput');
if (!obj.files) return;
const f = obj.files[0];
const reader = new FileReader();
const that = this;
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
importTrainingData(JSON.parse(data)).then(res => {
that.$message.success('导入成功!');
loading.close();
that.queryList.reload();
}).catch(error => {
loading.close();
that.$message.error('导入失败' + error.message);
});
obj.value = '';
};
});
},
exportTrainingData() {
if (!this.checkList.length) { return; }
exportTrainingData(this.checkList).then(res => {
const content = new Blob([JSON.stringify(res.data)]);
const urlObject = window.URL || window.webkitURL || window;
const url = urlObject.createObjectURL(content);
const el = document.createElement('a');
el.href = url;
el.download = `实训数据.json`;
el.click();
urlObject.revokeObjectURL(url);
}).catch(() => {
this.$message.error('导出失败');
});
},
editLabel() {
this.queryList.reload();
},
@ -270,3 +326,8 @@ export default {
}
};
</script>
<style>
.hiddenCheckBtn {
display: none;
}
</style>

View File

@ -205,6 +205,10 @@ export default {
name: '发布IBP管理',
handleClick: this.publishIbpManage
},
{
name: '草稿IBP管理',
handleClick: this.draftIbpManage
},
{
name: '加载计划运行图管理',
handleClick: this.runPlanCommonManage
@ -541,6 +545,9 @@ export default {
publishIbpManage(index, row) {
this.$router.push({path: '/systemManagement/lineDataManage/publishIbp', query: {mapId: row.id, lineCode: row.lineCode}});
},
draftIbpManage(index, row) {
this.$router.push({path: `/systemManagement/lineDataManage/ibp/home/${row.id}`, query: {lineCode: row.lineCode}});
},
runPlanCommonManage(index, row) {
this.$router.push({path: '/systemManagement/lineDataManage/runPlanCommon', query: {mapId: row.id, lineCode: row.lineCode}});
},