Merge remote-tracking branch 'origin/test'

This commit is contained in:
program-walker 2020-06-03 19:37:16 +08:00
commit 3bdc137618
62 changed files with 1154 additions and 576 deletions

View File

@ -6,7 +6,7 @@ NODE_ENV = 'development'
# VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
# VUE_APP_BASE_API = 'http://192.168.3.4:9000'
VUE_APP_BASE_API = 'http://192.168.3.6:9000'
VUE_APP_VOICE_API = 'https://test.joylink.club'
VUE_APP_VOICE_API = 'https://test.joylink.club/jlcloud'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.

View File

@ -4,4 +4,4 @@ VUE_APP_PRO = 'local'
# base api
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
VUE_APP_VOICE_API = 'https://joylink.club'
VUE_APP_VOICE_API = 'https://joylink.club/jlcloud'

View File

@ -3,4 +3,4 @@ NODE_ENV = 'production'
# base api
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
VUE_APP_VOICE_API = 'https://joylink.club'
VUE_APP_VOICE_API = 'https://joylink.club/jlcloud'

View File

@ -3,4 +3,4 @@ NODE_ENV = 'production'
# base api
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
VUE_APP_VOICE_API = 'https://test.joylink.club'
VUE_APP_VOICE_API = 'https://test.joylink.club/jlcloud'

View File

@ -163,3 +163,24 @@ export function getTestPaperDatail(competitionId) {
method: 'get'
});
}
/** 提交实操结果 */
export function submitPracticalCompetition(group, competitionId) {
return request({
url: `/api/v1/competitionPractical/${group}/${competitionId}/finish`,
method: 'put'
});
}
/** 开始实操竞赛 */
export function startPracticalCompetition(group, competitionId) {
return request({
url: `/api/v1/competitionPractical/${group}/${competitionId}/start`,
method: 'put'
});
}
/** 查询实操考试结果 */
export function getPracticalCompetitionResult(competitionId) {
return request({
url: `/api/v1/competitionPractical/${competitionId}/result`,
method: 'get'
});
}

View File

@ -693,3 +693,10 @@ export function getTrainDetailBytripNumber(group, params) {
params: params
});
}
/** 根据memberId获取综合演练角色信息 */
export function getMemberInfo(group, memberId) {
return request({
url: `/simulation/${group}/${memberId}/memberInfo`,
method: 'get'
});
}

View File

@ -260,4 +260,10 @@ deviceRender[deviceType.ElectricButterflyValve] = {
zlevel: 1,
z: 5
};
// 水池
deviceRender[deviceType.Cistern] = {
_type: deviceType.Cistern,
zlevel: 1,
z: 5
}
export default deviceRender;

View File

@ -39,7 +39,8 @@ const deviceType = {
StateTable: 'StateTable',
LightingGroup: 'LightingGroup',
BalancedElectric: 'BalancedElectric',
ElectricButterflyValve: 'ElectricButterflyValve'
ElectricButterflyValve: 'ElectricButterflyValve',
Cistern: 'Cistern'
};
export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,27 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from '../components/pathsvg';
export default class airConditioner extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this._type = device.model._type;
this.code = device.model.code;
this.create();
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.path = createPathSvg(this.model);
this.grouper.add(this.path);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -64,9 +64,17 @@ const map = {
width: 73,
path: 'M77,24V61L63,55V71H55V52L40.476,45.165,30,50V71H22V53L4,61V24L37,40.923V34.835C28.523,33.828,22,27.8,22,20.5,22,12.492,29.835,6,39.5,6S57,12.492,57,20.5c0,7.3-6.523,13.328-15,14.335v7.113ZM50.8,22H47l-4,3-4-3H30l3-5h5l4,2,3-1h5.534C48.973,14.409,43.6,10.881,38,11c-6.646.141-11,5.858-11,10s4.516,9.141,13,9C47.178,29.88,50.075,25.771,50.8,22Z'
},
ElectricButterflyValve: {
width: 39,
ElectricButterflyValve: {
width: 39,
path: 'M38,24V44H1V24H18.237L18,21s-6.5.6-9-8C7.705,8.542,10.288,2,20,2S31.849,8.083,31,13c-1.586,9.183-9,8-9,8v3H38Zm-3,4.077L24,34a4.361,4.361,0,0,1-3,5c-3.052,1.215-7,0-7,0L9,41H35V28.077ZM25.872,17.466A6.259,6.259,0,0,0,29,12a18.6,18.6,0,0,0-1-4L25,5H16L12.511,7.279C10.464,8.908,11.044,14.092,11,10.9a10.963,10.963,0,0,0,2.23,5.284L14,7h2l3.181,6.95L23,7h2Zm-1.924.915L23.261,10.13,19.91,17H18l-2.341-5.907L15.1,17.8A8.481,8.481,0,0,0,20,19C17.855,19.073,20.85,19.478,23.948,18.38ZM4,27V39.556L12,36a6.888,6.888,0,0,1,3-7c4.261-2.736,8,1,8,1l6-3H4Z'
},
Cistern: {
width: 323,
path: 'M264,27v3l-13-5.353V31s-8.068-6-16-6c-8.067,0-16,6-16,6V26H207V84H167v28H135v6s-7.614-6-16-6c-8.11,0-17,6-17,6v-6H23.467L26,119,4,109l23-9-3.13,7H76V31h72V12h59v9h12V14s8.08,5,16,5c8.079,0,16-5,16-5v7.353L264,16v7h54v4H264ZM148,37H82v70h20V99s8.89,8,17,8c8.386,0,16-8,16-8v8h26V84H148V37Zm54-20H153V55h15.5s-5.715-3.318-4.5-15c0.657-6.32,9-9,9-9l22-10h7V17Zm0,9h-6l-13,5s8.644,5.651,8,13c-0.827,9.433-4.75,11-4.75,11H202V26Zm-25,8a9,9,0,1,1-9,9A9,9,0,0,1,177,34Z'
},
StaircaseOneWay: {
width: 51,
path: 'M51,71H0V0H12V15H23V-1h4V15H39V0H51V71ZM23,19H12v4H23V19Zm0,8H12v3H23V27Zm0,7H12v3H23V34Zm0,7H12v3H23V41Zm0,7H12v3H23V48Zm0,7H12v4H23V55ZM39,19H27v4H39V19Zm0,8H27v3H39V27Zm0,7H27v3H39V34Zm0,7H27v3H39V41Zm0,7H27v3H39V48Zm0,7H27v4H39V55ZM43,4V63H8V4H4V66H47V4H43Z'
}
};

View File

@ -40,6 +40,7 @@ import SmookExhaustFd from './bas/smookExhaustFd';
import StateTable from './stateTable';
import LightingGroup from './lighting';
import ElectricButterflyValve from './bas/electricButterflyValve';
import Cistern from './bas/cistern';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -84,6 +85,7 @@ iscsShape[deviceType.StateTable] = StateTable;
iscsShape[deviceType.LightingGroup] = LightingGroup;
iscsShape[deviceType.BalancedElectric] = BalancedElectric;
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
iscsShape[deviceType.Cistern] = Cistern;
function shapefactory(device, iscs) {
const type = device.model._type;

View File

@ -16,13 +16,30 @@ export default class Staircase extends Group {
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.path = createPathSvg(this.model);
this.add(this.grouper);
if (this.model.isRight) {
let model = {};
let rotationAngle = this.model.rotationAngle;
if (this.model.oneWay) {
model = {
_type: 'StaircaseOneWay',
z:this.z,
zlevel:this.zlevel,
width: this.model.width,
fill: '#FFF'
};
rotationAngle = rotationAngle - 90;
this.grouper.origin = [this.model.width / 2, this.model.width * 0.718 / 2];
} else {
model = this.model;
this.grouper.origin = [this.model.width / 2, this.model.width * 1.368 / 2];
this.grouper.scale = [-1, 1];
}
this.grouper.rotation = Math.PI / 180 * (this.model.rotationAngle || 0);
this.path = createPathSvg(model);
this.add(this.grouper);
if (this.model.isRight && !this.model.oneWay) {
this.grouper.scale = [-1, 1];
} else if (this.model.isRight && this.model.oneWay) {
this.grouper.scale = [1, -1];
}
this.grouper.rotation = Math.PI / 180 * (rotationAngle || 0);
this.grouper.add(this.path);
}
setModel(dx, dy) {

View File

@ -166,6 +166,9 @@ export function parser(data) {
zrUtil.each(data.electricButterflyValveList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.ElectricButterflyValve, elem);
});
zrUtil.each(data.cisternList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Cistern, elem);
})
}
return iscsDevice;
@ -311,6 +314,9 @@ export function updateIscsData(state, device) {
case deviceType.ElectricButterflyValve:
updateIscsListByDevice(state, 'electricButterflyValveList', device);
break;
case deviceType.Cistern:
updateIscsListByDevice(state, 'cisternList', device);
break;
}
// store.dispatch('iscs/setIscsData', state.iscs);
}

View File

@ -76,6 +76,7 @@ export function bindSimulationTrain(group,groupNumber) {
params: ''
})
}
//EB紧急制动
export function trainSimulationEb(group,groupNumber) {
return request({
url: `/simulation/driving/${group}/train/${groupNumber}/eb`,
@ -83,6 +84,8 @@ export function trainSimulationEb(group,groupNumber) {
params: ''
})
}
//改变列车牵引/制动力
export function trainSimulationForce(group,groupNumber,percent) {
return request({
url: `/simulation/driving/${group}/train/${groupNumber}/force/${percent}`,
@ -90,6 +93,8 @@ export function trainSimulationForce(group,groupNumber,percent) {
params: ''
})
}
//改变列车档位
export function trainSimulationGear(group,groupNumber,gear) {
return request({
url: `/simulation/driving/${group}/train/${groupNumber}/gear/${gear}`,
@ -97,3 +102,30 @@ export function trainSimulationGear(group,groupNumber,gear) {
params: ''
})
}
//改变列车运行级别
export function trainSimulationDriveMode(group,groupNumber,driveMode) {
return request({
url: `/simulation/driving/${group}/train/${groupNumber}/driveMode/${driveMode}`,
method: 'put',
params: ''
})
}
//ATP切除
//ATO
export function trainSimulationAtp(group,groupNumber) {
return request({
url: `/simulation/driving/${group}/train/${groupNumber}/atp`,
method: 'put',
params: ''
})
}
//ATO
export function trainSimulationAto(group,groupNumber) {
return request({
url: `/simulation/driving/${group}/train/${groupNumber}/openAto`,
method: 'put',
params: ''
})
}

View File

@ -94,6 +94,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
// 对象化数据
let data = JSON.parse(Response.body);
// 遍历后台数据
// console.log(data);
if(data.type == "Train_Position"){

View File

@ -3,14 +3,14 @@ import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
// 定于仿真socket接口
export function PassflowConnect(nowstation,deviceaction,lefttrain,righttrain,routegroup) {
export function PassflowConnect(nowstation,deviceaction,toptrain,downtrain,routegroup) {
const scope = this;
this.controlstation = nowstation;
this.teststomp = new StompClient();
let trainleftnow = null;
let trainrightnow = null;
let traintopnow = null;
let traindownnow = null;
let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() };
@ -37,19 +37,7 @@ export function PassflowConnect(nowstation,deviceaction,lefttrain,righttrain,rou
if(data.body.type == "PSD"){
if(data.body.code == nowstation.toppsd){
if(data.body.open == 0){
deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1;
deviceaction.down.action.play();
}else{
deviceaction.down.action.reset();
deviceaction.down.action.time = 0;
deviceaction.down.action.timeScale = 1;
deviceaction.down.action.play();
}
}
if(data.body.code == nowstation.downpsd){
if(data.body.open == 0){
deviceaction.top.action.reset();
deviceaction.top.action.time =deviceaction.top.action._clip.duration;
deviceaction.top.action.timeScale = -1;
@ -61,25 +49,133 @@ export function PassflowConnect(nowstation,deviceaction,lefttrain,righttrain,rou
deviceaction.top.action.play();
}
}
if(data.body.code == nowstation.downpsd){
if(data.body.open == 0){
deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1;
deviceaction.down.action.play();
}else{
deviceaction.down.action.reset();
deviceaction.down.action.time = 0;
deviceaction.down.action.timeScale = 1;
deviceaction.down.action.play();
}
}
}
if(data.body.type == "TRAIN_DOOR"){
if(traintopnow == data.body.code){
if(data.body.open == "0"){
closetraindoor(toptrain,data.body.doorCode,"top");
}else{
opentraindoor(toptrain,data.body.doorCode,"top");
}
}
if(traindownnow == data.body.code){
// console.log(data.body);
if(data.body.open == "0"){
closetraindoor(downtrain,data.body.doorCode,"down");
}else{
opentraindoor(downtrain,data.body.doorCode,"down");
}
}
}
}
if(data.type == "TrainRun_3D"){
console.log(data.body);
console.log(nowstation);
for(let i=0,leni = data.body.length;i<leni;i++){
if(data.body[i].section == scope.controlstation.topsection){
console.log("top:"+data.body[i].offset);
if(traintopnow != data.body[i].code){
traintopnow = data.body[i].code;
}
toptrain.position.copy(toptrain.curve.getPointAt(data.body[i].offset));
// toptrain.position
// if(){
//
// }
}else{
if(traindownnow == data.body[i].code){
toptrain.position.x -= 1;
}
}
if(data.body[i].section == scope.controlstation.downsection){
if(data.body[i].section == scope.controlstation.downsection){
console.log("down:"+data.body[i].offset);
if(traindownnow != data.body[i].code){
traindownnow = data.body[i].code;
}
downtrain.position.copy(downtrain.curve.getPointAt(data.body[i].offset));
}else{
if(traindownnow == data.body[i].code){
downtrain.position.x += 1;
}
}
}
}
// console.log(data);
}
let actions;
function opentraindoor(train,doorcode,direct){
if(direct == "top"){
if(doorcode == "1"){
actions = train.action.down;
}
if(doorcode == "2"){
actions = train.action.top;
}
}else{
if(doorcode == "1"){
actions = train.action.top;
}
if(doorcode == "2"){
actions = train.action.down;
}
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = 0;
actions[an].timeScale = 1;
actions[an].play();
}
}
function closetraindoor(train,doorcode,direct){
if(direct == "top"){
if(doorcode == "1"){
actions = train.action.down;
}
if(doorcode == "2"){
actions = train.action.top;
}
}else{
if(doorcode == "1"){
actions = train.action.top;
}
if(doorcode == "2"){
actions = train.action.down;
}
}
for(let an=actions.length-1;an>=0;an--){
actions[an].reset();
actions[an].time = actions[an]._clip.duration;
actions[an].timeScale = -1;
actions[an].play();
}
}
}

View File

@ -41,8 +41,8 @@ let originhuman1 = null;
let originhuman2 = null;
let originanima1 = null;
let originanima2 = null;
let lefttrain = null;
let righttrain = null;
let toptrain = null;
let downtrain = null;
let zhajiin = [];
let zhajiout = [];
@ -395,9 +395,9 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
getPublishMapDetail(skinCode).then(netdata => {
console.log(netdata);
// console.log(netdata);
initstationlist(netdata.data.stationList,netdata.data.stationStandList,netdata.data.psdList);
socktest = new PassflowConnect(nowstation,deviceaction,lefttrain,righttrain,routegroup);
socktest = new PassflowConnect(nowstation,deviceaction,toptrain,downtrain,routegroup);
});
animate();
@ -815,7 +815,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
// console.log(humanlist.children.length);
}
function initstationlist(stationdata,standdata,psddata){
// console.log(standdata);
let list = [];
for(let i=0,leni = standdata.length;i<leni;i++){
for(let j=0,lenj = psddata.length;j<lenj;j++){
@ -846,7 +846,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
topsection:null,
downsection:null,
};
if(list[k][0].position.y>list[k][1].position.y){
if(list[k][0].position.y<list[k][1].position.y){
stationobject.toppsd = list[k][0].name;
stationobject.downpsd = list[k][1].name;
stationobject.topsection = list[k][0].standTrackCode;
@ -864,7 +864,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
nowstation = stationlist[0];
updatestationlist(stationlist);
console.log(nowstation);
// console.log(nowstation);
}
function inittrain(object){
let ntracks1,ntracks2,tclip,fclip;
@ -879,23 +879,40 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
lefttrain = object.clone(true);
lefttrain.action = {
toptrain = object.clone(true);
toptrain.action = {
top:[],
down:[]
};
let points1 = [];
points1.push(new THREE.Vector3(-71,0.06,-6.3));
points1.push(new THREE.Vector3(60.73,0.06,-6.3));
righttrain = object.clone(true);
righttrain.action = {
toptrain.curve = new THREE.CatmullRomCurve3(points1);
downtrain = object.clone(true);
downtrain.action = {
top:[],
down:[]
};
inittrainanimation(lefttrain,tclip,fclip);
inittrainanimation(righttrain,tclip,fclip);
lefttrain.position.z = 30;
righttrain.position.z = -10;
// scene.add(lefttrain);
// scene.add(righttrain);
let points2 = [];
points2.push(new THREE.Vector3(-71,0.06,28.68));
points2.push(new THREE.Vector3(60.73,0.06,28.68));
downtrain.curve = new THREE.CatmullRomCurve3(points2);
inittrainanimation(toptrain,tclip,fclip);
inittrainanimation(downtrain,tclip,fclip);
toptrain.position.z = -20;
toptrain.position.y = -20000;
toptrain.rotation.y = Math.PI;
downtrain.position.z = 40;
downtrain.position.y = -20000;
scene.add(toptrain);
scene.add(downtrain);
}
function inittrainanimation(train,tclip,fclip){
@ -960,6 +977,11 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
for(let j=0;j<object.children.length;j++){
if(object.children[j].name == "top"){
// var geometry = new THREE.BoxBufferGeometry( 50, 50, 50 );
// var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
// var cube = new THREE.Mesh( geometry, material );
// cube.position.copy(object.children[j].position);
// scene.add( cube );
object.children[j].animations = [];
object.children[j].animations.push(newclip.clone());

View File

@ -57,6 +57,30 @@ let standtop = {
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,0.38),
doorpoints:[
new THREE.Vector3(-62.84,1.77,-4.38),
new THREE.Vector3(-58.11,1.77,-4.38),
new THREE.Vector3(-53.47,1.77,-4.38),
new THREE.Vector3(-45.45,1.77,-4.38),
new THREE.Vector3(-41.1,1.77,-4.38),
new THREE.Vector3(-36.33,1.77,-4.38),
new THREE.Vector3(-31.5,1.77,-4.38),
new THREE.Vector3(-23.65,1.77,-4.38),
new THREE.Vector3(-18.98,1.77,-4.38),
new THREE.Vector3(-14.46,1.77,-4.38),
new THREE.Vector3(-10,1.77,-4.38),
new THREE.Vector3(-2.2,1.77,-4.38),
new THREE.Vector3(2.49,1.77,-4.38),
new THREE.Vector3(7.17,1.77,-4.38),
new THREE.Vector3(11.8,1.77,-4.38),
new THREE.Vector3(19.41,1.77,-4.38),
new THREE.Vector3(24.09,1.77,-4.38),
new THREE.Vector3(28.72,1.77,-4.38),
new THREE.Vector3(33.46,1.77,-4.38),
new THREE.Vector3(41.24,1.77,-4.38),
new THREE.Vector3(45.82,1.77,-4.38),
new THREE.Vector3(50.69,1.77,-4.38)
],
railpoints : [
new THREE.Vector3(52.1,1.77,-1.8),
new THREE.Vector3(-63.5,1.77,-1.8)
@ -69,6 +93,30 @@ let standdown = {
type : "stand",
stage : "3",
randompoint : new THREE.Vector3(-64,1.77,21),
doorpoints:[
new THREE.Vector3(-62.84,1.77,27),
new THREE.Vector3(-58.11,1.77,27),
new THREE.Vector3(-53.47,1.77,27),
new THREE.Vector3(-45.45,1.77,27),
new THREE.Vector3(-41.1,1.77,27),
new THREE.Vector3(-36.33,1.77,27),
new THREE.Vector3(-31.5,1.77,27),
new THREE.Vector3(-23.65,1.77,27),
new THREE.Vector3(-18.98,1.77,27),
new THREE.Vector3(-14.46,1.77,27),
new THREE.Vector3(-10,1.77,27),
new THREE.Vector3(-2.2,1.77,27),
new THREE.Vector3(2.49,1.77,27),
new THREE.Vector3(7.17,1.77,27),
new THREE.Vector3(11.8,1.77,27),
new THREE.Vector3(19.41,1.77,27),
new THREE.Vector3(24.09,1.77,27),
new THREE.Vector3(28.72,1.77,27),
new THREE.Vector3(33.46,1.77,27),
new THREE.Vector3(41.24,1.77,27),
new THREE.Vector3(45.82,1.77,27),
new THREE.Vector3(50.69,1.77,27)
],
railpoints : [
new THREE.Vector3(52.1,1.77,24),
new THREE.Vector3(-64,1.77,24)

View File

@ -412,10 +412,13 @@ class SkinCode extends defaultStyle {
spareColor: '#5b5b5b' // 区段显示颜色
},
core: {
length: 6 // 道岔单边长度
length: 6, // 道岔单边长度
graphShow: true // 图形显示
},
jointImg: { // 道岔 A B C D四元素属性配置
trapezoidLength: 8 // 直角梯形元素默认长度
trapezoidLength: 8, // 直角梯形元素默认长度
fork: true, // 挤岔专用(如有挤岔操作 变为true
forKColor: 'red' // 挤岔颜色 配合挤岔专用
},
arcBlcok: { // 圆形封锁图形
show: false, // 显示

View File

@ -395,7 +395,6 @@ class Signal extends Group {
this.cbtcStatus = '';
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.redColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
@ -565,6 +564,7 @@ class Signal extends Group {
this.sigBack && this.sigBack.hide();
this.sigBack && this.sigBack.stopAnimation(false);
this.lamps && this.lamps[0].setAnimationEnd();
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.redColor);
}
setState(model) {
@ -588,7 +588,7 @@ 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.fleetMode && this.setAutoRouteOpen();
// 联锁自动触发

View File

@ -45,6 +45,10 @@ class ESwLocal extends Group {
this.locShelter.stopAnimation(flag);
}
setColor(color) {
this.locShelter.setStyle({ fill: color });
}
animateStyle(cb) {
this.eachChild((child) => {
cb(child);

View File

@ -283,19 +283,18 @@ export default class Switch extends Group {
this.lockArc.hide(); // 圆形单锁框
this.name.getNameText().stopAnimation(false);
this.sheltertriangle.hide(); // 直角梯形覆盖图形
this.rhomboid.stopAnimation(false);
this.rhomboid.stopAnimation(false); // 平行四边形
this.releaseBackground.hide();
this.setHasTextBorder(0);
this.locShelter.hide(); // 定位覆盖图形
this.relocShelter.hide(); // 反位覆盖图形
this.enabledName.hide(); // 使能隐藏
this.lossShow && this.lossShow.hide();
this.lossShow && this.lossShow.hide(); // 道岔失去矩形
this.lossShow && this.lossShow.stopAnimation(false);
}
/** 定位*/
setLocationAction() {
// this.recover();
if (this.style.Switch.core.splice) {
this.locShelter.hide();
} else {
@ -303,12 +302,17 @@ export default class Switch extends Group {
}
this.relocShelter.hide();
this.rhomboid.hide();
if (this.style.Switch.core.graphShow) { // 佛山线路显示
this.relocShelter.show();
this.rhomboid.show();
this.relocShelter.setColor('#00FF00');
this.rhomboid.setColor('#00FF00');
}
this.setTextColor(this.style.Switch.text.locateColor);
}
/** 反位*/
setInversionAction() {
// this.recover();
this.setTextColor(this.style.Switch.text.inversionColor);
if (this.style.Switch.core.splice) {
this.relocShelter.hide();
@ -318,11 +322,15 @@ export default class Switch extends Group {
this.locShelter.hide(); // 定位
this.rhomboid.show(); // 平行四边形
this.setSectionState(this.rhomboid.getSection(), 'fill', this.model);
if (this.style.Switch.core.graphShow) { // 佛山线路显示
this.locShelter.show();
this.locShelter.setColor('#FFFF00');
this.rhomboid.setColor('#FFFF00');
}
}
/** 失去*/
setLossAction() {
// this.recover();
this.locShelter.show();
this.relocShelter.show();
this.rhomboid.hide();
@ -376,6 +384,7 @@ export default class Switch extends Group {
.when(2000, { fill: this.style.backgroundColor })
.start();
});
this.setTextColor('red');
}
}
@ -402,7 +411,6 @@ export default class Switch extends Group {
/** 封锁 */
block() {
if (this.style.Switch.jointImg.block) {
// this.recover();
this.relocShelter.show();
this.relocShelter.animateStyle(item => {
item.animateStyle(true)
@ -517,18 +525,15 @@ export default class Switch extends Group {
} else if (model.reversePosition) {
this.setInversionAction(model); /** 反位*/
} else {
this.setLossAction();
this.setLossAction(); // 失去
}
/** 道岔单锁 */
model.singleLock && this.setMonolock();
/** 道岔封锁 */
model.blockade && this.block();
model.singleLock && this.setMonolock(); // 道岔单锁
model.blockade && this.block(); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
/** 区段切除*/
// this.setForkAction(); // 道岔挤岔完成
// 道岔使能显示
model.isCiConfirm && this.setCiConfirm();
// this.setForkAction(); // 道岔挤岔
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
this.setSwitchFault(model.split);
model.cutOff && this.setSwitchCutOff();
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色

View File

@ -1,5 +1,5 @@
<template>
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
<div v-if="isShowBtn" menuButtonclass="menu menuButton" style="height: 45px;" :style="{left: point.x+'px', bottom: point.y+'px' }">
<button
:id="Signal.arrangementRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@ -257,8 +257,8 @@ export default {
data() {
return {
point: {
x: -1000,
y: -1000
x: 0,
y: 15
},
operation: '0',
buttonName: '',
@ -302,18 +302,13 @@ export default {
'$store.state.menuOperation.selectedCount': function (val) {
this.selectedChange();
}
},
},
mounted() {
this.resetPosition();
},
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},

View File

@ -1,5 +1,5 @@
<template>
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
<div v-if="isShowBtn" class="menu menuButton" style="height:45px;" :style="{left: point.x+'px', bottom: point.y+'px' }">
<button
:id="Signal.cancelTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@ -254,8 +254,8 @@ export default {
data() {
return {
point: {
x: -1000,
y: -1000
x: 5,
y: 15
},
operation: '0',
buttonName: '',
@ -297,11 +297,6 @@ export default {
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},

View File

@ -1,5 +1,5 @@
<template>
<div id="menuButton">
<div id="menuButton" class="menuButton">
<div class="haerbin-01__systerm button">
<el-row>
<el-col :span="11">

View File

@ -218,7 +218,7 @@ export default {
const operate = {
over: true,
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_FORCE_CANCEL_ROUTE
};
this.loading = true;

View File

@ -96,7 +96,7 @@ export default {
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation
};
this.$emit('setOperate', { selection: this.operate.selection, cancel: true });
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
@ -115,7 +115,10 @@ export default {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL;
} else if (this.operation == OperationEvent.StationControl.emergencyStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL;
} else if (this.operation == OperationEvent.StationControl.forcedStationControl.menu.operation) {
operate.cmdType = CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL;
}
this.$emit('setOperate', { selection: this.operate.selection, commit: true });
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
if (valid) {
this.doClose();

View File

@ -92,7 +92,7 @@ export default {
count: 0,
flagListBit: [],
backOperate: '',
timeout: 61,
timeout: 55,
counts: 0
};
},
@ -157,17 +157,22 @@ export default {
'$store.state.socket.msgHead': function (elem) {
if (elem) {
this.flagListBit[this.selection.forEach(elem => { return elem.stationControlCode == elem.code; })] = false;
if (elem.hasOwnProperty('timeout')) {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.acceptConversionResponseTimeout') }, false);
} else if (elem.hasOwnProperty('agree')) {
if (elem.agree) {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransfersuccees') }, true);
if (elem.hasOwnProperty('success')) {
if (elem.success) {
(elem.stationCodes || []).forEach(code => {
this.updateTableValue(code, { result: this.$t('menu.menuDialog.controlModeTransfersuccees') }, true);
this.removeSelection(code);
});
} else {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransferFailed') }, false);
(elem.stationCodes || []).forEach(code => {
this.updateTableValue(code, { result: this.$t('menu.menuDialog.controlModeTransferFailed') }, false);
this.removeSelection(code);
});
}
this.$store.dispatch('socket/shiftMsgQueue');
this.disabledClose = false;
this.disabledSure = false;
}
this.disabledClose = false;
this.disabledSure = false;
}
},
backOperate: function (operate) {
@ -327,11 +332,20 @@ export default {
this.timer = null;
}
},
removeSelection(code) {
let selectionIndex = -1;
this.selection.forEach((item, index) => {
if (item.code === code) {
selectionIndex = index;
}
});
if (selectionIndex > -1) {
this.selection.splice(selectionIndex, 1);
}
},
setRequestTimeout(elem) {
elem['count'] = 0;
this.$store.dispatch('socket/pushMsgQueue',
{ type: 'resp', timeout: 'true', stationControlCode: elem.code }
);
this.updateTableValue(elem.code, { result: this.$t('menu.menuDialog.acceptConversionResponseTimeout') }, false);
this.removeSelection(elem.code);
},
handleChooseChange(selection) {
this.selection = selection;
@ -450,12 +464,13 @@ export default {
this.backOperate = operate;
if (operate.cancel) {
this.disabledSure = this.disabledSend = false;
this.disabledClose = false;
}
if (operate.commit || operate.timeout) {
this.disabledSend = this.disabledSure = true;
this.disabledClose = true;
}
this.setTimer();
this.disabledClose = true;
this.counts = 1;
}
}

View File

@ -59,7 +59,7 @@ export default {
{
label: '进路取消',
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_FORCE_CANCEL_ROUTE
},
{
label: '信号封锁',
@ -131,7 +131,7 @@ export default {
{
label: '进路取消',
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_FORCE_CANCEL_ROUTE
},
{
label: '信号封锁',

View File

@ -62,6 +62,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {getMemberInfo} from '@/api/simulation';
export default {
name: 'RequestControl',
@ -75,24 +76,24 @@ export default {
disabledRefuse: false,
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
controlProps: {
'01': this.$t('menu.passiveDialog.inTheControl'),
'02': this.$t('menu.passiveDialog.stationControl')
'Center': this.$t('menu.passiveDialog.inTheControl'),
'Local': this.$t('menu.passiveDialog.stationControl')
},
selection: [],
tableData: [],
timer: null,
timeout: 61,
timeout: 55,
count: 0,
commandId: ''
sourceMemberId: ''
};
},
computed: {
targetStatus() {
if (this.$store.state.training.prdType == '01') {
return '01';
return 'Center';
}
if (this.$store.state.training.prdType == '02') {
return '02';
return 'Local';
}
return '';
},
@ -117,10 +118,10 @@ export default {
deep: true
},
'$store.state.socket.msgHead': function (elem) {
if (elem && elem.type == 'req') {
if (elem.stationControlCode) {
if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control' || elem.operateType == 'CM_Force_Station_Control')) {
if (elem.params.stationCodes && elem.params.stationCodes.length) {
this.doShow(elem);
this.commandId = elem.commandId;
this.sourceMemberId = elem.sourceMemberId;
}
}
}
@ -164,43 +165,40 @@ export default {
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(code) {
updateTableData(codes) {
this.tableData = [];
(codes || []).forEach(code=> {
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: false,
disabled: false
};
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: false,
disabled: false
};
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
const control = (device || {}).state;
if (control) {
model.control = { status: control.status, name: this.controlProps[control.status] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
const control = (device || {}).controlMode;
if (control) {
model.control = { status: control, name: this.controlProps[control] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
}
model.operate = device.name || '';
}
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (station) {
model.operate = station.name || '';
}
}
this.tableData.push(model);
this.tableData.push(model);
});
},
doShow(msgHead) {
this.requestInfo = `${msgHead.fromMember.deviceName}`;
if (msgHead.fromMember.nickName) {
this.requestInfo = `${msgHead.fromMember.deviceName}(${msgHead.fromMember.nickName})`;
}
getMemberInfo(this.$route.query.group, msgHead.sourceMemberId).then(resp => {
if (resp.data && resp.data.deviceName && resp.data.name) {
this.requestInfo = `${ resp.data.deviceName}(${resp.data.name})`;
}
});
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();
this.updateTableData(msgHead.stationControlCode);
this.updateTableData(msgHead.params.stationCodes);
const operate = {
start: true,
@ -220,7 +218,6 @@ export default {
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.count = 0;
this.dialogShow = false;
this.clearTimer();
@ -247,22 +244,27 @@ export default {
}
},
agree() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
code: this.tableData[0].code,
val: this.commandId,
send: true,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
ControlMode_Code: this.tableData[0].code,
Reply_Command_Id: this.commandId,
ControlMode_Reply: true
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: true
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
@ -272,22 +274,27 @@ export default {
});
},
refuse() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
code: this.tableData[0].code,
val: this.commandId,
send: true,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
ControlMode_Code: this.tableData[0].code,
Reply_Command_Id: this.commandId,
ControlMode_Reply: false
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: false
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}

View File

@ -738,6 +738,8 @@ const map = {
state.mousemove++;
},
setRouteData: (state, routeDataList) => {
state.routeData = {};
state.routeStartSignalData = {};
routeDataList.forEach(data => {
state.routeData[data.code] = data;
if (state.routeStartSignalData[data.startSignalCode] && state.routeStartSignalData[data.startSignalCode].length) {
@ -752,12 +754,14 @@ const map = {
state.routeList = routeDataList;
},
setOverlapData: (state, overlapList) => {
state.overlapData = {};
overlapList.forEach(data => {
state.overlapData[data.code] = data;
});
state.overlapList = overlapList;
},
setAutoReentryData: (state, autoReentryList) => {
state.autoReentryData = {};
autoReentryList.forEach(data => {
state.autoReentryData[data.code] = data;
});
@ -767,6 +771,7 @@ const map = {
state.autoReentryList = autoReentryList;
},
setSignalApproachSectionData: (state, signalApproachSectionList) => {
state.signalApproachSectionData = {};
signalApproachSectionList.forEach(data => {
state.signalApproachSectionData[data.signalCode] = data;
});

View File

@ -174,7 +174,7 @@ export default {
});
},
generatePaper(index, row) {
this.$router.push({ path: `/design/race/generate`, query: {raceId:row.id} });
this.$router.push({ path: `/design/race/generate`, query: {raceId:row.id, mapId: row.mapId} });
}
}
};

View File

@ -56,8 +56,16 @@
:summary-method="getSummaries"
:show-summary="showSummary"
>
<el-table-column prop="name" label="实操名称" />
<el-table-column prop="creatorName" label="创建人" />
<el-table-column prop="question" label="实操名称">
<template slot-scope="scope">
<span>{{ scope.row.question.name }}</span>
</template>
</el-table-column>
<el-table-column prop="question" label="实操描述">
<template slot-scope="scope">
<span>{{ scope.row.question.description }}</span>
</template>
</el-table-column>
<el-table-column prop="score" label="分值">
<template slot-scope="scope">
<span v-if="!scope.row.editScope" @click="editScope(scope.row)">{{ scope.row.score }}</span>
@ -127,12 +135,13 @@ export default {
}
},
addOperateQuestionList(row) {
if (this.operateQuestionList.length) {
const length = this.operateQuestionList.length;
if (length) {
this.operateIndexList.push(row.id);
this.operateQuestionList.push(row);
this.operateQuestionList.push({id:length + 1, score:0, question: row});
} else {
this.operateIndexList = [row.id];
this.operateQuestionList = [row];
this.operateQuestionList = [{id:1, score:0, question: row}];
}
},
addTheoryQuestion() {

View File

@ -6,6 +6,7 @@
</template>
<script>
import { getPracticeList } from '@/api/race';
export default {
mixins: [
// WindowResizeHandler
@ -31,31 +32,27 @@ export default {
queryForm: {
reset: true,
labelWidth: '80px',
queryObject: {
name: {
type: 'text',
label: '实操名称'
}
}
queryObject: {}
},
queryList: {
// query: getPracticeList,
data:[
{id:1, raceId:2, name:'行调进行扣车操作', creatorName:'水墨'},
{id:2, raceId:4, name:'行调进行扣车操作', creatorName:'zyy'},
{id:3, raceId:3, name:'行调进行扣车操作', creatorName:'水墨'}
],
query: getPracticeList,
beforeQuery: this.beforeQuery,
// data:[
// {id:1, raceId:2, name:'', creatorName:''},
// {id:2, raceId:4, name:'', creatorName:'zyy'},
// {id:3, raceId:3, name:'', creatorName:''}
// ],
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '实操名称',
prop: 'name'
prop: 'name',
width: '400'
},
{
title: '创建人',
prop: 'creatorName',
width: '100'
title: '实操描述',
prop: 'description'
},
{
type: 'button',
@ -100,9 +97,12 @@ export default {
},
addQuestion(index, row) {
this.$set(row, 'paper', true);
row.score = 0;
this.$emit('addQuestion', row);
},
beforeQuery(params) {
params.mapId = this.$route.query.mapId;
return params;
},
afterQuery(data) {
if (data && data.list) {
const that = this;

View File

@ -49,6 +49,8 @@ import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import { getSessionStorage } from '@/utils/auth';
import { ProjectCode } from '@/scripts/ProjectConfig';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
export default {
name: 'DeomonList',
@ -84,6 +86,18 @@ export default {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
async subscribe(group) {
if (!this.$store.state.socket.roomIsSubscribe) {
this.clearSubscribe(group);
const header = { group: group || '', 'X-Token': getToken() };
creatSubscribe(`${roomTopic}\/${group}`, header);
await this.$store.dispatch('socket/setRoomSubscribe', true);
}
},
async clearSubscribe(group) {
clearSubscribe(`${roomTopic}\/${group}`);
await this.$store.dispatch('socket/setRoomSubscribe', false);
},
async doShow() {
try {
this.pageLoading = true;
@ -120,6 +134,7 @@ export default {
path = '/jointTraining';
}
if (data.state == '02') {
this.subscribe(data.group);
launchFullscreen();
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: rest.data.drawWay };
if (rest.data.drawWay) {

View File

@ -46,6 +46,8 @@
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
export default {
name: 'DeomonList',
@ -81,6 +83,18 @@ export default {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
async subscribe(group) {
if (!this.$store.state.socket.roomIsSubscribe) {
this.clearSubscribe(group);
const header = { group: group || '', 'X-Token': getToken() };
creatSubscribe(`${roomTopic}\/${group}`, header);
await this.$store.dispatch('socket/setRoomSubscribe', true);
}
},
async clearSubscribe(group) {
clearSubscribe(`${roomTopic}\/${group}`);
await this.$store.dispatch('socket/setRoomSubscribe', false);
},
async doShow() {
try {
this.pageLoading = true;
@ -102,6 +116,7 @@ export default {
const rest = await getPublishMapInfo(data.mapId);
await getjointTrainingNew(data.group);
if (data.state == '02') {
this.subscribe(data.group);
launchFullscreen();
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: true };
await putJointTrainingSimulationEntranceNew(data.group);

View File

@ -22,6 +22,8 @@ import { getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat
import { getjointTrainingNew, putJointTrainingSimulationEntranceNew} from '@/api/jointTraining';
import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
export default {
name: 'DeomonList',
@ -57,6 +59,18 @@ export default {
doClose() {
this.dialogShow = false;
},
async subscribe() {
if (!this.$store.state.socket.roomIsSubscribe) {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${roomTopic}\/${this.group}`, header);
await this.$store.dispatch('socket/setRoomSubscribe', true);
}
},
async clearSubscribe() {
clearSubscribe(`${roomTopic}\/${this.group}`);
await this.$store.dispatch('socket/setRoomSubscribe', false);
},
async handleJoin() {
try {
this.loading = true;
@ -68,6 +82,7 @@ export default {
await getjointTraining(this.group);
}
if (this.state == '02') {
this.subscribe();
launchFullscreen();
const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: drawWay };
if (drawWay) {

View File

@ -112,7 +112,18 @@ export default {
async loadInitData() {
this.loading = true;
try {
const res = await getPublishMapInfo(this.mapId);
let res;
try {
res = await getPublishMapInfo(this.mapId);
} catch (error) {
if (error.code == 30001) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id);
localStore.remove();
if (url) {
this.$router.push(url);
}
}
}
const resp = await getSubSystemDetail(this.$route.params.subSystem);
this.tryUser = 0;
this.loading = false;
@ -153,16 +164,8 @@ export default {
}
}
} catch (error) {
if (error.code == 30001) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id);
localStore.remove();
if (url) {
this.$router.push(url);
}
} else {
this.loading = false;
this.$message.error(this.$t('error.refreshFailed'));
}
// this.loading = false;
// this.$message.error(this.$t('error.refreshFailed'));
}
},
refresh() {

View File

@ -0,0 +1,133 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="颜色" prop="fill">
<el-color-picker v-model="form.fill" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 20,
fill: '#000',
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'Cistern' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.fill = model.fill;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Cistern',
code: this.isUpdate ? this.form.code : getUID('Cistern', this.iscs.cisternList || []),
width: this.form.width,
fill: this.form.fill
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 20,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Cistern',
code: this.form.code,
width: this.form.width,
fill: '#000'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -123,7 +123,14 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="水池" name="Cistern">
<cistern
ref="cistern"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="照明组" name="LightingGroup">
<lighting-group
ref="lightingGroup"
@ -190,6 +197,7 @@ import SmookExhaustFd from './smookExhaustFd';
import LightingGroup from './lightingGroup';
import BalancedElectric from './balancedElectric';
import ElectricButterflyValve from './electricButterflyValve';
import Cistern from './cistern';
export default {
name: 'IscsOperate',
@ -212,7 +220,8 @@ export default {
IscsLine,
LightingGroup,
BalancedElectric,
ElectricButterflyValve
ElectricButterflyValve,
Cistern
},
mixins: [
],

View File

@ -7,8 +7,8 @@
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="addModel.width" />
</el-form-item>
<el-form-item label="扶梯朝右" prop="isRight">
<el-checkbox v-model="addModel.isRight" />
<el-form-item label="单向" prop="oneWay">
<el-checkbox v-model="addModel.oneWay" />
</el-form-item>
<el-form-item label="旋转角度">
<el-input-number v-model="addModel.rotationAngle" />
@ -41,7 +41,8 @@ export default {
x: 10,
y: 10,
rotationAngle: 0,
isRight:false
isRight:false,
oneWay: false
},
rules: {
width:[{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }],
@ -71,6 +72,7 @@ export default {
this.addModel.y = model.point.y;
this.addModel.isRight = model.isRight;
this.addModel.rotationAngle = model.rotationAngle || 0;
this.addModel.oneWay = !!model.oneWay;
}
}
},
@ -88,7 +90,8 @@ export default {
rotationAngle: this.addModel.rotationAngle,
code: this.isUpdate ? this.addModel.code : getUID('Staircase', this.iscs.staircaseList),
_type: 'Staircase',
width: this.addModel.width
width: this.addModel.width,
oneWay: this.addModel.oneWay
};
this.$emit('createDataModel', staircaseModel);
this.initPage();
@ -107,7 +110,8 @@ export default {
isRight: this.addModel.isRight,
rotationAngle: this.addModel.rotationAngle,
_type: 'Staircase',
width: this.addModel.width
width: this.addModel.width,
oneWay: this.addModel.oneWay
};
this.$emit('deleteDataModel', staircaseModel);
this.initPage();
@ -122,7 +126,8 @@ export default {
x: 10,
y: 10,
isRight:false,
rotationAngle: 0
rotationAngle: 0,
oneWay: false
};
}
}

View File

@ -214,18 +214,18 @@
this.moveheight=159;
this.movex=153+"px";
}
if(this.moveheight>85&&this.moveheight<76){
this.movex=73+"px";
if(this.moveheight<82&&this.moveheight>73){
this.movex=75+"px";
this.move = 0;
}else if(this.moveheight<0&&this.moveheight>159){
}else{
if(this.moveheight>=85){
this.move = -(this.moveheight-85)/65;
if(this.moveheight>=82){
this.move = -(this.moveheight-82)/65;
}
if(this.moveheight<=75){
this.move = (75 - this.moveheight)/75;
if(this.moveheight<=73){
this.move = (73 - this.moveheight)/75;
}
this.movex=this.moveheight-7+"px";
if(this.moveheight>=145){

View File

@ -20,7 +20,7 @@
<!-- <Right-Pane ref="rightcontrol" /> -->
<TopRight-Pane ref="topcontrol" />
<TopRight-Pane ref="topcontrol" :group-num="groupnum" />
@ -118,9 +118,12 @@ import axios from 'axios';
// this.groupnum = selVal;
for(let i=0;i<this.trainlist.length;i++){
if(this.trainlist[i].groupNumber == this.groupnum){
// console.log(this.trainlist[i].gear);
// this.groupnum
this.$refs.centercontrol.centerstate(this.trainlist[i].gear);
}
}
this.nowdrive = this.groupnum;
}).catch(error => {
this.groupnum = oldgroupnum;
@ -152,6 +155,7 @@ import axios from 'axios';
option.disabled = false;
if(netdata.data[i].name){
option.label = netdata.data[i].name+"正在驾驶"+netdata.data[i].groupNumber;
this.groupNumber = netdata.data[i].groupNumber;
option.disabled = true;
}
if(netdata.data[i].driverId){

View File

@ -1,42 +1,42 @@
<template>
<div style="width:100%;height:48%;position:absolute;top:0px;">
<!-- ATB启动 -->
<div id="atb" class="panebutton" style="top:8%;left:3%;" @tap="atbclick">
<!-- <div id="atb" class="panebutton" style="top:8%;left:3%;" @click="atbclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.ATBStart') }}</div>
</div>
<!-- BM/CBTC -->
<div id="bmcbtc" class="panebutton" style="top:8%;left:17%;" @tap="bmcbtcclick">
<img class="buttonimg" :src="greenimg" />
<div id="bmcbtc" class="panebutton" style="top:8%;left:17%;" @click="bmcbtcclick">
<img class="buttonimg" :src="cbtcbuttonimg" />
<div class="buttontext">BM/CBTC</div>
</div>
</div> -->
<!-- RM -->
<div id="rm" class="panebutton" style="top:8%;left:31%;" @tap="rmclick">
<img class="buttonimg" :src="greenimg" />
<div id="rm" class="panebutton" style="top:8%;left:31%;" @click="rmclick">
<img class="buttonimg" :src="rmbuttonimg" />
<div class="buttontext">RM</div>
</div>
<!-- 关左门 -->
<div id="dlclose" class="panebutton" style="top:8%;left:45%;" @tap="dlcclick">
<div id="dlclose" class="panebutton" style="top:8%;left:45%;" @click="dlcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.closeLeftDoor') }}</div>
</div>
<!-- 开左门A -->
<div id="dlopen" class="panebutton" style="top:8%;left:59%;" @tap="dloclick">
<div id="dlopen" class="panebutton" style="top:8%;left:59%;" @click="dloclick">
<img class="buttonimg" :src="redimg" />
<div class="buttontext">{{ $t('jlmap3d.openLeftDoor') }}</div>
</div>
<!-- ATO启动A -->
<div id="atoa" class="panebutton" style="top:8%;left:73%;" @tap="atoaclick">
<img class="buttonimg" :src="apoimg" />
<div id="atoa" class="panebutton" style="top:8%;left:73%;" @click="atoaclick">
<img class="buttonimg" :src="atobuttonimg" />
<div class="buttontext">{{ $t('jlmap3d.ATOStart') }}</div>
</div>
<!-- cbtc -->
<div id="cbtc" class="panebutton" style="top:8%;left:87%;" @tap="cbtcclick">
<img class="buttonimg" :src="greenimg" />
<!-- <div id="cbtc" class="panebutton" style="top:8%;left:87%;" @click="cbtcclick">
<img class="buttonimg" :src="cbtcbuttonimg" />
<div class="buttontext">CBTC</div>
</div>
</div> -->
<!-- 电笛按钮 -->
<!-- <div id="elflute" class="panebutton" style="bottom:3%;left:84%;" @tap="elfluteclick">
<!-- <div id="elflute" class="panebutton" style="bottom:3%;left:84%;" @click="elfluteclick">
<img class="buttonimg" :src="grayimg" />
<div class="buttontext">{{ $t('jlmap3d.electricHornButton') }}</div>
</div> -->
@ -75,22 +75,22 @@
</div> -->
<!-- 受电弓升 -->
<!-- <div id="sg" class="panebutton" style="bottom:6%;left:3%;" @tap="sgclink">
<!-- <div id="sg" class="panebutton" style="bottom:6%;left:3%;" @click="sgclink">
<img class="buttonimg" :src="sgimg" />
<div class="buttontext">{{ $t('jlmap3d.electricGongSheng') }}</div>
</div> -->
<!-- 受电弓降 -->
<!-- <div id="jg" class="panebutton" style="bottom:6%;left:17%;" @tap="jgclick">
<!-- <div id="jg" class="panebutton" style="bottom:6%;left:17%;" @click="jgclick">
<img class="buttonimg" :src="jgimg" />
<div class="buttontext">{{ $t('jlmap3d.pantographFall') }}</div>
</div> -->
<!-- 试灯按钮 -->
<!-- <div id="sl" class="panebutton" style="bottom:6%;left:40%;" @tap="slclick">
<!-- <div id="sl" class="panebutton" style="bottom:6%;left:40%;" @click="slclick">
<img class="buttonimg" :src="slimg" />
<div class="buttontext">{{ $t('jlmap3d.lampButton') }}</div>
</div> -->
<!-- ATP切除 -->
<div id="atp" class="panebutton" style="bottom:6%;left:31%;" @tap="atpclick">
<div id="atp" class="panebutton" style="bottom:6%;left:31%;" @click="atpclick">
<img class="buttonimg" :src="atpimg" />
<div class="buttontext">{{ $t('jlmap3d.removalATP') }}</div>
</div>
@ -103,11 +103,11 @@
<div class="tfbutton" style="top:25px;left:50px;">{{ $t('jlmap3d.remission') }}</div>
<div class="buttontext2">{{ $t('jlmap3d.parkingBrakeMode') }}</div>
</div> -->
<div id="dropen" class="panebutton" style="bottom:6%;left:45%;" @tap="droclick">
<div id="dropen" class="panebutton" style="bottom:6%;left:45%;" @click="droclick">
<img class="buttonimg" :src="redlimg" />
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
</div>
<div id="drclose" class="panebutton" style="bottom:6%;left:59%;" @tap="drcclick">
<div id="drclose" class="panebutton" style="bottom:6%;left:59%;" @click="drcclick">
<img class="buttonimg" :src="greenimg" />
<div class="buttontext">{{ $t('jlmap3d.closeRightDoor') }}</div>
</div>
@ -132,6 +132,7 @@
<script>
import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js';
import { trainSimulationDriveMode, trainSimulationAto ,trainSimulationAtp } from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
export default {
name: 'TopRightPane',
@ -169,24 +170,29 @@
sivtf:"rotate(0deg)",
driverlighttf:"rotate(0deg)",
headlighttf:"rotate(0deg)",
atobuttonimg:"/static/jl3d/control/green.png",
rmbuttonimg:"/static/jl3d/control/green.png",
cbtcbuttonimg:"/static/jl3d/control/green.png",
}
},
watch: {
},
props: {
groupNum: {
type: String,
default: null
},
},
computed: {
group() {
return this.$store.state.app.group;
return this.$route.query.group;
},
code() {
return this.$store.state.app.code;
},
traincode() {
return this.$store.state.app.driverTrain;
}
},
mounted() {
window.updatabuttonlight = this.updatabuttonlight;
},
beforeDestroy() {
@ -329,16 +335,23 @@
},
atpclick: function (e){
//console.log("atp");
trainSimulationAtp(this.group,this.groupNum).then(netdata => {
console.log(netdata);
});
},
atbclick: function (e){
},
bmcbtcclick: function (e){
trainSimulationDriveMode(this.group,this.groupNum,"CM").then(netdata => {
console.log(netdata);
});
},
rmclick: function (e){
trainSimulationDriveMode(this.group,this.groupNum,"RM").then(netdata => {
console.log(netdata);
});
},
dlcclick: function (e){
@ -347,7 +360,9 @@
},
atoaclick: function (e){
trainSimulationAto(this.group,this.groupNum).then(netdata => {
console.log(netdata);
});
},
cbtcclick: function (e){
@ -358,6 +373,27 @@
drcclick: function (e){
},
updatabuttonlight: function (data){
// console.log(data);
if(data.runLevel == "CBTC"){
this.cbtcbuttonimg = this.greenlimg;
}else{
this.cbtcbuttonimg = this.greenimg;
}
if(data.driveMode == "RM"){
this.rmbuttonimg = this.greenlimg;
}else{
this.rmbuttonimg = this.greenimg;
}
if(data.atoOn){
this.atobuttonimg = this.greenlimg;
}else{
this.atobuttonimg = this.greenimg;
}
}
},
}
</script>

View File

@ -265,6 +265,7 @@ export default {
updatestatus(newdata){
this.trainnum = newdata.groupNumber;
this.$refs.mmiui.updatetrainstatus(newdata);
updatabuttonlight(newdata);
},
warningmsg(nowmsg){
this.controlmsg = nowmsg;

View File

@ -202,6 +202,7 @@ export default {
},
updatetrainstatus(newdata){
//
// console.log(newdata);
this.updatespeed(newdata.v);
this.updateatpspeed(newdata.pv);
@ -215,6 +216,8 @@ export default {
this.updatedrivemode(newdata.driveMode);
this.updatestation(newdata.endStation,newdata.nextStation);
this.updateatoatp(newdata.atoOn,newdata.atpOn);
},
updatemmistate(aaa){
@ -239,7 +242,7 @@ export default {
}
},
updatedrivedata(drivedata){
console.log(drivedata);
// console.log(drivedata);
if(drivedata == "breaker"){
}
@ -308,34 +311,68 @@ export default {
}
},
updatarunlevel(drivedata){
if(drivedata == "cbtc"){
if(this.m2state == "start"){
this.m2state = 'il';
this.m2image = this.images.m2[this.m2state];
}else if(this.m2state == "il"){
this.m2state = 'itc';
this.m2image = this.images.m2[this.m2state];
}else if(this.m2state == "itc"){
this.m2state = 'cbtc';
this.m2image = this.images.m2[this.m2state];
}else if(this.m2state == "cbtc"){
this.m2state = 'start';
this.m2image = this.images.m2[this.m2state];
}
if(drivedata == "CBTC"){
this.m2state = 'cbtc';
this.m2image = this.images.m2[this.m2state];
// if(this.m2state == "start"){
// this.m2state = 'il';
// this.m2image = this.images.m2[this.m2state];
// }else if(this.m2state == "il"){
// this.m2state = 'itc';
// this.m2image = this.images.m2[this.m2state];
// }else if(this.m2state == "itc"){
// }else if(this.m2state == "cbtc"){
// this.m2state = 'start';
// this.m2image = this.images.m2[this.m2state];
// }
}else if(drivedata == "IL"){
this.m2state = 'il';
this.m2image = this.images.m2[this.m2state];
}else{
this.m2state = 'start';
this.m2image = this.images.m2[this.m2state];
}
},
updatedrivemode(drivedata){
if(drivedata == "AA"){
this.m7state = 'aoac';
this.m7image = this.images.m7[this.m7state];
if(drivedata == "CM"){
this.m1state = 'cm';
this.m1image = this.images.m1[this.m1state];
}else if(drivedata == "RM"){
this.m1state = 'rm';
this.m1image = this.images.m1[this.m1state];
}else if(drivedata == "AM"){
this.m1state = 'am';
this.m1image = this.images.m1[this.m1state];
}else{
this.m1state = 'start';
this.m1image = this.images.m1[this.m1state];
}
if(drivedata == "AM"){
this.m7state = 'aomc';
this.m7image = this.images.m7[this.m7state];
// if(this.m1state == "start"){
// this.m1state = 'rm';
// this.m1image = this.images.m1[this.m1state];
// }else if(this.m1state == "rm"){
// this.m1state = 'am';
// this.m1image = this.images.m1[this.m1state];
// }else if(this.m1state == "am"){
// this.m1state = 'cm';
// this.m1image = this.images.m1[this.m1state];
// }else if(this.m1state == "cm"){
// this.m1state = 'start';
// this.m1image = this.images.m1[this.m1state];
// }
},
updateatoatp(atoon,atpon){
if(!atoon){
this.m9state = "ato";
this.m9image = this.images.m9["ato"];
}
if(drivedata == "MM"){
this.m7state = 'momc';
this.m7image = this.images.m7[this.m7state];
if(!atpon){
this.m9state = "atp";
this.m9image = this.images.m9["atp"];
}
},
updatelen(len) {

View File

@ -85,7 +85,7 @@ export default {
}
},
updatestationlist(list){
console.log(list);
// console.log(list);
this.value = list[0].name
this.stationlist = list;
},

View File

@ -10,39 +10,17 @@
</div>
</template>
<script>
import { getExamLessonDetail } from '@/api/management/exam';
import { generateExamList } from '@/api/management/userexam';
import { mapGetters } from 'vuex';
import LangStorage from '@/utils/lang';
import { getPublishMapInfo } from '@/api/jmap/map';
import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {getRaceUserById} from '@/api/competition';
import { participantCreatTrainingRoom, getPracticalQuestion, getTheoryQuestion } from '@/api/competition';
// import applyImg from '@/assets/apply.png';
import {getRaceById } from '@/api/competition';
export default {
name: 'ExamDetailView',
data() {
return {
disabled: false,
// applyImg: applyImg,
examDetails: {
lessonId: '',
name: '',
remarks: '',
examDefinitionRulesVOList: [],
startTime: '',
endTime: '',
fullPoint: '',
passingPoint: '',
duration: 0,
type: ''
},
typeList: [],
examList: [],
trainingOperateTypeMap: {},
drawWay: false,
resultFlag: false,
lineCode: '' // 线
};
@ -56,106 +34,14 @@ export default {
}
},
watch: {
'$route.params.examId': function (val) {
this.loadInitPage(val);
},
$route() {
this.getUserStatus();
}
},
async mounted() {
// this.loadInitPage(this.$route.params.examId);
this.getUserStatus();
},
methods: {
async getList() {
this.typeList = [];
for (const val in ConstConfig.ConstSelect.trainingDeviceType) {
this.typeList.push({name: LangStorage.getLang() == 'en' ? ConstConfig.ConstSelect.trainingDeviceType[val].enlabel : ConstConfig.ConstSelect.trainingDeviceType[val].label, code: val});
}
this.trainingOperateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: []
};
let ele;
for ( ele in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][ele]);
}
for ( ele in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][ele]);
}
for ( ele in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][ele]);
}
for ( ele in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][ele]);
}
for ( ele in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][ele]);
}
for ( ele in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][ele]);
}
for ( ele in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][ele]);
}
},
async loadInitPage(examId) {
if (examId) {
try {
const response = await getPublishMapInfo(this.$route.query.mapId);
if (response.data) {
this.drawWay = response.data.drawWay;
this.lineCode = response.data.lineCode;
this.typeList = [];
await this.getList();
}
} catch (e) {
this.$message.error(this.$t('error.getMapDataFailed'));
}
const res = await getExamLessonDetail(examId);
this.examDetails = res.data;
this.examDetails.examDefinitionRulesVOList.forEach((res, index) => {
res.chapterIdLong = Number(res.num) * Number(res.point);
this.typeList.forEach(v => {
if (res.trainingType == v.code) {
this.examDetails.examDefinitionRulesVOList[index].name = v.name;
if (res.operateType) {
this.trainingOperateTypeMap[res.trainingType].forEach(item => {
if ((item.code || item.value) === res.operateType) {
this.examDetails.examDefinitionRulesVOList[index].name = `${this.examDetails.examDefinitionRulesVOList[index].name}-${item.name || item.label}`;
return;
}
});
}
}
});
});
}
},
async examDetail() {
const data = this.examDetails;
try {
const response = await generateExamList(data.id);
this.examList = response.data.userExamQuestionsVOs;
this.userExam = response.data;
const list = response.data.userExamQuestionsVOs;
await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime);
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
await this.$store.dispatch('trainingList/setTrainingList', list);
} catch (error) {
if (error.code === 500004) {
this.$messageBox(this.$t('tip.notWithinTheScopeOfTheExamination'));
} else {
this.$messageBox(`${error.message}`);
}
}
},
async getUserStatus() {
this.resultFlag = false;
const res = await getRaceUserById(this.$route.query.raceId);
@ -163,7 +49,8 @@ export default {
// this.$router.replace({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}` });
} else if (this.$route.query.type == 'operation' && (res.data.status == 4 || res.data.status == 6)) {
this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
// this.resultFlag = true;
this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
} else {
this.resultFlag = true;
}
@ -181,11 +68,15 @@ export default {
this.$messageBox('试卷还没被加载');
});
} else {
const mapIdData = await getRaceById(this.$route.query.raceId);
const lineCodeData = await getPublishMapInfo(mapIdData.data.mapId);
getPracticalQuestion(this.$route.query.raceId).then((responese)=>{
if (responese.data) {
participantCreatTrainingRoom(this.$route.query.raceId, {mapId: 41, prdType: '03'}).then(resp => {
const query = { lineCode: '11', mapId: '41', group: resp.data, raceId: this.$route.query.raceId};
participantCreatTrainingRoom(this.$route.query.raceId, {mapId: mapIdData.data.mapId, prdType: '03'}).then(resp => {
const query = { lineCode: lineCodeData.data.lineCode, mapId: mapIdData.data.mapId, group: resp.data, raceId: this.$route.query.raceId};
this.$router.replace({ path: `/jointTrainingNew`, query: query});
}).catch(() => {
this.$message.error('进入实操竞赛房间失败!');
});
} else {
this.$messageBox('试卷还没被加载');

View File

@ -4,6 +4,7 @@
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div>
<div class="context">
<div>{{ `得分:${operateScore}` }}</div>
<!-- <el-form ref="form" :model="resultModel" size="mini">
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
@ -12,25 +13,25 @@
<span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span>
</el-form-item>
</el-form> -->
<el-table :data="tableData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary :span-method="objectSpanMethod">
<el-table-column prop="title" label="题目">
<template slot-scope="scope">
<div v-html="scope.row.title" />
</template>
</el-table-column>>
<el-table-column prop="score" label="分值" />
<el-table-column prop="goal" label="得分" />
<el-table-column v-if="this.$route.query.type ==='theory'" prop="correctAnswer" label="答题结果" />
<el-table-column v-if="this.$route.query.type ==='theory'" prop="explain" label="说明" />
<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointIndex" label="得分点">
<template slot-scope="scope">
<span>{{ '得分点'+scope.row.scoringPointIndex }}</span>
</template>
</el-table-column>
<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointScore" label="得分点分值" />
<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointGoal" label="得分点得分" />
<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />
</el-table>
<!--<el-table :data="tableData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary :span-method="objectSpanMethod">-->
<!--<el-table-column prop="title" label="题目">-->
<!--<template slot-scope="scope">-->
<!--<div v-html="scope.row.title" />-->
<!--</template>-->
<!--</el-table-column>>-->
<!--<el-table-column prop="score" label="分值" />-->
<!--<el-table-column prop="goal" label="得分" />-->
<!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="correctAnswer" label="答题结果" />-->
<!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="explain" label="说明" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointIndex" label="得分点">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ '得分点'+scope.row.scoringPointIndex }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointScore" label="得分点分值" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointGoal" label="得分点得分" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />-->
<!--</el-table>-->
</div>
<div class="draf_box">
<el-button type="primary " @click="back">返回首页</el-button>
@ -40,7 +41,7 @@
<script>
// import { submitExam } from '@/api/management/userexam';
// import { UrlConfig } from '@/scripts/ConstDic';
import { getCompetitionDetail } from '@/api/competition';
import { getCompetitionDetail, getPracticalCompetitionResult } from '@/api/competition';
export default {
name: 'ExamResult',
@ -69,7 +70,8 @@ export default {
{ title: '4', score: '25', goal: '0', scoringPoints: [{score: '10', goal: '0', explain: '这是说明原因1'}, {score: '10', goal: '0', explain: '这是说明原因2'}, {score: '5', goal: '0', explain: '这是说明原因3'}] }
],
loading: true,
tableData: []
tableData: [],
operateScore: 0
};
},
computed: {
@ -112,7 +114,6 @@ export default {
this.loading = false;
if (this.$route.query.type == 'theory') {
getCompetitionDetail(this.$route.query.raceId).then(res => {
console.log(res);
this.tableData = [];
res.data.forEach(item => {
this.tableData.push({
@ -126,15 +127,18 @@ export default {
});
} else if (this.$route.query.type == 'operate') {
this.tableData = [];
this.operateData.forEach(item => {
if (item.scoringPoints && item.scoringPoints.length) {
item.scoringPoints.forEach((elem, index) => {
this.tableData.push({
title: item.title, score: index ? 0 : item.score, goal: index ? 0 : item.goal, scoringPointLength: item.scoringPoints.length, scoringPointIndex: index + 1, scoringPointScore: elem.score, scoringPointGoal: elem.goal, scoringPointExplain: elem.explain
});
});
}
getPracticalCompetitionResult(this.$route.query.raceId).then(res => {
this.operateScore = res.data;
});
// this.operateData.forEach(item => {
// if (item.scoringPoints && item.scoringPoints.length) {
// item.scoringPoints.forEach((elem, index) => {
// this.tableData.push({
// title: item.title, score: index ? 0 : item.score, goal: index ? 0 : item.goal, scoringPointLength: item.scoringPoints.length, scoringPointIndex: index + 1, scoringPointScore: elem.score, scoringPointGoal: elem.goal, scoringPointExplain: elem.explain
// });
// });
// }
// });
}
},
back() {

View File

@ -1,10 +1,10 @@
<template>
<!-- v-quickMenuDrag -->
<div class="chatBox">
<div class="chatBox" :style="{'bottom':bottom+'px'}">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
<div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<chat-coversition-list ref="chatCoversitionList" :user-role="userRole" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
@ -30,7 +30,8 @@
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div>
<el-button v-if="isButtonShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitCoversition()">退出群聊</el-button>
<el-button v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
</div>
@ -54,7 +55,7 @@ import ChatCreateGroup from './chatCreateGroup';
import ChatMemberList from './chatMemberList';
import ChatCoversitionList from './chatCoversitionList';
import RecordRTC from 'recordrtc';
import {uploadAudioFileNew} from '@/api/chat';
import {uploadAudioFileNew, quitCoversition} from '@/api/chat';
export default {
name: 'ChatBox',
components:{
@ -77,10 +78,13 @@ export default {
data() {
return {
minimize:true,
bottom:15,
recordSending:false,
currentCoversition:{},
seconds:0,
inter:null,
isHasCoversition:false,
quitLoading:false,
recorders: null,
microphone:null,
scriptTip:'',
@ -93,7 +97,10 @@ export default {
},
computed:{
isShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE';
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
},
isButtonShow() {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
}
},
watch: {
@ -114,6 +121,13 @@ export default {
},
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
},
'$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
}
},
@ -136,21 +150,39 @@ export default {
setSetting(data) {
this.form = data;
},
hideAddCoversition() {
this.isHasCoversition = true;
},
setCurrentCoversition(coversition) {
this.currentCoversition = coversition;
if (coversition.all) {
if (coversition && coversition.id) {
this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
this.headerTitle = '';
}
if (this.recordSending) {
this.cancleRecording();
}
this.$refs.chatContent.scrollTop();
},
quitCoversition() {
this.quitLoading = true;
quitCoversition(this.group, this.currentCoversition.id).then(res=>{
this.quitLoading = false;
this.currentCoversition = {all:undefined, id:null};
this.$refs.chatCoversitionList.initPage(true);
this.isHasCoversition = false;
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
this.quitLoading = false;
});
},
setHeadTitle(headerTitle) {
this.headerTitle = headerTitle;
},
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
this.isHasCoversition = true;
this.currentCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle;
},
@ -273,13 +305,22 @@ export default {
};
</script>
<style lang="scss" scoped>
.chat-box-footer-quit{
font-size: 12px;
padding: 5px 15px;
color: #fff;
float: left;
margin-left: 10px;
margin-bottom: 10px;
cursor: pointer;
}
.chatBox{
width: 503px;
// height: 400px;
position: absolute;
padding-left:5px;
left: 0;
bottom:28px;
bottom:15px;
z-index:22;
}
.chat-box{
@ -339,17 +380,13 @@ export default {
height: 30px;
}
.chat-box-footer-send{
background: #36a2fd;
width: 65px;
font-size: 12px;
padding: 5px 0px 4px 0px;
text-align: center;
border-radius: 3px;
color: #fff;
float: right;
margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
padding: 5px 15px;
}
.minimality {
float: right;
@ -377,6 +414,10 @@ export default {
.coversition-list{
}
.chat-box-footer-send.disbled{
cursor: no-drop;
}
.scriptTip{
position: absolute;
width: 260px;

View File

@ -70,20 +70,22 @@ export default {
},
methods:{
inintData() {
getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
const userId = this.$store.state.user.id;
const coversitionList = res.data.map(coversition=>{
coversition.self = false;
if (coversition.member.userId == userId) {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : '';
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
if (this.coversition.id) {
getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
const userId = this.$store.state.user.id;
const coversitionList = res.data.map(coversition=>{
coversition.self = false;
if (coversition.member.userId == userId) {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/audio/${coversition.audioPath}` : '';
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
this.scrollTop();
});
this.chatContentList = coversitionList;
this.scrollTop();
});
}
// const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList);
// const coversitionList = coversitionListAll[this.coversition.id] || [];
// // console.log('inintData---coversitionList' + JSON.stringify(this.$store.state.socket.coversitionList[this.coversition.id]));

View File

@ -7,45 +7,63 @@
:key="coversition.id"
:class="coversition.id==currentCoversition.id?'coversition-active each-coversition':'each-coversition'"
@click="changeCoversition(coversition)"
>{{ coversition.coverName }}</div>
>{{ coversition.name }}</div>
</div>
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import {getSimulationConversationListNew} from '@/api/chat';
export default {
name:'ChatCoversitionList',
props: {
userRole: {
type: String,
required: true
}
},
data() {
return {
coversitionList:[],
currentCoversition:{}
};
},
watch:{
'userRole':function(val) {
this.initPage(true);
}
},
mounted() {
this.initPage(true);
},
methods:{
initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
data.map(coversition=>{
if (coversition.name) {
coversition.coverName = coversition.name;
coversition.isOnline = true;
} else {
const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline;
if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
this.coversitionList = data;
} else {
this.coversitionList = data.filter(coversition=>{ return coversition.all == false; });
if (this.coversitionList.length >= 1) {
this.$emit('hideAddCoversition');
}
return coversition;
});
this.coversitionList = data;
}
if (resp.data && resp.data.length && resp.data.length > 0 && status) {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
} else {
if (this.coversitionList.length >= 1) {
this.currentCoversition = data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
} else {
this.currentCoversition = null;
this.$emit('setCurrentCoversition', this.currentCoversition);
}
}
} else if (resp.data && resp.data.length && resp.data.length > 0 && !status) {
const coversition = data.filter(coversition=>{ return coversition.all == false; });
this.currentCoversition = coversition[0];
this.$emit('setCurrentCoversition', coversition[0]);
}
}
});
@ -53,82 +71,22 @@ export default {
addCoversition(data, headerTitle) {
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
if (index < 0) {
const objectCover = this.handleMemberName(data);
if (data.name) {
data.coverName = data.name;
data.isOnline = true;
} else {
data.coverName = objectCover.coversitionName;
data.isOnline = objectCover.isOnline;
}
this.coversitionList.push(data);
if (headerTitle) {
this.currentCoversition = data;
}
this.currentCoversition = data;
}
},
changeCoversition(coversition) {
this.$emit('setHeadTitle', coversition.coverName);
this.$emit('setHeadTitle', coversition.name);
this.currentCoversition = {id:coversition.id, all:coversition.all};
this.$emit('setCurrentCoversition', coversition);
// this.$refs.chatContent.reloadData(this.currentCoversition);
},
changeCoversitionOther(coversition) {
const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline;
const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
if (index < 0) {
this.coversitionList.push(coversition);
}
this.changeCoversition(coversition);
},
handleMemberName(conversition) {
if (conversition.all) {
return {coversitionName:conversition.name, isOnline:true};
} else {
let coversitionName = '';
let isOnline = true;
if (conversition.memberList) {
conversition.memberList.forEach(member=>{
if (member.userId != this.$store.state.user.id) {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
let data = member.role;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.enLabel);
} else {
data = data.replace(rolename, element.label);
}
});
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
isOnline = member.online;
coversitionName = data + deviceName + memberName;
}
});
} else if (conversition.member) {
const member = conversition.member;
let data = member.role;
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.enLabel);
} else {
data = data.replace(rolename, element.label);
}
});
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
isOnline = member.online;
coversitionName = data + deviceName + memberName;
} else {
coversitionName = conversition.name;
}
return {coversitionName:coversitionName, isOnline:isOnline};
}
}
}
};

View File

@ -51,26 +51,29 @@ export default {
},
methods:{
getSimulationMembers() {
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
this.memberList = [];
if (this.currentCoversition.id) {
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData.map(member=>{
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
member.memberName = member.role + deviceName + memberName;
return member;
});
this.memberList = lastData;
});
lastData = JSON.parse(lastData);
lastData.map(member=>{
const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
member.memberName = member.role + deviceName + memberName;
return member;
});
this.memberList = lastData;
});
}
},
getMember(memberId) {
return this.memberList.filter(member=>{

View File

@ -89,25 +89,25 @@ export default {
const day = date.getDay();
switch (day) {
case 0:
this.dayString = '星 期 ';
this.dayString = '星 期 ';
break;
case 1:
this.dayString = '星 期 ';
this.dayString = '星 期 ';
break;
case 2:
this.dayString = '星 期 ';
this.dayString = '星 期 ';
break;
case 3:
this.dayString = '星 期 ';
this.dayString = '星 期 ';
break;
case 4:
this.dayString = '星 期 ';
this.dayString = '星 期 ';
break;
case 5:
this.dayString = '星 期 ';
this.dayString = '星 期 ';
break;
case 6:
this.dayString = '星 期 ';
this.dayString = '星 期 ';
}
}
}

View File

@ -1,10 +1,10 @@
<template>
<!-- v-quickMenuDrag -->
<div class="chatBox">
<div class="chatBox" :style="{'bottom':bottom+'px'}">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" />
<div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" :group="group" :user-role="userRole" @showAddCoverition="showAddCoverition" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<chat-coversition-list ref="chatCoversitionList" :user-role="userRole" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
@ -30,7 +30,8 @@
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<div v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" @click="startRecording()">发送语音</div>
<el-button v-if="isButtonShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitCoversition()">退出群聊</el-button>
<el-button v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
</div>
</div>
</div>
@ -54,7 +55,7 @@ import ChatCoversitionList from './chatCoversitionList';
import ChatCreateGroup from './chatCreateGroup';
import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc';
import {uploadAudioFileNew} from '@/api/chat';
import {uploadAudioFileNew, quitCoversition} from '@/api/chat';
export default {
name: 'ChatBox',
components:{
@ -78,6 +79,7 @@ export default {
data() {
return {
minimize:false,
bottom:15,
recordSending:false,
currentCoversition:{},
seconds:0,
@ -85,6 +87,7 @@ export default {
recorders: null,
microphone:null,
isHasCoversition:false,
quitLoading:false,
form:{
language:'zh',
sex:'1'
@ -100,6 +103,15 @@ export default {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
}
},
watch:{
'$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
}
},
mounted() {
this.initPage();
},
@ -121,7 +133,7 @@ export default {
this.$refs.chatCoversitionList.initPage(false);
},
setCurrentCoversition(coversition) {
if (coversition) {
if (coversition.id) {
this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
@ -138,8 +150,17 @@ export default {
hideAddCoversition() {
this.isHasCoversition = true;
},
showAddCoverition() {
this.isHasCoversition = false;
quitCoversition() {
this.quitLoading = true;
quitCoversition(this.group, this.currentCoversition.id).then(res=>{
this.currentCoversition = {all:undefined, id:null};
this.$refs.chatCoversitionList.initPage(true);
this.isHasCoversition = false;
this.quitLoading = false;
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
this.quitLoading = false;
});
},
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data);
@ -360,7 +381,19 @@ export default {
.coversition-list{
}
.chat-box-footer-quit{
background: red;
width: 65px;
font-size: 12px;
padding: 5px 0px 4px 0px;
text-align: center;
border-radius: 3px;
color: #fff;
float: left;
margin-left: 10px;
margin-bottom: 10px;
cursor: pointer;
}
.showMembers{
float: right;
line-height: 40px;
@ -432,6 +465,9 @@ export default {
background: #eeeeee;
cursor: pointer;
}
.chat-box-footer-send.disbled{
cursor: no-drop;
}
.minimize-box {
width: 97.5%;

View File

@ -94,7 +94,7 @@ export default {
},
methods:{
inintData() {
if (this.coversition) {
if (this.coversition.id) {
getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
const userId = this.$store.state.user.id;
const coversitionList = res.data.map(coversition=>{

View File

@ -15,14 +15,10 @@
</div>
</template>
<script>
import {getSimulationConversationListNew, quitCoversition} from '@/api/chat';
import {getSimulationConversationListNew} from '@/api/chat';
export default {
name:'ChatCoversitionList',
props: {
group: {
type: String,
required: true
},
userRole: {
type: String,
required: true
@ -95,14 +91,6 @@ export default {
this.coversitionList.push(coversition);
}
this.changeCoversition(coversition);
},
closeCoversition(coversitionId) {
quitCoversition(this.group, coversitionId).then(res=>{
this.initPage(true);
this.$emit('showAddCoverition');
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
});
}
}
};

View File

@ -59,7 +59,7 @@ export default {
methods:{
getSimulationMembers() {
this.memberList = [];
if (this.currentCoversition) {
if (this.currentCoversition.id) {
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
let lastData = JSON.stringify(resp.data);
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;

View File

@ -34,7 +34,7 @@ import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice';
import { participantCompleteCompetition, refereeExitSimulation, quitCurrentRace } from '@/api/competition';
import { participantCompleteCompetition, refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
import { prefixIntrger } from '@/utils/date';
export default {
@ -314,11 +314,11 @@ export default {
return `${hh}:${mm}:${ss}`;
},
startCompetition() {
const date = new Date(this.$store.state.training.initTime || null);
const model = {
initTime: this.formatTime(date)
};
this.start(model);
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
this.jsStart = false;
}).catch(()=> {
this.$message.error('开始竞赛失败');
});
},
endCompetition() {
this.$confirm('此操作将结束并提交本次竞赛,是否继续', this.$t('global.tips'), {
@ -326,11 +326,11 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
participantCompleteCompetition(this.$route.query.raceId, this.group).then(resp => {
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
// this.$router.go(-1);
this.submit();
}).catch(()=> {
this.$message.success('提交试卷失败!');
this.$message.error('提交试卷失败!');
});
});
},

View File

@ -287,6 +287,9 @@ export default {
let startOffset = 0;
const sectionMap = {};
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
const sectionModel = deepAssign({}, section);
sectionModel.lengthFact = Number(sectionModel.logicSectionCodeList.reduce((pre, code) => pre + Number(this.$store.getters['map/getDeviceByCode'](code).lengthFact), 0).toFixed(3));
models.push(sectionModel);
section.logicSectionCodeList.forEach(sectionCode => {
const logicSection = this.$store.getters['map/getDeviceByCode'](sectionCode);
sectionMap[logicSection.points[0].x + 's' + logicSection.points[0].y] = logicSection;

View File

@ -193,8 +193,8 @@ export default {
{ prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
{ prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint, lastDisabled: true },
{ prop: 'logicSectionStartOffset', label: this.$t('map.logicalSectionStartOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true },
{ prop: 'logicSectionEndOffset', label: this.$t('map.logicalSectionEndOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true },
{ prop: 'logicSectionStartOffset', label: this.$t('map.logicalSectionStartOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true }, //
{ prop: 'logicSectionEndOffset', label: this.$t('map.logicalSectionEndOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true }, //
{ prop: 'standTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isLogicSectionNameSort }, //
{ prop: 'standTrackName', label: this.$t('map.standTrackName'), type: 'input', isHidden: !this.isstandTrackNameShow },
@ -568,7 +568,7 @@ export default {
}
const changeSectionList = this.handleOtherSectionChange(model);
const changeStandList = this.handleRelevanceStand(model);
models = [model, ...changeSectionList, ...changeStandList];
models = [...changeSectionList, ...changeStandList];
this.$emit('updateMapModel', models);
this.oldPoint = JSON.parse(JSON.stringify(model.points));
@ -593,7 +593,7 @@ export default {
return models;
},
handleOtherSectionChange(model) { //
const models = [];
let models = [model];
const pointModel = [];
const slope1 = (this.oldPoint[this.oldPoint.length - 1].y - this.oldPoint[0].y) / (this.oldPoint[this.oldPoint.length - 1].x - this.oldPoint[0].x);
this.sectionList.forEach(section => {
@ -634,7 +634,7 @@ export default {
return pre + Number(length);
}, 0);
lengthFact += model.lengthFact;
copySection.lengthFact = lengthFact.toFixed(3); //
copySection.lengthFact = Number(lengthFact.toFixed(3)); //
if (copySection.lengthFact > 5) {
copySection.leftStopPointOffset = copySection.leftStopPointOffset || 5;
copySection.rightStopPointOffset = copySection.rightStopPointOffset || copySection.lengthFact - 5;
@ -669,6 +669,50 @@ export default {
models.push(item);
});
if (!model.parentCode) {
const arr = this.setLogicOffset(model, models);
models = [...models, ...arr];
} else {
const sectionModel = this.$store.getters['map/getDeviceByCode'](model.parentCode);
const arr = this.setLogicOffset(sectionModel, models);
models = [...models, ...arr];
}
return models;
},
selectSectionCode(code, list) {
let model = list.find(ele => ele.code == code);
if (!model) {
model = this.$store.getters['map/getDeviceByCode'](code);
} else {
model.deepFlag = true;
}
return model;
},
setLogicOffset(section, list) { //
const models = [];
// logicSectionCodeList
let startPoint = section.points[0].x + 's' + section.points[0].y;
let startOffset = 0;
const sectionMap = {};
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(sectionCode => {
const logicSection = this.selectSectionCode(sectionCode, list);
sectionMap[logicSection.points[0].x + 's' + logicSection.points[0].y] = logicSection;
});
while (sectionMap[startPoint]) {
const model = sectionMap[startPoint].deepFlag ? sectionMap[startPoint] : deepAssign({}, sectionMap[startPoint]);
if (!model.lengthFact) {
const length = section.lengthFact / section.logicSectionCodeList.length;
model.lengthFact = length.toFixed(3);
}
model.logicSectionStartOffset = startOffset;
model.logicSectionEndOffset = (model.lengthFact * 1000 + startOffset * 1000) / 1000;
!sectionMap[startPoint].deepFlag && models.push(model);
startOffset = (startOffset * 1000 + model.lengthFact * 1000) / 1000;
startPoint = model.points[model.points.length - 1].x + 's' + model.points[model.points.length - 1].y;
}
}
return models;
},
getSectionByCode(code) {