diff --git a/src/api/company.js b/src/api/company.js index 7b39b5dbe..cb3c79ab1 100644 --- a/src/api/company.js +++ b/src/api/company.js @@ -89,29 +89,6 @@ export function getCompanyMemberPaging(companyId) { method: 'get' }); } -/** 更新单位成员信息 */ -export function putCompanyMember(companyId, data) { - return request({ - url: `/api/company/${companyId}/refUserInfo`, - method: 'put', - data - }); -} -/** 导入单位成员信息 */ -export function importCompanyMember(companyId, data) { - return request({ - url: `/api/company/${companyId}/refUserInfo/import`, - method: 'post', - data - }); -} -/** 删除单位成员信息 */ -export function deleteCompanyMember(companyId, memberId) { - return request({ - url: `/api/company/${companyId}/refUserInfo/${memberId}`, - method: 'delete' - }); -} /** 查询职位信息 */ export function getPositionInfo(positionId) { return request({ @@ -172,3 +149,34 @@ export function deleteDeptInfo(deptId) { method: 'delete' }); } +/** 获取用户单位的部门信息 */ +export function getCompanyDeptInfo(companyId) { + return request({ + url: `/api/company/${companyId}/userDeparts`, + method: 'get' + }); +} +/** 导入单位成员信息 */ +export function importCompanyMember(companyId, data) { + return request({ + url: `/api/company/${companyId}/departUserInfo/import`, + method: 'post', + data + }); +} +/** 分页查询单位部门成员信息 */ +export function queryDeptInfoPaging(params) { + return request({ + url: `/api/company/dept/${params.deptId}/departUserInfo`, + method: 'get', + params + }); +} +/** 取消单位的部门成员关系 */ +export function deleteDepartUserRelation(data) { + return request({ + url: `/api/company/departUserInfo`, + method: 'delete', + data + }); +} diff --git a/src/api/iscs.js b/src/api/iscs.js index 0f15a31b9..2b81ddacb 100644 --- a/src/api/iscs.js +++ b/src/api/iscs.js @@ -41,3 +41,11 @@ export function deleteIscs(id) { method: 'delete' }); } +// 查询地图下是否有ISCS数据 +export function queryHasIscs(params) { + return request({ + url: `/api/v1/iscs/hasData`, + method: 'get', + params + }); +} diff --git a/src/api/jmap/lesson.js b/src/api/jmap/lesson.js index e1960957f..f8083a416 100644 --- a/src/api/jmap/lesson.js +++ b/src/api/jmap/lesson.js @@ -74,9 +74,9 @@ export function getPublishLessonListByMapId(params) { }); } /** 根据班级获取课程 */ -export function getLessonByClassId(classId) { +export function getLessonByClassId(departId) { return request({ - url: `/api/lesson/class/${classId}`, + url: `/api/lesson/depart/${departId}`, method: 'get' }); } @@ -95,10 +95,10 @@ export function aKeyGeneratingLesson(data) { data: data }); } -/** 根据课程ID获取班级 */ +/** 根据课程ID获取部门 */ export function getExamClassList(lessonId) { return request({ - url: `/api/lesson/${lessonId}/classes`, + url: `/api/lesson/${lessonId}/departs`, method: 'get' }); } diff --git a/src/api/management/user.js b/src/api/management/user.js index e70b2d586..440875834 100644 --- a/src/api/management/user.js +++ b/src/api/management/user.js @@ -163,11 +163,11 @@ export function getProjectClassList(projectCode) { } // 导出学生成绩 -export function exportStudentResults(projectCode, data) { +export function exportStudentResults(data) { return request({ - url: `/api/user/project/${projectCode}/export/student`, + url: `/api/user/scores`, method: 'put', - data: data + data }); } diff --git a/src/jmapNew/config/keyboardEvents.js b/src/jmapNew/config/keyboardEvents.js index 4938ba94a..caf5f6021 100644 --- a/src/jmapNew/config/keyboardEvents.js +++ b/src/jmapNew/config/keyboardEvents.js @@ -12,6 +12,7 @@ export const keyboardEvents = { ALT_O: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_O'}, ALT_E: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_E'}, ALT_S: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_S'}, - ALT_D: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_D'} + ALT_D: {altKey: true, ctrlKey: false, shiftKey: false, event: 'Alt_D'}, + TAB: {altKey: false, ctrlKey: false, shiftKey: false, event: 'Tab'} }; diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 5cc88ccfd..1d5b6e043 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -175,7 +175,8 @@ class SkinCode extends defaultStyle { greenColor: '#00FF00', // 信号灯绿色 yellowColor: '#FFFF00', // 信号灯黄色 whiteColor: '#FFFFFF', // 信号灯白色 - blueColor: '#0070C0' // 信号灯蓝色 + blueColor: '#0070C0', // 信号灯蓝色 + faultType: 'light' // 信号机故障类型 (light闪) }, route: { direction: true, // 自动通过方向 diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 6178586c2..c6b56ce65 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -153,7 +153,8 @@ class SkinCode extends defaultStyle { greenColor: '#00FF00', // 信号灯绿色 yellowColor: '#FFFF00', // 信号灯黄色 whiteColor: '#FFFFFF', // 信号灯白色 - blueColor: '#0070C0' // 信号灯蓝色 + blueColor: '#0070C0', // 信号灯蓝色 + faultType: 'flash' // 信号机故障类型 (flash为福州一号线与西安一三号线特殊类型,太阳) }, route: { direction: false, // 自动进路方向 diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index 65c2feb75..ea6015657 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -186,7 +186,7 @@ class SkinCode extends defaultStyle { stopWidth: 2, // 禁止线宽度 borderWidth: 2, // 信号灯边框线宽度 borderColor: '#000000', // 信号灯边框线颜色 - physicColor:'#ffffff', // 物理点灯信号灯边框线颜色 + physicColor:'#ffffff', // 物理点灯信号灯边框线颜色 radiusR: 5, // 信号灯半径 blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#C0C0C0', // 信号灯灰色 @@ -195,7 +195,7 @@ class SkinCode extends defaultStyle { yellowColor: 'yellow', // 信号灯黄色 whiteColor: '#FFFFFF', // 信号灯白色 blueColor: '#0070C0', // 信号灯蓝色 - logicDisplayNone: true // 信号机上×型标识不展示 + faultType: 'cross' // 信号机故障类型 (cross叉形狀) }, route: { direction: false, // 自动通过方向 diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index f9cfbb504..3bb623608 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -162,7 +162,7 @@ class SkinCode extends defaultStyle { yellowColor: '#FFFF00', // 信号灯黄色 whiteColor: '#FFFFFF', // 信号灯白色 blueColor: '#0070C0', // 信号灯蓝色 - faultType: 'flash' // 信号机故障类型 (flash为西安三号线特殊类型) + faultType: 'flash' // 信号机故障类型(flash太阳) }, route: { direction: false, // 自动进路方向 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index f059bc1f7..4a797e1a3 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -175,6 +175,7 @@ class SkinCode extends defaultStyle { yellowColor: 'yellow', // 信号灯黄色 whiteColor: '#FFFFFF', // 信号灯白色 blueColor: '#0070C0', // 信号灯蓝色 + faultType: 'watch', // 信号机故障类型 (watch表形狀) logicDisplayNone: true // 信号机上×型标识不展示 }, route: { diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 135d880f2..b636cf442 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -156,15 +156,20 @@ class Jlmap { if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); } } - switchScreen(data, num, sum) { - const sumHalf = sum <= 2 ? sum : sum / 2; - const dx = data.width / sumHalf; - const dy = data.height / sumHalf; - const row = num <= sumHalf ? 0 : 1; - const opts = { - dx: dx * (row == 0 ? num - 1 : num - sumHalf - 1), - dy: dy * row - }; + switchScreen(data, num, sum, obj) { + const opts = {}; + if (obj.width == 1) { + const dy = data.height / sum; + opts['dx'] = 0; + opts['dy'] = dy * (num - 1); + } else { + const sumHalf = sum <= 2 ? sum : sum / 2; + const dx = data.width / sumHalf; + const dy = data.height / sumHalf; + const row = num <= sumHalf ? 0 : 1; + opts['dx'] = dx * (row == 0 ? num - 1 : num - sumHalf - 1); + opts['dy'] = dy * row; + } this.$painter.updateScreenNum(opts); } @@ -236,6 +241,7 @@ class Jlmap { const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height}; rectList.push(rect); } + console.log(screenList, rectList); this.$painter.updateTransform1(screenList, rectList); } diff --git a/src/jmapNew/shape/SaidLamp/ELampFilament.js b/src/jmapNew/shape/SaidLamp/ELampFilament.js index 5feab8c97..4b08d7859 100644 --- a/src/jmapNew/shape/SaidLamp/ELampFilament.js +++ b/src/jmapNew/shape/SaidLamp/ELampFilament.js @@ -14,4 +14,7 @@ export default class ELampFilament extends Group { this.path = createPathSvg(this.model); this.add(this.path); } + setControlColor(color) { + this.path.setStyle({fill: color}); + } } diff --git a/src/jmapNew/shape/SaidLamp/index.js b/src/jmapNew/shape/SaidLamp/index.js index a395e12e3..5536254bf 100644 --- a/src/jmapNew/shape/SaidLamp/index.js +++ b/src/jmapNew/shape/SaidLamp/index.js @@ -224,11 +224,11 @@ export default class SaidLamp extends Group { this.isShowShape = false; } } - setControlColor(color, flag) { - this.control && this.control.getControl().stopAnimation(false); - this.control && this.control.setControlColor(color); + setControlColor(color, flag = false) { + this.control && this.control.getControl && this.control.getControl().stopAnimation(false); + this.control && this.control.setControlColor && this.control.setControlColor(color); if (flag) { - this.control && this.control.getControl().animateStyle(true) + this.control && this.control.getControl && this.control.getControl().animateStyle(true) .when(0, { fill: this.style.backgroundColor }) .when(1000, { fill: color }) .when(2000, { fill: this.style.backgroundColor }) diff --git a/src/jmapNew/shape/Signal/ESigLamp.js b/src/jmapNew/shape/Signal/ESigLamp.js index 7cc6492a3..18d65e975 100644 --- a/src/jmapNew/shape/Signal/ESigLamp.js +++ b/src/jmapNew/shape/Signal/ESigLamp.js @@ -58,11 +58,7 @@ class ESigLamp extends Group { _subType: 'SignalLamp', _val: '3', zlevel: model.zlevel, - z: model.z, - origin: { - x: model.originX, - y: model.originY - }, + z: model.z + 1, shape: { x1: model.x + (style.Signal.lamp.radiusR + 0.5) * Math.cos(Math.PI / 4), y1: model.y + (style.Signal.lamp.radiusR + 0.5) * Math.sin(Math.PI / 4), @@ -78,11 +74,7 @@ class ESigLamp extends Group { _subType: 'SignalLamp', _val: '3', zlevel: model.zlevel, - z: model.z, - origin: { - x: model.originX, - y: model.originY - }, + z: model.z + 1, shape: { x1: model.x + (style.Signal.lamp.radiusR + 0.5) * Math.cos(Math.PI / 4), y1: model.y + (style.Signal.lamp.radiusR + 0.5) * (Math.sin(Math.PI / 4) - Math.sqrt(2)), @@ -94,8 +86,51 @@ class ESigLamp extends Group { stroke: style.Signal.xColor || style.backgroundColor } }); + + const edge = 2; + this.lcross = new Line({ + _subType: 'SignalLamp', + _val: '3', + zlevel: model.zlevel, + z: model.z + 1, + shape: { + x1: model.x + (style.Signal.lamp.radiusR + edge + 0.5) * Math.cos(Math.PI / 4), + y1: model.y + (style.Signal.lamp.radiusR + edge + 0.5) * Math.sin(Math.PI / 4), + x2: model.x - (style.Signal.lamp.radiusR + edge + 0.5) * Math.cos(Math.PI / 4), + y2: model.y - (style.Signal.lamp.radiusR + edge + 0.5) * Math.sin(Math.PI / 4) + }, + style: { + lineWidth: style.Signal.lamp.stopWidth, + stroke: '#000000', + lineCap: 'round' + } + }); + this.rcross = new Line({ + _subType: 'SignalLamp', + _val: '3', + zlevel: model.zlevel, + z: model.z + 1, + shape: { + x1: model.x + (style.Signal.lamp.radiusR + edge + 0.5) * Math.cos(Math.PI / 4), + y1: model.y + (style.Signal.lamp.radiusR + edge + 0.5) * (Math.sin(Math.PI / 4) - Math.sqrt(2)), + x2: model.x - (style.Signal.lamp.radiusR + edge + 0.5) * Math.cos(Math.PI / 4), + y2: model.y - (style.Signal.lamp.radiusR + edge + 0.5) * (Math.sin(Math.PI / 4) - Math.sqrt(2)) + }, + style: { + lineWidth: style.Signal.lamp.stopWidth, + stroke: '#000000', + lineCap: 'round' + } + }); } this.add(this.lamp); + + if (style.Signal.lamp.faultType == 'cross') { + this.add(this.lcross); + this.add(this.rcross); + this.setFault2Corss(false); + } + if (!style.Signal.lamp.logicDisplayNone) { this.add(this.lstop); this.add(this.rstop); @@ -126,6 +161,16 @@ class ESigLamp extends Group { this.lamp.setStyle(data); } + setFault2Corss(has) { + if (has) { + this.lcross && this.lcross.show(); + this.rcross && this.rcross.show(); + } else { + this.lcross && this.lcross.hide(); + this.rcross && this.rcross.hide(); + } + } + setStop(has) { if (has) { this.lstop && this.lstop.show(); diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 15db10851..c32bda234 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -17,6 +17,8 @@ import Rect from 'zrender/src/graphic/shape/Rect'; import Polygon from 'zrender/src/graphic/shape/Polygon'; import Text from 'zrender/src/graphic/Text'; import Isogon from 'zrender/src/graphic/shape/Isogon'; +import deviceType from '../../constant/deviceType'; +import { findDeviceByModelDepType } from '../utils/ShapeDepFind'; // import BoundingRect from 'zrender/src/core/BoundingRect'; // import background from './../../../ibp/shape/background'; @@ -57,6 +59,7 @@ class Signal extends Group { const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下 // 信号机高柱矮柱 (信号机底座) + const sigPostY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR); this.sigPost = new ESigPost({ zlevel: this.zlevel, z: this.z, @@ -64,28 +67,23 @@ class Signal extends Group { drict: drict, type: model.lampPostType, x: model.position.x + model.positionPoint.x, - y: model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR) + y: sigPostY }); if (style.Signal.ciConfirm) { - this.ciConfirm = new Text({ + this.ciConfirm = new Text({ // 信号机使能 E 西安二号线独有 zlevel: this.zlevel, z: this.z, _val: '3', silent: false, - _subType: 'enabled', + _subType: 'enabled', // 标识 style: { - textBorderColor: 'red', - textBorderWidth: 0, - x: model.position.x + model.positionPoint.x, - y: model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR + style.Signal.ciConfirm.distance), - fontWeight: style.textStyle.fontWeight, + x: model.position.x + model.positionPoint.x - drict * 25, + y: sigPostY + posit * 11, fontSize: style.Signal.ciConfirm.fontSize, - fontFamily: style.fontFamily, text: style.Signal.ciConfirm.defaultText, - textFill: style.Signal.ciConfirm.textColor, textAlign: style.textStyle.textAlign, - textPosition: 'inside', - textVerticalAlign: style.textStyle.textVerticalAlign + textVerticalAlign: style.textStyle.textVerticalAlign, + textFill: style.Signal.ciConfirm.textColor } }); this.add(this.ciConfirm); @@ -471,7 +469,10 @@ class Signal extends Group { if (this.style.Signal.text.nameBorderShow) { this.sigName.setStyle({ textBorderWidth: 1 }); } - this.sigBack && this.sigBack.show(); + if (this.sigBack) { + this.sigBack.show(); + this.sigBack.setStyle('fill', this.style.Signal.sigBack.fillColor); + } } // 功能封锁 @@ -492,8 +493,24 @@ class Signal extends Group { // } fault() { - if (this.style.Signal.lamp.faultType && this.style.Signal.lamp.faultType == 'flash') { + if (this.style.Signal.lamp.faultType == 'flash') { this.lamps[0].faultShow(); + } else if (this.style.Signal.lamp.faultType == 'cross') { + this.lamps[0].setFault2Corss(true); + } else if (this.style.Signal.lamp.faultType == 'watch') { + const deivce = findDeviceByModelDepType(this.model, deviceType.LampFilament, 'stationCode'); + if (deivce && deivce.instance) { + deivce.instance.setControlColor('red'); + // if (model.redOpen) { + // deivce.instance.setControlColor('red'); + // } else if (model.greenOpen || model.yellowOpen) { + // deivce.instance.setControlColor('green'); + // } else { + // deivce.instance.setControlColor('#9F9C9C'); + // } + } + } else if (this.style.Signal.lamp.faultType == 'light') { + this.lamps[0].setAnimationStart('red'); } } @@ -607,9 +624,6 @@ class Signal extends Group { // 恢复状态 recover() { this.lamps.forEach(item=> { item.show(); }); - if (this.style.Signal.lamp.faultType && this.style.Signal.lamp.faultType == 'flash') { - this.lamps[0].faultHide(); - } this.sigName.setStyle({ textBorderWidth: 0 }); this.sigName.setColor(this.style.Signal.text.defaultColor); this.remainTImeName.hide(); @@ -621,12 +635,27 @@ class Signal extends Group { this.sigRoute.hide(); this.sigBack && this.sigBack.hide(); this.sigPost.setColor(this.style.Signal.post.standardColor); // 设置底座默认颜色 + if (this.style.Signal.lamp.guidName === 'singleRY') { this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth }); } if (this.style.Signal.lamp.guidName === 'double' || this.style.Signal.lamp.guidName === 'doubleAndBase') { this.lamps[1].hide(); } + + if (this.style.Signal.lamp.faultType == 'flash') { + this.lamps[0].faultHide(); + } else if (this.style.Signal.lamp.faultType == 'cross') { + this.lamps[0].setFault2Corss(false); + } else if (this.style.Signal.lamp.faultType == 'watch') { + const device = findDeviceByModelDepType(this.model, deviceType.LampFilament, 'stationCode'); + if (device && device.instance) { + device.instance.setControlColor('#9F9C9C'); + } + } else if (this.style.Signal.lamp.faultType == 'light') { + this.lamps[0].setAnimationEnd(); + } + this.insideTriangle && this.insideTriangle.setStyle({fill: this.style.Signal.insideTriangle.startSignalColor, stroke: this.style.Signal.insideTriangle.strokeColor}); this.insideTriangle && this.insideTriangle.hide(); this.sigPost && this.sigPost.removeTerminalOptional(); @@ -642,6 +671,7 @@ class Signal extends Group { if (!this.isShowShape) return; const path = window.location.href; this.recover(); + /** 信号机进路按钮显示 */ if (isShowThePrdType(model.prdType, '03') && this.style.Signal.lowButton.display) { /** 终端信号机按钮 */ @@ -660,7 +690,6 @@ class Signal extends Group { model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭 model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放 model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放 - model.fault && this.fault();// 信号机故障 model.remainTime && this.showRemainTime(model.remainTime); if (!path.includes('/map/draw')) { // 联锁自动进路通过 @@ -692,9 +721,9 @@ class Signal extends Group { this.sigBack && this.sigBack.show(); this.sigBack && this.sigBack.animateStyle(true) .when(0, { fill: this.style.backgroundColor }) - .when(1000, { fill: this.style.Signal.sigBack.color }) + .when(1000, { fill: this.style.Signal.sigBack.fillColor }) .when(2000, { fill: this.style.backgroundColor }) - .when(3000, { fill: this.style.Signal.sigBack.color }) + .when(3000, { fill: this.style.Signal.sigBack.fillColor }) .start(); } if (model.isRequestGuide) { @@ -711,6 +740,8 @@ class Signal extends Group { }); } } + // 信号机故障 + model.fault && this.fault(); // 设置灰显 model.noStatus && this.setAshShow(); } @@ -727,14 +758,23 @@ class Signal extends Group { return rect; } - getShapeTipPoint() { // 判断第一步 或 第二部步骤 获取元素包围框 - var drict = this.model.right ? 1 : -1; // 朝向 右:左 - var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下 - const rect = this.sigPost.getBoundingRect().clone(); - + getShapeTipPoint(opts) { // 判断第一步 或 第二部步骤 获取元素包围框 + let rect; + switch (opts.subDeviceType) { + case 'enabled': + rect = this.ciConfirm.getBoundingRect(); + break; + default: + var drict = this.model.right ? 1 : -1; // 朝向 右:左 + var offsetY = this.model.positionType == '01' ? this.style.Signal.text.fontSize : 0; // 位置 上:下 + rect = this.sigPost.getBoundingRect().clone(); + rect.x = rect.x + drict * this.style.Signal.post.standardVerticalWidth; + rect.y = rect.y - offsetY; + break; + } return { - x: rect.x + drict * this.style.Signal.post.standardVerticalWidth, - y: rect.y - offsetY + x: rect.x + rect.width / 2, + y:rect.y }; } drawSelected(selected) { diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 8f3b60099..6ed243a1a 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -558,15 +558,29 @@ export default class Switch extends Group { return this.name.getBoundingRect(); } - getShapeTipPoint() { - const text = this.name.getNameText(); - if (text) { - const rect = text.getBoundingRect(); + getShapeTipPoint(opts) { + let rect; + let text; + + switch (opts.subDeviceType) { + case 'enabled': + rect = this.enabledName.getBoundingRect(); + break; + default: + text = this.name.getNameText(); + if (text) { + rect = text.getBoundingRect(); + } + break; + } + + if (rect) { return { x: rect.x + rect.width / 2, y: rect.y }; } + return null; } diff --git a/src/jmapNew/shape/utils/ShapeDepFind.js b/src/jmapNew/shape/utils/ShapeDepFind.js new file mode 100644 index 000000000..251782965 --- /dev/null +++ b/src/jmapNew/shape/utils/ShapeDepFind.js @@ -0,0 +1,13 @@ +import Vue from 'vue'; + +// 查询有相同归属集中站的指定类型的图形 +export function findDeviceByModelDepType(model, type, compare) { + return Object.values(Vue.prototype.$jlmap.mapDevice).find(el => { + if (el._type == type) { + return (compare instanceof Function) + ? compare(el, model) + : el[compare] == model[compare]; + } + return false; + }); +} diff --git a/src/jmapNew/shape/utils/ShapePoints.js b/src/jmapNew/shape/utils/ShapePoints.js index ffba459d6..bc11a9b72 100644 --- a/src/jmapNew/shape/utils/ShapePoints.js +++ b/src/jmapNew/shape/utils/ShapePoints.js @@ -2,101 +2,101 @@ import Path from 'zrender/src/graphic/Path'; /** 指向箭头坐标*/ export function arrow(modelX, modelY, length, radius) { - return [ - [modelX - length, modelY], - [modelX - length + radius / 1.5, modelY - radius / 1.2], - [modelX - length + radius / 1.5, modelY - radius / 3], - [modelX + length, modelY - radius / 3], - [modelX + length, modelY + radius / 3], - [modelX - length + radius / 1.5, modelY + radius / 3], - [modelX - length + radius / 1.5, modelY + radius / 1.2] - ]; + return [ + [modelX - length, modelY], + [modelX - length + radius / 1.5, modelY - radius / 1.2], + [modelX - length + radius / 1.5, modelY - radius / 3], + [modelX + length, modelY - radius / 3], + [modelX + length, modelY + radius / 3], + [modelX - length + radius / 1.5, modelY + radius / 3], + [modelX - length + radius / 1.5, modelY + radius / 1.2] + ]; } /** 指向三角形坐标*/ export function triangular(modelX, modelY, drict, radius) { - return [ - [modelX, modelY], - [modelX - drict * (radius + 2), modelY - radius], - [modelX - drict * (radius + 2), modelY + radius] - ]; + return [ + [modelX, modelY], + [modelX - drict * (radius + 2), modelY - radius], + [modelX - drict * (radius + 2), modelY + radius] + ]; } /** 屏蔽门手电筒*/ export function flashlight(modelX, modelY, drict, width, height, offsetx, offsety, beyond) { - return [ - [modelX + drict * (offsetx), modelY + drict * offsety - (height + beyond) / 2], - [modelX + drict * (offsetx + beyond), modelY + drict * offsety - height / 2], - [modelX + drict * (offsetx + beyond + width), modelY + drict * offsety - height / 2], - [modelX + drict * (offsetx + beyond + width), modelY + drict * offsety + height / 2], - [modelX + drict * (offsetx + beyond), modelY + drict * offsety + height / 2], - [modelX + drict * (offsetx), modelY + drict * offsety + (height + beyond) / 2] - ]; + return [ + [modelX + drict * (offsetx), modelY + drict * offsety - (height + beyond) / 2], + [modelX + drict * (offsetx + beyond), modelY + drict * offsety - height / 2], + [modelX + drict * (offsetx + beyond + width), modelY + drict * offsety - height / 2], + [modelX + drict * (offsetx + beyond + width), modelY + drict * offsety + height / 2], + [modelX + drict * (offsetx + beyond), modelY + drict * offsety + height / 2], + [modelX + drict * (offsetx), modelY + drict * offsety + (height + beyond) / 2] + ]; } /** 区段限速体带方向*/ export function limitArrows(modelX, modelY, drict, radius) { - return [ - [modelX + drict * radius, modelY - radius], - [modelX + drict * radius, modelY + radius], - [modelX - drict * radius, modelY + radius], - [modelX - drict * radius * 1.8, modelY], - [modelX - drict * radius, modelY - radius] - ]; + return [ + [modelX + drict * radius, modelY - radius], + [modelX + drict * radius, modelY + radius], + [modelX - drict * radius, modelY + radius], + [modelX - drict * radius * 1.8, modelY], + [modelX - drict * radius, modelY - radius] + ]; } /** 区段折返标记*/ export function turnbackArrows(modelX, modelY, drict, width, height) { - return [ - [modelX - drict * (width - 1), modelY + height], - [modelX + drict * width / 2, modelY + height], - [modelX + drict * width / 2, modelY - height], - [modelX - drict * (width - 3), modelY - height] - ]; + return [ + [modelX - drict * (width - 1), modelY + height], + [modelX + drict * width / 2, modelY + height], + [modelX + drict * width / 2, modelY - height], + [modelX - drict * (width - 3), modelY - height] + ]; } export const Ugraph = Path.extend({ - type: 'ugraph', + type: 'ugraph', - shape: { - points: null, - counterclockwise: true - }, + shape: { + points: null, + counterclockwise: true + }, - style: { - stroke: '#000', - fill: null - }, + style: { + stroke: '#000', + fill: null + }, - buildPath: function (ctx, shape) { - var points = shape.points; - var r = Math.abs(points[1][1] - points[2][1]) / 2; - var x = Math.abs(points[1][0] + points[2][0]) / 2; - var y = Math.abs(points[1][1] + points[2][1]) / 2; - ctx.moveTo(points[0][0], points[0][1]); - ctx.lineTo(points[1][0], points[1][1]); + buildPath: function (ctx, shape) { + var points = shape.points; + var r = Math.abs(points[1][1] - points[2][1]) / 2; + var x = Math.abs(points[1][0] + points[2][0]) / 2; + var y = Math.abs(points[1][1] + points[2][1]) / 2; + ctx.moveTo(points[0][0], points[0][1]); + ctx.lineTo(points[1][0], points[1][1]); - shape.counterclockwise && ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false); - shape.counterclockwise || ctx.arc(x, y, r, Math.PI / 2, -Math.PI / 2, true); + shape.counterclockwise && ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false); + shape.counterclockwise || ctx.arc(x, y, r, Math.PI / 2, -Math.PI / 2, true); - ctx.moveTo(points[2][0], points[2][1]); - ctx.lineTo(points[3][0], points[3][1]); + ctx.moveTo(points[2][0], points[2][1]); + ctx.lineTo(points[3][0], points[3][1]); - ctx.closePath(); + ctx.closePath(); - points = shape.points; - r = Math.abs(points[1][1] - points[2][1]) / 2; - x = Math.abs(points[1][0] + points[2][0]) / 2; - y = Math.abs(points[1][1] + points[2][1]) / 2; - ctx.moveTo(points[0][0], points[0][1]); - ctx.lineTo(points[1][0], points[1][1]); + points = shape.points; + r = Math.abs(points[1][1] - points[2][1]) / 2; + x = Math.abs(points[1][0] + points[2][0]) / 2; + y = Math.abs(points[1][1] + points[2][1]) / 2; + ctx.moveTo(points[0][0], points[0][1]); + ctx.lineTo(points[1][0], points[1][1]); - shape.counterclockwise && ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false); - shape.counterclockwise || ctx.arc(x, y, r, Math.PI / 2, -Math.PI / 2, true); + shape.counterclockwise && ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false); + shape.counterclockwise || ctx.arc(x, y, r, Math.PI / 2, -Math.PI / 2, true); - ctx.moveTo(points[2][0], points[2][1]); - ctx.lineTo(points[3][0], points[3][1]); + ctx.moveTo(points[2][0], points[2][1]); + ctx.lineTo(points[3][0], points[3][1]); - ctx.closePath(); - } + ctx.closePath(); + } }); diff --git a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue index be532942e..02c4cbfd0 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue @@ -219,11 +219,25 @@ export default { mounted() { this.resetPosition(); }, + beforeDestroy() { + this.buttonDown(this.Command.cancel.clearMbm.operation); + }, methods: { passWordCommit(data) { - const operate = { - operation: data.operateNext - }; + let operate = {}; + if (data.overNext) { + operate = { + over: true, + code: data.code, + operation: data.operation, + cmdType:this.cmdType, + param: data.param + }; + } else { + operate = { + operation: data.operateNext + }; + } this.trainingOperation(operate); }, checkCancel() { @@ -474,11 +488,10 @@ export default { }); } else { const operate = { - over: true, code: deviceList[0].code, operation: this.$store.state.menuOperation.buttonOperation, - cmdType: this.cmdType, - param: {routeCode: route.code} + overNext: true, + param: {routeCode: route.code, signalCode: deviceList[0].code} }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -497,13 +510,13 @@ export default { over: true, code: deviceList[1].code, operation: this.$store.state.menuOperation.buttonOperation, - cmdType: this.cmdType, + overNext: true, param: '' }; let flag = false; this.routeList.forEach(item => { if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) { - operate.param = {routeCode: item.code}; + operate.param = {routeCode: item.code, signalCode: deviceList[0].code}; this.deviceList = []; flag = true; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => { diff --git a/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue b/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue index 7e681d07b..2bfb56b84 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue @@ -42,16 +42,6 @@ export default { menu: [], menuNormal: { Local: [ - { - label: '设置跳停', - handler: this.setJumpStop, - cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP - }, - { - label: '取消跳停', - handler: this.cancelJumpStop, - cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP - } ], Center: [ { diff --git a/src/jmapNew/theme/components/menus/dialog/routeControl.vue b/src/jmapNew/theme/components/menus/dialog/routeControl.vue index 050c532cd..02f2e54dd 100644 --- a/src/jmapNew/theme/components/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/components/menus/dialog/routeControl.vue @@ -43,6 +43,7 @@ diff --git a/src/views/package/index.vue b/src/views/package/index.vue index 3c7fa98ad..b9a9a0f80 100644 --- a/src/views/package/index.vue +++ b/src/views/package/index.vue @@ -7,7 +7,7 @@ - - diff --git a/src/views/teach/create.vue b/src/views/teach/create.vue new file mode 100644 index 000000000..54a79a4a7 --- /dev/null +++ b/src/views/teach/create.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index 5f00b30dd..9aec70cbc 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -7,7 +7,6 @@
-  {{ node.label }} -
diff --git a/src/views/teach/draftDetail.vue b/src/views/teach/draftDetail.vue new file mode 100644 index 000000000..6e1ed2a27 --- /dev/null +++ b/src/views/teach/draftDetail.vue @@ -0,0 +1,524 @@ + + + + + diff --git a/src/views/teach/draftLessonManage.vue b/src/views/teach/draftLessonManage.vue new file mode 100644 index 000000000..350f8a044 --- /dev/null +++ b/src/views/teach/draftLessonManage.vue @@ -0,0 +1,258 @@ + + + + diff --git a/src/views/teach/index.vue b/src/views/teach/index.vue index 13806cb58..c352ac2f7 100644 --- a/src/views/teach/index.vue +++ b/src/views/teach/index.vue @@ -4,6 +4,7 @@
{{ $t('global.lessonSystem') }}
+ 草稿课程管理 @@ -16,16 +17,15 @@ + @@ -34,23 +34,37 @@ import { getSubSystemDetail } from '@/api/trainingPlatform'; import { UrlConfig } from '@/scripts/ConstDic'; import { forceDeleteLesson } from '@/api/jmap/lesson'; import { getSessionStorage } from '@/utils/auth'; -import { lessonCreater } from '@/router/index_APP_TARGET'; +import { lessonCreater, superAdmin, admin } from '@/router/index'; +import { putLessonOffLine, updatePublishLesson } from '@/api/jmap/lesson'; +import UpdateOperate from '@/views/publish/publishLesson/draft.vue'; import localStore from 'storejs'; export default { name: 'TeachHome', + components:{ + UpdateOperate + }, data() { return { tableData: [], loading: false, project: '', - isTeacher: false, - userId: '' + mapId: '', + prdType: '' }; }, computed: { isGzbShow() { return getSessionStorage('project').startsWith('gzb'); + }, + userId() { + return this.$store.state.user.id; + }, + isLessonCreator() { + return this.$store.state.user.roles.includes(lessonCreater); + }, + isAdmin() { + return this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(superAdmin); } }, watch: { @@ -61,14 +75,14 @@ export default { mounted() { this.loadInitPage(); this.project = getSessionStorage('project'); - this.isTeacher = this.$store.state.user.roles.includes(lessonCreater); - this.userId = this.$store.state.user.id; }, methods: { loadInitPage() { if (this.$route.params.subSystem) { getSubSystemDetail(this.$route.params.subSystem).then(resp =>{ if (resp.data) { + this.mapId = resp.data.mapId; + this.prdType = resp.data.prdType; this.tableData = resp.data.lessonList; } else { this.tableData = []; @@ -88,6 +102,36 @@ export default { goLesson(row) { this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdType: row.prdType}}); }, + handleSoldOut(row) { + this.$confirm(this.$t('publish.wellSoldOutTraining'), this.$t('global.tips'), { + confirmButtonText: this.$t('global.confirm'), + cancelButtonText: this.$t('global.cancel'), + type: 'warning' + }).then(() => { + putLessonOffLine(row.id).then(response => { + this.$message.success(this.$t('publish.operationSuccess')); + this.reloadTable(); + }).catch(() => { + this.reloadTable(); + this.$messageBox(this.$t('error.operationFailure')); + }); + }).catch(() => { }); + }, + handleEdit(row) { + this.$refs.updateLesson.doShow(row); + }, + handleUpdate(data) { + updatePublishLesson(data).then(response => { + this.loadInitPage(); + this.$message.success(this.$t('publish.updateSuccess')); + }).catch(() => { + this.$messageBox(this.$t('error.updateFailed')); + }); + }, + draftLessonManage() { + const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.$route.query.cityCode}; + this.$router.push({ path: `/trainingPlatform/draftTeach/${this.$route.params.subSystem}`, query: query }); + }, handleDelete(row) { this.$confirm('此操作将删除课程及所有对应的试卷,且无法恢复,是否继续?', this.$t('global.tips'), { confirmButtonText: this.$t('global.confirm'), diff --git a/src/views/teach/operateMenu.vue b/src/views/teach/operateMenu.vue new file mode 100644 index 000000000..d720110cd --- /dev/null +++ b/src/views/teach/operateMenu.vue @@ -0,0 +1,130 @@ + + + + diff --git a/src/views/teach/sorttree.vue b/src/views/teach/sorttree.vue new file mode 100644 index 000000000..dee6f714f --- /dev/null +++ b/src/views/teach/sorttree.vue @@ -0,0 +1,143 @@ + + + + diff --git a/src/views/teach/trainingList.vue b/src/views/teach/trainingList.vue new file mode 100644 index 000000000..599ce2b7e --- /dev/null +++ b/src/views/teach/trainingList.vue @@ -0,0 +1,247 @@ + + + diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue index 43a7fd6ee..b64806ca9 100644 --- a/src/views/trainingPlatform/demonList.vue +++ b/src/views/trainingPlatform/demonList.vue @@ -9,7 +9,7 @@ -
+
-  {{ node.data.name+ $t('global.simulationSystem') }} -  {{ node.data.name+ $t('global.lessonSystem') }} -  {{ node.data.name+ $t('global.examSystem') }} -  {{ node.data.name+ $t('global.runPlanSystem') }} -  {{ node.data.name }} +  {{ node.data.name+ $t('global.simulationSystem') }} +  {{ node.data.name+ $t('global.lessonSystem') }} +  {{ node.data.name+ $t('global.examSystem') }} +  {{ node.data.name+ $t('global.runPlanSystem') }} +  {{ node.data.name }}
@@ -113,7 +113,7 @@ export default { break; case 'Lesson': this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`); - router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`}; + router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}?cityCode=${this.filterSelect}`}; this.toNextPage(isReplace, router); break; case 'Simulation': @@ -137,7 +137,6 @@ export default { }, forTree(item) { item.children && item.children.forEach(childrenItem => { - // childrenItem.key = item.id + childrenItem.id + childrenItem.type; childrenItem.key = item.key + '-' + childrenItem.id; if (childrenItem.children && childrenItem.children.length) { this.forTree(childrenItem); @@ -170,7 +169,15 @@ export default { checkId && this.findTree(this.treeList, checkId); !checkId && this.treeList && this.treeList.length && this.clickEvent(this.treeList[0], {data: this.treeList[0]}); } - this.loading = false; + setTimeout(()=> { + if (checkId) { + const checkIdDom = document.getElementById(checkId); + const mapTreeDom = document.getElementById('trainingMapTree'); + mapTreeDom.scrollTop = checkIdDom.offsetTop; + + } + this.loading = false; + }, 200); }); } catch (error) { this.loading = false; diff --git a/vue.config.js b/vue.config.js index dea847de9..9fc9cd204 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,6 +35,8 @@ module.exports = { productionSourceMap: false, // 项目打包后是否压缩 devServer: { port: port, + host: '0.0.0.0', + disableHostCheck: true, hotOnly: true, overlay: { warnings: false, @@ -63,12 +65,12 @@ module.exports = { // }, // parallel: require('os').cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。 configureWebpack: config => { - const appTarget = process.env.VUE_APP_PRO == 'local' ? 'HEB' : 'Common'; // 其他环境变量 区分配置 - config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/, - function (resourse) { - resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`); - }) - ); + // const appTarget = process.env.VUE_APP_PRO == 'local' ? 'HEB' : 'Common'; // 其他环境变量 区分配置 + // config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/, + // function (resourse) { + // resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`); + // }) + // ); if (process.env.NODE_ENV != 'development') { config.mode = 'production';