diff --git a/src/api/chat.js b/src/api/chat.js index 1c2c5a977..2998ee6b5 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -363,3 +363,11 @@ export function getAllConversition(group) { method: 'get' }); } + +/** 语音播完的接口 */ +export function overConversationMessage(group, conversationMessageId) { + return request({ + url: `/api/v1/competitionPractical/${group}/audio/over/${conversationMessageId}`, + method: 'put' + }); +} diff --git a/src/api/project.js b/src/api/project.js index d80bfdab0..0d4dcf09c 100644 --- a/src/api/project.js +++ b/src/api/project.js @@ -183,3 +183,11 @@ export function setSandboxConfig(id, data) { data: data }); } +/** 添加/修改联锁工作站配置 */ +export function setIlwConfig(id, data) { + return request({ + url: `/api/device/${id}/config/ilw`, + method: 'put', + data: data + }); +} diff --git a/src/api/rpTools.js b/src/api/rpTools.js index cb1bdbccf..45c852aeb 100644 --- a/src/api/rpTools.js +++ b/src/api/rpTools.js @@ -1,5 +1,26 @@ import request from '@/utils/request'; +/** + * 获取运行图配置 + */ +export function getRpConfig() { + return request({ + url: `/api/rpTools/config`, + method: 'get' + }) +} + +/** + * 修改运行图配置 + */ +export function modifyRpConfig(data) { + return request({ + url: `/api/rpTools/config`, + method: 'put', + data + }) +} + /** * 获取运行图数据 */ @@ -41,6 +62,71 @@ export function delRpTrip(tripNo) { }) } + +/** + * 平移服务 + */ +export function translateRpService(serviceNo, data) { + return request({ + url: `/api/rpTools/${serviceNo}/service`, + method: 'put', + data + }) +} + +/** + * 删除服务 + */ +export function delRpService(serviceNo) { + return request({ + url: `/api/rpTools/${serviceNo}/service`, + method: 'delete' + }) +} + + +/** + * 添加区域 + */ +export function createRpArea(data) { + return request({ + url: `/api/rpTools/area`, + method: 'post', + data + }) +} + +/** + * 修改区域 + */ +export function modifyRpArea(areaNo, data) { + return request({ + url: `/api/rpTools/${areaNo}/area`, + method: 'put', + data + }) +} + +/** + * 修改区域文字 + */ +export function modifyAreaNote(areaNo, data) { + return request({ + url: `/api/rpTools/${areaNo}/text`, + method: 'put', + data + }) +} +/** + * 删除区域 + */ +export function delRpArea(areaNo) { + return request({ + url: `/api/rpTools/${areaNo}/area`, + method: 'delete' + }) +} + /** * 修改运行时间 */ @@ -52,7 +138,6 @@ export function justTripNoRunning(tripNo, data) { }) } - /** * 修改停站时间 */ @@ -65,14 +150,12 @@ export function justTripNoStop(tripNo, data) { } /** - * 平移车次 + * 修改折返时间 */ -export function translateTripNo(tripNo, data) { +export function justTripTurnBack(tripNo, data) { return request({ - url: `/api/rpTools/${tripNo}/trip`, + url: `/api/rpTools/${tripNo}/turnBack`, method: 'put', data }) } - - diff --git a/src/i18n/langs/en/router.js b/src/i18n/langs/en/router.js index 16a83c9e6..aeca8ae18 100644 --- a/src/i18n/langs/en/router.js +++ b/src/i18n/langs/en/router.js @@ -84,5 +84,6 @@ export default { sceneManage:'Scene manage', companyManage: 'Company manage', authorApply: 'Grant application', - AuthorList: 'Authorization code list' + AuthorList: 'Authorization code list', + questionsRuleManage: 'Question rule manage' }; diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index cd19957eb..4d60a73cf 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -89,5 +89,6 @@ export default { sceneManage:'场景列表', companyManage: '单位管理', authorApply: '授权申请', - AuthorList: '授权列表' + AuthorList: '授权列表', + questionsRuleManage: '出题规则管理' }; diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index b66d244aa..501b6d95e 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -278,6 +278,7 @@ export default class Switch extends Group { this.shapeModelB.show(); this.shapeModelB.setColor(this.style.Section.line.spareColor); this.shapeModelC.show(); + this.shapeModelC.setColor(this.style.backgroundColor); } if (this.style.Switch.core.graphShow) { // 佛山线路显示 this.shapeModelB.show(); @@ -324,8 +325,8 @@ export default class Switch extends Group { .when(1000, { stroke: this.style.backgroundColor }) .start(); } - setSwitchFault(split) { - if (this.style.Switch.jointImg.faultStatus && split) { // 宁波线失表状态 + setSwitchFault(split, normalPosition, reversePosition) { + if (this.style.Switch.jointImg.faultStatus && split && !reversePosition && !normalPosition ) { // 宁波线失表状态 this.setForkAction(); // 道岔挤岔 } else { if (this.model.switchFaultCode && split) { @@ -511,6 +512,7 @@ export default class Switch extends Group { setState(model) { if (!this.isShowShape) return; this.recover(); + this.setSwitchFault(model.split, model.normalPosition, model.reversePosition); if (model.normalPosition) { this.setLocationAction(model); /** 定位*/ } else if (model.reversePosition) { @@ -519,7 +521,6 @@ export default class Switch extends Group { this.setLossAction(); // 失去 } model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示 - this.setSwitchFault(model.split); model.singleLock && this.setMonolock(); // 道岔单锁 model.blockade && this.block(); // 道岔封锁 diff --git a/src/jmapNew/theme/aus_00/planConvert copy.js b/src/jmapNew/theme/aus_00/planConvert copy.js new file mode 100644 index 000000000..6471969a0 --- /dev/null +++ b/src/jmapNew/theme/aus_00/planConvert copy.js @@ -0,0 +1,268 @@ +import { createSeriesModel, createMarkLineModels, createMartPoint } from './utils'; +import { toTimeStamp } from '@/utils/date'; + +export default { + /** 边缘高度*/ + EdgeHeight: 600, + + /** 间隔高度*/ + CoordMultiple: 1, + + /** 偏移时间*/ + TranslationTime: 0, + + /** 将后台数据解析成图形*/ + parseDataToGraph(chart, planData, stations, kmRangeCoordinateMap) { + const graphs = []; + if (planData && + planData.areaList && + planData.areaList.length) { + planData.areaList.forEach(area => { + const startTime = toTimeStamp(area.startTime); + const endTime = toTimeStamp(area.endTime); + + const fartherKm = this.getCoordinateYByObj(stations, kmRangeCoordinateMap, {stationCode: area.fartherStationCode}); + const closerKm = this.getCoordinateYByObj(stations, kmRangeCoordinateMap, {stationCode: area.closerStationCode}); + const point1 = [ startTime, fartherKm]; + const point2 = [ endTime, closerKm] + const position = chart.convertToPixel('grid', point1); + const position2 = chart.convertToPixel('grid', point2) + const width = Math.abs(position[0] - position2[0]); + const height = Math.abs(position[1] - position2[1]); + + graphs.push({ + type: 'rect', + subType: 'area', + areaNo: area.areaNo, + position, + point1, + point2, + model: area, + shape: { + x: 0, + y: 0, + width, + height + }, + style: { + fill: 'rgb(255,0,0, 0.3)', + stroke: 'rgb(255, 0, 0, 0.8)' + }, + z: 100 + }) + }) + } + + return graphs; + }, + + /** 将后台数据解析成折线*/ + parseDataToSeries(chart, planData, stations, kmRangeCoordinateMap) { + const models = []; + if (planData && + planData.serviceList && + planData.serviceList.length) { + planData.serviceList.forEach((service,i) => { + if (service.tripList && + service.tripList.length) { + + service.tripList.forEach((trip,j) => { + const opt = { + name: `plan-${service.serviceNo}-${trip.tripNo}-${trip.direction}`, + type: 'line', + symbolSize: 1, + showAllSymbol: true, + markPoint: { data: [] }, + data: [] + }; + + var lastPoint = null; + var nextPoint = null; + var pointData = { + name: `${service.serviceNo}-${trip.tripNo}`, + color: '#000', + direction: trip.direction, + coord: [trip.stationTimeList[0].departureTime, this.getCoordinateYByObj(stations, kmRangeCoordinateMap, trip.stationTimeList[0], trip.direction, false)], + }; + + opt.markPoint.data.push(createMartPoint(pointData)); + + trip.stationTimeList.forEach(elem => { + const name = `${trip.direction}${trip.tripNo}`; + if (elem.arrivalTime) { + opt.data.push([elem.arrivalTime, this.getCoordinateYByObj(stations, kmRangeCoordinateMap, elem, elem.direction, false), { + stationCode: elem.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + name + }]); + } + + if (elem.departureTime) { + opt.data.push([elem.departureTime, this.getCoordinateYByObj(stations, kmRangeCoordinateMap, elem, elem.direction, false), { + stationCode: elem.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + name + }]); + } + }); + + const model = createSeriesModel(opt, + { color: '#000', width: 1 }, + { color: '#000', fill: '#000'} + ); + models.push(model); + + if (service.tripList[j + 1] && + service.tripList[j + 1].stationTimeList) { + const opt = { + name: `reentry-${service.serviceNo}-${trip.tripNo}-${trip.direction}`, + type: 'line', + symbolSize: 1, + showAllSymbol: false, + markPoint: { data: [] }, + data: [] + }; + + lastPoint = trip.stationTimeList[trip.stationTimeList.length-1]; + nextPoint = service.tripList[j + 1].stationTimeList[0]; + const name = `${trip.direction}${trip.tripNo}`; + opt.data.push([lastPoint.arrivalTime, this.getCoordinateYByObj(stations, kmRangeCoordinateMap, lastPoint, trip.direction, false), { + stationCode: lastPoint.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + name + }]); + + opt.data.push([lastPoint.arrivalTime, this.getCoordinateYByObj(stations, kmRangeCoordinateMap, lastPoint, trip.direction, true), { + stationCode: lastPoint.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + name + }]); + opt.data.push([nextPoint.departureTime, this.getCoordinateYByObj(stations, kmRangeCoordinateMap, lastPoint, trip.direction, true), { + stationCode: lastPoint.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + name + }]); + opt.data.push([nextPoint.departureTime, this.getCoordinateYByObj(stations, kmRangeCoordinateMap, lastPoint, trip.direction, false), { + stationCode: lastPoint.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + name + }]); + + + const model = createSeriesModel(opt, + { color: '#000', width: 1 }, + { color: '#000', fill: '#000'} + ); + models.push(model); + } + }); + } + }) + } + + return models; +}, + + /** 更新数据并解析成折线*/ + updateDataToModels(chart, planData, stations, kmRangeCoordinateMap, series) { + if (planData && planData.length) { + } + return series; + }, + + /** 初始化Y轴*/ + initializeYaxis(stations) { + return createMarkLineModels(stations, (elem) => { + return this.EdgeHeight + elem.kmRange * this.CoordMultiple; + }); + }, + + /** 将后台数据转换为试图序列模型*/ + convertStationsToMap(stations) { + var map = {}; + if (stations && stations.length) { + stations.forEach((elem) => { + map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; + }); + } + + return map; + }, + + /** 计算y轴最小值*/ + computedYaxisMinValue(stations) { + return stations[0].kmRange * this.CoordMultiple; + }, + + /** 计算y轴最大值*/ + computedYaxisMaxValue(stations) { + return stations[stations.length - 1].kmRange * this.CoordMultiple + this.EdgeHeight * 2; + }, + + /** 格式化y轴数据*/ + computedFormatYAxis(stations, params) { + var yText = '0m'; + + stations.forEach(elem => { + if (elem.kmRange < parseInt(params.value) / this.CoordMultiple - this.EdgeHeight) { + yText = Math.floor(elem.kmRange) + 'm'; + } + }); + + return yText; + }, + + /** 根据方向计算y折返偏移量*/ + getYvalueByDirectionCode(defaultVlue, direction) { + if (direction === '1') { + defaultVlue -= this.EdgeHeight / 2; + } else if (direction === '2') { + defaultVlue += this.EdgeHeight / 2; + } + + return defaultVlue; + }, + + + /** 根据elem计算y值*/ + getCoordinateYByObj(stations, kmRangeCoordinateMap, obj, direction, isSpecial) { + var defaultVlue = 0; + var station = stations.find(it => { return it.code == obj.stationCode; }); + if (station) { + defaultVlue = kmRangeCoordinateMap[`${station.kmRange}`]; + if (isSpecial) { + defaultVlue = this.getYvalueByDirectionCode(defaultVlue, direction); + } + } + + return defaultVlue; + }, + + /** 通过y坐标获取站信息 */ + getStationByCoordinate(stations, y) { + for(var i = stations.length-1; i >= 0; i--) { + const station = stations[i]; + const edge = this.EdgeHeight + const preKm = i == 0? edge*2: Math.abs(station.kmRange-stations[i-1].kmRange)/2; + const nxtKm = i == stations.length-1? edge: Math.abs(station.kmRange-stations[i+1].kmRange)/2; + const min = edge + station.kmRange - preKm; + const max = edge + station.kmRange + nxtKm; + if (y >= min && y <= max) { + return station; + } + } + return null; + } +}; diff --git a/src/jmapNew/theme/aus_00/planConvert--.js b/src/jmapNew/theme/aus_00/planConvert--.js index 7fc4a47d0..9696965ab 100644 --- a/src/jmapNew/theme/aus_00/planConvert--.js +++ b/src/jmapNew/theme/aus_00/planConvert--.js @@ -1,4 +1,5 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan'; +import { toTimeStamp } from '@/utils/date'; export default { /** 边缘高度*/ @@ -10,20 +11,65 @@ export default { /** 偏移时间*/ TranslationTime: 0, - /** 将后台数据解析成图表*/ - convertDataToModels(tripList, stations, kmRangeCoordMap, lineStyle) { + /** 将后台数据解析成图形*/ + parseDataToGraph(chart, planData, stations, kmRangeCoordMap) { + const graphs = []; + if (planData && + planData.areaList && + planData.areaList.length) { + planData.areaList.forEach(el => { + const startTime = toTimeStamp(el.startTime); + const endTime = toTimeStamp(el.endTime); + + const fartherKm = this.getCoordYByObj(stations, kmRangeCoordMap, {stationCode: el.fartherStationCode}); + const closerKm = this.getCoordYByObj(stations, kmRangeCoordMap, {stationCode: el.closerStationCode}); + const point1 = [ startTime, fartherKm]; + const point2 = [ endTime, closerKm] + const position = chart.convertToPixel('grid', point1); + const position2 = chart.convertToPixel('grid', point2) + const width = Math.abs(position[0] - position2[0]); + const height = Math.abs(position[1] - position2[1]); + + graphs.push({ + type: 'rect', + subType: 'area', + areaNo: el.areaNo, + position, + point1, + point2, + model: el, + shape: { + x: 0, + y: 0, + width, + height + }, + style: { + fill: 'rgb(255,0,0, 0.3)', + stroke: 'rgb(255, 0, 0, 0.8)' + }, + z: 100 + }) + }) + } + + return graphs; + }, + + /** 将后台数据解析成折线*/ + parseDataToSeries(chart, planData, stations, kmRangeCoordMap) { var models = []; /** 按车次遍历数据*/ - if (tripList && tripList.length) { - tripList.forEach(trip => { + if (planData && planData.length) { + planData.forEach(trip => { const opt = { - name: `run-${trip.tripNo}`, + name: `plan-${trip.tripNo}`, type: 'line', symbolSize: 1, showAllSymbol: true, lineStyle: { color: '#000', - width: 1, + width: 1, }, itemStyle: { color: '#000', @@ -36,11 +82,11 @@ export default { /** 计算停站点坐标集合*/ trip.stationTimeList.forEach((elem,idx) => { if (elem.arrivalTime) { - opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); + opt.data.push([elem.arrivalTime, this.getCoordYByObj(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); } if (elem.departureTime) { - opt.data.push([elem.departureTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); + opt.data.push([elem.departureTime, this.getCoordYByObj(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); } }); @@ -51,9 +97,9 @@ export default { return models; }, - /** 更新数据并解析成图表*/ - updateDataToModels(tripList, stations, kmRangeCoordMap, runPlanData, series, lineStyle) { - if (tripList && tripList.length) { + /** 更新数据并解析成折线*/ + updateDataToModels(chart, planData, stations, kmRangeCoordMap, runPlanData, series) { + if (planData && planData.length) { } return series; }, @@ -108,7 +154,7 @@ export default { }, /** 根据elem计算y值*/ - getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) { + getCoordYByObj(stations, kmRangeCoordMap, elem, directionCode, isSpecial) { var defaultVlue = 0; var station = stations.find(it => { return it.code == elem.stationCode; }); if (station) { @@ -119,5 +165,24 @@ export default { } return defaultVlue; - } + }, + + /** 通过y坐标获取站信息*/ + getStationByCoordinate(stations, y) { + for(var i = stations.length-1; i >= 0; i--) { + const station = stations[i]; + const edge = this.EdgeHeight; + const rate = this.CoordMultiple; + + const preKm = i == 0? edge*2: rate/2; + const nxtKm = i == stations.length-1? edge: rate/2; + const min = edge + i*rate - preKm; + const max = edge + i*rate + nxtKm; + + if (y >= min && y <= max) { + return station; + } + } + return null; + } }; diff --git a/src/jmapNew/theme/aus_00/planConvert.js b/src/jmapNew/theme/aus_00/planConvert.js index f037426f2..7e00cbdf0 100644 --- a/src/jmapNew/theme/aus_00/planConvert.js +++ b/src/jmapNew/theme/aus_00/planConvert.js @@ -1,4 +1,5 @@ -import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; +import { createSeriesModel, createMarkLineModels, createRectArea, createMartPoint } from './utils'; +import { toTimeStamp } from '@/utils/date'; export default { /** 边缘高度*/ @@ -10,63 +11,139 @@ export default { /** 偏移时间*/ TranslationTime: 0, - /** 将后台数据解析成图表*/ - convertDataToModels(tripList, stations, kmRangeCoordMap, lineStyle) { - var models = []; - /** 按车次遍历数据*/ - if (tripList && tripList.length) { - tripList.forEach(trip => { - const opt = { - name: `run-${trip.tripNo}`, - type: 'line', - symbolSize: 1, - showAllSymbol: true, - lineStyle: { - color: '#000', - width: 1, - }, - itemStyle: { - color: '#000', - fill: '#000' - }, - markPoint: { data: [] }, - data: [] - }; + /** 将后台数据解析成图形*/ + parseDataToGraph(chart, planData, stations) { + const graphs = []; + if (planData && + planData.areaList && + planData.areaList.length) { + planData.areaList.forEach(area => { + const startTime = toTimeStamp(area.startTime); + const endTime = toTimeStamp(area.endTime); - // const length = trip.stationTimeList.length; - // if (trip.tripNo && - // trip.stationTimeList.length) { - // opt.markPoint.data.push(createMartPointReverse({ - // name: `${trip.tripNo}`, - // color: '#000' || lineStyle.color, - // coord: [ - // trip.stationTimeList[0].arrivalTime, - // this.getCoordYByElem(stations, kmRangeCoordMap, trip.stationTimeList[0]) - // ] - // })); - // } + const fartherKm = this.getCoordinateYByStationCode(stations, area.fartherStationCode); + const closerKm = this.getCoordinateYByStationCode(stations, area.closerStationCode); + const point1 = [ startTime, fartherKm]; + const point2 = [ endTime, closerKm] + const position = chart.convertToPixel('grid', point1); + const position2 = chart.convertToPixel('grid', point2) + const width = Math.abs(position[0] - position2[0]); + const height = Math.abs(position[1] - position2[1]); - /** 计算停站点坐标集合*/ - trip.stationTimeList.forEach((elem,idx) => { - if (elem.arrivalTime) { - opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); - } + graphs.push(createRectArea({ + areaNo: area.areaNo, + model: area, + position, + point1, + point2, + width, + height + })); + }) + } - if (elem.departureTime) { - opt.data.push([elem.departureTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]); - } - }); + return graphs; + }, - models.push(opt); - }); + /** 将后台数据解析成折线*/ + parseDataToSeries(chart, planData, stations) { + const models = []; + if (planData && + planData.serviceList && + planData.serviceList.length) { + planData.serviceList.forEach((service,i) => { + if (service.tripList && + service.tripList.length) { + + const opt = { + name: `service${service.serviceNo}`, + type: 'line', + symbolSize: 1, + showAllSymbol: true, + markPoint: { data: [] }, + data: [] + }; + + service.tripList.forEach((trip,j) => { + var lastPoint = null; + var nextPoint = null; + var pointData = { + name: `${service.serviceNo}-${trip.tripNo}`, + color: '#000', + direction: trip.direction, + coord: [trip.stationTimeList[0].departureTime, this.getCoordinateYByStationCode(stations, trip.stationTimeList[0].stationCode)], + }; + + opt.markPoint.data.push(createMartPoint(pointData)); + + trip.stationTimeList.forEach(elem => { + if (elem.arrivalTime) { + opt.data.push([elem.arrivalTime, this.getCoordinateYByStationCode(stations, elem.stationCode), { + stationCode: elem.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + silent: false + }]); + } + + if (elem.departureTime) { + opt.data.push([elem.departureTime, this.getCoordinateYByStationCode(stations, elem.stationCode), { + stationCode: elem.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + silent: false + }]); + } + }); + + if (service.tripList[j + 1] && + service.tripList[j + 1].stationTimeList) { + + lastPoint = trip.stationTimeList[trip.stationTimeList.length-1]; + nextPoint = service.tripList[j + 1].stationTimeList[0]; + + opt.data.push({ + value: [lastPoint.arrivalTime, this.getCoordinateYByStationCode(stations, lastPoint.stationCode, true, trip.direction), { + stationCode: lastPoint.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + silent: true + }], + symbol: 'none', + symbolSize: 1, + }); + opt.data.push({ + value: [nextPoint.departureTime, this.getCoordinateYByStationCode(stations, lastPoint.stationCode, true, trip.direction), { + stationCode: lastPoint.stationCode, + serviceNo: service.serviceNo, + tripNo: trip.tripNo, + direction: trip.direction, + silent: true + }], + symbol: 'none', + symbolSize: 1, + }); + } + }); + + const model = createSeriesModel(opt, + { color: '#000', width: 1 }, + { color: '#000', fill: '#000'} + ); + models.push(model); + } + }) } return models; }, - /** 更新数据并解析成图表*/ - updateDataToModels(tripList, stations, kmRangeCoordMap, runPlanData, series, lineStyle) { - if (tripList && tripList.length) { + /** 更新数据并解析成折线*/ + updateDataToModels(chart, planData, stations, series) { + if (planData && planData.length) { } return series; }, @@ -78,18 +155,6 @@ export default { }); }, - /** 将后台数据转换为试图序列模型*/ - convertStationsToMap(stations) { - var map = {}; - if (stations && stations.length) { - stations.forEach((elem) => { - map[`${elem.kmRange}`] = this.EdgeHeight + elem.kmRange * this.CoordMultiple; - }); - } - - return map; - }, - /** 计算y轴最小值*/ computedYaxisMinValue(stations) { return stations[0].kmRange * this.CoordMultiple; @@ -111,33 +176,47 @@ export default { }); return yText; - }, + }, - /** 根据是否和上一个车次是否相交,计算下一个车次的折返的高度*/ - computedReentryNumber(code) { - // return parseInt(code || 1) % 2 ? 1 : 2; - return 1; - }, + /** 根据方向计算y折返偏移量*/ + getOffsetYByDirection(value, direction) { + if (direction === '1') { + value -= this.EdgeHeight / 2; + } else if (direction === '2') { + value += this.EdgeHeight / 2; + } - /** 根据方向计算y折返偏移量*/ - getYvalueByDirectionCode(defaultVlue, directionCode, num) { - if (directionCode === '1') { - defaultVlue += this.EdgeHeight / 2 * num; - } else if (directionCode === '2') { - defaultVlue -= this.EdgeHeight / 2 * num; - } + return value; + }, - return defaultVlue; - }, - /** 根据elem计算y值*/ - getCoordYByElem(stations, kmRangeCoordMap, elem) { - var defaultVlue = 0; - var station = stations.find(it => { return it.code == elem.stationCode; }); + /** 通过站信息获取y坐标*/ + getCoordinateYByStationCode(stations, stationCode, isSpecial=false, direction='01') { + var value = 0; + var station = stations.find(it => { return it.code == stationCode; }); if (station) { - defaultVlue = kmRangeCoordMap[`${station.kmRange}`]; + value = this.EdgeHeight + station.kmRange * this.CoordMultiple; + if (isSpecial) { + value = this.getOffsetYByDirection(value, direction); + } } - return defaultVlue; - } + return value; + }, + + /** 通过y坐标获取站信息 */ + getStationByCoordinate(stations, y) { + for(var i = stations.length-1; i >= 0; i--) { + const station = stations[i]; + const edge = this.EdgeHeight + const preKm = i == 0? edge*2: Math.abs(station.kmRange-stations[i-1].kmRange)/2; + const nxtKm = i == stations.length-1? edge: Math.abs(station.kmRange-stations[i+1].kmRange)/2; + const min = edge + station.kmRange - preKm; + const max = edge + station.kmRange + nxtKm; + if (y >= min && y <= max) { + return station; + } + } + return null; + } }; diff --git a/src/jmapNew/theme/aus_00/utils.js b/src/jmapNew/theme/aus_00/utils.js new file mode 100644 index 000000000..09d2bc119 --- /dev/null +++ b/src/jmapNew/theme/aus_00/utils.js @@ -0,0 +1,232 @@ +import store from '@/store/index_APP_TARGET'; +import { timeFormat } from '@/utils/date'; + +/** 创建一个车次数据点*/ +export function createMartPoint(opt) { + const rotate = opt.direction == '2' ? 45 : (opt.direction == '1' ? -45 : 0); + const position = opt.type ? 'insideBottomLeft' : 'insideTopLeft'; + return { + coord: opt.coord, + name: opt.name, + label: { + normal: { + rotate: rotate, + formatter: '{b}', + backgroundColor: 'rgb(242,242,242,0.1)', + color: 'black', + position: position + } + } + }; +} + +/** 创建一个服务数据序列*/ +export function createSeriesModel(opt, lineStyle={}, itemStyle={}) { + return { + z: opt.z || 2, + type: 'line', + name: opt.name, + data: opt.data, + sampling: 'average', + symbolSize: opt.symbolSize, + showAllSymbol: opt.showAllSymbol||'auto', + lineStyle: lineStyle, + itemStyle: itemStyle, + animation: false, + markPoint: { + symbol: 'roundRect', + symbolSize: 1, + data: opt.markPoint.data + } + }; +} + +/** + * 创建一个区域 + */ +export function createRectArea(opt, style={}) { + return { + type: 'rect', + subType: 'area', + areaNo: opt.model.areaNo, + position: opt.position, + point1: opt.point1, + point2: opt.point2, + model: opt.model, + shape: { + x: 0, + y: 0, + width: opt.width, + height: opt.height + }, + style: { + fill: 'rgb(255,0,0, 0.3)', + stroke: 'rgb(255, 0, 0, 0.8)', + text: opt.model.text, + textFill: 'rgb(0, 0, 0)', + fontSize: 18, + fontWeight: 500, + textVerticalAlign: 'middle', + textAlign: 'center', + ...style + }, + z: 100 + } +} + +/** 创建标记横线*/ +export function createMarkLineModels(stations, computedYaxis) { + const markLineModel = {}; + if (stations && stations.length) { + markLineModel.type = 'line'; + markLineModel.name = 'markline'; + markLineModel.silent = true; + markLineModel.animation = false; + markLineModel.markLine = {}; + markLineModel.markLine.silent = true; + markLineModel.markLine.data = []; + markLineModel.markLine.lineStyle = { color: '#B0C4DE', width: 0.5 }; + markLineModel.markLine.symbol = 'none'; + markLineModel.elements = [] + stations.forEach((elem, index) => { + markLineModel.markLine.data.push( + { + label: { + show: true, + position: 'start', + formatter: elem.name, + color: 'black' + }, + lineStyle: { + type: 'solid', + width: 0.5, + opacity: 0.5 + }, + yAxis: computedYaxis(elem, index) + } + ); + }); + } + return markLineModel; +} + +/** 对list数据进行排序, 相同元素保持原有顺序*/ +export function sortListByCb(list, callback) { + list.map((elem, index) => { elem[`oldIndex`] = index; }); + list.sort((a, b) => { + return callback(a, b) || a.oldIndex - b.oldIndex; + }); + return list; +} + +/** 将数字转换成asc码*/ +export function numToAsc(num) { + const nmA = 'A'.charCodeAt(0); + const nmZ = 'Z'.charCodeAt(0); + const len = nmZ - nmA + 1; + let str = ''; + + while (num >= 0) { + str = String.fromCharCode(num % len + nmA) + str; + num = Math.floor(num / len) - 1; + } + + return str; +} + +/** 将asc码转换成数字*/ +export function ascToNum(asc) { + const base = 'A'.charCodeAt() - 1; + let idx = asc.length - 1; + let num = 0; + let mulFactor = 1; + while (idx >= 0) { + num += (asc[idx].charCodeAt() - base) * mulFactor; + mulFactor *= 26; + idx -= 1; + } + + return num; +} + +/** 根据索引获取单元格的数据*/ +export function getCellValue(Sheet, index) { + let value; + const cell = Sheet[index]; + if (cell) { + value = cell.w || cell.v; + } + + return value; +} + +/** 转换sheet数据为json数据*/ +export function convertSheetToList(Sheet, isReverse) { + const dataList = []; + + if (Sheet) { + const refarea = Sheet['!ref']; + const regular = /([a-zA-Z]+)([0-9]+):([a-zA-Z]+)([0-9]+)/i; + + if (refarea == null) return []; // "A1:M698" + if (regular.test(refarea)) { + /** 正则转换解析行列数据*/ + const CoordList = regular.exec(refarea); + /** 转换数据为二维数组*/ + const colBeg = ascToNum(CoordList[1]); + const colEnd = ascToNum(CoordList[3]); + const rowBeg = Number(CoordList[2]); + const rowEnd = Number(CoordList[4]); + + if (isReverse) { + for (let i = colBeg - 1; i < colEnd; i++) { + dataList.push([]); + for (let j = rowBeg; j <= rowEnd; j++) { + dataList[dataList.length - 1].push(getCellValue(Sheet, numToAsc(i) + j)); + } + } + } else { + for (let i = rowBeg; i <= rowEnd; i++) { + dataList.push([]); + for (let j = colBeg - 1; j < colEnd; j++) { + dataList[dataList.length - 1].push(getCellValue(Sheet, numToAsc(j) + i)); + } + } + } + } + } + + return dataList; +} + +/** 通过time将时间格式化*/ +export function formatTime(time) { + if (Number.isInteger(time)) { + return timeFormat(time); + } else { + return ''; + } +} + +/** 通过code将名称格式化*/ +export function formatName(code) { + let name = ''; + const device = store.getters['map/getDeviceByCode'](code); + if (device) { + name = device.name; + } + return name; +} + +/** 将时间格式化前补零*/ +export function prefixTime(time) { + let str = `${time}` || ''; + if (str) { + const list = str.split(':'); + str = list.map(elem => { + return `00000${elem}`.substr(-2); + }).join(':'); + } + + return str; +} diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 9a767a63b..4077a1a95 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -151,6 +151,7 @@ const RefereeList = () => import('@/views/jsxt/refereeList/index'); const RefereeDisplay = () => import('@/views/jsxt/refereeList/display'); const Approval = () => import('@/views/approval/index'); const CompanyManage = () => import('@/views/system/companyManage/index'); +const QuestionsRuleManage = () => import('@/views/system/questionsRuleManage/index'); import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { getSessionStorage } from '@/utils/auth'; @@ -814,6 +815,14 @@ export const asyncRouter = [ i18n: 'router.companyManage' } }, + { // 出题规则管理 + path: 'questionsRuleManage', + hidden: true, + component: QuestionsRuleManage, + meta: { + i18n: 'router.questionsRuleManage' + } + }, { // 缓存管理 path: 'cache', diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 5d3f54a54..781b5d0ed 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -185,7 +185,10 @@ export default { QuestionTypeList: [ { label: '选择题', value: 'select' }, - { label: '判断题', value: 'judge' } + { label: '判断题', value: 'judge' }, + { label: '多选题', value: 'multi'}, + { label: '填空题', value: 'fill'}, + { label: '问答题', value: 'answer'} ], // 新版的产品类型枚举 prdType:[ @@ -238,7 +241,8 @@ export default { {label: 'PLC网关', value: 'PLC_GATEWAY'}, {label: '端头控制盒', value: 'PSL'}, {label: 'PSC控制柜', value: 'PSC'}, - {label: '虚拟电子沙盘', value: 'SANDBOX'} + {label: '虚拟电子沙盘', value: 'SANDBOX'}, + {label: '联锁工作站', value: 'ILW'} ] } }; diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index 5b67c4e7d..9adfb41c2 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -128,10 +128,7 @@ export const DeviceMenu = { SetDriver: '106', Script: '107', IscsSystem: '108', - IscsInterface: '109', - - planJustRunning: '200', - planJustDeparture: '201' + IscsInterface: '109' }; /** diff --git a/src/scripts/cmdPlugin/Config.js b/src/scripts/cmdPlugin/Config.js index 5e2394321..1dca7fcd9 100644 --- a/src/scripts/cmdPlugin/Config.js +++ b/src/scripts/cmdPlugin/Config.js @@ -36,7 +36,9 @@ export const deviceFaultType = { {label: '主灯丝熔断故障', value: 'MAIN_FILAMENT_BROKEN'} ], Switch: [ - {label: '失表', value: 'SPLIT'} + {label: '失表', value: 'SPLIT'}, + {label: '定位失表', value: 'NORMAL_SPLIT'}, + {label: '反位失表', value: 'REVERSE_SPLIT'} ], StationStand: [ {label: '屏蔽门故障打开', value: 'FAULT_PSD_OPEN'} diff --git a/src/scripts/cmdPlugin/MenuContextHandler.js b/src/scripts/cmdPlugin/MenuContextHandler.js index 7a4ea8fd4..b17078940 100644 --- a/src/scripts/cmdPlugin/MenuContextHandler.js +++ b/src/scripts/cmdPlugin/MenuContextHandler.js @@ -65,7 +65,7 @@ class MenuContextHandler { let menu = []; const control = this.getStationControl(selected); // (!store.state.scriptRecord.bgSet || store.state.scriptRecord.isScriptCommand) - if (control) { + if (control && !store.state.scriptRecord.audioPlay) { if (this.getPrdType() != '' && this.getPrdType() != null) { const type = State2SimulationMap[this.getPrdType()]; const status = State2ControlMap[control.controlMode]; // 判断当前模式 diff --git a/src/store/index_Common.js b/src/store/index_Common.js index dc1b2f8b5..e5553b3e4 100644 --- a/src/store/index_Common.js +++ b/src/store/index_Common.js @@ -17,6 +17,7 @@ import ibp from './modules/ibp'; import order from './modules/order'; import iscs from './modules/iscs'; import rpTools from './modules/rpTools'; +import race from './modules/race'; import getters from './getters'; @@ -39,8 +40,9 @@ const store = new Vuex.Store({ scriptRecord, ibp, order, - iscs, - rpTools + iscs, + rpTools, + race }, getters }); diff --git a/src/store/index_HEB.js b/src/store/index_HEB.js index 295be5d36..dbaf695f1 100644 --- a/src/store/index_HEB.js +++ b/src/store/index_HEB.js @@ -16,6 +16,7 @@ import scriptRecord from './modules/scriptRecord'; import ibp from './modules/ibp'; import order from './modules/order'; import iscs from './modules/iscs'; +import race from './modules/race'; import getters from './getters'; @@ -38,7 +39,8 @@ const store = new Vuex.Store({ scriptRecord, ibp, order, - iscs + iscs, + race }, getters }); diff --git a/src/store/modules/race.js b/src/store/modules/race.js new file mode 100644 index 000000000..a71c23aab --- /dev/null +++ b/src/store/modules/race.js @@ -0,0 +1,40 @@ +/** + * 竞赛状态数据 + */ +const race = { + namespaced: true, + state: { + preTheoryData: [] // 导入的理论预保存数据, + }, + getters: { + preTheoryData: (state)=>{ + return state.preTheoryData; + } + }, + mutations: { + setPreTheoryData: (state, preTheoryData) => { + state.orderList = preTheoryData; + } + }, + actions: { + /** + * 设置导入的理论预保存数据 + */ + setPreTheoryData: ({ commit }, preTheoryData) => { + commit('setPreTheoryData', preTheoryData); + } + // getRouteDataListByCode: ({ state, commit }, code) => { // 获取进路数据 + // return new Promise((resolve) => { + // const list = []; + // const routeList = Object.values(state.routeData); + // routeList.forEach(route => { + // if (route.startSignalCode == code) { + // list.push(route); + // } + // }); + // resolve(list); + // }); + // }, + } +}; +export default race; diff --git a/src/store/modules/rpTools.js b/src/store/modules/rpTools.js index 5bc5d1af8..640a5a80f 100644 --- a/src/store/modules/rpTools.js +++ b/src/store/modules/rpTools.js @@ -3,7 +3,7 @@ const runPlan = { state: { stations: [], // 车站列表 - planData: {}, // 运行图原始数据 + planData: [], // 运行图原始数据 editData: {}, // 运行图编辑数据 planSizeCount: 0, // 运行图canvas 大小变更标识 planLoadedCount: 0, // 运行图数据更新 @@ -16,7 +16,10 @@ const runPlan = { getters: { stations: (state) => { return state.stations || []; - } + }, + planData: (state) => { + return state.planData || []; + } }, mutations: { setWidth: (state, width) => { @@ -48,7 +51,11 @@ const runPlan = { } }, actions: { - /** 设置运行图大小*/ + /** 更新数据*/ + updateRunPlanData: ({ commit }, data) => { + commit('updateRunPlanData', data); + }, + /** 设置运行图大小*/ resize({ commit }, opt) { if (opt.width) { commit('setWidth', opt.width); @@ -57,32 +64,6 @@ const runPlan = { commit('setHeight', opt.height); } }, - /** 设置stations数据 */ - setStations: ({ commit }, mapModel) => { - return new Promise((resolve) => { - commit('setStations', mapModel); - resolve(mapModel); - }); - }, - /** 设置运行图数据 */ - setPlanData: ({ commit }, data) => { - commit('setPlanData', data); - }, - /** 选择车次*/ - setSelected: ({ commit }, selected) => { - commit('setSelected', selected); - }, - /** 更新数据*/ - updateRunPlanData: ({ commit }, data) => { - commit('updateRunPlanData', data); - }, - /** 清空数据*/ - clear: ({ commit }) => { - return new Promise((resolve) => { - commit('clear'); - resolve(); - }); - }, /** 刷新页面*/ refresh: ({commit}) => { commit('refresh'); diff --git a/src/store/modules/scriptRecord.js b/src/store/modules/scriptRecord.js index e9fa3e90d..705418a79 100644 --- a/src/store/modules/scriptRecord.js +++ b/src/store/modules/scriptRecord.js @@ -14,7 +14,8 @@ const scriptRecord = { updateRoleId:'', // 剧本更新角色id updateCoversitionStatus:0, // 剧本仿真更新会话信息 userRole:null, // 剧本更新的角色 - operationalItemVOs:{} // 剧本场景的运营统计数据缓存 + operationalItemVOs:{}, // 剧本场景的运营统计数据缓存 + audioPlay:false // 语音是否自动播放 }, getters: { mapLocation: (state)=>{ @@ -76,6 +77,9 @@ const scriptRecord = { }, updateOperationalItemVOs:(state, operationalItemVOs) => { state.operationalItemVOs = operationalItemVOs; + }, + setAudioPlay:(state, audioPlay) => { + state.audioPlay = audioPlay; } }, actions: { @@ -108,6 +112,9 @@ const scriptRecord = { }, updateOperationalItemVOs:({ commit }, operationalItemVOs) => { commit('updateOperationalItemVOs', operationalItemVOs); + }, + updateAudioPlay:({ commit }, audioPlay) => { + commit('setAudioPlay', audioPlay); } } }; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 5c17a46dd..ed8381fb5 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,8 +2,8 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; - // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 + // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.169:9000'; // 旭强 // BASE_API = 'http://192.168.3.175:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 diff --git a/src/views/competitionManage/bankList/dialog-modify-rich.vue b/src/views/competitionManage/bankList/dialog-modify-rich.vue index e41791c43..0536570a1 100644 --- a/src/views/competitionManage/bankList/dialog-modify-rich.vue +++ b/src/views/competitionManage/bankList/dialog-modify-rich.vue @@ -38,7 +38,7 @@ export default { doInput() { const node = this.node; node.model[node.prop] = this.content; - this.$emit('update', node.model); + // this.$emit('update'); this.doClose(); } } diff --git a/src/views/competitionManage/bankList/index.vue b/src/views/competitionManage/bankList/index.vue index aa13ca0ba..cf01dda72 100644 --- a/src/views/competitionManage/bankList/index.vue +++ b/src/views/competitionManage/bankList/index.vue @@ -26,6 +26,7 @@ export default { queryForm: { reset: true, labelWidth: '80px', + leftSpan: 17, queryObject: { type: { type: 'select', @@ -63,7 +64,7 @@ export default { title: '答 案', prop: 'answer', type: 'tagMore', - width: '100', + width: '200', columnValue: (row) => { return this.answerTags(row); }, tagType: (row) => { return ''; @@ -77,7 +78,7 @@ export default { { type: 'button', title: '操 作', - width: '420', + width: '320', buttons: [ { name: '编辑', @@ -98,7 +99,8 @@ export default { ], actions: [ { text: '添 加', handler: this.doCreate }, - { text: '导 入', fileType: 'file', handler: this.importQuestionBank } + { text: '导 入', fileType: 'file', handler: this.importQuestionBank }, + { text: '出题规则管理', handler: this.questionsRuleManage} ] } }; @@ -149,6 +151,17 @@ export default { answer.push(el.content); } break; + case 'multi': + if (el.correct) { + answer.push(this.$asc2chart(i + 65)); + } + break; + case 'fill': + answer.push(el.content); + break; + case 'answer': + answer.push(el.content); + break; } }); return answer; @@ -161,7 +174,9 @@ export default { const questionTypeMap = { '单选': 'select', '多选': 'multi', - '判断': 'judge' + '判断': 'judge', + '填空': 'fill', + '问答': 'answer' }; if (file) { setTimeout(() => { @@ -216,19 +231,34 @@ export default { topic: dataList[topicIndex][index], optionList: [] }; - param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' }); - param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' }); - if (dataList[option3Index][index]) { - param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')}); - } - if (dataList[option4Index][index]) { - param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')}); + if (param.type === 'fill') { + const answer = dataList[answerIndex][index]; + const answerList = answer.split('&&'); + answerList && answerList.forEach(item => { + param.optionList.push({content: item, correct: true}); + }); + } else if (param.type === 'answer') { + param.optionList.push({content: dataList[answerIndex][index]}); + } else { + param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' }); + param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' }); + if (dataList[option3Index][index]) { + param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')}); + } + if (dataList[option4Index][index]) { + param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')}); + } } questionList.push(param); } }); } } + // this.$store.dispatch('race/setPreTheoryData', questionList).then(({ valid }) => { + // + // }).catch(() => { + // this.$message.error('导入题库失败!'); + // }); importQuestionBand(questionList, 'DRTS').then(resp => { this.$message.success('导入题库成功!'); }).catch(()=>{ @@ -250,6 +280,9 @@ export default { if (!obj.files) return; const f = obj.files[0]; this.handleImport(f); + }, + questionsRuleManage() { + this.$router.push({ path: `/system/questionsRuleManage`}); } } }; diff --git a/src/views/competitionManage/bankList/item-answer.vue b/src/views/competitionManage/bankList/item-answer.vue index 9f44910e3..c5dc79a69 100644 --- a/src/views/competitionManage/bankList/item-answer.vue +++ b/src/views/competitionManage/bankList/item-answer.vue @@ -11,18 +11,37 @@ × - + + + diff --git a/src/views/competitionManage/bankList/question-form.vue b/src/views/competitionManage/bankList/question-form.vue index 0d128f3b4..0309dab86 100644 --- a/src/views/competitionManage/bankList/question-form.vue +++ b/src/views/competitionManage/bankList/question-form.vue @@ -10,11 +10,11 @@ @@ -73,6 +73,14 @@ export default { { content: '√', correct: true }, { content: '×', correct: false } ]; + }, + multi: function() { + return [ + { content: '', correct: false}, + { content: '', correct: false }, + { content: '', correct: false }, + { content: '', correct: false } + ]; } }; }, @@ -113,7 +121,18 @@ export default { } }, onAnswerChnage(answer) { - this.option.optionList.forEach((el, i) => { el.correct = i == answer; }); + if (this.option.type === 'judge' || this.option.type === 'select') { + this.option.optionList.forEach((el, i) => { el.correct = i == answer; }); + } else if (this.option.type === 'multi') { + this.option.optionList.forEach((el, i) => { el.correct = answer.includes(i); }); + } else if (this.option.type === 'fill') { + this.option.optionList = []; + answer.forEach(item => { + this.option.optionList.push({ content: item.value, correct: true }); + }); + } else if (this.option.type === 'answer') { + this.option.optionList = [{content: answer, correct:true}]; + } }, onModify(node) { this.$emit('modify', node); diff --git a/src/views/competitionManage/bankList/question-update-page.vue b/src/views/competitionManage/bankList/question-update-page.vue index 0e2a41161..2b9f72958 100644 --- a/src/views/competitionManage/bankList/question-update-page.vue +++ b/src/views/competitionManage/bankList/question-update-page.vue @@ -52,7 +52,7 @@ export default { loadInitData() { getQuestionInfo(this.questionId).then(resp => { this.formModel = resp.data; - this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct); + // this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct); }); }, doBack() { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 922433159..f52812b23 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -259,7 +259,7 @@ export default { }, bgImg() { const bgImgAll = process.env.VUE_APP_PRO === 'local' || this.$route.query.project == 'heb' ? '' : bgImg; - const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX']; + const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW']; const imgMap = { ISCS_LW: bgIscsImg, ISCS_CW: bgIscsImg, @@ -267,12 +267,13 @@ export default { CCTV: bgCctvImg, VR_PSD: bgPsdImg, LSW: bgLswImg, - SANDBOX: bgLswImg + SANDBOX: bgLswImg, + ILW: bgLswImg }; return synchronousLogin.includes(this.$route.query.type) ? imgMap[this.$route.query.type] : bgImgAll; }, syncLogin() { - const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX']; + const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW']; return this.$route.query.type ? synchronousLogin.includes(this.$route.query.type) : false; }, loadingText() { @@ -282,7 +283,8 @@ export default { VR_IBP: '检测现地工作站登陆中', CCTV: '检测教员机登录中', VR_PSD: '检测教员机登录中', - LSW: '检测教员机登录中' + LSW: '检测教员机登录中', + ILW: '检测教员机登录中' }; return this.$route.query.type ? textMap[this.$route.query.type] : ''; } @@ -542,6 +544,16 @@ export default { type: this.$route.query.type }; this.$router.push({ path: `/jlmap3d/sandbox`, query: sandboxQuery }); + } else if (this.$route.query.type === 'ILW') { + const ilwQuery = { + mapid: query.mapId, + group: query.group, + project: getSessionStorage('project'), + token: getToken(), + projectDevice: this.$route.query.projectDevice, + type: this.$route.query.type + }; + this.$router.push({ path: `/jointTrainingNew`, query: query }); } else { this.$router.push({ path: `/jointTrainingNew`, query: query }); } diff --git a/src/views/newMap/chatView/chatBox.vue b/src/views/newMap/chatView/chatBox.vue index 6b81d8dfc..8c7917304 100644 --- a/src/views/newMap/chatView/chatBox.vue +++ b/src/views/newMap/chatView/chatBox.vue @@ -1,16 +1,16 @@