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) { export function chatWithAudio(file, group) {
return request({ return request({
url: `/api/jointTraining/chatWithAudio?group=${group}`, 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) { export function getJoinTrainCode(data, group) {
return request({ return request({

View File

@ -142,7 +142,7 @@ export function loadDraftScript(scriptId, memberId, group) {
/** 剧本预览选择角色 */ /** 剧本预览选择角色 */
export function loadDraftScriptNew(memberId, group) { export function loadDraftScriptNew(memberId, group) {
return request({ return request({
url: `/simulation/${group}/${memberId}`, url: `/simulation/${group}/choosePlay?memberId=${memberId}`,
method: 'put' 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查询发布的剧本的详细信息 */ /** 通过ID查询发布的剧本的详细信息 */
export function getScriptById(id) { export function getScriptById(id) {
return request({ return request({
@ -17,6 +26,15 @@ export function getScriptById(id) {
method: 'get' method: 'get'
}); });
} }
/** 通过ID查询发布的剧本的详细信息(新版) */
export function getScriptByIdNew(id) {
return request({
url: `/api/scirpt/v1/${id}/detail`,
method: 'get'
});
}
/** 通过group查询未发布剧本的详细信息 */ /** 通过group查询未发布剧本的详细信息 */
export function getDraftScriptByGroup(group) { export function getDraftScriptByGroup(group) {
return request({ 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) { export function selectScriptMembersNew(group, data) {
return request({ return request({

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -93,9 +93,8 @@ class EMouse extends Group {
this.lineBorder.hide(); this.lineBorder.hide();
} else { } else {
const model = this.device.model; const model = this.device.model;
const arr = JSON.parse(JSON.stringify(model.points)); let points = [];
arr.reverse(); const pointsReverse = [];
const points = [];
model.points.forEach((ele, index) => { model.points.forEach((ele, index) => {
let flag = false; let flag = false;
if (index == model.points.length - 1) { if (index == model.points.length - 1) {
@ -103,11 +102,9 @@ class EMouse extends Group {
} else { } else {
this.triangle = new JTriangle(ele, model.points[index + 1]); this.triangle = new JTriangle(ele, model.points[index + 1]);
} }
const directx = this.triangle.drictx;
const directy = this.triangle.dricty; const directy = this.triangle.dricty;
const switchWidth = 5; // 超出宽度多少
if (index > 0) { 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; flag = true;
} }
} else { } else {
@ -116,40 +113,22 @@ class EMouse extends Group {
} }
} }
if (flag) { if (flag) {
const switchWidth = this.device.style.Section.mouseOverStyle.lineWidthMore; // 超出宽度多少
const param = [ele.x, ele.y + switchWidth]; const param = [ele.x, ele.y + switchWidth];
points.push(param); points.push(param);
const param1 = [ele.x, ele.y - switchWidth];
pointsReverse.unshift(param1);
} else { } 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); 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) => { points = points.concat(pointsReverse);
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);
}
});
this.lineBorder = new Polygon({ this.lineBorder = new Polygon({
zlevel: this.device.zlevel, zlevel: this.device.zlevel,
z: this.device.z + 10, 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 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]); const traingleEnd = new JTriangle(this.model.points[length - 2], this.model.points[length - 1]);
if (this.model.leftAxlePosition) { 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({ this.leftAxle = new EAxle({
_subType: 'leftAxle', _subType: 'leftAxle',
zlevel: this.zlevel, zlevel: this.zlevel,
@ -58,7 +63,7 @@ export default class Section extends Group {
drictx: 1, drictx: 1,
dricty: this.model.leftAxlePosition === 1 || this.model.leftAxlePosition === 2 ? 1 : -1, dricty: this.model.leftAxlePosition === 1 || this.model.leftAxlePosition === 2 ? 1 : -1,
isSpecial: this.model.leftAxlePosition === -2 || this.model.leftAxlePosition === 2, 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, difference: this.model.points[0].y - this.model.points[1].y,
multiple: 1 multiple: 1
}, },
@ -71,6 +76,11 @@ export default class Section extends Group {
this.add(this.leftAxle); this.add(this.leftAxle);
} }
if (this.model.rightAxlePosition) { 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({ this.rightAxle = new EAxle({
_subType: 'rightAxle', _subType: 'rightAxle',
zlevel: this.zlevel, zlevel: this.zlevel,
@ -81,7 +91,7 @@ export default class Section extends Group {
drictx: -1, drictx: -1,
dricty: this.model.rightAxlePosition === 1 || this.model.rightAxlePosition === 2 ? 1 : -1, dricty: this.model.rightAxlePosition === 1 || this.model.rightAxlePosition === 2 ? 1 : -1,
isSpecial: this.model.rightAxlePosition === -2 || this.model.rightAxlePosition === 2, 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, difference: this.model.points[length - 2].y - this.model.points[length - 1].y,
multiple1: -1 multiple1: -1
}, },
@ -282,7 +292,6 @@ export default class Section extends Group {
style: style style: style
}); });
this.add(this.section); this.add(this.section);
if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示) if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示)
this.sectionBlock = new EblockLines({ this.sectionBlock = new EblockLines({
zlevel: this.zlevel, zlevel: this.zlevel,
@ -381,20 +390,22 @@ export default class Section extends Group {
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
this.release = new ERelease({ if ((model.type == '01' && (!model.logicSectionCodeList || !model.logicSectionCodeList.length)) || model.type == '02' || model.type == '03') {
zlevel: this.zlevel, this.release = new ERelease({
z: this.z, zlevel: this.zlevel,
shape: { z: this.z,
x1: model.points[0].x + traingle.getCos(traingle.absz / 3), shape: {
y1: model.points[0].y + traingle.getSin(traingle.absz / 3), x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2), y1: model.points[0].y + traingle.getSin(traingle.absz / 3),
y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2) 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 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 y: 0
}; };
} }
this.cbtcStatus = '';
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.transformRotation(this); this.transformRotation(this);
@ -314,39 +315,89 @@ class Signal extends Group {
} }
// 关闭 // 关闭
close() { close(logicLight) {
if (this.count == 2) { // 双灯 if (this.style.Signal.lamp.logicColor && logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); // 逻辑点灯影响灯颜色仅西安二且暂无双灯
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); if (this.count == 1) {
} else if (this.count == 1) { // 单灯 this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机 this.insideTriangle.show();
this.lamps[0].setColor(this.style.Signal.lamp.blueColor); this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor});
} else { if (this.cbtcStatus !== 'close') {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); 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() { openPositive(logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor); if (this.style.Signal.lamp.logicColor && logicLight) {
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色 // 逻辑点灯影响灯颜色仅西安二且暂无双灯
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor); if (this.count == 1) {
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.sigPost.setColor('#00FF00'); this.insideTriangle.show();
if (this.model.logicLight) { this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor});
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); 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() { openLateral(logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); if (this.style.Signal.lamp.logicColor && logicLight) {
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); if (this.count == 1) {
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.sigPost.setColor('#00FF00'); this.insideTriangle.show();
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色 this.insideTriangle.setStyle({fill: this.style.Signal.lamp.yellowColor});
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); 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() { guid() {
this.cbtcStatus = 'guid';
if (this.style.Signal.lamp.guidName === 'double') { if (this.style.Signal.lamp.guidName === 'double') {
this.lamps[1].show(); 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') { if (this.style.Signal.lamp.guidName === 'double' || this.style.Signal.lamp.guidName === 'doubleAndBase') {
this.lamps[1].hide(); 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.insideTriangle && this.insideTriangle.hide();
this.sigPost && this.sigPost.removeTerminalOptional(); this.sigPost && this.sigPost.removeTerminalOptional();
this.ciConfirm && this.ciConfirm.stopAnimation(false); this.ciConfirm && this.ciConfirm.stopAnimation(false);
@ -528,13 +581,10 @@ class Signal extends Group {
/** 信号机封锁 */ // 缺一个功能封锁 /** 信号机封锁 */ // 缺一个功能封锁
model.blockade && this.block(); 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.guid(); // 引导信号显示
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭 model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放 model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放 model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
/** 进路交人工控或自动控 */ /** 进路交人工控或自动控 */
!model.atsControl && this.setArtificialRouteClose(); !model.atsControl && this.setArtificialRouteClose();
// 联锁自动进路通过 // 联锁自动进路通过

View File

@ -382,6 +382,7 @@ class StationStand extends Group {
this.trainDepart && this.trainDepart.hideMode(); this.trainDepart && this.trainDepart.hideMode();
this.reentry && this.reentry.hideMode(); this.reentry && this.reentry.hideMode();
this.jump && this.jump.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.trainParking && this.stop(); /** 列车停站*/
model.emergencyClosed && this.emergentClose(); /** 站台紧急关闭*/ model.emergencyClosed && this.emergentClose(); /** 站台紧急关闭*/
model.doorOpen && this.doorOpen(); /** 车门开启 (西安二号线样式)*/ model.trainParking && this.doorOpen(); /** 车门开启 (西安二号线样式)*/
if (Number(model.parkingTime) > 0) { if (Number(model.parkingTime) > 0) {
this.setManuallyArmisticeTime(model.parkingTime); // 设置站台停车时间 this.setManuallyArmisticeTime(model.parkingTime); // 设置站台停车时间

View File

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

View File

@ -3,6 +3,7 @@ import Text from 'zrender/src/graphic/Text';
import LangStorage from '@/utils/lang'; import LangStorage from '@/utils/lang';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
import Vue from 'vue';
class EMouse extends Group { class EMouse extends Group {
constructor(device) { constructor(device) {
@ -33,9 +34,13 @@ class EMouse extends Group {
direction = this.device.model.right != 1; direction = this.device.model.right != 1;
} }
if (LangStorage.getLang() == 'en') { 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 { } 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; const trainTip = this.device.style.Train.common.trainTip;
if (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), x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y), y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
text: targetCode.substring(targetCode.length - style.Train.trainNumber.targetCodePrefix.length), text: targetCode.substring(targetCode.length - style.Train.trainNumber.targetCodePrefix.length),
textFill: style.trainTextColor, textFill: model.style.Train.trainNumber.fontColor || style.trainTextColor,
textStroke: style.trainTextColor, textStroke: style.trainTextColor,
fontWeight: 400,
textStrokeWidth: 0, textStrokeWidth: 0,
fontSize: model.fontSize, fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily, fontFamily: style.Train.common.fontFamily,
@ -301,20 +300,12 @@ export default class TrainBody extends Group {
this.trainBodyBox && this.trainBodyBox.setColor(key, color); this.trainBodyBox && this.trainBodyBox.setColor(key, color);
} }
getBoundingRect() { getBoundingRect() {
let rect = null; const rect = new BoundingRect(0, 0, 0, 0);
this.eachChild(elem => { if (this.trainBodyBox) {
if (elem) { const tempRect = this.trainBodyBox.getBoundingRect().clone();
const tempRect = elem.getBoundingRect(); rect.union(tempRect);
if ((tempRect.x || tempRect.y) && tempRect.width && tempRect.height) { }
if (rect) { return rect;
rect.union(tempRect);
} else {
rect = tempRect;
}
}
}
});
return rect || new BoundingRect(0, 0, 0, 0);
} }
formatChangePosition(model, style) { formatChangePosition(model, style) {
if (this.nameFormat) { if (this.nameFormat) {

View File

@ -2,32 +2,32 @@ import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
export default class TrainBodyBox extends Group { export default class TrainBodyBox extends Group {
constructor(model) { constructor(model) {
super(); super();
this.model = model; this.model = model;
this.create(); this.create();
} }
create() { create() {
const model = this.model; const model = this.model;
this.trainBodyBox = new Rect({ this.trainBodyBox = new Rect({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
shape: { shape: {
x: model.point.x, x: model.point.x,
y: model.point.y, y: model.point.y,
width: model.style.Train.common.trainWidth, width: model.style.Train.common.trainWidth,
height: model.style.Train.common.trainHeight height: model.style.Train.common.trainHeight
}, },
style: { style: {
lineWidth: model.style.Train.trainBody.trainBodyLineWidth, lineWidth: model.style.Train.trainBody.trainBodyLineWidth,
stroke: model.style.Train.trainBody.trainSidelineColor || model.style.trainSidelineColor, stroke: model.style.Train.trainBody.trainSidelineColor || model.style.trainSidelineColor,
fill: model.style.Train.trainBody.trainBodyFillColor fill: model.style.Train.trainBody.trainBodyFillColor
}, },
cursor: 'pointer' cursor: 'pointer'
}); });
this.add(this.trainBodyBox); this.add(this.trainBodyBox);
} }
setColor(key, color) { setColor(key, color) {
this.trainBodyBox.setStyle(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) => { const flag = this.style.Train.trainStatusStyle.destinationStatus.some((item) => {
if (status === item.status) { if (status === item.status) {
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) { switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
case 'trainTarget': case 'trainTarget':
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor); this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
break; break;
case 'trainServer': case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(item.showColor); this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
break; break;
case 'trainWindowBorder': case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor); this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor);
break; break;
default: default:
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor); this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
} }
return true; return true;
} }
}); });
if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) { if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) {
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) { switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
case 'trainTarget': case 'trainTarget':
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor); this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
break; break;
case 'trainServer': case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor); this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
break; break;
case 'trainWindowBorder': case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor); this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor);
break; break;
default: default:
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor); 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) { if (this.style.Train.trainStatusStyle.directionStopType.length > 0) {
this.style.Train.trainStatusStyle.directionStopType.forEach((item) => { this.style.Train.trainStatusStyle.directionStopType.forEach((item) => {
if (right === item.type) { if (right === item.type) {
this.trainL && this.trainL.setLineShow(item.lineLShow); if (this.style.Train.trainHead.directionStopType == 'special') {
this.trainR && this.trainR.setLineShow(item.lineRShow); 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; return true;
} }
}); });
@ -425,22 +430,22 @@ export default class Train extends Group {
const arr = this.nameFormat.split(':'); const arr = this.nameFormat.split(':');
arr.forEach(ele => { arr.forEach(ele => {
switch (ele) { switch (ele) {
case 'targetCode': { case 'targetCode': {
this.size += (style.Train.trainNumber.targetCodePrefix || '').length; this.size += (style.Train.trainNumber.targetCodePrefix || '').length;
break; break;
} }
case 'serviceNumber': { case 'serviceNumber': {
this.size += (style.Train.trainServer.serviceNumberPrefix || '').length; this.size += (style.Train.trainServer.serviceNumberPrefix || '').length;
break; break;
} }
case 'tripNumber': { case 'tripNumber': {
this.size += (style.Train.trainTarget.tripNumberPrefix || '').length; this.size += (style.Train.trainTarget.tripNumberPrefix || '').length;
break; break;
} }
case 'groupNumber': { case 'groupNumber': {
this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length; this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length;
break; break;
} }
} }
}); });
} else { } else {

View File

@ -47,6 +47,12 @@ export function parser(data, skinCode, showConfig) {
mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig);
}, this); }, 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 => { zrUtil.each(data.signalList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert, showConfig);
}, this); }, this);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,7 +20,7 @@
<script> <script>
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map'; import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
import { UrlConfig } from '@/scripts/ConstDic'; 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 { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import FilterCity from '@/views/components/filterCity'; import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs'; import localStore from 'storejs';
@ -215,7 +215,7 @@ export default {
this.$store.dispatch('config/resize', { width: width, height: height }); this.$store.dispatch('config/resize', { width: width, height: height });
}, },
isAdministrator() { 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); this.loadInitPage(this.$route.params.examId);
}, },
methods: { methods: {
getList() { async getList() {
if (this.drawWay) { if (this.drawWay) {
this.typeList = []; this.typeList = [];
for (const val in ConstConfig.ConstSelect.trainingDeviceType) { for (const val in ConstConfig.ConstSelect.trainingDeviceType) {
@ -161,53 +161,53 @@ export default {
this.$Dictionary.trainOperation().then(list => { this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; // this.trainingOperateTypeMap['07'] = list; //
}); });
getDetailList('training_type').then(res => { const res = await getDetailList('training_type');
this.typeList = res.data; this.typeList = res.data;
if (LangStorage.getLang() == 'en') { if (LangStorage.getLang() == 'en' && this.typeList) {
this.typeList.forEach(item => { this.typeList.forEach(item => {
switch (item.code) { switch (item.code) {
case '01': case '01':
item.name = 'Control permission operation'; item.name = 'Control permission operation';
break; break;
case '02': case '02':
item.name = 'Signalling machine operation'; item.name = 'Signalling machine operation';
break; break;
case '03': case '03':
item.name = 'Turnout operation'; item.name = 'Turnout operation';
break; break;
case '04': case '04':
item.name = 'Section operation'; item.name = 'Section operation';
break; break;
case '05': case '05':
item.name = 'Platform operation'; item.name = 'Platform operation';
break; break;
case '06': case '06':
item.name = 'Train scheduling operation'; item.name = 'Train scheduling operation';
break; break;
case '07': case '07':
item.name = 'Train operation'; item.name = 'Train operation';
break; break;
case '08': case '08':
item.name = 'Temporary speed limit operation of the whole line'; item.name = 'Temporary speed limit operation of the whole line';
break; break;
} }
}); });
} }
});
} }
}, },
async loadInitPage(examId) { async loadInitPage(examId) {
if (examId) { if (examId) {
getPublishMapInfo(this.$route.query.mapId).then(res => { try {
if (res.data) { const response = await getPublishMapInfo(this.$route.query.mapId);
this.drawWay = res.data.drawWay; if (response.data) {
this.lineCode = res.data.lineCode; this.drawWay = response.data.drawWay;
this.lineCode = response.data.lineCode;
this.typeList = []; this.typeList = [];
this.getList(); await this.getList();
} }
}).catch(() => { } catch (e) {
this.$message.error(this.$t('error.getMapDataFailed')); this.$message.error(this.$t('error.getMapDataFailed'));
}); }
const res = await getExamLessonDetail(examId); const res = await getExamLessonDetail(examId);
this.examDetails = res.data; this.examDetails = res.data;
this.examDetails.examDefinitionRulesVOList.forEach((res, index) => { 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> </template>
<script> <script>
import { getScriptPageListOnline, getScriptById, getDraftScriptByGroup, getDraftScriptByGroupNew } from '@/api/script'; import {getScriptPageListOnlineNew, getScriptByIdNew, getDraftScriptByGroupNew } from '@/api/script';
// //
export default { export default {
@ -148,41 +148,25 @@ export default {
}, },
listQuest(params) { listQuest(params) {
params['mapId'] = this.$route.query.mapId; params['mapId'] = this.$route.query.mapId;
return getScriptPageListOnline(params); return getScriptPageListOnlineNew(params);
}, },
async loadInitData() { async loadInitData() {
}, },
async handleLoad(index, row) { async handleLoad(index, row) {
this.row = row; this.row = row;
if (row.drawWay) { const res = this.$route.fullPath.includes('design/displayNew/demon') ? await getDraftScriptByGroupNew(row.group) : await getScriptByIdNew(row.id);
const res = this.$route.fullPath.includes('design/displayNew/demon') ? await getDraftScriptByGroupNew(row.group) : await getScriptById(row.id); let newMemberList = [];
let newMemberList = []; if (res.code == 200) {
if (res.code == 200) { if (res.data.playerList && res.data.playerList.length > 0) {
if (res.data.playerList && res.data.playerList.length > 0) { newMemberList = res.data.playerList.filter(item => item.hasPlay === true);
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' });
} }
} else { if (res.data.mapLocation) {
const res = this.$route.fullPath.includes('design/display/demon') ? await getDraftScriptByGroup(row.group) : await getScriptById(row.id); this.mapLocation = res.data.mapLocation;
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' });
} }
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
} }
this.roleShow = true; this.roleShow = true;
}, },

View File

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

View File

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

View File

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

View File

@ -195,7 +195,10 @@ export default {
let list = []; let list = [];
nameList.forEach(item => { nameList.forEach(item => {
if (item !== 'skinVO') { 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); this.$jlmap.updateShowMode(list, showMode);

View File

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

View File

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

View File

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

View File

@ -24,59 +24,78 @@ export default {
}; };
}, },
mounted() { mounted() {
getSimulationConversationListNew(this.$route.query.group).then(resp=>{ this.initPage(true);
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]);
}
}
});
}, },
methods:{ 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) { addCoversition(data) {
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; }); const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
if (index < 0) { 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.coversitionList.push(data);
this.currentCoversition = data;
} }
}, },
changeCoversition(coversition) { 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.currentCoversition = {id:coversition.id, group:coversition.group};
this.$emit('setCurrentCoversition', coversition); this.$emit('setCurrentCoversition', coversition);
// this.$refs.chatContent.reloadData(this.currentCoversition); // this.$refs.chatContent.reloadData(this.currentCoversition);
}, },
handleMemberName(conversition) { handleMemberName(conversition) {
if (conversition.group) { if (conversition.group) {
return conversition.name; return {coversitionName:conversition.name, isOnline:true};
} else { } else {
let coversitionName = ''; let coversitionName = '';
conversition.memberList.forEach(member=>{ let isOnline = true;
if (member.userId != this.$store.state.user.id) { if (conversition.memberList) {
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; conversition.memberList.forEach(member=>{
let data = member.role; if (member.userId != this.$store.state.user.id) {
roleTypeList.forEach(function(element) { const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
const rolename = element.value; let data = member.role;
if (Cookies.get('user_lang') == 'en') { roleTypeList.forEach(function(element) {
data = data.replace(rolename, element.enLabel); const rolename = element.value;
} else { if (Cookies.get('user_lang') == 'en') {
data = data.replace(rolename, element.label); 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; const deviceName = member.deviceName ? '-' + member.deviceName : '';
} const memberName = member.name ? '-' + member.name : '';
}); isOnline = member.online;
return coversitionName; 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{ .coversition-active{
background: #e0e0e0; 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> </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() { getSimulationMembers() {
getSimulationMembersNew(this.$route.query.group).then(resp => { getSimulationMembersNew(this.$route.query.group).then(resp => {
let lastData = JSON.stringify(resp.data); let lastData = JSON.stringify(resp.data);

View File

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

View File

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

View File

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

View File

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

View File

@ -162,7 +162,9 @@ export default {
rightAxlePosition: 0, rightAxlePosition: 0,
roadType: null, roadType: null,
firstTurnBack: false, firstTurnBack: false,
belongStation: '' // belongStation: '', //
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0}
}, },
oldPoint: [], // oldPoint: [], //
field: '', field: '',
@ -545,21 +547,71 @@ export default {
}, },
{ {
prop: 'leftAxlePosition', prop: 'leftAxlePosition',
label: '左侧计轴', label: '左侧计轴:',
type: 'select', type: 'select',
optionLabel: 'label', optionLabel: 'label',
optionValue: 'value', optionValue: 'value',
options: this.axlePositionList, options: this.axlePositionList,
isHidden: !this.hasAssociatedSection 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', prop: 'rightAxlePosition',
label: '右侧计轴', label: '右侧计轴:',
type: 'select', type: 'select',
optionLabel: 'label', optionLabel: 'label',
optionValue: 'value', optionValue: 'value',
options: this.axlePositionList, options: this.axlePositionList,
isHidden: !this.hasAssociatedSection 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() { edit() {
this.$refs['dataform'].validate(valid => { this.$refs['dataform'].validate(valid => {
if (valid) { if (valid) {
if ( if (this.editModel.type === '03' && this.editModel.leftSectionCode && this.editModel.rightSectionCode) {
this.editModel.type === '03' &&
this.editModel.leftSectionCode &&
this.editModel.rightSectionCode
) {
this.$messageBox('道岔区段应仅有一侧关联区段!'); this.$messageBox('道岔区段应仅有一侧关联区段!');
return; return;
} }
let models = []; let models = [];
const model = deepAssign(this.editModel, { const model = deepAssign(this.editModel, { _type: 'Section' }); // model
_type: 'Section' if (model.lengthFact > 5 && (model.transferTrack || model.reentryTrack || model.standTrack)) {
}); // model model.leftStopPointOffset = model.leftStopPointOffset || 5;
if ( model.rightStopPointOffset = model.rightStopPointOffset || model.lengthFact - 5;
model.lengthFact > 5 &&
(model.transferTrack ||
model.reentryTrack ||
model.standTrack)
) {
model.leftStopPointOffset = 5;
model.rightStopPointOffset = model.lengthFact - 5;
} }
const changeSectionList = this.handleOtherSectionChange( const changeSectionList = this.handleOtherSectionChange(model);
model
);
models = [model, ...changeSectionList]; models = [model, ...changeSectionList];
this.$emit('updateMapModel', models); this.$emit('updateMapModel', models);
@ -1044,13 +1083,9 @@ export default {
// //
const models = []; const models = [];
const pointModel = []; const pointModel = [];
const slope1 = 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.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 => { this.sectionList.forEach(section => {
if (section.parentCode === model.code) { if (section.parentCode === model.code) { //
const copySection = deepAssign({}, section); const copySection = deepAssign({}, section);
copySection.logicSectionShow = model.logicSectionShow; copySection.logicSectionShow = model.logicSectionShow;
// copySection.lengthFact = (Number(model.lengthFact) / model.logicSectionCodeList.length).toFixed(3); // // 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]; copySection.points[copySection.points.length - 1] = model.points[model.points.length - 1];
} }
models.push(copySection); models.push(copySection);
} else if ( } else if (model.code !== section.code && (section.type === '01' || section.type === '03' || section.type === '02')) {
model.code !== section.code &&
(section.type === '01' || section.type === '03' || section.type === '02')
) {
const copySection = deepAssign({}, section); const copySection = deepAssign({}, section);
let updataFlag = false; let updataFlag = false;
if (model.leftSectionCode !== this.oldLeftSectionCode) { if (model.leftSectionCode !== this.oldLeftSectionCode) {
@ -1089,24 +1121,19 @@ export default {
updataFlag = true; updataFlag = true;
} }
} }
if (model.parentCode == copySection.code) { if (model.parentCode == copySection.code) { //
let lengthFact = 0; let lengthFact = 0;
copySection.logicSectionCodeList.forEach(code => { copySection.logicSectionCodeList.forEach(code => {
if (model.code != code) { if (model.code != code) {
const localSectionModel = this.$store.getters[ const localSectionModel = this.$store.getters['map/getDeviceByCode'](code);
'map/getDeviceByCode' lengthFact += Number(localSectionModel.lengthFact);
](code);
lengthFact += Number(
localSectionModel.lengthFact
);
} }
}); });
lengthFact += model.lengthFact; lengthFact += model.lengthFact;
copySection.lengthFact = lengthFact.toFixed(3); // copySection.lengthFact = lengthFact.toFixed(3); //
if (copySection.lengthFact > 5) { if (copySection.lengthFact > 5) {
copySection.leftStopPointOffset = 5; copySection.leftStopPointOffset = copySection.leftStopPointOffset || 5;
copySection.rightStopPointOffset = copySection.rightStopPointOffset = copySection.rightStopPointOffset || copySection.lengthFact - 5;
copySection.lengthFact - 5;
} }
updataFlag = true; updataFlag = true;
} }
@ -1216,6 +1243,7 @@ export default {
); );
models = [...models, ...deleteObjAssociatedSection]; models = [...models, ...deleteObjAssociatedSection];
_that.$emit('updateMapModel', models); _that.$emit('updateMapModel', models);
this.clear();
_that.deviceSelect(); _that.deviceSelect();
}) })
.catch(error => { .catch(error => {
@ -1282,6 +1310,10 @@ export default {
this.editModel.logicSectionCodeList = []; this.editModel.logicSectionCodeList = [];
this.editModel.rightSectionCode = ''; this.editModel.rightSectionCode = '';
this.editModel.leftSectionCode = ''; 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:{ methods:{
// //
editSectionNum() { editSectionNum() {
const models = []; let models = [];
this.addList = []; this.addList = [];
const counts = 0; const counts = 0;
const sectionPoints = [...this.editModel.points]; // const sectionPoints = [...this.editModel.points]; //
@ -87,65 +87,15 @@ export default {
lineLength = lengthFact / this.logicNum; // lineLength = lengthFact / this.logicNum; //
} }
if (sectionPoints.length === 2) { if (sectionPoints.length === 2) {
const triangle = new JTriangle(sectionPoints[0], sectionPoints[1]); models = this.createLogicalSections(sectionPoints, counts, lineLength);
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);
}
} else { } else {
const triangleList = []; models = this.createLogicalMoerScetion(sectionPoints, counts, lineLength);
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;
}
}
}
} }
let logicSectionCodeList = []; let logicSectionCodeList = [];
models.forEach(item=> { models.forEach(item=> {
logicSectionCodeList.push(item.code); logicSectionCodeList.push(item.code);
}); });
this.editModel.logicSectionCodeList.forEach( logicCode => { this.editModel.logicSectionCodeList.forEach(logicCode => {
const section = this.$store.getters['map/getDeviceByCode'](logicCode); const section = this.$store.getters['map/getDeviceByCode'](logicCode);
models.push(deepAssign(section, {_dispose: true})); models.push(deepAssign(section, {_dispose: true}));
}); });
@ -157,25 +107,70 @@ export default {
models.push(model); models.push(model);
this.$emit('updateMapModel', models); this.$emit('updateMapModel', models);
}, },
handleDelete(index, row) { // 2线
row.num = 0; createLogicalSections(sectionPoints, counts, lineLength) {
},
//
createLogicalSections(num, beg, end, model, counts, lineLength, totalNum) {
const models = []; const models = [];
const triangle = new JTriangle(beg, end); const triangle = new JTriangle(sectionPoints[0], sectionPoints[1]);
const offset = Math.sqrt(triangle.abspowz) / num; const offset = Math.sqrt(triangle.abspowz) / this.logicNum;
for (let i = 0; i < num; i++) { for (let i = 0; i < this.logicNum; i++) {
const points = [ const points = [
{ x: beg.x + triangle.getCos(offset * i), y: beg.y + triangle.getSin(offset * i) }, { x: sectionPoints[0].x + triangle.getCos(offset * i), y: sectionPoints[0].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 + 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); models.push(param);
this.addList.push(param); this.addList.push(param);
} }
return models; 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) { addLogicalSection(model, points, index, lineLength, totalNum) {
const data = { const data = {

View File

@ -207,7 +207,11 @@ export default {
relevanceSectionList: [], relevanceSectionList: [],
roadType: selected.roadType, roadType: selected.roadType,
firstTurnBack: false, firstTurnBack: false,
belongStation: '' belongStation: '',
rightAxleOffset: {x:0, y:0},
leftAxleOffset: {x:0, y:0},
leftAxlePosition: 0,
rightAxlePosition: 0,
}; };
models.push(model); models.push(model);
} }
@ -286,7 +290,11 @@ export default {
relevanceSectionList: [], relevanceSectionList: [],
roadType: null, roadType: null,
firstTurnBack: false, 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'](lsection.code), { _dispose: true }));
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.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, guideShow: false,
stationCode: this.addModel.stationCode, stationCode: this.addModel.stationCode,
callOn: true, callOn: true,
turnBack: false turnBack: false,
ctc: true
}; };
this.sectionList.forEach(elem => { this.sectionList.forEach(elem => {

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </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> <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 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"> <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:{ watch:{
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation); Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
@ -191,7 +197,7 @@ export default {
this.isPause = !(this.$store.state.scriptRecord.simulationPause); this.isPause = !(this.$store.state.scriptRecord.simulationPause);
this.$parent.$parent.$parent.setIsParse(this.isPause); this.$parent.$parent.$parent.setIsParse(this.isPause);
this.$refs['modalData'].clearValidate(); this.$refs['modalData'].clearValidate();
if (this.$route.query.drawWay == 'true') { if (this.drawWay) {
this.$refs['commandDataNew'].clearValidate(); this.$refs['commandDataNew'].clearValidate();
if (!val) { if (!val) {
this.initActionData(); this.initActionData();
@ -224,10 +230,11 @@ export default {
initData() { initData() {
this.buttonName = this.$t('scriptRecord.addConversitionButton'); this.buttonName = this.$t('scriptRecord.addConversitionButton');
this.operateType = 'add'; this.operateType = 'add';
if (this.$route.query.drawWay == 'true') { if (this.drawWay) {
getScriptPlayMemberNew(this.group).then(resp => { getScriptPlayMemberNew(this.group).then(resp => {
this.orginMemberList = resp.data; 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.resetDisabled();
this.initCommandActionData(); this.initCommandActionData();
}).catch(error => { }).catch(error => {
@ -235,22 +242,9 @@ export default {
}); });
} else { } else {
getScriptPlayMember(this.group).then(resp => { getScriptPlayMember(this.group).then(resp => {
const roleTypeList = ConstConfig.ConstSelect.roleType;
this.orginMemberList = resp.data; this.orginMemberList = resp.data;
let lastData = JSON.stringify(resp.data); const lastData = JSON.stringify(resp.data);
roleTypeList.forEach(function(element) { this.memberList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
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;
this.resetDisabled(); this.resetDisabled();
this.initCommandActionData(); this.initCommandActionData();
}).catch(error => { }).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) { hover(field) {
if (this.field == '') { if (this.field == '') {
if (this.isFirstTips) { if (this.isFirstTips) {
@ -385,7 +397,7 @@ export default {
const data = this.modalData.actionVO; const data = this.modalData.actionVO;
this.modifying = true; this.modifying = true;
if (this.operateType == 'add') { if (this.operateType == 'add') {
if (this.$route.query.drawWay == 'true') { if (this.drawWay) {
addScriptActionNew(group, data).then(response=>{ addScriptActionNew(group, data).then(response=>{
this.modifying = false; this.modifying = false;
this.$message.success(this.$t('scriptRecord.addConversitionSuccess')); this.$message.success(this.$t('scriptRecord.addConversitionSuccess'));
@ -512,7 +524,7 @@ export default {
} }
}, },
resetData() { resetData() {
if (this.$route.query.drawWay != 'true') { if (!this.drawWay) {
this.$refs.command.resetData(); this.$refs.command.resetData();
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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