diff --git a/src/jmapNew/config/deviceStyle.js b/src/jmapNew/config/deviceStyle.js index 7b079c099..5f92bd9bb 100644 --- a/src/jmapNew/config/deviceStyle.js +++ b/src/jmapNew/config/deviceStyle.js @@ -1,6 +1,6 @@ const mapDeviceStyle = { '01': 'chengdu_01', - // '01': 'xian_02', + // '01': 'xian_02', '02': 'fuzhou_01', '03': 'bejing_01', '04': 'chengdu_03', diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 11359fa25..8d0b9cddd 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -98,7 +98,8 @@ class SkinCode extends defaultStyle { axle: { radius: 3, // 计轴 半径 distance: 5, // 计轴和区段之间的距离 (未用) - color: 'white', // 区段计轴颜色 + color: '#808080', // 区段计轴颜色 + occupyColor: '#FF0000', // 区段计轴占用颜色 resetColor: '#00FFFF', // 区段计轴预复位颜色 Failure: '#E6A23C' // #FFFF00 计轴失效 }, diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index aad226366..80cd14f6e 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -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(); diff --git a/src/jmapNew/shape/Section/EAxle.js b/src/jmapNew/shape/Section/EAxle.js index ff299b4c9..4be5695a3 100644 --- a/src/jmapNew/shape/Section/EAxle.js +++ b/src/jmapNew/shape/Section/EAxle.js @@ -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(); diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 084a105ec..53aeff108 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -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); } + } } diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 7d72dcb73..1622ced7f 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -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(); } } diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index 6b378a621..14df4b555 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -139,7 +139,7 @@ export default { watch: { '$store.state.menuOperation.setMenuChangeCount': function (val) { if (this.selected._type) { - if (this.selected._type == 'Section' && this.selected.type == '03') { + if (this.selected._type == 'Section' && (this.selected.type == '03' || this.selected.type == '04')) { // 道岔区段 道岔计轴区段 都是道岔操作 this.selected = this.selected.switch; } this.canCommand = true; diff --git a/src/jmapNew/theme/ningbo_01/operationConfig.js b/src/jmapNew/theme/ningbo_01/operationConfig.js index cb4f02fc9..73b76ffe0 100644 --- a/src/jmapNew/theme/ningbo_01/operationConfig.js +++ b/src/jmapNew/theme/ningbo_01/operationConfig.js @@ -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: '鼠标左键点击【确定】按钮' } ] }, diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index 225c78190..deeb34c7a 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -192,6 +192,8 @@ export function parser(data, skinCode, showConfig) { if (cnodeSection && lnodeSection && rnodeSection) { cnodeSection['switch'] = lnodeSection['switch'] = rnodeSection['switch'] = mapDevice[elem.code]; + const sectionParent = mapDevice[cnodeSection.parentCode]; + sectionParent['switch'] = mapDevice[elem.code]; if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) { mapDevice[elem.code].intersection = { x: cnodeSection.points[0].x, diff --git a/src/router/index_Common.js b/src/router/index_Common.js index f467a4aea..91d893624 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -52,6 +52,7 @@ const Taskmanage = () => import('@/views/lesson/taskmanage/list'); const TrainingRuleList = () => import('@/views/lesson/trainingRule/list'); const TrainingRuleEdit = () => import('@/views/lesson/trainingRule/detail/index'); const Trainingmanage = () => import('@/views/lesson/trainingmanage/index'); +const TrainingmanageOld = () => import('@/views/lesson/trainingmanage/oldMap'); const LessonEdit = () => import('@/views/lesson/lessoncategory/index'); const LessonHome = () => import('@/views/lesson/home'); const LessonDetail = () => import('@/views/lesson/details'); @@ -312,6 +313,11 @@ export const asyncRouter = [ component: Trainingmanage, hidden: true }, + {// 老地图实训管理 + path: 'lesson/TrainingmanageOld', + component: TrainingmanageOld, + hidden: true + }, { // 创建课程 path: 'lesson/edit/:type', component: LessonEdit, diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index 8c1af282b..35c1a79de 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -2291,6 +2291,7 @@ export const UrlConfig = { trainingRule: '/design/lesson/trainingRule', trainingRuleDetail: '/design/lesson/trainingRule/detail', trainingManage: '/design/lesson/trainingManage', + trainingManageOld: '/design/lesson/trainingManageOld', lessonTraining: '/design/lesson/training', trainingRecord: '/design/lesson/training', runPlan: '/design/runPlan/detail', diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index 490f910ca..93600be5d 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -209,7 +209,11 @@ export default { this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId}}); }, trainingManage() { - this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay, lineCode: this.$route.query.lineCode}}); + if (this.$route.query.drawWay + '' === 'true') { + this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay, lineCode: this.$route.query.lineCode}}); + } else { + this.$router.push({path: `${UrlConfig.design.trainingManageOld}`, query: {mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay, lineCode: this.$route.query.lineCode}}); + } }, operationManage() { this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode}}); diff --git a/src/views/lesson/trainingRule/addBatch.vue b/src/views/lesson/trainingRule/addBatch.vue index 65c4904a5..591c4074f 100644 --- a/src/views/lesson/trainingRule/addBatch.vue +++ b/src/views/lesson/trainingRule/addBatch.vue @@ -6,6 +6,7 @@ width="25%" :before-close="handleClose" center + :z-index="2000" > @@ -96,19 +97,13 @@ export default { const self = this; this.$refs.dataform.validateForm(() => { if (this.isShow) { - this.$confirm( - this.$t('lesson.wellClearOperate'), - this.$t('global.tips'), - { - confirmButtonText: this.$t('global.confirm'), - cancelButtonText: this.$t('global.cancel'), - type: 'warning' - } - ) - .then(() => { - self.create(); - }) - .catch(() => {}); + this.$confirm(this.$t('lesson.wellClearOperate'), this.$t('global.tips'), { + confirmButtonText: this.$t('global.confirm'), + cancelButtonText: this.$t('global.cancel'), + type: 'warning' + }).then(() => { + self.create(); + }).catch(() => {}); } else { self.create(); } diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue index b42e24814..5c551ced9 100644 --- a/src/views/lesson/trainingmanage/index.vue +++ b/src/views/lesson/trainingmanage/index.vue @@ -2,12 +2,12 @@
+ ref="draftTrain" + :map-id-list="mapIdList" + :training-type-list="trainingTypeList" + :training-operate-type-map="trainingOperateTypeMap" + @refresh="reloadTable" + /> -->
{{ $t('global.back') }} @@ -47,7 +47,6 @@ export default { ControlConvertMenu: [], TrainWindow: [] }, - isLeaving:false, trainingTypeMap: {}, pagerConfig: { pageSize: 'pageSize', @@ -138,15 +137,15 @@ export default { type: '' } /* { - name: this.$t('lesson.trainingRecord'), - handleClick: this.trainingRecord, - type: '' - }*/ + name: this.$t('lesson.trainingRecord'), + handleClick: this.trainingRecord, + type: '' + }*/ ] } ], actions: [ - { text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false } + { text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging } // { text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'}, // { text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'} ] @@ -171,12 +170,6 @@ export default { await this.loadInitData(json); this.typeChoose(json); }, - mounted() { - this.interCheckGenerateStatus(); - }, - beforeDestroy() { - this.isLeaving = true; - }, methods: { async loadInitData(queryData) { this.mapIdList = []; @@ -217,28 +210,6 @@ export default { this.reloadTable(); }, - interCheckGenerateStatus() { - createAllTrainingList(this.$route.query.mapId, false).then((data)=>{ - if (data.data) { - this.queryList.actions.pop(); - this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true }); - } else { - this.queryList.actions.pop(); - this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false }); - } - setTimeout(() => { - if (!this.isLeaving) { - this.interCheckGenerateStatus(this.$route.query.mapId, false); - } - }, 30000); - }).catch(()=>{ - setTimeout(() => { - if (!this.isLeaving) { - this.interCheckGenerateStatus(this.$route.query.mapId, false); - } - }, 30000); - }); - }, async prdChoose(queryData) { this.trainingTypeMap = {}; const lineCode = this.$route.query.lineCode; @@ -291,26 +262,15 @@ export default { beforeClose: async (action, instance, done) => { if (action === 'confirm') { instance.confirmButtonLoading = true; - // instance.confirmButtonText = '生成中...'; - this.queryList.actions.pop(); - this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true }); + instance.confirmButtonText = '生成中...'; try { - const data = await createAllTrainingList(this.$route.query.mapId, true); - this.$message.success('实训生成中...'); - instance.confirmButtonLoading = false; - if (!data.data) { - this.queryList.actions.pop(); - this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false }); - } + await createAllTrainingList(this.$route.query.mapId); + this.$message.success('生成实训成功'); done(); } catch (error) { - instance.confirmButtonLoading = false; this.$message.error(`生成实训失败: ${error.message}`); - this.queryList.actions.pop(); - this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false }); } } else { - instance.confirmButtonLoading = false; done(); } } @@ -384,9 +344,9 @@ export default { }; diff --git a/src/views/lesson/trainingmanage/oldMap.vue b/src/views/lesson/trainingmanage/oldMap.vue new file mode 100644 index 000000000..5884600ab --- /dev/null +++ b/src/views/lesson/trainingmanage/oldMap.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/newMap/mapsystemNew/common/index.vue b/src/views/newMap/mapsystemNew/common/index.vue index 72b1bb70d..abadb52e4 100644 --- a/src/views/newMap/mapsystemNew/common/index.vue +++ b/src/views/newMap/mapsystemNew/common/index.vue @@ -77,7 +77,7 @@ export default { device = this.$store.getters['map/getDeviceByCode'](section.relSwitchCode); } } - if (device._type == 'Section' && device.type == '03') { // 过滤道岔区段变成道岔model + if (device._type == 'Section' && (device.type == '03' || device.type == '04')) { // 过滤道岔相关区段变成道岔model device = device.switch; } diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index fad94a87b..76c89cfc1 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -196,7 +196,7 @@ export default { name: this.$t('map.mapData'), item: [ { prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.centralizedStationList, isHidden: this.isLSectionOffsetShow}, - { prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter') }, + { prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter'), isHidden: this.isLengthFactShow }, { prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, disabled: true, isHidden: !this.isStopPointOffset }, { prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, disabled: true, isHidden: !this.isStopPointOffset }, { prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow }, @@ -362,6 +362,9 @@ export default { isLSectionOffsetShow() { return this.editModel.type === '02'; }, + isLengthFactShow() { + return this.editModel.type === '02' || this.editModel.type === '04'; + }, centralizedStationList() { let list = []; list = this.stationList.filter(station=>{ @@ -414,10 +417,11 @@ export default { this.editModel = deepAssign(this.editModel, selected); this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; this.editModel.points = JSON.parse(JSON.stringify(selected.points)); + console.log(selected, selected.lengthFact, '实际长度'); + this.editModel.lengthFact = selected.lengthFact || 0; this.oldPoint = JSON.parse(JSON.stringify(selected.points)); this.oldLeftSectionCode = selected.leftSectionCode; this.oldRightSectionCode = selected.rightSectionCode; - this.editModel.lengthFact = selected.lengthFact || 0; this.$refs.logicBlock.computedLogicSectionNumList(this.editModel.logicSectionNum); if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) { this.$refs.splitOrMerge.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);