This commit is contained in:
lVAL 2021-02-23 14:54:24 +08:00
commit cb8d4f9f03
18 changed files with 144 additions and 88 deletions

View File

@ -264,3 +264,10 @@ export function getSectionListByStationCode(id, stationCode) {
method: 'get' method: 'get'
}); });
} }
/** 查询地图下所有的区段 */
export function getSectionListByMapId(id) {
return request({
url: `/api/map/${id}/sections`,
method: 'get'
});
}

View File

@ -221,9 +221,9 @@ export function executeScriptNew(group) {
} }
/** 处理ibp盘事件 */ /** 处理ibp盘事件 */
export function handlerIbpEvent(group, button, stationCode) { export function handlerIbpEvent(group, button, stationCode, buttonCode) {
return request({ return request({
url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}`, url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}&buttonCode=${buttonCode}`,
method: 'put' method: 'put'
}); });
} }

View File

@ -495,6 +495,7 @@ export default class Station extends Group {
this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.text.fontColor); this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.text.fontColor);
this.interconnectedControl && this.interconnectedControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.interconnectedControl && this.interconnectedControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.interconnectedControl && this.interconnectedControl.setTextColor(this.style.Station.StationControl.text.fontColor); this.interconnectedControl && this.interconnectedControl.setTextColor(this.style.Station.StationControl.text.fontColor);
this.controlPreReset && this.controlPreReset.setColor(this.style.Station.StationControl.lamp.grayColor);
this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor);
@ -522,6 +523,7 @@ export default class Station extends Group {
// }); // });
// // // //
// } // }
model.preResetValidDuration && this.handlePreResetLamp();
model.controller && this.handleComplexControl(model.controller); model.controller && this.handleComplexControl(model.controller);
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller) && model.centralized) { if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller) && model.centralized) {
model.chargeStationCodeList.forEach(item => { model.chargeStationCodeList.forEach(item => {
@ -544,7 +546,9 @@ export default class Station extends Group {
}); });
} }
} }
handlePreResetLamp() {
this.controlPreReset && this.controlPreReset.setColor('#f00');
}
handleComplexControl(controller) { handleComplexControl(controller) {
const memberData = store.state.training.memberData; const memberData = store.state.training.memberData;
if (memberData[controller].userId) { if (memberData[controller].userId) {

View File

@ -13,11 +13,11 @@ export default class StationTurnBack extends Group {
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.z = 40; this.z = 40;
this.model = model; this.model = model;
this.style = style; this.style = style;
this.lineCode = lineCode; this.lineCode = lineCode;
this.isShowShape = true; this.isShowShape = true;
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
this.setShowMode(); this.setShowMode();
} }
@ -75,7 +75,7 @@ export default class StationTurnBack extends Group {
textVerticalAlign: 'bottom' textVerticalAlign: 'bottom'
} }
}); });
this.add(this.text); this.add(this.text);
} }
let turnName = '按计划执行'; let turnName = '按计划执行';
if (this.lineCode == '03') { if (this.lineCode == '03') {
@ -114,11 +114,11 @@ export default class StationTurnBack extends Group {
} }
} }
createMouseEvent() { createMouseEvent() {
if (this.style.LcControl.mouseOverStyle) { if (this.style.LcControl.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
} }
} }
@ -158,28 +158,28 @@ export default class StationTurnBack extends Group {
} }
} }
setAshShow() { setAshShow() {
this.control && this.control.setStyle({fill:'#FFF'}); this.control && this.control.setStyle({fill:'#FFF'});
} }
// 设置状态 // 设置状态
setState(model, tbStrategyId = null) { setState(model, tbStrategyId = null) {
if (!this.isShowShape) return; if (!this.isShowShape) return;
this.recover(); this.recover();
// 只响应前端自定义类型的状态变化 // 只响应前端自定义类型的状态变化
if (model._free) { if (model._free) {
this.setAshShow() this.setAshShow();
} else { } else {
if (tbStrategyId) { if (tbStrategyId) {
model.tbStrategyId = tbStrategyId; model.tbStrategyId = tbStrategyId;
model.optionList.forEach(item => { model.optionList.forEach(item => {
if (item.id == tbStrategyId) { if (item.id == tbStrategyId) {
this.handleStatus(item.label); this.handleStatus(item.label);
} }
}); });
} }
} }
} }
getShapeTipPoint() { getShapeTipPoint() {
const rect = this.control.getBoundingRect(); const rect = this.control.getBoundingRect();
@ -213,7 +213,11 @@ export default class StationTurnBack extends Group {
return this.model.position; return this.model.position;
} }
getBoundingRect() { getBoundingRect() {
return this.strategyText.getBoundingRect()||this.control.getBoundingRect(); if (this.strategyText && this.strategyText.getBoundingRect()) {
return this.strategyText.getBoundingRect();
} else if (this.control && this.control.getBoundingRect()) {
return this.control.getBoundingRect();
}
} }
} }

View File

@ -32,7 +32,7 @@ class Theme {
'11': 'all', '11': 'all',
'12': 'all', '12': 'all',
'13':'all', '13':'all',
'14':'all' '14':'ecStation'
}; };
} }

View File

@ -87,10 +87,6 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
@ -101,6 +97,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -184,10 +184,6 @@ export default {
} else { } else {
this.menu = []; this.menu = [];
} }
//
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
@ -198,6 +194,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -231,10 +231,6 @@ export default {
}, },
initMenu() { initMenu() {
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
@ -245,6 +241,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
}, },
executeConfirm(operate) { executeConfirm(operate) {
if (operate.operation === OperationEvent.Signal.unlock.confirm.operation) { if (operate.operation === OperationEvent.Signal.unlock.confirm.operation) {

View File

@ -131,10 +131,6 @@ export default {
initMenu() { initMenu() {
if (this.selected.centralized) { if (this.selected.centralized) {
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
const userId = this.$store.state.user.id; const userId = this.$store.state.user.id;
@ -144,6 +140,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
} }
}, },
doShow(point) { doShow(point) {

View File

@ -78,10 +78,6 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
const userId = this.$store.state.user.id; const userId = this.$store.state.user.id;
@ -92,6 +88,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -82,10 +82,6 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
this.getCurrentStateObject(); this.getCurrentStateObject();
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
@ -96,6 +92,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -185,11 +185,6 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
@ -200,6 +195,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -80,11 +80,6 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
if (this.$store.state.training.mode === TrainingMode.NORMAL) { if (this.$store.state.training.mode === TrainingMode.NORMAL) {
const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
const memberData = this.$store.state.training.memberData; const memberData = this.$store.state.training.memberData;
@ -95,6 +90,10 @@ export default {
}); });
} }
} }
//
if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce;
}
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -186,6 +186,16 @@ export default {
initMenu() { initMenu() {
// //
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = MenuContextHandler.covert(this.menuNormal);
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;
});
}
}
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
// if (!this.$store.state.scriptRecord.bgSet) { // if (!this.$store.state.scriptRecord.bgSet) {
@ -198,16 +208,6 @@ export default {
// this.menu = this.menuForce; // 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) { doShow(point) {
this.clickEvent(); this.clickEvent();

View File

@ -119,7 +119,8 @@ export const IbpOperation = {
XXKM: {operate: '08', event: 'XXKM', name: '下行屏蔽门开门'}, XXKM: {operate: '08', event: 'XXKM', name: '下行屏蔽门开门'},
SXKM: {operate: '10', event: 'SXKM', name: '上行屏蔽门开门'}, SXKM: {operate: '10', event: 'SXKM', name: '上行屏蔽门开门'},
XXYS: {operate: '09', event: 'XXYS', name: '下行钥匙'}, XXYS: {operate: '09', event: 'XXYS', name: '下行钥匙'},
SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'} SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'},
PRERESET: {operate: '12', event: 'PRERESET', name: '计轴复位'}
}; };
/** /**

View File

@ -34,6 +34,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="form.mean === 'PRERESET'" label="关联区段">
<el-select v-model="form.sectionCode" placeholder="请选择">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + '(' + item.code +')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
@ -44,6 +54,7 @@
</template> </template>
<script> <script>
import {getSectionListByStationCode, getSectionListByMapId } from '@/api/jmap/map';
export default { export default {
name: 'ButtonDraft', name: 'ButtonDraft',
components: { components: {
@ -62,14 +73,17 @@ export default {
{ label: '取消紧急停车', value: 'QXJJTC' }, { label: '取消紧急停车', value: 'QXJJTC' },
{ label: '报警切除', value: 'BJQC' }, { label: '报警切除', value: 'BJQC' },
{ label: '下行屏蔽门开门', value: 'XXKM' }, { label: '下行屏蔽门开门', value: 'XXKM' },
{ label: '上行屏蔽门开门', value: 'SXKM' } { label: '上行屏蔽门开门', value: 'SXKM' },
{ label: '计轴复位', value: 'PRERESET' }
], ],
form: { form: {
code: '', code: '',
buttonColor: 'red', buttonColor: 'red',
buttonWidth: 25, buttonWidth: 25,
x: 10, x: 10,
y: 10 y: 10,
sectionCode: '',
mean: ''
}, },
rules: { rules: {
code: [ code: [
@ -81,7 +95,8 @@ export default {
buttonWidth: [ buttonWidth: [
{ required: true, message: this.$t('ibp.enterTheButtonWidth'), trigger: 'blur' } { required: true, message: this.$t('ibp.enterTheButtonWidth'), trigger: 'blur' }
] ]
} },
sectionList: []
}; };
}, },
computed: { computed: {
@ -100,12 +115,31 @@ export default {
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.mean = model.mean; this.form.mean = model.mean;
this.form.sectionCode = model.sectionCode;
} }
} }
}, },
mounted() { mounted() {
if (this.$route.query.stationCode) {
getSectionListByStationCode(this.$route.query.mapId, this.$route.query.stationCode).then(resp => {
this.sectionList = resp.data;
console.log(resp.data);
}).catch(() => {
this.$message.error('获取区段列表失败!');
});
} else {
getSectionListByMapId(this.$route.query.mapId).then(resp => {
this.sectionList = resp.data;
console.log(resp.data);
}).catch(() => {
this.$message.error('获取区段列表失败!');
});
}
}, },
methods: { methods: {
// consoleChange() {
// console.log(this.form.mean === 'PRERESET', this.form.mean );
// },
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
@ -119,7 +153,8 @@ export default {
color: this.form.buttonColor, color: this.form.buttonColor,
status: 'off', status: 'off',
width: this.form.buttonWidth, width: this.form.buttonWidth,
mean: this.form.mean mean: this.form.mean,
sectionCode: this.form.sectionCode
}; };
this.$emit('createData', buttonModel); this.$emit('createData', buttonModel);
this.initPage(); this.initPage();
@ -139,7 +174,8 @@ export default {
color: this.form.buttonColor, color: this.form.buttonColor,
status: 'off', status: 'off',
width: this.form.buttonWidth, width: this.form.buttonWidth,
mean: this.form.mean mean: this.form.mean,
sectionCode: this.form.sectionCode
}; };
this.$emit('deleteDataModel', buttonModel ); this.$emit('deleteDataModel', buttonModel );
this.initPage(); this.initPage();
@ -154,7 +190,8 @@ export default {
buttonWidth: 25, buttonWidth: 25,
x: 10, x: 10,
y: 10, y: 10,
mean: '' mean: '',
sectionCode: ''
}; };
}, },
generateCode() { generateCode() {

View File

@ -229,10 +229,12 @@ export default {
}, },
onMouseDown(em) { onMouseDown(em) {
if (em.deviceModel.mean) { if (em.deviceModel.mean && IbpOperation[em.deviceModel.mean] && em.deviceModel.mean === IbpOperation.PRERESET.event) {
if (IbpOperation[em.deviceModel.mean]) { handlerIbpEvent(this.$route.query.group, IbpOperation[em.deviceModel.mean].event, this.stationCode, em.deviceModel.sectionCode).then(() => {
handlerIbpEvent(this.$route.query.group, IbpOperation[em.deviceModel.mean].event, this.stationCode); }).catch(error => { this.$message.error(error.message); });
} } else if ( em.deviceModel.mean && IbpOperation[em.deviceModel.mean]) {
handlerIbpEvent(this.$route.query.group, IbpOperation[em.deviceModel.mean].event, this.stationCode).then(() => {
}).catch(error => { this.$message.error(error.message); });
} }
}, },
// //

View File

@ -103,7 +103,8 @@ export default {
'allowEarlyDepartureWhenHoldTrain', 'allowEarlyDepartureWhenHoldTrain',
'standSkipSetTrainOnlyOnce', 'standSkipSetTrainOnlyOnce',
'blockadeCommandOnlyValidInStandbyMode', 'blockadeCommandOnlyValidInStandbyMode',
'ebwhenCancelRoute' 'ebwhenCancelRoute',
'stationPreResetBeforeAxlePreReset'
], ],
selectList: ['runMode'], selectList: ['runMode'],
generalConfig: [ generalConfig: [
@ -137,7 +138,8 @@ export default {
'allowEarlyDepartureWhenHoldTrain', 'allowEarlyDepartureWhenHoldTrain',
'standSkipSetTrainOnlyOnce', 'standSkipSetTrainOnlyOnce',
'blockadeCommandOnlyValidInStandbyMode', 'blockadeCommandOnlyValidInStandbyMode',
'ebwhenCancelRoute' 'ebwhenCancelRoute',
'stationPreResetBeforeAxlePreReset'
], ],
rangeList: ['noParkingSM', 'parkingSM'], rangeList: ['noParkingSM', 'parkingSM'],
speedList: ['rmAtpSpeed', 'urmAtpSpeed'], speedList: ['rmAtpSpeed', 'urmAtpSpeed'],
@ -176,7 +178,8 @@ export default {
allowEarlyDepartureWhenHoldTrain: '扣车时是否允许提前发车', allowEarlyDepartureWhenHoldTrain: '扣车时是否允许提前发车',
standSkipSetTrainOnlyOnce: '站台指定列车跳停仅跳停一次', standSkipSetTrainOnlyOnce: '站台指定列车跳停仅跳停一次',
blockadeCommandOnlyValidInStandbyMode: '封锁命令(状态)仅在后备模式下有效', blockadeCommandOnlyValidInStandbyMode: '封锁命令(状态)仅在后备模式下有效',
ebwhenCancelRoute: '取消进路时列车紧急制动' ebwhenCancelRoute: '取消进路时列车紧急制动',
stationPreResetBeforeAxlePreReset: '计轴预复位前需要车站预复位'
} }
}; };
}, },