This commit is contained in:
zyy 2020-04-09 15:21:57 +08:00
commit 184ff9d1e2
10 changed files with 186 additions and 79 deletions

View File

@ -1,6 +1,6 @@
const mapDeviceStyle = {
'01': 'chengdu_01',
// '01': 'xian_02'
// '01': 'xian_02',
'02': 'fuzhou_01',
'03': 'bejing_01',
'04': 'chengdu_03',

View File

@ -98,7 +98,8 @@ class SkinCode extends defaultStyle {
axle: {
radius: 3, // 计轴 半径
distance: 5, // 计轴和区段之间的距离 (未用)
color: 'white', // 区段计轴颜色
color: '#808080', // 区段计轴颜色
occupyColor: '#FF0000', // 区段计轴占用颜色
resetColor: '#00FFFF', // 区段计轴预复位颜色
Failure: '#E6A23C' // #FFFF00 计轴失效
},

View File

@ -332,6 +332,8 @@ class Jlmap {
}
update(list) {
this.setUpdateMapDevice(list || []); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息
const signalDeviceList = [];
const signalStatusList = [];
(list || []).forEach(elem => {
const code = elem.code;
const type = elem._type;
@ -347,8 +349,12 @@ class Jlmap {
}
const signalDevice = this.mapDevice[route.startSignalCode];
const signalStatus = {atsControl: elem.atsControl, fleetMode: elem.fleetMode};
if (this.hookHandle(signalDevice, signalStatus)) {
this.$painter.update(signalDevice);
const index = signalDeviceList.indexOf(signalDevice);
if (index === -1) {
signalDeviceList.push(signalDevice);
signalStatusList.push(signalStatus);
} else {
signalStatusList[index] = {atsControl: signalStatusList[index].atsControl && elem.atsControl, fleetMode: signalStatusList[index].fleetMode || elem.fleetMode};
}
} else if (elem.deviceType === 'CYCLE') {
store.dispatch('map/updateAutoReentryState', elem);
@ -385,13 +391,19 @@ class Jlmap {
}
}
});
this.handleRouteSignalStatus(signalDeviceList, signalStatusList);
// 状态后处理
this.postHandle(list || []);
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }
}
handleRouteSignalStatus(signalDeviceList, signalStatusList) {
signalDeviceList.forEach((item, index)=> {
if (item && this.hookHandle(item, signalStatusList[index])) {
this.$painter.update(item);
}
});
}
pullBack(payload) {
if (payload.type === 'zoom') {
const zrWidth = this.$zr.getWidth();

View File

@ -7,13 +7,17 @@ import Path from 'zrender/src/graphic/Path';
export const EAxle = Path.extend({
type: 'EAxle',
shape: {
point: null
// style: this.style,
// traingle: traingle11,
// drictx: 1,
// dricty: 1,
// point: this.model.points[0]
},
buildPath: function (ctx, model) {
if (model && model.style && model.traingle) {
const axleLength = 2 * model.style.Section.axle.radius;
const positionx = model.point.x + model.drictx * (model.traingle.getCos(axleLength));
const positiony = model.point.y + model.dricty * (model.traingle.getCos(axleLength));
const positionx = model.point.x + model.drictx * (model.traingle.getCos(axleLength) * 1.2);
const positiony = model.point.y + model.dricty * (model.traingle.getCos(axleLength) * 1.2);
// 圆弧
const arcX = positionx - model.dricty * model.traingle.getSin(axleLength);
const arcY = positiony + model.drictx * model.traingle.getSin(axleLength);
@ -23,8 +27,8 @@ export const EAxle = Path.extend({
const x1 = positionx - model.traingle.getCos(axleLength) - model.dricty * model.traingle.getSin(axleLength);
const y1 = positiony + model.drictx * model.traingle.getSin(axleLength) - model.traingle.getSin(axleLength);
const x2 = positionx + model.traingle.getCos(axleLength) - model.dricty * model.traingle.getSin(axleLength);
const y2 = positiony + model.drictx * model.traingle.getSin(axleLength) + model.traingle.getSin(axleLength);
const x2 = positionx + model.traingle.getCos(axleLength * 1.5) - model.dricty * model.traingle.getSin(axleLength);
const y2 = positiony + model.drictx * model.traingle.getSin(axleLength * 1.5) + model.traingle.getSin(axleLength);
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.closePath();

View File

@ -6,7 +6,7 @@ import ELines from './ELines'; // 创建多线条 曲线 (私有)
import EblockLines from './EblockLines'; // 区段封锁特有
import ESeparator from './ESeparator'; // 分隔符 (私有)
import EMouse from './EMouse';
// import { EAxle } from './EAxle'; // 创建计轴 (暂时不使用)
import { EAxle } from './EAxle'; // 创建计轴 (暂时不使用)
import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
import ELimitName from './ELimitName'; // 成都三号线 限速名称
import JTriangle from '../../utils/JTriangle';
@ -39,6 +39,23 @@ export default class Section extends Group {
this.creatRelease(); // 创建延时释放
this.createSeparator(); // 创建分隔符
this.createTurnBack(); // 创建成都三号线 折返箭头
// this.createAxles();
/* 计轴 */
// const traingle11 = new JTriangle(this.model.points[0], this.model.points[1]);
// this.axle = new EAxle({
// shape: {
// style: this.style,
// traingle: traingle11,
// drictx: 1,
// dricty: 1,
// point: this.model.points[0]
// },
// style: {
// fill: this.style.Section.axle.color,
// stroke: this.style.Section.axle.color
// }
// });
// this.add(this.axle);
}
// 创建区段名称
@ -209,6 +226,7 @@ export default class Section extends Group {
});
this.add(this.destinationText);
}
}
}

View File

@ -566,11 +566,11 @@ class Signal extends Group {
}
setLowButtonActive() {
this.lowButton.setLowButtonActive();
this.lowButton && this.lowButton.setLowButtonActive();
}
setLowButtonRecover() {
this.lowButton.setLowButtonRecover();
this.lowButton && this.lowButton.setLowButtonRecover();
}
}

View File

@ -82,7 +82,7 @@ export default {
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
return OperationEvent.StationControl.requestCentralControl.choose.domId;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
return OperationEvent.StationControl.StationControl.choose.domId;
return OperationEvent.StationControl.requestStationControl.choose.domId;
} else {
return '';
}
@ -95,7 +95,7 @@ export default {
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
return OperationEvent.StationControl.StationControl.confirm.domId;
return OperationEvent.StationControl.requestStationControl.confirm.domId;
} else {
return '';
}

View File

@ -693,11 +693,11 @@ export default {
operateType: 'Signal_Block',
skinCode: '06',
trainingName: '信号封锁({5})',
trainingRemark: '信号封',
trainingRemark: '信号封',
trainingType: 'Signal',
productTypes: ['01'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '306', tip: '鼠标右键菜单选择【信号封】' },
{ deviceType: '04', orderNum: 1, operateCode: '306', tip: '鼠标右键菜单选择【信号封】' },
{ deviceType: '04', orderNum: 2, operateCode: '306', tip: '鼠标左键点击【确定】按钮' }
]
},
@ -721,7 +721,7 @@ export default {
{
maxDuration: 15,
minDuration: 8,
operateType: 'Signal_Detail',
operateType: 'Signal_Find_Routes_Status',
skinCode: '06',
trainingName: '查询进路控制状态({5})',
trainingRemark: '查询进路控制状态',

View File

@ -99,7 +99,7 @@ export default {
/** 取消联锁自动触发 */
CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER: {value:'Signal_Cancel_CI_Auto_Trigger', label: '取消联锁自动触发'},
/** 查询进路状态 */
CMD_SIGNAL_DETAIL: {value:'Signal_Detail', label: '查询进路状态'},
CMD_SIGNAL_DETAIL: {value:'Signal_Find_Routes_Status', label: '查询进路状态'},
/** 设置自动折返 */
CMD_SIGNAL_SET_AUTO_TURN_BACK: {value: 'Signal_Set_Auto_Turn_Back', label: '设置自动折返'},
/** 取消自动折返 */

View File

@ -28,6 +28,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
// import TrainingDraft from './draft';
import localStore from 'storejs';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getOperateTrainingList } from '@/api/management/operation';
export default {
name: 'TrainingGeneration',
@ -38,6 +39,7 @@ export default {
return {
mapIdList: [],
trainingTypeList: [],
trainingTypeLists: [],
trainingOperateTypeMap: {
Switch: [],
Section: [],
@ -105,7 +107,7 @@ export default {
title: this.$t('lesson.trainingType'),
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeList, ['value', 'label']); },
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeLists, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
@ -185,36 +187,55 @@ export default {
this.mapIdList = response.data;
});
this.queryForm.queryObject.prdType.config.data = this.prdTypeList;
//
// this.trainingTypeList = [];
// this.$Dictionary.trainingType().then(list => {
// this.trainingTypeList = list;
// });
let val;
for ( val in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
if (this.$route.query.drawWay + '' === 'true') {
let val;
for ( val in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
}
for ( val in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
}
for ( val in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
await this.prdChoose(queryData);
} else {
//
this.trainingTypeList = [];
this.$Dictionary.trainingType().then(list => {
this.trainingTypeList = list;
});
this.trainingOperateTypeMap = {};
const list01 = await this.$Dictionary.stationControl();
this.trainingOperateTypeMap['01'] = list01; //
const list02 = await this.$Dictionary.signalOperation();
this.trainingOperateTypeMap['02'] = list02; //
const list03 = await this.$Dictionary.switchOperation();
this.trainingOperateTypeMap['03'] = list03; //
const list04 = await this.$Dictionary.sectionOperation();
this.trainingOperateTypeMap['04'] = list04; //
const list05 = await this.$Dictionary.stationStandOperation();
this.trainingOperateTypeMap['05'] = list05; //
const list06 = await this.$Dictionary.trainPlanOperation();
this.trainingOperateTypeMap['06'] = list06; //
const list07 = await this.$Dictionary.trainOperation();
this.trainingOperateTypeMap['07'] = list07; //
const list08 = await this.$Dictionary.limitOperation();
this.trainingOperateTypeMap['08'] = list08; //
this.prdChoose(queryData);
}
for ( val in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
}
for ( val in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
await this.prdChoose(queryData);
this.reloadTable();
},
interCheckGenerateStatus() {
@ -240,38 +261,89 @@ export default {
});
},
async prdChoose(queryData) {
this.trainingTypeMap = {};
const lineCode = this.$route.query.lineCode;
const res = await getCmdList(lineCode, {prdType:queryData.prdType});
const trainingOperateList = [];
const trainingOperateConfigList = [];
const operateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: []
};
if (res && res.code === 200) {
res.data.forEach(item => {
this.trainingOperateTypeMap[item.operateObject].forEach(ele => {
if (ele.value == item.operate) {
operateTypeMap[item.operateObject].push(ele);
let flag = true;
this.trainingTypeList.forEach(item => {
if (item.code === queryData.type) {
flag = false;
}
});
console.log(flag, '-------------', this.queryForm.queryObject.operateType);
if (this.$route.query.drawWay + '' === 'true') {
if (flag) { console.log('11111111111'); queryData.type = ''; queryData.operateType = ''; }
this.trainingTypeMap = {};
const lineCode = this.$route.query.lineCode;
const res = await getCmdList(lineCode, {prdType:queryData.prdType});
const trainingOperateList = [];
const trainingOperateConfigList = [];
const operateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: []
};
if (res && res.code === 200) {
res.data.forEach(item => {
this.trainingOperateTypeMap[item.operateObject].forEach(ele => {
if (ele.value == item.operate) {
operateTypeMap[item.operateObject].push(ele);
}
});
if (!trainingOperateList.includes(item.operateObject)) {
trainingOperateList.push(item.operateObject);
const objectLabel = ConstConfig.ConstSelect.trainingDeviceType[item.operateObject] || {};
trainingOperateConfigList.push({value: item.operateObject, label: Cookies.get('user_lang') == 'en' ? objectLabel.enlabel : objectLabel.label});
}
});
if (!trainingOperateList.includes(item.operateObject)) {
trainingOperateList.push(item.operateObject);
const objectLabel = ConstConfig.ConstSelect.trainingDeviceType[item.operateObject] || {};
trainingOperateConfigList.push({value: item.operateObject, label: Cookies.get('user_lang') == 'en' ? objectLabel.enlabel : objectLabel.label});
}
});
this.queryForm.queryObject.type.config.data = trainingOperateConfigList;
this.trainingTypeList = trainingOperateConfigList;
this.trainingTypeMap = operateTypeMap;
this.queryForm.queryObject.type.config.data = trainingOperateConfigList;
this.trainingTypeList = trainingOperateConfigList;
this.trainingTypeLists = trainingOperateConfigList;
this.trainingTypeMap = operateTypeMap;
} else {
this.$message.error(this.$t('error.failedToObtainTrainingType'));
}
} else {
this.$message.error(this.$t('error.failedToObtainTrainingType'));
if (!flag) { queryData.type = ''; queryData.operateType = ''; }
this.trainingTypeMap = {};
const mapId = this.$route.query.mapId;
const res = await getOperateTrainingList({ mapId: mapId, productType: queryData.prdType });
if (res && res.code == 200) {
const trainingTypeLists = res.data;
this.trainingTypeList.forEach(elem => {
trainingTypeLists.forEach(item => {
if (item.id == elem.code) {
item.label = elem.name;
item.value = elem.code;
}
if (this.trainingOperateTypeMap[item.id].length) {
this.trainingOperateTypeMap[item.id].forEach(i => {
item.children.forEach(v => {
if (i.code == v.id) {
v.label = i.name;
v.value = i.code;
}
});
});
}
});
});
trainingTypeLists.forEach(item => {
item.children.forEach(v => {
if (!this.trainingTypeMap[item.id]) {
this.trainingTypeMap[item.id] = [];
}
this.trainingTypeMap[item.id].push({
label: v.label,
value: v.value
});
});
});
this.queryForm.queryObject.type.config.data = trainingTypeLists;
this.trainingTypeLists = trainingTypeLists;
}
}
},
typeChoose(form) {