Merge remote-tracking branch 'origin/test'

This commit is contained in:
program-walker 2020-05-15 14:37:45 +08:00
commit 5dede5c9df
64 changed files with 2225 additions and 857 deletions

View File

@ -49,7 +49,7 @@ export function chatWithText(data, group) {
});
}
// 文字聊天 发送文字
// 文字聊天 发送语音
export function chatWithAudio(file, group) {
return request({
url: `/api/jointTraining/chatWithAudio?group=${group}`,
@ -58,6 +58,15 @@ export function chatWithAudio(file, group) {
});
}
// 文字聊天 发送语音(新版)
export function chatWithAudioNew(file, group) {
return request({
url: `/api/v1/jointTraining/chatWithAudio?group=${group}`,
method: 'post',
data: file
});
}
// 生成分发二维码
export function getJoinTrainCode(data, group) {
return request({

View File

@ -142,7 +142,7 @@ export function loadDraftScript(scriptId, memberId, group) {
/** 剧本预览选择角色 */
export function loadDraftScriptNew(memberId, group) {
return request({
url: `/simulation/${group}/${memberId}`,
url: `/simulation/${group}/choosePlay?memberId=${memberId}`,
method: 'put'
});
}

View File

@ -10,6 +10,15 @@ export function getScriptPageListOnline(params) {
});
}
/** 分页查找上线的剧本(新版)*/
export function getScriptPageListOnlineNew(params) {
return request({
url: `/api/scirpt/v1/paging/online`,
method: 'get',
params: params
});
}
/** 通过ID查询发布的剧本的详细信息 */
export function getScriptById(id) {
return request({
@ -17,6 +26,15 @@ export function getScriptById(id) {
method: 'get'
});
}
/** 通过ID查询发布的剧本的详细信息(新版) */
export function getScriptByIdNew(id) {
return request({
url: `/api/scirpt/v1/${id}/detail`,
method: 'get'
});
}
/** 通过group查询未发布剧本的详细信息 */
export function getDraftScriptByGroup(group) {
return request({

View File

@ -285,6 +285,14 @@ export function selectScriptMembers(group, data) {
});
}
/** 剧本开始执行(新版) */
export function scriptExecuteNew(group) {
return request({
url: `/api/scriptExecute/${group}`,
method: 'put'
});
}
/** 选择剧本演出成员角色 (新版地图)*/
export function selectScriptMembersNew(group, data) {
return request({

View File

@ -597,7 +597,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 7, y: 19 }, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 20, // 列车车头矩形高度
trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000'// 列车车头矩形填充颜色
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
trainHeight: 20, // 列车高度

View File

@ -540,7 +540,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度
trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
trainHeight: 20, // 列车高度

View File

@ -717,7 +717,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度
trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
trainHeight: 20, // 列车高度

View File

@ -574,7 +574,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 18}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 18, // 列车车头矩形高度
trainConntWidth: 5, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
useSelfFormat: true,

View File

@ -413,7 +413,6 @@ class SkinCode extends defaultStyle {
block: false // 封锁显示
}
};
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};
@ -567,7 +566,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
trainHeight: 17, // 列车高度
@ -613,18 +613,18 @@ class SkinCode extends defaultStyle {
}
], // 运行方向状态类型对应车头显示状态 1从左往右 0从右往左
directionStopType: [
{
type: 1,
lineLShow: false,
lineRShow: true
},
{
type: 0,
lineLShow: true,
lineRShow: false
}
{
type: 1,
lineLShow: false,
lineRShow: true
},
{
type: 0,
lineLShow: true,
lineRShow: false
}
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
driveModeStatus: [
{
status: 'AM',

View File

@ -618,7 +618,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 15 }, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 0, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
hasTravelSigns: true, // 是否有行进标志

View File

@ -577,7 +577,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 4, y: 20}, // 列车车头三角坐标3偏移量
trainConntWidth: 2, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度
trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
trainHeight: 20, // 列车高度

View File

@ -81,7 +81,7 @@ class SkinCode extends defaultStyle {
textShadowColor: '#22DFDF',
nameShow: false,
lineDash: '',
lineWidthMore: 0
lineWidthMore: 5
},
line: {
width: 5, // 区段宽度
@ -594,7 +594,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
trainHeadFillColor: '#EF0C08', // 列车车头矩形填充颜色
directionStopType:'normal' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
trainHeight: 17, // 列车高度

View File

@ -88,7 +88,7 @@ class SkinCode extends defaultStyle {
beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#FFFFFF', // 区段侵入颜色
spareColor: '#AAA9A9', // 区段空闲颜色
communicationOccupiedColor: '#FF00FF', // 区段通信车占用颜色
communicationOccupiedColor: '#DE310C', // 区段通信车占用颜色
unCommunicationOccupiedColor: '#DE310C', // 区段非通讯车占用颜色
routeLockColor: '#52BD5F', // 区段进路锁定颜色
faultLockColor: '#006400', // 区段故障锁定颜色
@ -105,13 +105,13 @@ class SkinCode extends defaultStyle {
},
axle: {
show: true, // 计轴是否显示
radius: 5, // 计轴 半径
distance: 5, // 计轴和区段之间的距离 (未用)
radius: 3, // 计轴 半径
distance: 4, // 计轴和区段之间的距离 (未用)
color: '#9F9C9C', // 区段计轴颜色
occupyColor: '#FF0000', // 区段计轴占用颜色
resetColor: '#00FFFF', // 区段计轴预复位颜色
Failure: '#E6A23C', // #FFFF00 计轴失效
lineWidth: 3
lineWidth: 2
},
speedLimit: { // 限速元素
width: 1, // 限速线的宽度
@ -165,6 +165,7 @@ class SkinCode extends defaultStyle {
},
lamp: {
bgShow: false, // 是否被选中
logicColor: true, // cbtc通信是否影响灯颜色
guidName: 'singleRY', // 默认引导类型
borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度
@ -599,7 +600,7 @@ class SkinCode extends defaultStyle {
rectWidth: 20, // 折返模块宽度
lineWidth: 3, // 折返模块线宽
fillColor: 'rgba(0,0,0,0)', // 填充色
strokeColor: '#FFFFFF' // 线颜色
strokeColor: '#9F9C9C' // 线颜色
};
this[deviceType.ModeStatusGroup] = { // 车站状态模式
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示
@ -679,16 +680,18 @@ class SkinCode extends defaultStyle {
textAContent: '警' // textA文本
},
trainNumber: {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'DDD', // 默认目的地码
targetCodePrefix: '00', // 目的地码前缀
defaultTargetCode: 'DD', // 默认目的地码
trainTargetTextAlign: 'left', // 目的地码文字显示位置
trainNumberOffset: { x: 24, y: 4}// 目的地码偏移量
trainNumberOffset: { x: 24, y: 4}, // 目的地码偏移量
fontColor: '#000000'
},
trainServer: {
serviceNumberPrefix: '000', // 服务号(表号)前缀
defaultServiceNumber: 'TTT', // 默认服务号(表号)
defaultServerNoColor: '#FFFFFF', // 默认服务号状态显示颜色
trainServerOffset: { x: 4, y: 4} // 列车服务号偏移
trainServerOffset: { x: 4, y: 4}, // 列车服务号偏移
fontColor: '#000000'
},
trainTarget: {
tripNumberPrefix: '000', // 车次号前缀
@ -708,7 +711,8 @@ class SkinCode extends defaultStyle {
trainHeadTriangleThird: { x: -1, y: 21}, // 列车车头三角坐标3偏移量
trainConntWidth: 0, // 列车竖杠的宽度
trainHeadFillColor: '#2AA32A', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度
trainHeadRectHeight: 20, // 列车车头矩形高度
directionStopType:'special' // special 西安二号线 停车 列车方向图标不消失 normal 正常
},
common: {
trainHeight: 20, // 列车高度

View File

@ -124,7 +124,6 @@ deviceState[deviceType.StationStand] = {
assignSkip: 0, // 是否指定跳停
runLevelTime: 0, // 区间运行时间 自动为 0
parkingTime: 0, // 站台停车时间 自动为0
doorOpen:0, // 车门开启 自动为0 (西安二号线样式 暂时后端没加该字段)
// /** 折返策略*/
// reentryStrategy: {

View File

@ -24,8 +24,7 @@ class Status {
assignSkip: device.assignSkip, // 是否指定跳停
runLevelTime: device.runLevelTime, // 区间运行时间 自动为 0
parkingTime: device.parkingTime, // 站台停车时间 自动为0
fault: device.fault, /** 非故障*/
doorOpen:device.doorOpen /** 车门开启 自动为0 (西安二号线样式 暂时后端没加该字段)*/
fault: device.fault /** 非故障*/
};
}
handleSection(device) {

View File

@ -93,9 +93,8 @@ class EMouse extends Group {
this.lineBorder.hide();
} else {
const model = this.device.model;
const arr = JSON.parse(JSON.stringify(model.points));
arr.reverse();
const points = [];
let points = [];
const pointsReverse = [];
model.points.forEach((ele, index) => {
let flag = false;
if (index == model.points.length - 1) {
@ -103,11 +102,9 @@ class EMouse extends Group {
} else {
this.triangle = new JTriangle(ele, model.points[index + 1]);
}
const directx = this.triangle.drictx;
const directy = this.triangle.dricty;
const switchWidth = 5; // 超出宽度多少
if (index > 0) {
if (model.points[index - 1].y == ele.y) {
if (model.points[index - 1].y == ele.y || index < model.points.length - 1 && model.points[index + 1].y == ele.y) {
flag = true;
}
} else {
@ -116,40 +113,22 @@ class EMouse extends Group {
}
}
if (flag) {
const switchWidth = this.device.style.Section.mouseOverStyle.lineWidthMore; // 超出宽度多少
const param = [ele.x, ele.y + switchWidth];
points.push(param);
const param1 = [ele.x, ele.y - switchWidth];
pointsReverse.unshift(param1);
} else {
const param = [ele.x - directx * this.triangle.getAbsSin(switchWidth), ele.y + directy * this.triangle.getAbsCos(switchWidth)];
const switchWidth = this.device.style.Section.mouseOverStyle.lineWidthMore + 3;
const T = this.triangle.getAbsCos(switchWidth);
const param = [ele.x - directy * this.triangle.getAbsSin(T), ele.y + this.triangle.getAbsCos(T)];
points.push(param);
const param1 = [ele.x + directy * this.triangle.getAbsSin(T), ele.y - this.triangle.getAbsCos(T)];
pointsReverse.unshift(param1);
}
});
model.points.forEach((ele, index) => {
let flag = false;
if (index == model.points.length - 1) {
this.triangle = new JTriangle(model.points[index - 1], ele);
} else {
this.triangle = new JTriangle(ele, model.points[index + 1]);
}
const directx = this.triangle.drictx;
const directy = this.triangle.dricty;
const switchWidth = 5; // 超出宽度多少
if (index > 0) {
if (model.points[index - 1].y == ele.y) {
flag = true;
}
} else {
if (model.points[index + 1].y == ele.y) {
flag = true;
}
}
if (flag) {
const param = [ele.x, ele.y - switchWidth];
points.unshift(param);
} else {
const param = [ele.x + directx * this.triangle.getAbsSin(switchWidth), ele.y - directy * this.triangle.getAbsCos(switchWidth)];
points.unshift(param);
}
});
points = points.concat(pointsReverse);
this.lineBorder = new Polygon({
zlevel: this.device.zlevel,
z: this.device.z + 10,

View File

@ -48,6 +48,11 @@ export default class Section extends Group {
const traingleStart = new JTriangle(this.model.points[0], this.model.points[1]);
const traingleEnd = new JTriangle(this.model.points[length - 2], this.model.points[length - 1]);
if (this.model.leftAxlePosition) {
const leftPoint = {x:this.model.points[0].x, y: this.model.points[0].y};
if (this.model.leftAxleOffset) {
leftPoint.x = leftPoint.x + this.model.leftAxleOffset.x || 0;
leftPoint.y = leftPoint.y + this.model.leftAxleOffset.y || 0;
}
this.leftAxle = new EAxle({
_subType: 'leftAxle',
zlevel: this.zlevel,
@ -58,7 +63,7 @@ export default class Section extends Group {
drictx: 1,
dricty: this.model.leftAxlePosition === 1 || this.model.leftAxlePosition === 2 ? 1 : -1,
isSpecial: this.model.leftAxlePosition === -2 || this.model.leftAxlePosition === 2,
point: this.model.points[0],
point: leftPoint,
difference: this.model.points[0].y - this.model.points[1].y,
multiple: 1
},
@ -71,6 +76,11 @@ export default class Section extends Group {
this.add(this.leftAxle);
}
if (this.model.rightAxlePosition) {
const rightPoint = {x:this.model.points[length - 1].x, y: this.model.points[length - 1].y};
if (this.model.rightAxleOffset) {
rightPoint.x = rightPoint.x + this.model.rightAxleOffset.x || 0;
rightPoint.y = rightPoint.y + this.model.rightAxleOffset.y || 0;
}
this.rightAxle = new EAxle({
_subType: 'rightAxle',
zlevel: this.zlevel,
@ -81,7 +91,7 @@ export default class Section extends Group {
drictx: -1,
dricty: this.model.rightAxlePosition === 1 || this.model.rightAxlePosition === 2 ? 1 : -1,
isSpecial: this.model.rightAxlePosition === -2 || this.model.rightAxlePosition === 2,
point: this.model.points[length - 1],
point: rightPoint,
difference: this.model.points[length - 2].y - this.model.points[length - 1].y,
multiple1: -1
},
@ -282,7 +292,6 @@ export default class Section extends Group {
style: style
});
this.add(this.section);
if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示)
this.sectionBlock = new EblockLines({
zlevel: this.zlevel,
@ -381,20 +390,22 @@ export default class Section extends Group {
const model = this.model;
const style = this.style;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
this.release = new ERelease({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
y1: model.points[0].y + traingle.getSin(traingle.absz / 3),
x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2),
y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2)
},
lineWidth: style.Section.line.width,
stroke: style.Section.line.spareColor
});
if ((model.type == '01' && (!model.logicSectionCodeList || !model.logicSectionCodeList.length)) || model.type == '02' || model.type == '03') {
this.release = new ERelease({
zlevel: this.zlevel,
z: this.z,
shape: {
x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
y1: model.points[0].y + traingle.getSin(traingle.absz / 3),
x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2),
y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2)
},
lineWidth: style.Section.line.width,
stroke: style.Section.line.spareColor
});
this.add(this.release);
this.add(this.release);
}
}
// 创建限速线

View File

@ -36,6 +36,7 @@ class Signal extends Group {
y: 0
};
}
this.cbtcStatus = '';
this.create();
this.createMouseEvent();
this.transformRotation(this);
@ -314,39 +315,89 @@ class Signal extends Group {
}
// 关闭
close() {
if (this.count == 2) { // 双灯
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
} else if (this.count == 1) { // 单灯
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
close(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
// 逻辑点灯影响灯颜色仅西安二且暂无双灯
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor});
if (this.cbtcStatus !== 'close') {
setTimeout(()=> {
this.insideTriangle.setStyle({fill: '#000'});
}, 1000);
setTimeout(()=> {
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor});
}, 2000);
}
this.cbtcStatus = 'close';
}
} else {
this.cbtcStatus = '';
if (this.count == 2) { // 双灯
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
} else if (this.count == 1) { // 单灯
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
}
}
}
/* 正向开放*/
openPositive() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
openPositive(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
// 逻辑点灯影响灯颜色仅西安二且暂无双灯
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor});
if (this.cbtcStatus !== 'openPositive') {
setTimeout(()=> {
this.insideTriangle.setStyle({fill: '#000'});
}, 500);
setTimeout(()=> {
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor});
}, 1000);
}
this.cbtcStatus = 'openPositive';
}
} else {
this.cbtcStatus = '';
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
}
}
/* 侧向开放 */
openLateral() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
openLateral(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.yellowColor});
this.cbtcStatus = 'openLateral';
}
} else {
this.cbtcStatus = '';
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
}
}
@ -362,6 +413,7 @@ class Signal extends Group {
// 引导
guid() {
this.cbtcStatus = 'guid';
if (this.style.Signal.lamp.guidName === 'double') {
this.lamps[1].show();
}
@ -502,6 +554,7 @@ class Signal extends Group {
if (this.style.Signal.lamp.guidName === 'double' || this.style.Signal.lamp.guidName === 'doubleAndBase') {
this.lamps[1].hide();
}
this.insideTriangle && this.insideTriangle.setStyle({fill: this.style.Signal.insideTriangle.startSignalColor, stroke: this.style.Signal.insideTriangle.strokeColor});
this.insideTriangle && this.insideTriangle.hide();
this.sigPost && this.sigPost.removeTerminalOptional();
this.ciConfirm && this.ciConfirm.stopAnimation(false);
@ -528,13 +581,10 @@ class Signal extends Group {
/** 信号机封锁 */ // 缺一个功能封锁
model.blockade && this.block();
/** 设置灯的颜色 */
// model.redOpen = 1;
// model.yellowOpen = 1;
// model.greenOpen = 0;
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放
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.atsControl && this.setArtificialRouteClose();
// 联锁自动进路通过

View File

@ -382,6 +382,7 @@ class StationStand extends Group {
this.trainDepart && this.trainDepart.hideMode();
this.reentry && this.reentry.hideMode();
this.jump && this.jump.hideMode();
this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.defaultColor);
}
/** 空闲*/
@ -492,7 +493,7 @@ class StationStand extends Group {
model.trainParking && this.stop(); /** 列车停站*/
model.emergencyClosed && this.emergentClose(); /** 站台紧急关闭*/
model.doorOpen && this.doorOpen(); /** 车门开启 (西安二号线样式)*/
model.trainParking && this.doorOpen(); /** 车门开启 (西安二号线样式)*/
if (Number(model.parkingTime) > 0) {
this.setManuallyArmisticeTime(model.parkingTime); // 设置站台停车时间

View File

@ -162,7 +162,7 @@ export default class Switch extends Group {
_subType: 'enabled', // 标识
style: {
x: arrowTextX,
y: arrowTextY,
y: arrowTextY + 10,
fontSize: 12,
text: 'E',
textAlign: 'center',

View File

@ -3,6 +3,7 @@ import Text from 'zrender/src/graphic/Text';
import LangStorage from '@/utils/lang';
import Rect from 'zrender/src/graphic/shape/Rect';
import store from '@/store/index_APP_TARGET';
import Vue from 'vue';
class EMouse extends Group {
constructor(device) {
@ -33,9 +34,13 @@ class EMouse extends Group {
direction = this.device.model.right != 1;
}
if (LangStorage.getLang() == 'en') {
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
text = ` The planned train: ${trainType} \n Table No.: ${this.device.model.serviceNumber} \n Train Trip No.: ${this.device.model.tripNumber}\n Destination: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n Train No.: ${this.device.model.groupNumber}\n Early or late: ${destinationText}\n Direction: ${direction ? 'up' : 'down'}\n Crew No.: \n Start Station: \n Terminal Station: \n Occupied Track: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n Current Station: \n Train-ground communication: normal \n Operation Speed level: 4 \n Detained: ${this.device.model.hold ? 'Detained' : 'Normal'}\n \n 跳停状态: ${this.device.model.jump ? 'Skip to continue moving' : 'Normal'}Stationary: ${!this.device.model.stop ? 'No' : 'Yes'}\n Blocked: No \n Speed: ${this.device.model.speed || 0} km/h \n Authorized Distance: ${this.device.model.maLen || 0} m`;
} else {
text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
if (Vue.prototype.$jlmap.lineCode == '11' || Vue.prototype.$jlmap.lineCode == '10') {
text = `列车类型: ${trainType}\n\0\0\0\0源:人工标记\n\0\0号: ${this.device.model.groupNumber}\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\nATP报告方向: ${direction ? '上行' : '下行'}\n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n所在车站: \n车次通信: 通信车\n运行时间: \n停站时间: \n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n车戴扣车: 不执行\n跳停状态: 无跳停\n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车状态: CTC车\n最高信号系统控制: CTC\n驾驶模式: SM模式\n最高ATP模式: AM\nATP1状态: 激活\nATP2状态: 备用\n速度: ${this.device.model.speed || 0} km/h\n车门状态: ${this.device.model.speed ? '关闭' : direction ? '左开右关' : '左关右开'}\n制动状态: 无紧急制动\n停车保证: 可保证停车\n站台无法进入: 否\n前方站台停车点: 中间\n折法策略: \n折返状态: \n屏蔽门开门许可: 是\n运营里程: 无效\n总重量: 196T\n车长: 11860cm\n列车编组: 1`;
} else {
text = `列车类型: ${trainType} \n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.destinationCode ? this.device.model.destinationCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${direction ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.parentName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${ this.device.model.hold ? '扣车' : '正常'}\n跳停状态: ${this.device.model.jump ? '跳停' : '正常'} \n停稳状态: ${!this.device.model.stop ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`;
}
}
const trainTip = this.device.style.Train.common.trainTip;
if (trainTip) {

View File

@ -135,9 +135,8 @@ export default class TrainBody extends Group {
x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
text: targetCode.substring(targetCode.length - style.Train.trainNumber.targetCodePrefix.length),
textFill: style.trainTextColor,
textFill: model.style.Train.trainNumber.fontColor || style.trainTextColor,
textStroke: style.trainTextColor,
fontWeight: 400,
textStrokeWidth: 0,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
@ -301,20 +300,12 @@ export default class TrainBody extends Group {
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
}
getBoundingRect() {
let rect = null;
this.eachChild(elem => {
if (elem) {
const tempRect = elem.getBoundingRect();
if ((tempRect.x || tempRect.y) && tempRect.width && tempRect.height) {
if (rect) {
rect.union(tempRect);
} else {
rect = tempRect;
}
}
}
});
return rect || new BoundingRect(0, 0, 0, 0);
const rect = new BoundingRect(0, 0, 0, 0);
if (this.trainBodyBox) {
const tempRect = this.trainBodyBox.getBoundingRect().clone();
rect.union(tempRect);
}
return rect;
}
formatChangePosition(model, style) {
if (this.nameFormat) {

View File

@ -2,32 +2,32 @@ import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class TrainBodyBox extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model;
this.trainBodyBox = new Rect({
zlevel: model.zlevel,
z: model.z,
shape: {
x: model.point.x,
y: model.point.y,
width: model.style.Train.common.trainWidth,
height: model.style.Train.common.trainHeight
},
style: {
lineWidth: model.style.Train.trainBody.trainBodyLineWidth,
stroke: model.style.Train.trainBody.trainSidelineColor || model.style.trainSidelineColor,
fill: model.style.Train.trainBody.trainBodyFillColor
},
cursor: 'pointer'
});
this.add(this.trainBodyBox);
}
setColor(key, color) {
this.trainBodyBox.setStyle(key, color);
}
zlevel: model.zlevel,
z: model.z,
shape: {
x: model.point.x,
y: model.point.y,
width: model.style.Train.common.trainWidth,
height: model.style.Train.common.trainHeight
},
style: {
lineWidth: model.style.Train.trainBody.trainBodyLineWidth,
stroke: model.style.Train.trainBody.trainSidelineColor || model.style.trainSidelineColor,
fill: model.style.Train.trainBody.trainBodyFillColor
},
cursor: 'pointer'
});
this.add(this.trainBodyBox);
}
setColor(key, color) {
this.trainBodyBox.setStyle(key, color);
}
}

View File

@ -229,34 +229,34 @@ export default class Train extends Group {
const flag = this.style.Train.trainStatusStyle.destinationStatus.some((item) => {
if (status === item.status) {
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
case 'trainTarget':
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
break;
case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
break;
case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor);
break;
default:
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
case 'trainTarget':
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
break;
case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
break;
case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor);
break;
default:
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
}
return true;
}
});
if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) {
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
case 'trainTarget':
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
default:
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
case 'trainTarget':
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
default:
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
}
}
}
@ -291,8 +291,13 @@ export default class Train extends Group {
if (this.style.Train.trainStatusStyle.directionStopType.length > 0) {
this.style.Train.trainStatusStyle.directionStopType.forEach((item) => {
if (right === item.type) {
this.trainL && this.trainL.setLineShow(item.lineLShow);
this.trainR && this.trainR.setLineShow(item.lineRShow);
if (this.style.Train.trainHead.directionStopType == 'special') {
this.trainL && this.trainL.setArrowShow(item.lineLShow);
this.trainR && this.trainR.setArrowShow(item.lineRShow);
} else {
this.trainL && this.trainL.setLineShow(item.lineLShow);
this.trainR && this.trainR.setLineShow(item.lineRShow);
}
return true;
}
});
@ -425,22 +430,22 @@ export default class Train extends Group {
const arr = this.nameFormat.split(':');
arr.forEach(ele => {
switch (ele) {
case 'targetCode': {
this.size += (style.Train.trainNumber.targetCodePrefix || '').length;
break;
}
case 'serviceNumber': {
this.size += (style.Train.trainServer.serviceNumberPrefix || '').length;
break;
}
case 'tripNumber': {
this.size += (style.Train.trainTarget.tripNumberPrefix || '').length;
break;
}
case 'groupNumber': {
this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length;
break;
}
case 'targetCode': {
this.size += (style.Train.trainNumber.targetCodePrefix || '').length;
break;
}
case 'serviceNumber': {
this.size += (style.Train.trainServer.serviceNumberPrefix || '').length;
break;
}
case 'tripNumber': {
this.size += (style.Train.trainTarget.tripNumberPrefix || '').length;
break;
}
case 'groupNumber': {
this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length;
break;
}
}
});
} else {

View File

@ -47,6 +47,12 @@ export function parser(data, skinCode, showConfig) {
mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig);
}, this);
zrUtil.each(data.sectionList || [], elem => {
if (elem.type == '02' || elem.type == '03') {
mapDevice[elem.code].parentName = mapDevice[elem.parentCode] ? mapDevice[elem.parentCode].name : '';
}
}, this);
zrUtil.each(data.signalList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert, showConfig);
}, this);

View File

@ -49,12 +49,12 @@ export default {
{
name: 'global.designPlatformEntrance',
handle: this.goToDesign,
hidden: getSessionStorage('project').startsWith('design')
hidden: getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')]
},
{
name: 'global.trainingPlatformEntrance',
handle: this.goToTraining,
hidden: !getSessionStorage('project').startsWith('design')
hidden: !getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')]
},
{
name: 'global.caseShow',

View File

@ -236,9 +236,9 @@
</div>
</div>
<div v-if="project.endsWith('gzb')" class="form_box">
<div class="title">绑定微信:</div>
<div class="title">{{ wxUnionId||wxOpenId? '更改绑定微信:': '绑定微信:' }}</div>
<div class="content">
<el-button v-if="!binding&&!bindSuccess" type="primary" size="small" @click="generateQrCode">生成微信二</el-button>
<el-button v-if="!binding&&!bindSuccess" type="primary" size="small" style="position: absolute;" @click="generateQrCode">生成微信二</el-button>
<div v-if="binding && !bindSuccess" class="login-code-box" @click="generateQrCode">
<qrcode-vue
v-loading="loadingCode"
@ -250,7 +250,7 @@
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div v-if="bindSuccess"><span>绑定成功</span></div>
<div v-if="bindSuccess"><span>绑定微信成功</span></div>
</div>
</div>
<span slot="footer" class="dialog-footer">
@ -339,7 +339,9 @@ export default {
],
nationCodeInit: '86', //
loginClient: 'LianKeTang',
project:''
project:'',
wxUnionId: '',
wxOpenId: ''
};
},
computed: {
@ -373,6 +375,8 @@ export default {
email: user.email,
passWord: ''
};
this.wxUnionId = user.wxUnionId;
this.wxOpenId = user.wxOpenId;
this.oldPassWord = user.password;
this.nationCode = user.nationCode ? user.nationCode : '86';
this.nationCodeInit = user.nationCode
@ -542,6 +546,7 @@ export default {
},
generateQrCode() {
getWxQrCode(LoginParams[this.loginClient]).then(response => {
this.loadingCode = false;
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.binding = true;
@ -684,6 +689,9 @@ export default {
line-height: 28px;
margin-bottom: 10px;
}
.login-qrcode {
width: 150px;
}
}
</style>
<style rel="stylesheet/scss" lang="scss">

View File

@ -346,43 +346,43 @@ export const asyncRouter = [
}
]
},
{ // 个人地图
path: '/design/userlist',
redirect: '/design/userlist/home',
component: Layout,
meta: {
roles: [admin]
},
children: [
{
path: '',
redirect: '/design/userlist/home',
component: DesignPlatformUser,
meta: {
i18n: 'router.designUserPage',
icon: 'design'
},
children: [
{
path: 'home',
component: DesignPlatformHome,
meta: {
}
},
{ // 地图 绘制
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{ // 运行图设计
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
}
]
}
]
},
// { // 个人地图
// path: '/design/userlist',
// redirect: '/design/userlist/home',
// component: Layout,
// meta: {
// roles: [admin]
// },
// children: [
// {
// path: '',
// redirect: '/design/userlist/home',
// component: DesignPlatformUser,
// meta: {
// i18n: 'router.designUserPage',
// icon: 'design'
// },
// children: [
// {
// path: 'home',
// component: DesignPlatformHome,
// meta: {
// }
// },
// { // 地图 绘制
// path: 'map/draw/:mapId/:view',
// component: Mapedit,
// hidden: true
// },
// { // 运行图设计
// path: 'runPlan/detail/:mapId',
// component: PlanMonitorDetail,
// hidden: true
// }
// ]
// }
// ]
// },
{ // 全屏战场图
path: '/display/:mode',
component: Display,
@ -847,15 +847,16 @@ export const asyncRouter = [
]
},
{ // 新个人地图
path: '/design/usermap',
redirect: '/design/usermap/home',
path: '/design',
// redirect: '/design/usermap/home',
component: Layout,
meta: {
i18n: 'router.newDesignUserPage',
roles: [admin, user]
},
children: [
{
path: '',
path: 'usermap',
redirect: '/design/usermap/home',
component: NewDesignPlatformUser,
meta: {
@ -866,6 +867,7 @@ export const asyncRouter = [
{
path: 'home',
component: DesignPlatformHome,
hidden: true,
meta: {
}
}
@ -877,15 +879,48 @@ export const asyncRouter = [
]
},
{ // 新地图绘制
path: 'map/draw/:mapId/:view',
path: 'usermap/map/draw/:mapId/:view',
component: NewMapDraft,
hidden: true
},
{
path:'iscs/design',
redirect: '/iscs/design',
component: IscsDesign,
meta: {
i18n: 'router.iscsDraw',
roles: [admin]
},
children: [
{
path: 'edit/:id/:mode',
component: IscsDraw,
hidden: true
}
]
},
{
path: 'iscs/system',
redirect: '/iscs/system',
component: IscsSystem,
meta: {
i18n: 'router.iscsSystem',
roles: [admin]
},
children: [
{
path: 'config/:mode',
component: IscsConfig,
hidden: true
}
]
}
]
},
{ // iscs系统
path: '/iscs',
component: Layout,
hidden: true,
meta: {
i18n: 'router.iscsSystem',
roles: [admin]
@ -929,7 +964,7 @@ export const asyncRouter = [
component: Layout,
meta: {
i18n: 'router.studentManage',
roles: [admin, user]
roles: [admin, lessonCreater]
},
hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('gzb') && !window.document.location.pathname.includes('gzb') : !window.document.location.pathname.includes('gzb'),
children: [

View File

@ -52,6 +52,10 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
homeTitle: '调度一部',
browserTitle: '西安地铁调度一部城市轨道交通设计平台',
loginPath: '/designxadt/login'
},
jsxt:{
title: '城市轨道交通竞赛平台',
loginPath: '/js/login'
}
};
@ -65,7 +69,8 @@ export const ProjectIcon = {
hyd: FaviconHyd,
designhyd: FaviconHyd,
xadt: FaviconXadt,
designxadt: FaviconXadt
designxadt: FaviconXadt,
jsxt: Favicon
};
export const ProjectCode = {
@ -80,7 +85,7 @@ export const ProjectCode = {
};
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt']; // 实训设计平台通过项目code获取地图列表的项目
export const CaseHideProjectList = ['hyd', 'designhyd']; // 案例展示隐藏的项目
export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt'];// 需要在公共路由中生成登录页面的项目&登录页样式
export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'jsxt'];// 需要在公共路由中生成登录页面的项目&登录页样式
export const goOtherPlatformMenu = { // 导航栏快速切换平台
login: '/design/login',
design: '/login',
@ -123,6 +128,11 @@ export const PermissionParam = { // 路径权限处理所需参数配置(跳
whitePage: '/xadt/login',
reg: /^\/xadt/,
clientId: null
},
jsxt: {
whitePage: '/jsxt/login',
reg: /^\/jsxt/,
clientId: null
}
};
export const ProjectList = [

View File

@ -118,7 +118,7 @@ function handleRecordList(state, data) {
value: data.message,
self: isSelf,
voice: data.isAudio,
src: data.isAudio ? `${process.env.process.env.VUE_VOICE_API}/jlcloud/audio/${data.audioPath}` : '',
src: data.isAudio ? `/jlcloud/audio/${data.audioPath}` : '',
other: !isSelf,
userName: data.member.nickName,
chatTime: data.chatTime,
@ -141,17 +141,16 @@ function handleSimulationInfo(state, data) {
const myDate1 = myDate.toLocaleDateString().replace(/\//g, '-');
const chatTime = /\d{2}:\d{2}:\d{2}/.exec(data.chatTime)[0] || data.chatTime;
const params = {
conversationId:data.conversationId,
id:data.conversationId,
self: isSelf,
message: data.message,
voice: data.isAudio,
src: data.isAudio ? `/jlcloud/audio/${data.audioPath}` : '',
memberName:data.member.name,
memberRole:data.member.role,
member:data.member,
memberOnline:data.member.online,
chatTime: data.chatTime,
targetOnline:data.targetMember ? data.targetMember.online : null,
targetName:data.targetMember ? data.targetMember.name : 'All',
targetName:data.targetMember ? data.targetMember : 'All',
targetRole:data.targetMember ? data.targetMember.role : null,
group: data.group,
date: +new Date(`${myDate1} ${chatTime}`)

View File

@ -20,7 +20,7 @@
<script>
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
import { UrlConfig } from '@/scripts/ConstDic';
import { superAdmin, admin } from '@/router/index_APP_TARGET';
import { superAdmin, admin, lessonCreater } from '@/router/index_APP_TARGET';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs';
@ -215,7 +215,7 @@ export default {
this.$store.dispatch('config/resize', { width: width, height: height });
},
isAdministrator() {
return this.$store.state.user.roles.includes(superAdmin) || this.$store.state.user.roles.includes(admin);
return this.$store.state.user.roles.includes(superAdmin) || this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(lessonCreater);
}
}
};

View File

@ -101,7 +101,7 @@ export default {
this.loadInitPage(this.$route.params.examId);
},
methods: {
getList() {
async getList() {
if (this.drawWay) {
this.typeList = [];
for (const val in ConstConfig.ConstSelect.trainingDeviceType) {
@ -161,53 +161,53 @@ export default {
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; //
});
getDetailList('training_type').then(res => {
this.typeList = res.data;
if (LangStorage.getLang() == 'en') {
this.typeList.forEach(item => {
switch (item.code) {
case '01':
item.name = 'Control permission operation';
break;
case '02':
item.name = 'Signalling machine operation';
break;
case '03':
item.name = 'Turnout operation';
break;
case '04':
item.name = 'Section operation';
break;
case '05':
item.name = 'Platform operation';
break;
case '06':
item.name = 'Train scheduling operation';
break;
case '07':
item.name = 'Train operation';
break;
case '08':
item.name = 'Temporary speed limit operation of the whole line';
break;
}
});
}
});
const res = await getDetailList('training_type');
this.typeList = res.data;
if (LangStorage.getLang() == 'en' && this.typeList) {
this.typeList.forEach(item => {
switch (item.code) {
case '01':
item.name = 'Control permission operation';
break;
case '02':
item.name = 'Signalling machine operation';
break;
case '03':
item.name = 'Turnout operation';
break;
case '04':
item.name = 'Section operation';
break;
case '05':
item.name = 'Platform operation';
break;
case '06':
item.name = 'Train scheduling operation';
break;
case '07':
item.name = 'Train operation';
break;
case '08':
item.name = 'Temporary speed limit operation of the whole line';
break;
}
});
}
}
},
async loadInitPage(examId) {
if (examId) {
getPublishMapInfo(this.$route.query.mapId).then(res => {
if (res.data) {
this.drawWay = res.data.drawWay;
this.lineCode = res.data.lineCode;
try {
const response = await getPublishMapInfo(this.$route.query.mapId);
if (response.data) {
this.drawWay = response.data.drawWay;
this.lineCode = response.data.lineCode;
this.typeList = [];
this.getList();
await this.getList();
}
}).catch(() => {
} catch (e) {
this.$message.error(this.$t('error.getMapDataFailed'));
});
}
const res = await getExamLessonDetail(examId);
this.examDetails = res.data;
this.examDetails.examDefinitionRulesVOList.forEach((res, index) => {

View File

@ -0,0 +1,424 @@
<template>
<!-- v-quickMenuDrag -->
<div class="chatBox">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" @addCoversition="addCoversition" />
<div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
<div v-show="currentCoversition.group==undefined?true:currentCoversition.group" class="showMembers" @click="handleMembers()">
<i class="el-icon-user-solid" />
</div>
<div class="chat-setting" @click="handleSetting()">
<i class="el-icon-s-tools" />
</div>
</div>
<div class="chat-box-content">
<chat-content ref="chatContent" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
<div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" />
<div class="record_tip_text">正在录音...</div>
<div class="record_tip_confirm" @click="stopRecording()">确定</div>
<div class="record_tip_cancle" @click="cancleRecording()">取消</div>
</div>
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div>
</div>
</div>
</div>
</div>
<div v-show="minimize" class="reminder-drag minimize-box">
<div class="chat-title">聊天窗口</div>
<div class="minimality" @click="handleMinimality('max')">
<i class="el-icon-circle-plus" />
</div>
</div>
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
</div>
</template>
<script>
import ChatSetting from './chatSetting';
import ChatContent from './chatContent';
import ChatMemberList from './chatMemberList';
import ChatCoversitionList from './chatCoversitionList';
import RecordRTC from 'recordrtc';
import {uploadAudioFileNew} from '@/api/chat';
export default {
name: 'ChatBox',
components:{
ChatSetting,
ChatContent,
ChatMemberList,
ChatCoversitionList
},
props: {
group: {
type: String,
required: true
}
},
data() {
return {
minimize:true,
recordSending:false,
currentCoversition:{},
seconds:0,
inter:null,
recorders: null,
microphone:null,
form:{
language:'zh',
sex:'1'
},
headerTitle:'所有人'
};
},
watch: {
'$store.state.socket.simulationRoleList': function (val) {
if (val && val.length) {
this.$nextTick(() => {
this.$refs.chatMemberList.setMemberStatus(val);
this.$refs.chatCoversitionList.setCoversitionStatus(val);
});
}
}
},
mounted() {
this.initPage();
},
methods:{
async initPage() {
},
handleMinimality(data) {
if (data == 'min') {
this.minimize = true;
this.$refs.chatSetting.doClose();
} else {
this.minimize = false;
}
},
setSetting(data) {
this.form = data;
},
setCurrentCoversition(coversition) {
this.currentCoversition = coversition;
},
setHeadTitle(headerTitle) {
this.headerTitle = headerTitle;
},
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
if (headerTitle) {
this.currentCoversition = {id:data.id, group:data.group};
this.headerTitle = headerTitle;
}
},
//
startRecording() {
const that = this;
if (!this.recordSending && !this.recorders && !this.microphone) {
this.$refs.chatSetting.doClose();
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
navigator.getUserMedia(
{ audio: true } //
, function (stream) {
that.microphone = stream;
that.recorders = new RecordRTC(that.microphone, {
type: 'audio',
recorderType: StereoAudioRecorder,
numberOfAudioChannels: 1,
bitsPerSecond:256000,
desiredSampRate: 16000
});
that.recorders.startRecording();
that.recordSending = true;
that.inter = setInterval(() => {
if (that.seconds < 60) {
that.seconds++;
} else {
clearInterval(that.inter);
}
}, 1000);
}, function (error) {
switch (error.code || error.name) {
case 'PERMISSION_DENIED':
case 'PermissionDeniedError':
that.$message({
showClose: true,
message: '用户拒绝提供信息',
type: 'error'
});
break;
case 'NOT_SUPPORTED_ERROR':
case 'NotSupportedError':
that.$message({
showClose: true,
message: '浏览器不支持硬件设备',
type: 'error'
});
break;
case 'MANDATORY_UNSATISFIED_ERROR':
case 'MandatoryUnsatisfiedError':
that.$message({
showClose: true,
message: '无法发现指定的硬件设备',
type: 'error'
});
break;
default:
that.$message({
showClose: true,
message: '无法打开麦克风',
type: 'error'
});
break;
}
}
);
}
},
cancleRecording() {
if (this.microphone) {
clearInterval(this.inter);
this.seconds = 0;
this.microphone.stop();
this.microphone = null;
this.recordSending = false;
this.recorders = null;
}
},
//
stopRecording() {
const that = this;
this.recorders.stopRecording(function(blobURL) {
const data = URL.createObjectURL(that.recorders.getBlob());
console.log('--------', data);
clearInterval(that.inter);
that.seconds = 0;
const blob = that.recorders.getBlob();
const fd = new FormData();
fd.append('file', blob);
uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.currentCoversition.id, fd)
.then((data) => {
})
.catch(error => {
console.log(error);
});
if (that.microphone) {
that.microphone.stop();
that.microphone = null;
that.recordSending = false;
that.recorders = null;
}
});
},
handleSetting() {
this.$refs.chatSetting.doShow();
},
handleMembers() {
this.$refs.chatSetting.doClose();
this.$refs.chatMemberList.doShow();
}
}
};
</script>
<style lang="scss" scoped>
.chatBox{
width: 503px;
height: 400px;
position: absolute;
padding-left:5px;
left: 0;
bottom:28px;
z-index:22;
}
.chat-box{
width: 100%;
height: 100%;
}
.chat-box-header{
width: 100%;
height: 40px;
border-bottom: 1px #dedede solid;
}
.chat-box-header-title{
font-size: 15px;
margin-left: 15px;
display: inline-block;
margin-top: 10px;
}
.chat-box-content{
width: 100%;
height: 300px;
border-bottom: 1px #dedede solid;
position: relative;
}
.chat-box-contentTip{
}
.chat-box-footer{
display: inline-block;
width: 100%;
}
.chat-window{
display: inline-block;
width: 400px;
}
.chat-setting{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 16px;
}
.chat-box-footer-tool{
width: 100%;
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;
}
.minimality {
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size:16px;
}
.chat-box-main{
position: absolute;
width: 100%;
left: 0;
height: 100%;
top: 0;
border-right: 1px #dedede solid;
z-index: 4;
background: #fff;
border-radius: 5px;
left:5px;
font-size:0;
}
.chat-coversition{
}
.coversition-list{
}
.showMembers{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 17px;
}
#record_progress_bar{
height: 100%;
position: absolute;
background: #bbe5f5;
}
.chat_record_tip{
height: 28px;
display: inline-block;
background: #dfe6ee;
width: 100%;
font-size: 13px;
border-top: 1px #d8dce5 solid;
position: absolute;
bottom: 0;
right: 0;
}
.record_icon{
display: inline-block;
width: 8px;
height: 8px;
background: #25d825;
border-radius: 10px;
left: 7px;
margin-right: 0px;
box-shadow: -1px 0px 3px #6d6d6d;
border: 1px #28d228 solid;
position: absolute;
top: 10px;
}
.record_tip_text{
display: inline-block;
font-size: 12px;
margin-left: 3px;
// padding: 8px 0px 6px 0px;
position: absolute;
top: 8px;
left:20px
}
.record_tip_confirm{
position: absolute;
right: 63px;
padding: 3px 0px 2px 0px;
border: 1px #a2a5aa solid;
border-radius: 5px;
width: 45px;
text-align: center;
font-size: 12px;
top: 4px;
background: #eeeeee;
cursor: pointer;
}
.record_tip_cancle{
position: absolute;
right: 10px;
padding: 3px 0px 2px 0px;
border: 1px #a2a5aa solid;
border-radius: 5px;
width: 45px;
text-align: center;
font-size: 12px;
top: 4px;
background: #eeeeee;
cursor: pointer;
}
.minimize-box {
width: 97.5%;
height: 40px;
position: absolute;
left: 5px;
bottom: 0;
z-index: 222;
background: #fff;
border-radius: 5px;
.chat-title {
float: left;
font-size: 15px;
margin-left: 10px;
line-height: 40px;
}
.minimality {
float: right;
height: 40px;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
}
}
</style>

View File

@ -0,0 +1,200 @@
<template>
<div class="chatcontentIn">
<div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass">
<div :class="chatContent.self?'rightUser':'leftUser'">
<div class="userHeader">
<div v-if="chatContent.group&& !chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div>
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div>
</div>
<div class="userBubble" @click="playAudio('audio'+index)">
<div class="userMessage">
<span v-if="chatContent.group&&!(chatContent.member && chatContent.member.robot)">@{{ covertName(chatContent.targetName) }}</span>
<span class="el-icon-video-play playicon" />
<span class="messageText">{{ chatContent.message }}</span>
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {getSimulationContextListNew} from '@/api/chat';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
export default {
props:{
currentCoversition:{
type:Object,
required:true
}
},
data() {
return {
chatContentList:[],
coversition:{},
baseUrl:process.env.VUE_APP_VOICE_API
};
},
watch:{
'$store.state.socket.simulationText':function (val, old) { // 仿
const simulationText = this.$store.state.socket.simulationText;
if (this.currentCoversition.id == val.id) {
this.chatContentList.push(simulationText);
} else {
this.$emit('addCoversition', {data:simulationText, headerTitle:''});
this.chatContentList.push(simulationText);
}
},
$route() {
this.inintData();
},
currentCoversition:function (val, old) {
if (val) {
this.chatContentList = [];
this.coversition = this.currentCoversition;
this.inintData();
}
}
},
mounted() {
// this.coversition = this.currentCoversition;
// this.inintData();
},
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.targetName = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
});
// 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]));
// this.chatContentList = coversitionList;
},
formatTime(time) {
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
},
covertName(data) {
if (data != 'All') {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
if (rolename == data.role) {
data.role = element.enLabel;
}
} else {
if (rolename == data.role) {
data.role = element.label;
}
}
});
const deviceName = data.deviceName ? '-' + data.deviceName : '';
const memberName = data.name ? '-' + data.name : '';
return data.role + deviceName + memberName;
} else {
return 'All';
}
},
playAudio(id) {
document.querySelector('#' + id).play();
}
// reloadData(currentCoversition) {
// this.chatContentList = [];
// this.coversition = currentCoversition;
// this.inintData();
// }
}
};
</script>
<style lang="scss" scoped>
.chatcontentIn{
height: 100%;
width: 100%;
display: inline-block;
overflow: auto;
padding-bottom: 20px;
cursor:auto;
}
.leftUser{
float: left;
margin-left: 10px;
margin-top: 10px;
display: inline-block;
}
.rightUser{
float: right;
margin-right: 10px;
margin-top: 10px;
display: inline-block;
}
.userHeader{margin-bottom: 2px;}
.userName{font-size: 12px;display:inline-block;}
.userChatTime{font-size: 12px;display:inline-block;}
.userBubble{
max-width: 200px;
font-size: 12px;
padding: 10px;
background: #ccc;
border-radius: 5px;
cursor: pointer;
}
.playicon{
font-size: 20px;
vertical-align: top;
}
.textRight{text-align: right;width: 100%;}
.userMessage{}
.messageText{line-height: 20px;}
.chatContentInClass{
display: inline-block;
width: 100%;
}
// safariqq360
//
.chatcontentIn::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.chatcontentIn::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.chatcontentIn::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.chatcontentIn::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -0,0 +1,187 @@
<template>
<div class="chat-coversition">
<div id="coversition-list-name" />
<div class="coversition-list">
<div
v-for="coversition in coversitionList"
:key="coversition.id"
:class="coversition.id==currentCoversition.id?'coversition-active each-coversition':'each-coversition'"
@click="changeCoversition(coversition)"
>{{ coversition.coverName }}</div>
</div>
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import {getSimulationConversationListNew} from '@/api/chat';
export default {
name:'ChatCoversitionList',
data() {
return {
coversitionList:[],
currentCoversition:{}
};
},
mounted() {
this.initPage(true);
},
methods:{
initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
data.map(coversition=>{
const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline;
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]);
}
}
});
},
addCoversition(data, headerTitle) {
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
if (index < 0) {
debugger;
const objectCover = this.handleMemberName(data);
data.coverName = objectCover.coversitionName;
data.isOnline = objectCover.isOnline;
this.coversitionList.push(data);
if (headerTitle) {
this.currentCoversition = data;
}
}
},
changeCoversition(coversition) {
this.$emit('setHeadTitle', !coversition.isOnline ? coversition.coverName + ' (离线)' : coversition.coverName);
this.currentCoversition = {id:coversition.id, group:coversition.group};
this.$emit('setCurrentCoversition', coversition);
// this.$refs.chatContent.reloadData(this.currentCoversition);
},
handleMemberName(conversition) {
if (conversition.group) {
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};
}
},
setCoversitionStatus(data) {
this.initPage(false);
this.$emit('setHeadTitle', !this.currentCoversition.isOnline ? this.currentCoversition.coverName + ' (离线)' : this.currentCoversition.coverName);
// this.changeCoversition(this.currentCoversition);
}
}
};
</script>
<style lang="scss" scoped>
.chat-coversition{
width: 100px;
display: inline-block;
border-right: 1px #dedede solid;
height: 100%;
vertical-align: top;
background: #f9f9f9;
border-radius: 5px 0px 0px 5px;
}
.coversition-list{
padding: 3px 0px 10px 0px;
height: 355px;
overflow: auto;
margin-top:40px;
}
.each-coversition{
font-size: 14px;
padding: 10px 7px 10px 10px;
border-bottom: 1px #dedede solid;
cursor: pointer;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.coversition-active{
background: #e0e0e0;
}
// safariqq360
//
.coversition-list::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.coversition-list::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -0,0 +1,166 @@
<template>
<div :class="showMembers?'memberAnimate chat-box-members':'chat-box-members'">
<div class="chat-member-title">成员列表</div>
<div class="chat-member-list">
<div
v-for="member in memberList"
:key="member.id"
:class="member.online?'each-chat-member':'each-chat-member each-chat-member-outline'"
@click="createConversition(member)"
>{{ member.memberName }}</div>
</div>
</div>
</template>
<script>
import {getSimulationMembersNew, getSimulationConversationIdNew} from '@/api/chat';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
export default {
name: 'ChatMemberList',
props: {
group: {
type: String,
required: true
}
},
data() {
return {
showMembers:false,
memberList:[]
};
},
mounted() {
this.getSimulationMembers();
},
methods:{
createConversition(member) {
if (member.userId != this.$store.state.user.id && member.online) {
getSimulationConversationIdNew({ memberId: member.id }, this.group).then(resp => {
if (resp.data) {
const data = resp.data;
this.$emit('addCoversition', {data:data, headerTitle:member.memberName});
this.showMembers = false;
}
});
}
},
setMemberStatus(memberInfo) {
this.getSimulationMembers();
// memberInfo.forEach(member=>{
// if (this.coversitionList) {
// this.coversitionList.forEach(item=>{
// if (item.id == member.id) {
// item.online = member.online;
// }
// });
// }
// });
},
getSimulationMembers() {
getSimulationMembersNew(this.$route.query.group).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;
});
},
doShow() {
if (this.showMembers) {
this.showMembers = false;
} else {
this.showMembers = true;
this.getSimulationMembers();
}
}
}
};
</script>
<style lang="scss" scoped>
.memberAnimate{
transform: translateX(97%);
}
.chat-box-members{
position: absolute;
width: 140px;
right: 0;
height: 100%;
background: #fff;
border-right: 1px #dedede solid;
border-radius: 0px 5px 5px 0px;
z-index: 2;
transition: transform 1s;
padding: 12px 2px 10px 16px;
font-size: 14px;
}
.chat-member-title{
}
.chat-member-list{
margin-top: 13px;
font-size: 12px;
margin-left: 2px;
height: 350px;
overflow-y: auto;
}
.each-chat-member{
margin-bottom: 10px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.each-chat-member-outline{
color: #ccc;
}
// safariqq360
//
.chat-member-list::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.chat-member-list::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.chat-member-list::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.chat-member-list::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -0,0 +1,126 @@
<template>
<div v-show="dialogVisible" class="chat-popup">
<div class="chat-setting-header">
<div class="chat-setting-title">设置</div>
<div class="chat-setting-close">
<i class="el-icon-close" @click="dialogVisible=false" />
</div>
</div>
<div class="chat-setting-content">
<div class="chat-setting-language">
<div class="setting-language-title">语言: </div>
<el-switch
v-model="form.language"
class="setting-language-select"
active-color="#409EFF"
inactive-color="#ff4949"
active-text="中"
inactive-text="En"
active-value="zh"
inactive-value="en"
@change="changeLanguage()"
/>
</div>
<div class="chat-setting-sex">
<div class="setting-sex-title">性别: </div>
<el-switch
v-model="form.sex"
class="setting-sex-select"
active-color="#409EFF"
inactive-color="#ff4949"
active-icon-class="el-icon-male"
inactive-icon-class="el-icon-female"
active-value="1"
inactive-value="0"
@change="changeSex()"
/>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ChatSetting',
props:{
form:{
type:Object,
required:true
}
},
data() {
return {
dialogVisible: false,
loading:false
};
},
methods:{
doShow() {
this.dialogVisible = true;
},
doClose() {
this.dialogVisible = false;
},
changeLanguage() {
this.$emit('setSetting', this.form);
},
changeSex() {
this.$emit('setSetting', this.form);
}
}
};
</script>
<style lang="scss" scoped>
.chat-popup{
position: absolute;
width: 54%;
height: 143px;
border: 1px #dedede solid;
left: 33%;
top: 24%;
z-index: 7;
border-radius: 4px;
-webkit-box-shadow: 3px 3px 3px #dedede;
box-shadow: 3px 3px 3px #dedede;
background: #fff;
}
.chat-setting-header{
padding-left: 10px;
padding-top: 6px;
font-size: 14px;
border-bottom: 1px #dedede solid;
padding-bottom: 6px;
}
.chat-setting-title{
display: inline-block;
}
.chat-setting-close{
float: right;
display: inline-block;
margin-right: 5px;
font-size: 16px;
cursor: pointer;
}
.chat-setting-content{
}
.chat-setting-language,.chat-setting-sex{
display: inline-block;
margin-top: 20px;
}
.setting-language-title,.setting-sex-title{
display: inline-block;
font-size: 14px;
margin-left: 20px;
vertical-align: top;
margin-top: 3px;
}
.setting-language-select,.setting-sex-select{
display: inline-block;
vertical-align: top;
}
</style>
<style lang="scss">
.setting-sex-select .el-icon-male,.setting-sex-select .el-icon-female{
font-size:18px !important;
}
</style>

View File

@ -51,7 +51,7 @@
</template>
<script>
import { getScriptPageListOnline, getScriptById, getDraftScriptByGroup, getDraftScriptByGroupNew } from '@/api/script';
import {getScriptPageListOnlineNew, getScriptByIdNew, getDraftScriptByGroupNew } from '@/api/script';
//
export default {
@ -148,41 +148,25 @@ export default {
},
listQuest(params) {
params['mapId'] = this.$route.query.mapId;
return getScriptPageListOnline(params);
return getScriptPageListOnlineNew(params);
},
async loadInitData() {
},
async handleLoad(index, row) {
this.row = row;
if (row.drawWay) {
const res = this.$route.fullPath.includes('design/displayNew/demon') ? await getDraftScriptByGroupNew(row.group) : await getScriptById(row.id);
let newMemberList = [];
if (res.code == 200) {
if (res.data.playerList && res.data.playerList.length > 0) {
newMemberList = res.data.playerList.filter(item => item.hasPlay === true);
}
if (res.data.mapLocation) {
this.mapLocation = res.data.mapLocation;
}
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
const res = this.$route.fullPath.includes('design/displayNew/demon') ? await getDraftScriptByGroupNew(row.group) : await getScriptByIdNew(row.id);
let newMemberList = [];
if (res.code == 200) {
if (res.data.playerList && res.data.playerList.length > 0) {
newMemberList = res.data.playerList.filter(item => item.hasPlay === true);
}
} else {
const res = this.$route.fullPath.includes('design/display/demon') ? await getDraftScriptByGroup(row.group) : await getScriptById(row.id);
let newMemberList = [];
if (res.code == 200) {
if (res.data.playerVOList && res.data.playerVOList.length > 0) {
newMemberList = res.data.playerVOList.filter(item => item.hasPlay === true);
}
if (res.data.mapLocation) {
this.mapLocation = res.data.mapLocation;
}
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
if (res.data.mapLocation) {
this.mapLocation = res.data.mapLocation;
}
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
}
this.roleShow = true;
},

View File

@ -5,8 +5,6 @@
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :group="group" :training-obj="trainingObj" />
<menu-demon
v-if="isDemon"
ref="menuDemon"
@ -20,10 +18,8 @@
@showScheduling="showScheduling"
/>
<menu-script v-if="isScript" ref="menuScript" :offset="offset" :group="group" />
<menu-schema
v-if="isDemon || isScript "
v-if="isDemon"
ref="menuSchema"
:offset="offset"
:offset-bottom="offsetBottom"
@ -42,7 +38,6 @@
<run-plan-Load ref="runPlanLoad" :group="group" />
<run-plan-view ref="runPlanView" :group="group" />
<add-quest ref="addQuest" @selectQuest="selectQuest" />
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
</div>
</template>
@ -54,12 +49,10 @@ import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import MenuDemon from '@/views/newMap/displayNew/menuDemon';
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import MenuScript from '@/views/newMap/displayNew/menuScript';
import AddQuest from './demon/addQuest';
import Scheduling from './demon/scheduling';
import { mapGetters } from 'vuex';
import { setGoodsTryUse } from '@/api/management/goods';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import { clearSimulation, getSimulationInfoNew, scriptExecuteNew } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
@ -80,12 +73,10 @@ export default {
AddQuest,
MapSystemDraft,
MenuDemon,
MenuScript,
MenuSchema,
MenuSystemTime,
// Jl3dSimulation,
Jl3dDrive,
Scheduling
Jl3dDrive
// Scheduling
},
props: {
size: {
@ -119,8 +110,7 @@ export default {
'04': '02', // =>
'05': '' // => null
},
isDrive: this.prdType == '04',
isShowScheduling: this.prdType == '05'
isDrive: this.prdType == '04'
};
},
computed: {
@ -146,9 +136,6 @@ export default {
right() {
return this.$store.state.config.width / 2 - 55;
},
trainingId() {
return this.$route.query.trainingId;
},
mapId() {
return this.$route.query.mapId;
},
@ -156,24 +143,16 @@ export default {
// return this.$route.query.prdType;
return this.$store.state.training.prdType;
},
skinCode() {
return this.$route.query.skinCode;
},
isLesson() {
return this.mode === 'teach' || this.mode === 'manage';
},
isDemon() {
return this.mode === 'demon';
},
isScript() {
return this.mode === 'script';
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
// isDrive() {
// return this.prdType == '04';
// },
// isShowScheduling() {
// return this.prdType == '05';
// }
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
@ -183,19 +162,12 @@ export default {
this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBoxP.style.cursor = '';
},
'$store.state.training.prdType': function(val) {
// this.prdType=val;
this.isDrive = (val == '04');
this.isShowScheduling = (val == '05');
},
'$store.state.socket.permissionOver': function () {
this.$alert('用户权限已被收回', '提示', {
confirmButtonText: '确定',
callback: action => {
this.back();
}
});
},
// '$store.state.training.prdType': function(val) {
// debugger;
// // this.prdType=val;
// this.isDrive = (val == '04');
// this.isShowScheduling = (val == '05');
// },
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
@ -322,8 +294,6 @@ export default {
await this.loadSimulationInfo();
if (this.isDemon) {
await this.initLoadDemonData();
} else if (this.isScript) {
await this.initLoadTaskData();
}
this.checkLoginLineTimer();
this.checkMouseStatusTimer();
@ -344,18 +314,6 @@ export default {
this.endViewLoading();
}
},
//
async initLoadTaskData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.switchMode('01');
if (this.group) {
await this.loadNewMapDataByGroup(this.group);
} else {
this.endViewLoading();
}
},
//
async runQuestLoadShow() {
this.$refs.addQuest.doShow();
@ -389,13 +347,19 @@ export default {
}
}
this.switchMode(prdType);
const res = this.$route.query.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
const res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
if (mapLocation) {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
if (this.drawWay) {
scriptExecuteNew(this.group).then(data=>{
}).catch(error=>{
console.log(error);
});
}
// if (res.data && res.data.mapLocation) {
// const mapLocation={'offsetX': res.data.mapLocation.x, 'offsetY': res.data.mapLocation.y, 'scaleRate': res.data.mapLocation.scale};
// Vue.prototype.$jlmap.setOptions(mapLocation);
@ -435,12 +399,8 @@ export default {
},
// 仿退
async back() {
if (this.isLesson) {
await this.$refs.lessonMenu.back();
} else if (this.isDemon) {
if (this.isDemon) {
await this.$refs.menuDemon.back();
} else if (this.isScript) {
await this.$refs.menuScript.back();
}
},
// 使
@ -491,9 +451,7 @@ export default {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.width;
const height = this.size ? this.size.height : this.height;
this.$store.dispatch('config/resize', { width, height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
}

View File

@ -99,7 +99,7 @@ import Scheduling from './demon/scheduling';
import { mapGetters } from 'vuex';
import { getTrainingStepsDetailNew, getTrainingDetailNew } from '@/api/jmap/training';
import { setGoodsTryUse } from '@/api/management/goods';
import { clearSimulation, loadScript, loadScriptNew, getSimulationInfoNew } from '@/api/simulation';
import { clearSimulation, loadScriptNew, getSimulationInfoNew, scriptExecuteNew } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
@ -481,14 +481,17 @@ export default {
//
async selectQuest(row, id, mapLocation, roleName) {
try {
// const res = await loadScript(row.id, id, this.group);
const res = this.$route.query.drawWay == 'true' ? await loadScriptNew(row.id, id, this.group) : await loadScript(row.id, id, this.group);
const res = await loadScriptNew(row.id, id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
if (mapLocation) {
const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}
scriptExecuteNew(this.group).then(data=>{
}).catch(error=>{
console.log(error);
});
}
if (this.$refs.menuDemon) {
await this.$refs.menuDemon.initLoadPage();
@ -587,11 +590,11 @@ export default {
window.open(routeData.href, '_blank', 'noopener noreferrer');
},
devicemodel() {
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
if (this.deviceShow == false) {
this.deviceShow = true;
} else {
this.deviceShow = false;
}
},
showScheduling() {
this.$refs.scheduling.doShow();

View File

@ -1,5 +1,6 @@
<template>
<div>
<chat-box :group="group" />
<div class="display-card" :style="{top: offset+'px'}">
<el-row>
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
@ -32,6 +33,7 @@
<!-- 单人仿真 -->
<script>
import SetTime from './demon/setTime';
import ChatBox from './chatView/chatBox';
import { Notification } from 'element-ui';
import { getGoodsTryUse } from '@/api/management/goods';
import { ranAsPlan, exitRunPlan, clearSimulation } from '@/api/simulation';
@ -42,7 +44,8 @@ import { quitScript, quitScriptNew } from '@/api/simulation';
export default {
name: 'MenuDemon',
components: {
SetTime
SetTime,
ChatBox
},
props: {
group: {

View File

@ -195,7 +195,10 @@ export default {
let list = [];
nameList.forEach(item => {
if (item !== 'skinVO') {
list = [...list, ...this.$store.state.map.map[item]];
const data = this.$store.state.map.map[item];
if (data && data.constructor === Array) {
list = [...list, ...data];
}
}
});
this.$jlmap.updateShowMode(list, showMode);

View File

@ -147,7 +147,9 @@ export default {
this.mapViewLoaded(true);
},
'$store.state.training.prdType': function (val) {
this.changePrdType(val);
if (val) {
this.changePrdType(val);
}
},
'$store.state.map.showCentralizedStationNum': function (val) {
this.setShowStation(this.$store.state.map.showCentralizedStationCode);
@ -401,7 +403,10 @@ export default {
let list = [];
nameList.forEach(item => {
if (item !== 'skinVO') {
list = [...list, ...this.$store.state.map.map[item]];
const data = this.$store.state.map.map[item];
if (data && data.constructor === Array) {
list = [...list, ...data];
}
}
});
this.$jlmap.updatePrdType(val, nameList);

View File

@ -85,7 +85,8 @@ export default {
'$store.state.socket.simulationRoleList': function (val) {
if (val && val.length) {
this.$nextTick(() => {
debugger;
this.$refs.chatMemberList.setMemberStatus(val);
this.$refs.chatCoversitionList.setCoversitionStatus(val);
});
}
}
@ -196,8 +197,6 @@ export default {
stopRecording() {
const that = this;
this.recorders.stopRecording(function(blobURL) {
const data = URL.createObjectURL(that.recorders.getBlob());
console.log('--------', data);
clearInterval(that.inter);
that.seconds = 0;
const blob = that.recorders.getBlob();
@ -209,7 +208,6 @@ export default {
.catch(error => {
console.log(error);
});
//
if (that.microphone) {
that.microphone.stop();
that.microphone = null;

View File

@ -3,12 +3,12 @@
<div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass">
<div :class="chatContent.self?'rightUser':'leftUser'">
<div class="userHeader">
<div v-if="chatContent.group&& !chatContent.self" class="userName">{{ handle(chatContent) }}</div>
<div v-if="chatContent.group&& !chatContent.self" class="userName">{{ covertName(chatContent.member) }}</div>
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div>
</div>
<div class="userBubble" @click="playAudio('audio'+index)">
<div class="userMessage">
<span v-if="chatContent.group&&!chatContent.member.robot">@{{ chatContent.targetName }}</span>
<span v-if="chatContent.group&&!chatContent.member.robot">@{{ covertName(chatContent.targetName) }}</span>
<span class="el-icon-video-play playicon" />
<span class="messageText">{{ chatContent.message }}</span>
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" />
@ -68,9 +68,7 @@ export default {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : '';
coversition.memberName = coversition.member.name;
coversition.targetName = coversition.targetMember ? coversition.targetMember.name : 'All';
coversition.memberRole = coversition.member.role;
coversition.targetName = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
@ -83,18 +81,27 @@ export default {
formatTime(time) {
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
},
handle(chatContent) {
let data = chatContent.memberRole;
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);
}
});
return data + '-' + chatContent.memberName;
covertName(data) {
if (data != 'All') {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
if (rolename == data.role) {
data.role = element.enLabel;
}
} else {
if (rolename == data.role) {
data.role = element.label;
}
}
});
const deviceName = data.deviceName ? '-' + data.deviceName : '';
const memberName = data.name ? '-' + data.name : '';
return data.role + deviceName + memberName;
} else {
return 'All';
}
},
playAudio(id) {
document.querySelector('#' + id).play();

View File

@ -24,59 +24,78 @@ export default {
};
},
mounted() {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
data.map(coversition=>{
coversition.coverName = this.handleMemberName(coversition);
return coversition;
});
this.coversitionList = data;
if (resp.data && resp.data.length && resp.data.length > 0) {
this.currentCoversition = resp.data[0];
this.$emit('setCurrentCoversition', resp.data[0]);
}
}
});
this.initPage(true);
},
methods:{
initPage(status) {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
if (resp.data) {
const data = resp.data;
data.map(coversition=>{
const objectCover = this.handleMemberName(coversition);
coversition.coverName = objectCover.coversitionName;
coversition.isOnline = objectCover.isOnline;
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]);
}
}
});
},
addCoversition(data) {
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
if (index < 0) {
data.coverName = this.handleMemberName(data);
const objectCover = this.handleMemberName(data);
data.coverName = objectCover.coversitionName;
data.isOnline = objectCover.isOnline;
this.coversitionList.push(data);
this.currentCoversition = data;
}
},
changeCoversition(coversition) {
this.$emit('setHeadTitle', coversition.coverName);
this.$emit('setHeadTitle', !coversition.isOnline ? coversition.coverName + ' (离线)' : coversition.coverName);
this.currentCoversition = {id:coversition.id, group:coversition.group};
this.$emit('setCurrentCoversition', coversition);
// this.$refs.chatContent.reloadData(this.currentCoversition);
},
handleMemberName(conversition) {
if (conversition.group) {
return conversition.name;
return {coversitionName:conversition.name, isOnline:true};
} else {
let coversitionName = '';
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 : '';
coversitionName = data + deviceName + memberName;
}
});
return 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 {
coversitionName = conversition.name;
}
return {coversitionName:coversitionName, isOnline:isOnline};
}
},
setCoversitionStatus(data) {
this.initPage(false);
this.$emit('setHeadTitle', !this.currentCoversition.isOnline ? this.currentCoversition.coverName + ' (离线)' : this.currentCoversition.coverName);
// this.changeCoversition(this.currentCoversition);
}
}
};
@ -109,4 +128,41 @@ export default {
.coversition-active{
background: #e0e0e0;
}
// safariqq360
//
.coversition-list::-webkit-scrollbar {
width: 6px;
height: 6px;
// height: 110px;
background-color: #FFFFFF;
}
/*定义滚动条轨道 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-track {
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
background-color: #FFFFFF;;
}
/*定义滑块 内阴影+圆角*/
.coversition-list::-webkit-scrollbar-thumb {
border-radius: 10px;
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #cacaca;
}
/*滑块效果*/
.coversition-list::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: rgba(0,0,0,0.4);
}
/*IE滚动条颜色*/
html {
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
scrollbar-highlight-color:#000;
scrollbar-3dlight-color:#000;
scrollbar-darkshadow-color:#000;
scrollbar-Shadow-color:#adadad;/*滑块边色*/
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
scrollbar-track-color:#eeeeee;/*背景颜色*/
}
</style>

View File

@ -44,6 +44,18 @@ export default {
});
}
},
setMemberStatus(memberInfo) {
this.getSimulationMembers();
// memberInfo.forEach(member=>{
// if (this.coversitionList) {
// this.coversitionList.forEach(item=>{
// if (item.id == member.id) {
// item.online = member.online;
// }
// });
// }
// });
},
getSimulationMembers() {
getSimulationMembersNew(this.$route.query.group).then(resp => {
let lastData = JSON.stringify(resp.data);

View File

@ -173,7 +173,7 @@
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { addRoutingData, updateRoutingData, gernateRoutingSection } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
// import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/utils/runPlan';
import Sortable from 'sortablejs';
@ -192,16 +192,10 @@ export default {
return null;
}
}
// routeData: {
// type: Object,
// default() {
// return null;
// }
// }
},
data() {
return {
ViewMode: ViewMode,
// ViewMode: ViewMode,
field: '',
allowSelect:false,
isStartSelected:false,
@ -299,12 +293,6 @@ export default {
this.addModel.mapId = val.id;
}
},
// routeData(val, old) {
// debugger;
// if (val) {
// this.addModel = val;
// }
// },
'addModel.parkSectionCodeList':function(val, old) {
this.changeSectionSelected(val, true);
},

View File

@ -220,8 +220,8 @@ export default {
}
},
typeChange(type) { //
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.addModel.automaticRouteCode = '';
this.addModel.cycleCode = '';
this.addModel.concentrateStationList = '';

View File

@ -263,8 +263,8 @@ export default {
},
methods: {
typeChange(type) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.addModel.type = type;
this.editModel.type = type;
},
@ -288,6 +288,7 @@ export default {
this.returnModeGroupList = [];
this.controlSwitchList = [];
this.AxleList = [];
this.SwitchFaultList = [];
indicatorLightList.forEach(item => {
switch (item._type) {
case 'AtsControl':
@ -341,6 +342,9 @@ export default {
case 'Axle':
this.AxleList.push(item);
break;
case 'SwitchFault':
this.SwitchFaultList.push(item);
break;
}
});
},
@ -397,6 +401,9 @@ export default {
case 'Axle':
this.selectLists = this.AxleList;
break;
case 'SwitchFault':
this.selectLists = this.SwitchFaultList;
break;
default :
this.selectLists = this.intersiteControlList;
break;
@ -414,8 +421,8 @@ export default {
this.addModel.switchCode = selected.code;
}
} else if (selected && this.controlLampTypeList.includes(selected._type)) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;
@ -506,7 +513,8 @@ export default {
},
mfNum: this.addModel.mfNum,
pfNum: this.addModel.pfNum,
stationCode: this.addModel.stationCode //
stationCode: this.addModel.stationCode, //
switchCode: this.addModel.switchCode
};
models.push(model);
this.$emit('updateMapModel', models);

View File

@ -227,7 +227,9 @@ export default {
rightAxlePosition: 0,
roadType: null,
firstTurnBack: false,
belongStation: ''
belongStation: '',
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0}
};
},
//

View File

@ -162,7 +162,9 @@ export default {
rightAxlePosition: 0,
roadType: null,
firstTurnBack: false,
belongStation: '' //
belongStation: '', //
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0}
},
oldPoint: [], //
field: '',
@ -545,21 +547,71 @@ export default {
},
{
prop: 'leftAxlePosition',
label: '左侧计轴',
label: '左侧计轴:',
type: 'select',
optionLabel: 'label',
optionValue: 'value',
options: this.axlePositionList,
isHidden: !this.hasAssociatedSection
},
{
prop: 'leftAxleOffset',
label: '左侧计轴偏移:',
type: 'coordinate',
width: '150px',
isHidden: !this.hasAssociatedSection,
children: [
{
prop: 'leftAxleOffset.x',
firstLevel: 'leftAxleOffset',
secondLevel: 'x',
label: 'x:',
type: 'number',
labelWidth: '20px'
},
{
prop: 'leftAxleOffset.y',
firstLevel: 'leftAxleOffset',
secondLevel: 'y',
label: 'y:',
type: 'number',
labelWidth: '20px'
}
]
},
{
prop: 'rightAxlePosition',
label: '右侧计轴',
label: '右侧计轴:',
type: 'select',
optionLabel: 'label',
optionValue: 'value',
options: this.axlePositionList,
isHidden: !this.hasAssociatedSection
},
{
prop: 'rightAxleOffset',
label: '右侧计轴偏移:',
type: 'coordinate',
width: '150px',
isHidden: !this.hasAssociatedSection,
children: [
{
prop: 'rightAxleOffset.x',
firstLevel: 'rightAxleOffset',
secondLevel: 'x',
label: 'x:',
type: 'number',
labelWidth: '20px'
},
{
prop: 'rightAxleOffset.y',
firstLevel: 'rightAxleOffset',
secondLevel: 'y',
label: 'y:',
type: 'number',
labelWidth: '20px'
}
]
}
]
},
@ -1005,30 +1057,17 @@ export default {
edit() {
this.$refs['dataform'].validate(valid => {
if (valid) {
if (
this.editModel.type === '03' &&
this.editModel.leftSectionCode &&
this.editModel.rightSectionCode
) {
if (this.editModel.type === '03' && this.editModel.leftSectionCode && this.editModel.rightSectionCode) {
this.$messageBox('道岔区段应仅有一侧关联区段!');
return;
}
let models = [];
const model = deepAssign(this.editModel, {
_type: 'Section'
}); // model
if (
model.lengthFact > 5 &&
(model.transferTrack ||
model.reentryTrack ||
model.standTrack)
) {
model.leftStopPointOffset = 5;
model.rightStopPointOffset = model.lengthFact - 5;
const model = deepAssign(this.editModel, { _type: 'Section' }); // model
if (model.lengthFact > 5 && (model.transferTrack || model.reentryTrack || model.standTrack)) {
model.leftStopPointOffset = model.leftStopPointOffset || 5;
model.rightStopPointOffset = model.rightStopPointOffset || model.lengthFact - 5;
}
const changeSectionList = this.handleOtherSectionChange(
model
);
const changeSectionList = this.handleOtherSectionChange(model);
models = [model, ...changeSectionList];
this.$emit('updateMapModel', models);
@ -1044,13 +1083,9 @@ export default {
//
const models = [];
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);
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 => {
if (section.parentCode === model.code) {
if (section.parentCode === model.code) { //
const copySection = deepAssign({}, section);
copySection.logicSectionShow = model.logicSectionShow;
// copySection.lengthFact = (Number(model.lengthFact) / model.logicSectionCodeList.length).toFixed(3); //
@ -1061,10 +1096,7 @@ export default {
copySection.points[copySection.points.length - 1] = model.points[model.points.length - 1];
}
models.push(copySection);
} else if (
model.code !== section.code &&
(section.type === '01' || section.type === '03' || section.type === '02')
) {
} else if (model.code !== section.code && (section.type === '01' || section.type === '03' || section.type === '02')) {
const copySection = deepAssign({}, section);
let updataFlag = false;
if (model.leftSectionCode !== this.oldLeftSectionCode) {
@ -1089,24 +1121,19 @@ export default {
updataFlag = true;
}
}
if (model.parentCode == copySection.code) {
if (model.parentCode == copySection.code) { //
let lengthFact = 0;
copySection.logicSectionCodeList.forEach(code => {
if (model.code != code) {
const localSectionModel = this.$store.getters[
'map/getDeviceByCode'
](code);
lengthFact += Number(
localSectionModel.lengthFact
);
const localSectionModel = this.$store.getters['map/getDeviceByCode'](code);
lengthFact += Number(localSectionModel.lengthFact);
}
});
lengthFact += model.lengthFact;
copySection.lengthFact = lengthFact.toFixed(3); //
if (copySection.lengthFact > 5) {
copySection.leftStopPointOffset = 5;
copySection.rightStopPointOffset =
copySection.lengthFact - 5;
copySection.leftStopPointOffset = copySection.leftStopPointOffset || 5;
copySection.rightStopPointOffset = copySection.rightStopPointOffset || copySection.lengthFact - 5;
}
updataFlag = true;
}
@ -1216,6 +1243,7 @@ export default {
);
models = [...models, ...deleteObjAssociatedSection];
_that.$emit('updateMapModel', models);
this.clear();
_that.deviceSelect();
})
.catch(error => {
@ -1282,6 +1310,10 @@ export default {
this.editModel.logicSectionCodeList = [];
this.editModel.rightSectionCode = '';
this.editModel.leftSectionCode = '';
this.editModel.rightAxleOffset = {x:0, y:0};
this.editModel.leftAxleOffset = {x:0, y:0};
this.editModel.leftAxlePosition = 0;
this.editModel.rightAxlePosition = 0;
}
}
};

View File

@ -77,7 +77,7 @@ export default {
methods:{
//
editSectionNum() {
const models = [];
let models = [];
this.addList = [];
const counts = 0;
const sectionPoints = [...this.editModel.points]; //
@ -87,65 +87,15 @@ export default {
lineLength = lengthFact / this.logicNum; //
}
if (sectionPoints.length === 2) {
const triangle = new JTriangle(sectionPoints[0], sectionPoints[1]);
const offset = Math.sqrt(triangle.abspowz) / this.logicNum;
for (let i = 0; i < this.logicNum; i++) {
const points = [
{ x: sectionPoints[0].x + triangle.getCos(offset * i), y: sectionPoints[0].y + triangle.getSin(offset * i) },
{ x: sectionPoints[0].x + triangle.getCos(offset * (i + 1)), y: sectionPoints[0].y + triangle.getSin(offset * (i + 1)) }
];
const param = this.addLogicalSection(this.editModel, points, counts + i, lineLength, this.logicNum);
models.push(param);
this.addList.push(param);
}
models = this.createLogicalSections(sectionPoints, counts, lineLength);
} else {
const triangleList = [];
const pointLength = [0];
let totalLength = 0;
for (let i = 1; i < sectionPoints.length; i++) {
const triangle = new JTriangle(sectionPoints[i - 1], sectionPoints[i]);
triangleList.push(triangle);
totalLength += Math.floor(Math.sqrt(triangle.abspowz));
pointLength.push(totalLength);
}
const offset = this.logicNum ? Math.floor(totalLength / this.logicNum) : 0;
let startPoint = sectionPoints[0];
let startIndex = 1;
for (let i = 0; i < this.logicNum; i++) {
const rectLength = (i + 1) * offset;
let flag = true;
for (let index = 0; index < pointLength.length; index++) {
if (rectLength <= pointLength[index] && flag) {
const points = [{x: startPoint.x, y: startPoint.y}];
let surplusLength = rectLength - pointLength[index - 1];
if (startIndex === index) {
surplusLength = offset;
}
for (let j = startIndex; j <= index; j++) {
if (i === this.logicNum - 1 && j === index) {
points.push(sectionPoints[sectionPoints.length - 1]);
} else if (j === index) {
points.push({x: points[points.length - 1].x + triangleList[index - 1].getCos(surplusLength),
y: points[points.length - 1].y + triangleList[index - 1].getSin(surplusLength)});
} else if (index - startIndex > 1) {
points.push(sectionPoints[j]);
}
}
startIndex = index;
const param = this.addLogicalSection(this.editModel, points, counts + i, lineLength, this.logicNum);
startPoint = {x:points[points.length - 1].x, y:points[points.length - 1].y };
models.push(param);
this.addList.push(param);
flag = false;
}
}
}
models = this.createLogicalMoerScetion(sectionPoints, counts, lineLength);
}
let logicSectionCodeList = [];
models.forEach(item=> {
logicSectionCodeList.push(item.code);
});
this.editModel.logicSectionCodeList.forEach( logicCode => {
this.editModel.logicSectionCodeList.forEach(logicCode => {
const section = this.$store.getters['map/getDeviceByCode'](logicCode);
models.push(deepAssign(section, {_dispose: true}));
});
@ -157,25 +107,70 @@ export default {
models.push(model);
this.$emit('updateMapModel', models);
},
handleDelete(index, row) {
row.num = 0;
},
//
createLogicalSections(num, beg, end, model, counts, lineLength, totalNum) {
// 2线
createLogicalSections(sectionPoints, counts, lineLength) {
const models = [];
const triangle = new JTriangle(beg, end);
const offset = Math.sqrt(triangle.abspowz) / num;
for (let i = 0; i < num; i++) {
const triangle = new JTriangle(sectionPoints[0], sectionPoints[1]);
const offset = Math.sqrt(triangle.abspowz) / this.logicNum;
for (let i = 0; i < this.logicNum; i++) {
const points = [
{ x: beg.x + triangle.getCos(offset * i), y: beg.y + triangle.getSin(offset * i) },
{ x: beg.x + triangle.getCos(offset * (i + 1)), y: beg.y + triangle.getSin(offset * (i + 1)) }
{ x: sectionPoints[0].x + triangle.getCos(offset * i), y: sectionPoints[0].y + triangle.getSin(offset * i) },
{ x: sectionPoints[0].x + triangle.getCos(offset * (i + 1)), y: sectionPoints[0].y + triangle.getSin(offset * (i + 1)) }
];
const param = this.addLogicalSection(model, points, counts + i, lineLength, totalNum);
const param = this.addLogicalSection(this.editModel, points, counts + i, lineLength, this.logicNum);
models.push(param);
this.addList.push(param);
}
return models;
},
// 线
createLogicalMoerScetion(sectionPoints, counts, lineLength) {
const models = [];
const triangleList = [];
let totalLength = 0; // 线
const pointLength = [0];
for (let i = 1; i < sectionPoints.length; i++) {
const triangle = new JTriangle(sectionPoints[i - 1], sectionPoints[i]);
triangleList.push(triangle);
totalLength += Math.floor(Math.sqrt(triangle.abspowz));
pointLength.push(totalLength);
}
const offset = this.logicNum ? Math.floor(totalLength / this.logicNum) : 0; //
let startPoint = sectionPoints[0];
let startIndex = 1;
for (let i = 0; i < this.logicNum; i++) {
const rectLength = (i + 1) * offset;
const points = [{x: startPoint.x, y: startPoint.y}];
let flag = true;
for (let index = 0; index < pointLength.length; index++) {
if (rectLength <= pointLength[index] && flag) {
let surplusLength = offset;
if (index - startIndex >= 1) {
surplusLength = rectLength - pointLength[index - 1];
}
for (let j = startIndex; j <= index; j++) {
if (i == this.logicNum - 1) {
points.push(sectionPoints[sectionPoints.length - 1]); //
} else if (j == index) {
points.push({x: points[points.length - 1].x + triangleList[index - 1].getCos(surplusLength),
y: points[points.length - 1].y + triangleList[index - 1].getSin(surplusLength)});
} else if (index - startIndex >= 1) {
points.push(sectionPoints[j]);
}
}
startIndex = index;
if (points.length > 1) {
const param = this.addLogicalSection(this.editModel, points, counts + i, lineLength, this.logicNum);
models.push(param);
this.addList.push(param);
startPoint = {x: points[points.length - 1].x, y: points[points.length - 1].y }; //
flag = false;
}
}
}
}
return models;
},
//
addLogicalSection(model, points, index, lineLength, totalNum) {
const data = {

View File

@ -207,7 +207,11 @@ export default {
relevanceSectionList: [],
roadType: selected.roadType,
firstTurnBack: false,
belongStation: ''
belongStation: '',
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0},
leftAxlePosition: 0,
rightAxlePosition: 0,
};
models.push(model);
}
@ -286,7 +290,11 @@ export default {
relevanceSectionList: [],
roadType: null,
firstTurnBack: false,
belongStation: ''
belongStation: '',
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0},
leftAxlePosition: 0,
rightAxlePosition: 0,
};
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true }));
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true }));

View File

@ -201,7 +201,8 @@ export default {
guideShow: false,
stationCode: this.addModel.stationCode,
callOn: true,
turnBack: false
turnBack: false,
ctc: true
};
this.sectionList.forEach(elem => {

View File

@ -17,61 +17,78 @@
<create-signal ref="createSignal" :field="field" @signalSectionCode="signalSectionCode" @updateMapModel="updateMapModel" />
</el-tab-pane>
<el-tab-pane class="view-control" label="批量操作" name="three" :lazy="lazy">
<el-form ref="mark" label-width="130px" :model="addModel" size="mini">
<el-form-item label="左右偏移值" prop="number">
<el-input v-model="addModel.number" style="width: 178px;" />
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="editAll">构建信号机偏移量</el-button>
<el-button type="" style="margin: 0;" size="small" @click="questionList = []">{{ $t('map.clearHint') }}</el-button>
</div>
<hr style="width: 100%">
<el-form ref="signalType" label-width="130px" :model="typeModel" size="mini" style="margin-top: 40px">
<el-form-item label="信号机类型:" prop="type">
<el-select v-model="typeModel.type" placeholder="请选择">
<el-option
v-for="item in signalTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setAllSignalType">设置全部信号机类型</el-button>
</div>
<hr style="width: 100%">
<el-form ref="signalCiStation" label-width="130px" :model="ciModel" size="mini" style="margin-top: 40px;">
<el-form-item label="信号机范围:">
<el-select v-model="ciModel.stationList" multiple placeholder="请选择">
<el-option
v-for="item in centralizedStationList"
:key="item.code"
:label="item.name+'下信号机'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="归属连锁站:">
<el-select v-model="ciModel.ciStation" placeholder="请选择">
<el-option
v-for="item in ciStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setCiStationSignal">设置归属联锁站</el-button>
</div>
<hr style="width: 100%">
<div class="flex_box" style="margin-top: 20px">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setSignalCallOn">批量设置引导信号</el-button>
</div>
<el-collapse v-model="collapseActive" accordion style="margin-left: 20px">
<el-collapse-item title="构建信号机偏移量" name="1">
<el-form ref="mark" label-width="130px" :model="addModel" size="mini">
<el-form-item label="左右偏移值" prop="number">
<el-input v-model="addModel.number" style="width: 178px;" />
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="editAll">设置</el-button>
<el-button type="" style="margin: 0;" size="small" @click="questionList = []">{{ $t('map.clearHint') }}</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置信号机类型" name="2">
<el-form ref="signalType" label-width="130px" :model="typeModel" size="mini" style="margin-top: 40px">
<el-form-item label="信号机类型:" prop="type">
<el-select v-model="typeModel.type" placeholder="请选择">
<el-option
v-for="item in signalTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setAllSignalType">设置</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置信号机归属联锁站" name="3">
<el-form ref="signalCiStation" label-width="130px" :model="ciModel" size="mini" style="margin-top: 40px;">
<el-form-item label="信号机范围:">
<el-select v-model="ciModel.stationList" multiple placeholder="请选择">
<el-option
v-for="item in centralizedStationList"
:key="item.code"
:label="item.name+'下信号机'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="归属连锁站:">
<el-select v-model="ciModel.ciStation" placeholder="请选择">
<el-option
v-for="item in ciStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setCiStationSignal">设置</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置引导信号" name="4">
<div class="flex_box" style="margin-top: 20px">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setSignalCallOn">设置</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置灭灯显示(CTC级)" name="5">
<el-form ref="ctcForm" label-width="160px" :model="ctcModel" size="mini">
<el-form-item label="是否灭灯显示(CTC级):" prop="number">
<el-checkbox v-model="ctcModel.ctc" />
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setCtcShow">设置</el-button>
</div>
</el-collapse-item>
</el-collapse>
<div style="height: calc(100% - 90px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-card v-if="questionList.length" class="box-card">
@ -106,6 +123,7 @@ export default {
data() {
return {
activeName: 'first',
collapseActive: '',
lazy: true,
SignalDirectionList: [
{ code: false, name: '向左' },
@ -153,7 +171,8 @@ export default {
guidePosition: { x: 0, y: 0 },
interlockStationCode: '',
callOn: true,
turnBack: false
turnBack: false,
ctc: true //
},
addModel: {
number: 2
@ -164,6 +183,9 @@ export default {
ciModel: {
stationList: [],
ciStation: []
},
ctcModel: {
ctc: true
}
};
},
@ -245,7 +267,8 @@ export default {
{ prop: 'guidePosition.y', firstLevel: 'guidePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'callOn', label: '是否引导信号:', type: 'checkbox'},
{ prop: 'turnBack', label: '是否折返进路始端:', type: 'checkbox', isHidden: this.editModel.virtual}
{ prop: 'turnBack', label: '是否折返进路始端:', type: 'checkbox', isHidden: this.editModel.virtual},
{ prop: 'ctc', label: '是否灭灯显示(CTC级)', type: 'checkbox'}
]
},
map: {
@ -421,10 +444,8 @@ export default {
},
virtualChange(val) {
if (val) {
this.editModel.callOn = false;
this.editModel.turnBack = false;
} else {
this.editModel.callOn = true;
this.editModel.turnBack = false;
}
},
@ -462,6 +483,16 @@ export default {
this.$emit('updateMapModel', models);
this.$message.success('数据构建成功!');
},
setCtcShow() {
const models = [];
this.signalList.forEach(item => {
const signalModel = deepAssign({}, item); //
signalModel.ctc = this.ctcModel.ctc;
models.push(signalModel);
});
this.$emit('updateMapModel', models);
this.$message.success('数据构建成功!');
},
//
findSection(signal) {
// 01 02

View File

@ -139,9 +139,9 @@ export default {
this.$message.success(this.$t('publish.deleteSuccess'));
this.reloadTable();
localStore.remove('mapId');
}).catch(() => {
}).catch((error) => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
this.$messageBox(this.$t('error.deleteFailed') + ':' + error.message);
});
}).catch(() => { });
},

View File

@ -66,6 +66,12 @@ export default {
}
};
},
computed:{
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
},
watch: {
'$store.state.scriptRecord.bgSet': function (val) {
this.backDisabled = val;
@ -103,7 +109,7 @@ export default {
}
},
pauseScript() {
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
simulationPause(this.group).then(resp => {
this.$store.dispatch('scriptRecord/updateSimulationPause', true);
}).catch(() => {
@ -119,7 +125,7 @@ export default {
},
executePlayScript() {
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
executeScriptNew(this.group).then(resp => {
this.$store.dispatch('scriptRecord/updateSimulationPause', false);
}).catch(() => {
@ -138,7 +144,7 @@ export default {
const data = Vue.prototype.$jlmap.$options;
const group = this.$route.query.group;
const dataZoom = {scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
saveScriptScenesNew(this.group).then(resp => {
updateMapLocationNew(group, dataZoom).then(response=>{
this.$store.dispatch('scriptRecord/updateBgSet', true);
@ -165,8 +171,7 @@ export default {
},
saveScenesData() {
this.isSavingScript = true;
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
saveScriptDataNew(this.group).then(resp => {
this.$message.success(this.$t('scriptRecord.saveDataSucess'));
this.isSavingScript = false;
@ -204,7 +209,7 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
dumpScriptDataNew(group).then(resp => {
this.$parent.$refs['display'].$refs['menuScript'].resetBeginTime();
this.$refs['getAction'].loadInitData();

View File

@ -30,7 +30,7 @@
</el-form-item>
</el-form>
</el-card>
<el-card v-if="this.$route.query.drawWay != 'true'" class="commandCard">
<el-card v-if="!drawWay" class="commandCard">
<div class="addCommand">{{ $t('scriptRecord.addCommand') }}</div>
<el-form ref="commandData" size="mini" :model="commandData" :rules="commandRules" label-width="120px" class="actionInfo" label-position="right">
<el-form-item :label="$t('scriptRecord.executor')" class="conditionVO" prop="action.memberId">
@ -181,6 +181,12 @@ export default {
}
};
},
computed:{
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
},
watch:{
'$store.state.map.mapViewLoadedCount': function (val) {
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
@ -191,7 +197,7 @@ export default {
this.isPause = !(this.$store.state.scriptRecord.simulationPause);
this.$parent.$parent.$parent.setIsParse(this.isPause);
this.$refs['modalData'].clearValidate();
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
this.$refs['commandDataNew'].clearValidate();
if (!val) {
this.initActionData();
@ -224,10 +230,11 @@ export default {
initData() {
this.buttonName = this.$t('scriptRecord.addConversitionButton');
this.operateType = 'add';
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
getScriptPlayMemberNew(this.group).then(resp => {
this.orginMemberList = resp.data;
this.memberList = resp.data;
const lastData = JSON.stringify(resp.data);
this.memberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
this.resetDisabled();
this.initCommandActionData();
}).catch(error => {
@ -235,22 +242,9 @@ export default {
});
} else {
getScriptPlayMember(this.group).then(resp => {
const roleTypeList = ConstConfig.ConstSelect.roleType;
this.orginMemberList = resp.data;
let lastData = JSON.stringify(resp.data);
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.forEach(each=>{
each.name = each.role + (each.name == undefined ? '' : each.name);
});
this.memberList = lastData;
const lastData = JSON.stringify(resp.data);
this.memberList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
this.resetDisabled();
this.initCommandActionData();
}).catch(error => {
@ -259,6 +253,24 @@ export default {
}
},
covert(data, roleTypeList) {
let lastData = data;
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.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.name = each.role + deviceName + name;
});
return lastData;
},
hover(field) {
if (this.field == '') {
if (this.isFirstTips) {
@ -385,7 +397,7 @@ export default {
const data = this.modalData.actionVO;
this.modifying = true;
if (this.operateType == 'add') {
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
addScriptActionNew(group, data).then(response=>{
this.modifying = false;
this.$message.success(this.$t('scriptRecord.addConversitionSuccess'));
@ -512,7 +524,7 @@ export default {
}
},
resetData() {
if (this.$route.query.drawWay != 'true') {
if (!this.drawWay) {
this.$refs.command.resetData();
}
}

View File

@ -30,6 +30,12 @@ export default {
sexGroup: this.$t('scriptRecord.roleSexMale')
};
},
computed:{
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
},
watch: {
'$store.state.socket.simulationStart': function (val) {
if (val) {
@ -43,12 +49,13 @@ export default {
methods: {
initData() {
const group = this.$props.group;
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
getScriptMemberDataNew(group).then(response=>{
let lastData = JSON.stringify(response.data);
lastData = lastData.replace(new RegExp('id', 'g'), 'key');
lastData = JSON.parse(lastData);
this.allRoleData = lastData;
const lastData = JSON.stringify(response.data);
this.allRoleData = this.coverData(lastData, ConstConfig.ConstSelect.roleTypeNew);
// lastData = lastData.replace(new RegExp('id', 'g'), 'key');
// lastData = JSON.parse(lastData);
// this.allRoleData = lastData;
getScriptPlayMemberNew(group).then(response=>{
const last = response.data;
// let userdata=JSON.stringify(response.data)
@ -63,7 +70,7 @@ export default {
} else {
getScriptMemberData(group).then(response=>{
const lastData = JSON.stringify(response.data);
this.allRoleData = this.coverData(lastData);
this.allRoleData = this.coverData(lastData, ConstConfig.ConstSelect.roleType);
getScriptPlayMember(group).then(response=>{
const last = response.data;
// let userdata=JSON.stringify(response.data)
@ -77,8 +84,7 @@ export default {
}
},
coverData(data) {
const roleTypeList = ConstConfig.ConstSelect.roleType;
coverData(data, roleTypeList) {
let lastData = data.replace(new RegExp('id', 'g'), 'key');
roleTypeList.forEach(function(element) {
const rolename = element.value;
@ -91,7 +97,9 @@ export default {
});
lastData = JSON.parse(lastData);
lastData.forEach(each=>{
each.name = each.role + (each.name == undefined ? '' : each.name);
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.name = each.role + deviceName + name;
});
return lastData;
},
@ -100,7 +108,7 @@ export default {
case 'right': {
const group = this.$props.group;
const data = movedKeys;
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
selectScriptMembersNew(group, data).then(response=>{
this.$message.success(this.$t('scriptRecord.selectScriptActorSuccess'));
this.$emit('refresh');
@ -123,7 +131,7 @@ export default {
case 'left': {
const group = this.$props.group;
const data = movedKeys;
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
cancleScriptMembersNew(group, data).then(response=>{
this.$emit('refresh');
this.$message.success(this.$t('scriptRecord.cancleScriptActorSuccess'));
@ -149,10 +157,9 @@ export default {
const data = {'gender': event};
modifyScriptMemberSex(group, id, data).then(response=>{
this.$message.success(this.$t('scriptRecord.modifyScriptActorSexSuccess'));
})
.catch(error => {
this.$messageBox(`${this.$t('scriptRecord.modifyScriptActorSexFail')}: ${error.message}`);
});
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.modifyScriptActorSexFail')}: ${error.message}`);
});
}
}
};

View File

@ -62,6 +62,12 @@ export default {
signalName:''
};
},
computed:{
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
},
watch: {
'$store.state.menuOperation.selectedCount':function(em) {
const device = this.$store.state.menuOperation.selected;
@ -77,7 +83,7 @@ export default {
getDeviceCode() {
const params = {deviceType:'StationStand'};
const group = this.$route.query.group;
if (this.$route.query.drawWay != 'true') {
if (!this.drawWay) {
getDeviceCodeByDeviceType(group, params).then(response =>{
let resultData = response.data;
resultData = JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g, 'name'));

View File

@ -20,7 +20,7 @@
</span>
</div>
<div class="btnGroup">
<el-button v-if="actionInfo.visible" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible && !drawWay" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div>
</el-card>
@ -29,6 +29,7 @@
</el-scrollbar>
</template>
<script>
import Cookies from 'js-cookie';
import {deleteScriptAction, getAvailableDeviceCommand, getScriptRecord, getScriptAllAction, getScriptPlayMemberNew } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import CommandHandler from '@/scripts/cmdPlugin/CommandHandler';
@ -49,12 +50,18 @@ export default {
return {
actionInfoList: [],
deviceCommandList: [],
reverse: true,
reverse: false,
loading: true,
// behaviorName:"",
memberName: ''
};
},
computed:{
drawWay() {
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
},
watch: {
actionInfoList: function(val) {
this.$nextTick(function() {
@ -70,7 +77,7 @@ export default {
loadInitData() {
// const group=this.$route.query.group;
const data = {role: 'Driver'};
if (this.$route.query.drawWay != 'true') {
if (!this.drawWay) {
getAvailableDeviceCommand(data).then(response=>{
this.deviceCommandList = response.data;
this.loadOtherData(this.$route.query);
@ -79,11 +86,30 @@ export default {
this.loadOtherData(this.$route.query);
}
},
covert(data, roleTypeList) {
let lastData = data;
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.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.name = each.role + deviceName + name;
});
return lastData;
},
loadOtherData(obj) {
const group = obj.group;
if (this.$route.query.drawWay == 'true') {
if (this.drawWay) {
getScriptPlayMemberNew(this.group).then(response => {
const memberVOList = response.data;
const lastData = JSON.stringify(response.data);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
getScriptAllAction(group).then(resp=>{
this.actionInfoList = [];
const actionList = resp.data;
@ -122,14 +148,16 @@ export default {
getScriptRecord(group).then(response=>{
this.$store.dispatch('scriptRecord/updateBgSet', response.data.bgSet);
this.actionInfoList = [];
const roleTypeList = ConstConfig.ConstSelect.roleType;
// const roleTypeList = ConstConfig.ConstSelect.roleType;
// let memberVOList = JSON.stringify(response.data.memberVOList);
// roleTypeList.forEach(function(element) {
// const rolename = element.value;
// memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
// });
// memberVOList = JSON.parse(memberVOList);
const lastData = JSON.stringify(response.data);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
let memberVOList = JSON.stringify(response.data.memberVOList);
roleTypeList.forEach(function(element) {
const rolename = element.value;
memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
});
memberVOList = JSON.parse(memberVOList);
const actionList = response.data.actionVOList;
actionList.forEach(element => {
@ -174,7 +202,7 @@ export default {
},
deleteAction(row) {
const group = this.$props.group;
if (this.$route.query.drawWay != 'true') {
if (!this.drawWay) {
deleteScriptAction(group, row).then(resp => {
this.reloadTable();
this.$message.success('删除行为动作成功');
@ -187,7 +215,7 @@ export default {
this.loadInitData();
},
modifyAction(row) {
if (this.$route.query.drawWay != 'true') {
if (!this.drawWay) {
this.$emit('setAction', row);
}
}

View File

@ -1,9 +1,9 @@
<template>
<div class="joylink-card">
<div style="margin-top: 20px;width: 90%; position: absolute; left: 5%;">
<div style="margin-top: 20px;width: 90%; position: absolute; left: 5%; height: 100%;">
<el-row>
<el-col :span="20">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" size="mini" style="width: 100%;margin-top: 10px;">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" size="mini" style="width: 100%;margin-top: 10px;">
<el-row>
<el-col :span="6">
<el-form-item label="班级:" prop="classId">
@ -23,7 +23,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="始日期:" prop="termBeginDate">
<el-form-item label="学期起始日期:" prop="termBeginDate">
<el-date-picker
v-model="form.termBeginDate"
type="date"
@ -33,7 +33,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结束日期:" prop="termEndDate">
<el-form-item label="学期结束日期:" prop="termEndDate">
<el-date-picker
v-model="form.termEndDate"
type="date"
@ -45,11 +45,11 @@
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="产品类型:"><span>行调</span></el-form-item>
<el-form-item label="教学类型:"><span>行调</span></el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="课程:" prop="centerLessonId">
<el-select v-model="form.centerLessonId" placeholder="请选择" @change="centerLessonChange">
<el-select v-model="form.centerLessonId" clearable placeholder="请选择" @change="centerLessonChange">
<el-option
v-for="item in centerLessonList"
:key="item.id"
@ -61,7 +61,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="试卷:" prop="centerExamPaperId">
<el-select v-model="form.centerExamPaperId" placeholder="请选择">
<el-select v-model="form.centerExamPaperId" clearable placeholder="请选择">
<el-option
v-for="item in centerExamPaperList"
:key="item.id"
@ -74,11 +74,11 @@
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="产品类型:"><span>现地</span></el-form-item>
<el-form-item label="教学类型:"><span>现地</span></el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="课程:" prop="localLessonId">
<el-select v-model="form.localLessonId" placeholder="请选择" @change="localLessonChange">
<el-select v-model="form.localLessonId" clearable placeholder="请选择" @change="localLessonChange">
<el-option
v-for="item in localLessonList"
:key="item.id"
@ -90,7 +90,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="试卷:" prop="localExamPaperId">
<el-select v-model="form.localExamPaperId" placeholder="请选择">
<el-select v-model="form.localExamPaperId" clearable placeholder="请选择">
<el-option
v-for="item in localExamPaperList"
:key="item.id"
@ -118,30 +118,34 @@
</el-button>
<el-button type="primary" size="mini" style="margin-top: 10px;" @click="exportResults">成绩导出</el-button></el-col>
</el-row>
<el-table
:data="tableData"
border
>
<el-table-column prop="index" label="序号" />
<el-table-column
prop="studentID"
label="学号"
/>
<el-table-column
prop="name"
label="姓名"
/>
<el-table-column label="考勤(10分)" prop="attendance" width="180" />
<el-table-column label="技能操作(30分)">
<el-table-column v-if="showLocal" :label="'ATS现地('+ lessonSocre +'分)'" prop="localLessonPassRate" />
<el-table-column v-if="showCenter" :label="'ATS行调('+ lessonSocre+'分)'" prop="centerLessonPassRate" />
</el-table-column>
<el-table-column label="考试成绩(60分)">
<el-table-column v-if="showLocal" :label="'ATS现地('+ examSocre+'分)'" prop="localExamSocreRadio" />
<el-table-column v-if="showCenter" :label="'ATS行调('+ examSocre+'分)'" prop="centerExamSocreRadio" />
</el-table-column>
<el-table-column label="期末成绩(100分)" prop="totolScore" />
</el-table>
<div style="height: calc(100% - 270px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-table
:data="tableData"
border
>
<el-table-column prop="index" label="序号" />
<el-table-column
prop="studentID"
label="学号"
/>
<el-table-column
prop="name"
label="姓名"
/>
<el-table-column label="考勤(10分)" prop="attendance" width="180" />
<el-table-column label="技能操作(30分)">
<el-table-column v-if="showLocal" :label="'ATS现地('+ lessonSocre +'分)'" prop="localLessonPassRate" />
<el-table-column v-if="showCenter" :label="'ATS行调('+ lessonSocre+'分)'" prop="centerLessonPassRate" />
</el-table-column>
<el-table-column label="考试成绩(60分)">
<el-table-column v-if="showLocal" :label="'ATS现地('+ examSocre+'分)'" prop="localExamSocreRadio" />
<el-table-column v-if="showCenter" :label="'ATS行调('+ examSocre+'分)'" prop="centerExamSocreRadio" />
</el-table-column>
<el-table-column label="期末成绩(100分)" prop="totolScore" />
</el-table>
</el-scrollbar>
</div>
</div>
</div>
</template>
@ -162,6 +166,28 @@ export default {
components: {
},
data() {
var validatePass = (rule, value, callback) => {
if (this.form.attendanceDays && this.form.termBeginDate && this.form.termEndDate) {
const timeDifference = new Date(this.form.termEndDate).valueOf() - new Date(this.form.termBeginDate).valueOf();
if (timeDifference < (this.form.attendanceDays - 1) * 24 * 3600 * 1000) {
callback(new Error('学期日期间隔不得小于考勤天数!'));
} else {
this.$refs.form.clearValidate('attendanceDays');
this.$refs.form.clearValidate('termBeginDate');
this.$refs.form.clearValidate('termEndDate');
callback();
}
} else {
callback();
}
};
var validatePrdParam = (rule, value, callback) => {
if ((this.form.localLessonId && this.form.localExamPaperId) || (this.form.centerLessonId && this.form.centerExamPaperId)) {
callback();
} else {
callback(new Error('至少选择一类课程试卷!'));
}
};
return {
loading: false,
classList: [],
@ -196,9 +222,16 @@ export default {
],
rules: {
classId: [{ required: true, message: '请选择班级', trigger: 'change' }],
attendanceDays: [{required: true, message: '请输入考勤天数', trigger: 'blur'}],
termBeginDate: [{required: true, message: '请选择开始日期', trigger: 'change'}],
termEndDate: [{required: true, message: '请选择结束日期', trigger: 'change'}]
attendanceDays: [
{required: true, message: '请输入考勤天数', trigger: 'blur'},
{required: true, message: '请输入考勤天数', trigger: 'change'},
{validator: validatePass, trigger: 'blur' },
{validator: validatePass, trigger: 'change'}
],
termBeginDate: [{required: true, message: '请选择开始日期', trigger: 'change'}, {validator: validatePass, trigger: 'change' }],
termEndDate: [{required: true, message: '请选择结束日期', trigger: 'change'}, {validator: validatePass, trigger: 'change' }],
localExamPaperId: [{validator: validatePrdParam, trigger: 'change'}],
centerExamPaperId: [{validator: validatePrdParam, trigger: 'change'}]
},
pagerConfig: {
pageSize: 'pageSize',
@ -241,6 +274,7 @@ export default {
}
},
mounted() {
this.classList = [];
getProjectClassList(ProjectCode[this.project]).then(resp => {
this.classList = resp.data;
}).catch(() =>{
@ -299,14 +333,14 @@ export default {
this.showLocal = true;
localExamSocreRadio = elem.examSocreRadio * 100 * 60 / 100 / item.scores.length;
localLessonPassRate = elem.lessonPassRate * 100 * 30 / 100 / item.scores.length;
totolScore += localExamSocreRadio;
totolScore += localLessonPassRate;
totolScore += localExamSocreRadio * 100;
totolScore += localLessonPassRate * 100;
} else if (elem.prdType === '02') {
this.showCenter = true;
centerExamSocreRadio = elem.examSocreRadio * 100 * 60 / 100 / item.scores.length;
centerLessonPassRate = elem.lessonPassRate * 100 * 30 / 100 / item.scores.length;
totolScore += centerExamSocreRadio;
totolScore += centerLessonPassRate;
totolScore += centerExamSocreRadio * 100;
totolScore += centerLessonPassRate * 100;
}
});
totolScore += item.attendance * 100 * 10 / 100;
@ -320,7 +354,7 @@ export default {
localLessonPassRate: localLessonPassRate,
centerExamSocreRadio: centerExamSocreRadio,
centerLessonPassRate: centerLessonPassRate,
totolScore: totolScore
totolScore: totolScore / 100
});
});
}).catch(() =>{
@ -335,6 +369,7 @@ export default {
},
localLessonChange(lessonId) {
this.localExamPaperList = [];
this.form.localExamPaperId = '';
if (lessonId) {
getExamList({lessonId:lessonId, pageSize:999, pageNum:1}).then(resp => {
this.localExamPaperList = resp.data.list;
@ -345,6 +380,7 @@ export default {
},
centerLessonChange(lessonId) {
this.centerExamPaperList = [];
this.form.centerExamPaperId = '';
if (lessonId) {
getExamList({lessonId:lessonId, pageSize:999, pageNum:1}).then(resp => {
this.centerExamPaperList = resp.data.list;
@ -354,13 +390,20 @@ export default {
}
},
getLessonByClassId(classId) {
this.lessonList = [];
this.localLessonList = [];
this.centerLessonList = [];
this.form.localLessonId = '';
this.form.centerLessonId = '';
this.localExamPaperList = [];
this.form.localExamPaperId = '';
this.centerExamPaperList = [];
this.form.centerExamPaperId = '';
if (classId) {
getLessonByClassId(classId).then(resp => {
this.lessonList = resp.data;
this.lessonList.forEach(item => {
if (item.prdType === '01') {
this.localExamPaperList.push(item);
this.localLessonList.push(item);
} else if (item.prdType === '02') {
this.centerLessonList.push(item);
}
@ -404,9 +447,9 @@ export default {
studentData.students = students;
}
importStudentResults(ProjectCode[that.project], studentData).then(resp => {
that.$message.success('学生成绩导入成功!');
that.$message.success('学生信息导入成功!');
}).catch(error => {
that.$message.error('学生成绩导入失败!');
that.$message.error('学生信息导入失败!');
});
} catch (error) {
that.$message.warning(`解析成绩单失败:${error}`);

View File

@ -38,6 +38,7 @@
<div class="record_tip_cancle" @click="cancleRecording()">取消</div>
</div>
</div>
<audio ref="audio" />
<div class="chat__footer">
<div class="chat_tool">
<div class="microphoneBtn" @click="startRecording()">
@ -53,7 +54,7 @@
<script>
// import HZRecorder from '@/utils/HZRecorder';
import RecordRTC from 'recordrtc';
import { chatWithText, chatWithAudio } from '@/api/chat';
import { chatWithText, chatWithAudio, chatWithAudioNew } from '@/api/chat';
import { chatWithTextNew } from '@/api/jointTraining';
export default {
@ -81,7 +82,8 @@ export default {
recorders: null,
sending: false,
disabled:true,
microphone:null
microphone:null,
baseUrl:process.env.VUE_APP_VOICE_API
};
},
computed: {
@ -95,7 +97,8 @@ export default {
return this.$store.state.user ? this.$store.state.user.id : '';
},
drawWay() {
return this.$route.query.drawWay + '';
const drawWay = this.$route.query.drawWay;
return drawWay && JSON.parse(drawWay);
}
},
watch: {
@ -119,7 +122,7 @@ export default {
async handleSendText() {
try {
if (this.text.trim()) {
if (this.drawWay === 'true') {
if (this.drawWay) {
await chatWithTextNew(this.text, this.group);
} else {
await chatWithText(this.text, this.group);
@ -150,13 +153,17 @@ export default {
startRecording() {
const that = this;
if (!this.recordSending && !this.recorders && !this.microphone) {
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
navigator.getUserMedia(
{ audio: true } //
, function (stream) {
that.microphone = stream;
that.recorders = new RecordRTC(that.microphone, {
type: 'audio',
checkForInactiveTracks: true
recorderType: StereoAudioRecorder,
numberOfAudioChannels: 1,
bitsPerSecond:256000,
desiredSampRate: 16000
});
that.recorders.startRecording();
that.recordSending = true;
@ -203,63 +210,33 @@ export default {
}
}
);
// HZRecorder.init.get(rec => {
// if (typeof rec == 'object') {
// this.recorders = rec;
// this.recorders.start();
// this.recordSending = true;
// }
// });
}
},
//
stopRecording() {
const that = this;
this.recorders.stopRecording(function(blobURL) {
const data = URL.createObjectURL(that.recorders.getBlob());
console.log('--------', data);
clearInterval(that.inter);
that.seconds = 0;
const blob = that.recorders.getBlob();
const fd = new FormData();
fd.append('file', blob);
chatWithAudio(fd, that.$route.query.group).then((res)=>{
this.recordSending = false;
that.$message({
showClose: true,
message: '语音发送成功',
type: 'success'
});
}).catch(error => {
// this.sending = false;
that.recordSending = false;
const message = JSON.parse(error.message);
if (message.err_no == 3301) {
that.$message({
showClose: true,
message: '音频质量有问题',
type: 'error'
if (that.drawWay) {
chatWithAudioNew(fd, that.group)
.then((data) => {
})
.catch(error => {
console.log(error);
});
} else if (message.err_no == 3308) {
that.$message({
showClose: true,
message: '音频过长,建议60s以下',
type: 'error'
} else {
chatWithAudio(fd, that.group)
.then((data) => {
})
.catch(error => {
console.log(error);
});
} else if (message.err_no == 3314) {
that.$message({
showClose: true,
message: '音频太短,建议重录',
type: 'error'
});
} else {
that.$message({
showClose: true,
message: '网络问题,请重试',
type: 'error'
});
}
});
}
if (that.microphone) {
that.microphone.stop();
that.microphone = null;
@ -267,57 +244,6 @@ export default {
that.recorders = null;
}
});
// this.sending = true;
// if (this.recorders) {
// this.recorders.stop();
// var fd = new FormData();
// fd.append('file', this.recorders.getBlob());
// chatWithAudio(fd, this.$route.query.group).then((res)=>{
// this.recordSending = false;
// this.$message({
// showClose: true,
// message: '',
// type: 'success'
// });
// }).catch(error => {
// // this.sending = false;
// this.recordSending = false;
// const message = JSON.parse(error.message);
// if (message.err_no == 3301) {
// this.$message({
// showClose: true,
// message: '',
// type: 'error'
// });
// } else if (message.err_no == 3308) {
// this.$message({
// showClose: true,
// message: ',60s',
// type: 'error'
// });
// } else if (message.err_no == 3314) {
// this.$message({
// showClose: true,
// message: ',',
// type: 'error'
// });
// } else {
// this.$message({
// showClose: true,
// message: '',
// type: 'error'
// });
// }
// });
// this.recorders = null;
// } else {
// // this.sending = false;
// this.$message({
// showClose: true,
// message: ',',
// type: 'error'
// });
// }
},
cancleRecording() {
if (this.microphone) {
@ -330,7 +256,7 @@ export default {
}
},
playAudio(nor) {
this.$refs.audio.src = nor.src;
this.$refs.audio.src = this.baseUrl + nor.src;
this.$refs.audio.play();
}
}