mergemaster

This commit is contained in:
sunzhenyu 2019-08-29 17:17:10 +08:00
commit e80e3eb224
50 changed files with 644 additions and 10717 deletions

View File

@ -1,16 +0,0 @@
import defaultStyle from '../defaultStyle';
import deviceType from '../../constant/deviceType';
class SkinStyle extends defaultStyle {
constructor() {
super();
this[deviceType.Link] = {
lineWidthColor: '#FFFFFF', // line 颜色
linkWidth: 4.4, // link 宽度
linkColor: '#3F3F3F', // link 线条颜色
linkTextColor: '#FFFFFF' // link 字体颜色
};
}
}
export default new SkinStyle();

View File

@ -1,556 +0,0 @@
import defaultStyle from '../defaultStyle';
import deviceType from '../../constant/deviceType';
class SkinStyle extends defaultStyle {
constructor() {
super();
this[deviceType.Link] = {
lineWidthColor: '#FFFFFF', // line 颜色
linkWidth: 4.4, // link 宽度
linkColor: '#3F3F3F', // link 线条颜色
linkTextColor: '#FFFFFF' // link 字体颜色
};
this[deviceType.Section] = {
text: {
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'bold', // 字体粗细
fontColor: 'yellow', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
mouseOverStyle: {
borderColor: '#fff',
borderBackgroundColor: '#22DFDF',
textShadowColor: '#22DFDF'
},
line: {
width: 5, // 区段宽度
beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#EF0C08', // 区段侵入颜色
spareColor: '#606060', // 区段空闲颜色
communicationOccupiedColor: '#FF0000', // 区段通信车占用颜色
unCommunicationOccupiedColor: '#800080', // 区段非通讯车占用颜色
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
faultLockColor: '#006400', // 区段故障锁定颜色
undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FEFF00', // 保护区段锁闭(未用)
blockColor: '#800080', // 区段封锁颜色
atcExcisionColor: '#A0522D', // 区段atc切除颜色
atsExcisionColor: '#A0522D', // 区段ats切除颜色
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#C0C0C0' // 逻辑区段名称颜色 (未用)
},
axle: {
radius: 3, // 计轴 半径
distance: 5, // 计轴和区段之间的距离 (未用)
color: '#C0C0C0', // 区段计轴颜色
resetColor: '#00FFFF', // 区段计轴预复位颜色
Failure: '#E6A23C' // #FFFF00 计轴失效
},
speedLimit: { // 限速元素
width: 1, // 限速线的宽度
distance: 5, // 限速线距离区段距离
lineColor: '#FFFF00', // 限速线颜色
nameShow: false // 名称显示
},
separator: {
z: 1, // 分割符层级
width: 1.5, // 分隔符宽度
endWidth: 1.5, // 尽头分隔符宽度
endColor: '#7F7F7F', // 尽头分隔符颜色
color: '#7F7F7F' // 区段边界符颜色
}
};
this[deviceType.Signal] = {
distance: 0, // 设备距离区段的距离
post: {
standardColor: '#5578B6', // 灯灯柱颜色
standardWidth: 1.5 // 灯柱宽度
},
text: {
distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: '#C0C0C0', // 信号灯字体默认色
blockColor: '#EF0C08', // 信号灯字体锁定颜色
checkColor: '#00FF00' // 信号字体
},
lamp: {
stopWidth: 2, // 禁止线宽度
borderVariable: true, // 信号灯边框可变
borderWidth: 0.5, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色
radiusR: 5, // 信号机宽度
blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#7F7F7F', // 信号灯灰色
redColor: '#FF0000', // 信号灯红色
greenColor: '#00FF00', // 信号灯绿色
yellowColor: '#FFFF00', // 信号灯黄色
whiteColor: '#FFFFFF', // 信号灯白色
blueColor: '#0070C0' // 信号灯蓝色
},
route: {
direction: false, // 自动进路方向
offset: { x: 1, y: -2 }, // 自动进路偏移量
routeColor: '#00FF00' // 自动进路
},
auto: {
direction: true, // 自动通过方向
offset: { x: 4, y: 0}, // 自动通过偏移量
width: 5, // 自动宽度
autoRoute: '#00FF00', // 自动进路
autoTrigger: '#FFFF00', // 自动触发
manualControl: '#FFFF00', // 人工控制
outConflict: '#C00808' // 出车冲突
},
delay: {
direction: false, // 延时解锁方向
offset: { x: 0, y: -5}, // 延时解锁偏移量
fontSize: 9, // 延迟解锁字体大小
fontColor: '#FF0000', // 延迟解锁颜色
fontWeight: 'bold' // 字体粗细
},
button: {
distance: 5, // 信号灯按钮距离区段的距离
borderDashColor: '#FFFFFF', // 信号灯按钮边线
buttonColor: 'darkgreen', // 信号灯按钮颜色
buttonLightenColor: '#E4EF50' // 信号灯按钮闪烁颜色
},
mouseOverStyle: {
borderLineColor: '#FFFFFF',
borderLineDash: [3, 3],
nameBackgroundColor: '#22DFDF',
lampBorderLineColor: '#22DFDF'
}
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 8 // 站台默认字体大小
},
safetyDoor: { // 屏蔽门
height: 1.6, // 站台屏蔽门高度
distance: 9, // 站台和屏蔽门之间的距离
defaultColor: '#00FF00', // 屏蔽门默认颜色
splitDoorColor: '#F61107' // 屏蔽门切除颜色
},
stand: { // 站台
headFontSize: 8, // 站台首端字体大小
spareColor: '#606060', // 站台空闲颜色
stopColor: '#FEFE00', // 站台列车停站颜色
jumpStopColor: '#9A99FF', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径
offset: {x: 0, y: 0}, // 站台紧急关闭偏移量
closeColor: '#F61107' // 站台紧急关闭颜色
},
reentry: { // 站台折返策略
position: 0, // 折返方向
offset: {x: -16, y: 18}, // 折返偏移量
noHumanColor: '#0F16DA', // 站台无人折返
autoChangeEndsColor: '#0BF400' // 站台自动换端
},
detainCar: { // 扣车
text: 'H', // 扣车显示内容
position: 1, // 扣车方向
offset: {x: -8, y: 13}, // 扣车偏移量
trainColor: '#E4EF50', // 车站扣车颜色
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: {x: -8, y: 3}, // 运行时间偏移量
textColor: '#FFFFFF' // 停站时间字体颜色
},
level: { // 运行等级
position: 1, // 运行等级方向
offset: {x: -8, y: 22}, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色
},
mouseOverStyle: {
borderLineColor: '#FFFFFF',
borderLineDash: [3, 3]
}
};
this[deviceType.StationControl] = {
text: {
distance: 2, // 灯和文字之间的距离
fontSize: 10, // 控制模式字体大小
fontFormat: 'consolas', // 控制模式字体格式
fontColor: '#ffffff', // 控制模式字体颜色
fontWeight: 'normal', // 控制模式字体粗细
textAlign: 'middle', // 控制模式水平对齐
textVerticalAlign: 'top' // 控制模式垂直对齐
},
lamp: {
count: 3, // 控制模式灯个数
offset: { x: 20, y: 0 }, // 偏移量
radiusR: 6, // 控制模式灯的半径
distance: 36, // 控制模式之间灯之间的距离
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
},
arrow: {
show: false // 控制模式箭头显隐
},
mouseOverStyle: { // 鼠标悬浮样式
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top'
}
};
this[deviceType.StationCounter] = {
text: {
distance: 2, // 计数器名称和文字的距离
fontColor: '#FFFFFF', // 计数器字体颜色
borderColor: '#E4EF50' // 计数器边框颜色
}
};
this[deviceType.StationDelayUnlock] = {
text: {
distance: 3, // 延迟解锁和设备之间的距离
fontColor: '#FFFFFF', // 延时解锁字体颜色
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.Station] = {
kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold' // 文字错细
};
this[deviceType.Switch] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: -15, y: -10}, // 道岔名称与区段距离
fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#FFFFFF', // 道岔失去颜色
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#9C9D09', // 道岔反位颜色
monolockColor: '#870E10' // 道岔单锁颜色
},
core: {
length: 6 // 道岔单边长度
},
monolock: { // 道岔单锁配置
locationColor: '#870E10', // 道岔单锁定位颜色 (红色)
inversionColor: '#870E10', // 道岔单锁反位颜色 (红色)
rectShow: false // 道岔单锁 矩形框是否显示
},
block: { // 道岔封锁配置
nameBorderShow: true, // 道岔名称是否有包围框 显示
contentRectShow: false // 道岔封锁显示
},
mouseOverStyle: {
borderBackgroundColor: '#22DFDF', // 边框背景色
borderColor: '#fff', // 边框颜色
textShadowColor: '#22DFDF' // 字体阴影颜色
}
};
this[deviceType.LcControl] = {
text: {
fontSize: 10, // 灯字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#FFFF00' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
arcColor: '#00FFFF',
textColor: '#000000'
}
};
this[deviceType.ZcControl] = {
text: {
fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#00FF00' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
arcColor: '#00FFFF',
textColor: '#000000'
}
};
this[deviceType.LimitControl] = {
text: {
fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#ECE9D8' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
textColor: '#000000',
arcColor: '#00FFFF'
}
};
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};
this[deviceType.TrainWindow] = {
lineColor: '#FFF', // 车次窗颜色
lineDash: [3, 3], // 车次窗虚线间隔
lineWidth: 1, // 车次窗线宽
trainWindowSmooth: 0.01 // 车次窗矩形圆滑程度
};
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 0.1, // 车身line宽
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离
trainBodyFillColor: '#725A64', // 列车车身填充颜色
trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式
},
hsda: {
lrPaddingHSDA: 3, // HSDA两边间隔
upPaddingHSDA: 4, // HSDA上边距离
trainHSDATextFontSize: 9, // 列车HDSA字号
textHContent: 'H', // textH文本
textSContent: 'S', // textS文本
textDContent: 'D', // textD文本
textAContent: 'A'// textA文本
},
trainNumber: {
trainNumberOffset: { x: 0, y: 1}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀
defaultServiceNumber: 'AA', // 默认服务号(表号)
trainServerOffset: { x: 4, y: 4}// 列车服务号偏移
},
trainTarget: {
tripNumberPrefix: '000', // 车次号前缀
defaultTripNumber: 'DDD', // 默认车次号2
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
trainTargetTextAlign: 'right'// 车次号文字显示位置
},
trainTargetNumber: {
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
},
trainHead: {
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 20, // 列车车头矩形高度
trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000'// 列车车头矩形填充颜色
},
common: {
trainHeight: 20, // 列车高度
trainHeadDistance: 4, // 列车和车头之间的间距
trainWidth: 40, // 列车长度
trainTextFontSize: 12, // 列车字号
fontFamily: 'consolas', // 默认字体 族类
haveTextHSDA: true, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 7/5, // 字体宽高比例用以拼接text是计算位置
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
useSelfFormat: true, // 使用配置项的nameFormat
useSelfText: true // 使用配置项的字体大小
},
trainStatusStyle: {
destinationStatus: [
{status: '01', showColor: '#FFFFFF'},
{status: '02', showColor: '#00FF00'},
{status: '03', showColor: '#A0522D'},
{status: '04', showColor: '#FFFF00'}
], // 目的地状态 01准点 02早点 03晚点 04头码车
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
destinationStatusSetText: 'trainTarget', // 目的地状态设置的对应哪个text的颜色
directionType: [
{
type: '01',
lineLShow: true,
lineRShow: true,
arrowLShow: false,
arrowRShow: false
},
{
type: '02',
lineLShow: false,
lineRShow: true,
arrowLShow: false,
arrowRShow: true
},
{
type: '03',
lineLShow: true,
lineRShow: false,
arrowLShow: true,
arrowRShow: false
}
], // 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
directionStopType: [
{type: '01', lineLShow: false, lineRShow: false},
{type: '02', lineLShow: false, lineRShow: true},
{type: '03', lineLShow: true, lineRShow: false}
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
runModeStatus: [
{
status: '01',
trainLColor: '#FFFFFF',
trainRColor: '#FFFFFF'
},
{
status: '02',
trainLColor: '#00FF00',
trainRColor: '#00FF00'
},
{
status: '03',
trainLColor: '#FFFF00',
trainRColor: '#FFFF00'},
{
status: '04',
trainLColor: '#A0522D',
trainRColor: '#A0522D'
},
{
status: '05',
trainLColor: '#A0522D',
trainRColor: '#A0522D'
}
], // 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
runControlStatus: [
{status: '01', hShow: false, sShow: false},
{status: '02', hShow: true, sShow: false},
{status: '03', hShow: false, sShow: true}
], // 设置运行控制状态类型 01正常 02扣车 03停跳
doorStatus: [
{status: '01', dShow: false},
{status: '02', dShow: true}
], // 设置车门状态类型 01关门 02开门
communicationStatus: [
{status: '01', trainColor: '#725A64'},
{status: '02', trainColor: '#C0C0C0'}
], // 设置通信状态 01正常 02故障
alarmStatus: [
{status: '01', aShow: false},
{status: '02', aShow: true}
], // 设置报警状态 01不报警 02报警
serverNoType: [
{type: '01', showColor: '#FFFFFF'},
{type: '02', showColor: '#FFF000'}
], // 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车
defaultServerNoColor: '#FFFFFF' // 默认服务号状态显示颜色
}
};
}
}
export default new SkinStyle();

View File

@ -1,545 +0,0 @@
import defaultStyle from '../defaultStyle';
import deviceType from '../../constant/deviceType';
class SkinStyle extends defaultStyle {
constructor() {
super();
this[deviceType.Link] = {
lineWidthColor: '#FFFFFF', // line 颜色
linkWidth: 4.4, // link 宽度
linkColor: '#3F3F3F', // link 线条颜色
linkTextColor: '#FFFFFF' // link 字体颜色
};
this[deviceType.Section] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
fontSize: 12, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 24, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'bold', // 字体粗细
fontColor: 'yellow', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
line: {
width: 5, // 区段宽度
beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#FFFFFF', // 区段侵入颜色
spareColor: '#5578B6', // 区段空闲颜色
communicationOccupiedColor: '#FF00FF', // 区段通信车占用颜色
unCommunicationOccupiedColor: '#DE310C', // 区段非通讯车占用颜色
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
faultLockColor: '#006400', // 区段故障锁定颜色
undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FFFFFF', // 保护区段锁闭
blockColor: '#00FF00', // 区段封锁颜色
atcExcisionColor: '#A0522D', // 区段atc切除颜色
atsExcisionColor: '#A0522D', // 区段ats切除颜色
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#C0C0C0' // 逻辑区段名称颜色 (未用)
},
axle: {
radius: 3, // 计轴 半径
distance: 5, // 计轴和区段之间的距离 (未用)
color: '#C0C0C0', // 区段计轴颜色
resetColor: '#00FFFF', // 区段计轴预复位颜色
Failure: '#E6A23C' // #FFFF00 计轴失效
},
speedLimit: { // 限速元素
width: 1, // 限速线的宽度
distance: 5, // 限速线距离区段距离
lineColor: '#C0C000', // 限速线颜色 (黄色透明光)
nameBackground: '#C0C000', // 限速名称背景颜色
nameShow: true, // 名称显示
nameNumberColor: '#C00808', // 限速值颜色
nameNumberFontSize: 11, // 限速值大小
kilometerColor: '#fff', // 公里标颜色
kilometerFontSize: 8, // 公里标大小
drogueWidth: 19, // 浮标宽度
drogueHeight: 12 // 浮标高度
},
separator: {
z: 6, // 分割符层级
width: 1.5, // 分隔符宽度
endWidth: 1.5, // 尽头分隔符宽度
endColor: '#FFFFFF', // 尽头分隔符颜色
color: '#FFFFFF' // 区段边界符颜色
},
shuttleBack: { // 折返进路 (存在此对象 显示折返箭头)
distance: 5 // 限速线距离区段距离
}
};
this[deviceType.Signal] = {
distance: 10, // 设备距离区段的距离
post: {
standardColor: '#FFFFFF', // 灯柱颜色
standardWidth: 2 // 灯柱宽度
},
text: {
distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: '#FFFFFF', // 信号灯字体默认色
blockColor: '#EF0C08', // 信号灯字体锁定颜色
checkColor: '#00FF00' // 信号保护区段检查颜色
},
lamp: {
borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度
borderWidth: 2, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色
radiusR: 6, // 信号灯半径
blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#7F7F7F', // 信号灯灰色
redColor: '#FF0000', // 信号灯红色
greenColor: '#00FF00', // 信号灯绿色
yellowColor: '#FFFF00', // 信号灯黄色
whiteColor: '#FFFFFF', // 信号灯白色
blueColor: '#0070C0' // 信号灯蓝色
},
route: {
direction: true, // 自动通过方向
offset: { x: 4, y: 0}, // 自动通过偏移量
routeColor: '#00FF00' // 自动进路
},
auto: {
direction: false, // 自动通过方向
offset: { x: -4, y: 0}, // 自动通过偏移量
width: 5, // 自动宽度
manualControl: '#FFFF00', // 人工控制
autoRoute: '#00FF00', // 自动进路
autoTrigger: '#FFFF00', // 自动触发
outConflict: '#C00808' // 出车冲突
},
delay: {
direction: false, // 延时解锁方向
offset: { x: -5, y: 0}, // 延时解锁偏移量
fontSize: 11, // 延迟解锁字体大小
fontColor: '#C00808', // 延迟解锁颜色
fontWeight: 'bold' // 字体粗细
},
button: {
distance: 5, // 信号灯按钮距离区段的距离
borderDashColor: '#FFFFFF', // 信号灯按钮边线
buttonColor: 'darkgreen', // 信号灯按钮颜色
buttonLightenColor: '#E4EF50' // 信号灯按钮闪烁颜色
}
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小
haveJumpShow: true // 站台是否有列车停跳显示
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
distance: 8, // 站台和屏蔽门之间的距离
defaultColor: '#00FF00', // 屏蔽门默认颜色
splitDoorColor: '#C00808' // 屏蔽门切除颜色
},
stand: { // 站台
headFontSize: 10, // 站台首端字体大小
spareColor: '#808080', // 站台空闲颜色
stopColor: '#FFF000', // 站台列车停站颜色
jumpStopColor: '#808080', // 站台跳停颜色
designatedJumpStopColor: '#808080' // 站台指定列车跳停颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径
offset: {x: 0, y: 40}, // 站台紧急关闭偏移量
closeColor: '#F61107' // 站台紧急关闭颜色
},
reentry: { // 站台折返策略
position: 0, // 折返方向
offset: {x: -16, y: 20}, // 折返偏移量
noHumanColor: '#0F16DA', // 站台无人折返
autoChangeEndsColor: '#0BF400' // 站台自动换端
},
detainCar: { // 扣车
text: '扣', // 扣车显示内容
position: -1, // 扣车方向
offset: {x: -8, y: -20}, // 扣车偏移量
trainColor: '#FFFF00', // 车站扣车颜色
centerTrainColor: '#C0C0C0', // 中心扣车颜色
andCenterTrainColor: '#C0C0C0', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: {x: -8, y: -4}, // 运行时间偏移量
textColor: '#C0C0C0' // 停站时间字体颜色
},
jump: {
text: '跳', // 停跳显示内容
position: -1, // 停跳方向
offset: {x: -8, y: 0},
textColor: '#0000FF', // 停跳文字颜色
arcColor: '#0000FF', // 停跳圆圈颜色
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
r: 8 // 圆半径大小
},
level: { // 运行等级
position: 1, // 运行等级方向
offset: {x: -8, y: 30}, // 运行等级偏移量
textColor: '#FFF000' // 停站等级字体颜色
}
};
this[deviceType.StationControl] = {
text: {
distance: 2, // 灯和文字之间的距离
fontSize: 11, // 字体大小
fontFormat: 'consolas', // 字体格式
fontColor: '#ffffff', // 字体颜色
fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top' // 字体垂直对齐
},
lamp: {
count: 4, // 控制模式的个数
offset: {x: 0, y: 0}, // 偏移量
radiusR: 6, // 控制模式灯的半径
distance: 36, // 控制模式之间灯之间的距离
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
},
arrow: {
show: true // 控制模式箭头显隐
}
};
this[deviceType.StationCounter] = {
text: {
distance: 2, // 计数器名称和文字的距离
fontColor: '#FFFFFF', // 计数器字体颜色
borderColor: '#E4EF50' // 计数器边框颜色
}
};
this[deviceType.StationDelayUnlock] = {
text: {
distance: 3, // 延迟解锁和设备之间的距离
fontColor: '#FFFFFF', // 延时解锁字体颜色
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.Station] = {
kilometerPosition: 'up' // 公里标朝向
};
this[deviceType.Switch] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 5, y: -10}, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#C00808', // 道岔失去颜色
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#FFFF00', // 道岔反位颜色
monolockColor: '#FFFFFF' // 道岔单锁颜色
},
core: {
length: 6 // 道岔单边长度
},
monolock: { // 道岔单锁配置
locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
inversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
rectShow: true, // 道岔单锁 矩形框是否显示
rectWidth: 18, // 矩形框 宽高
rectBorderColor: '#fff' // 矩形边框颜色
},
block: { // 道岔封锁配置
nameBorderShow: false, // 道岔名称是否有包围框 显示
contentRectShow: true, // 道岔封锁显示
contentRectColor: 'red' // 道岔封锁边框颜色
}
};
this[deviceType.LcControl] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
}
};
this[deviceType.ZcControl] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#00FF00' // 控制灯颜色
}
};
this[deviceType.LimitControl] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#ECE9D8' // 控制灯颜色
}
};
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};
this[deviceType.TrainWindow] = {
lineColor: '#4DD43F', // 车次窗颜色
lineDash: null, // 车次窗虚线间隔
lineWidth: 1, // 车次窗线宽
trainWindowSmooth: 0 // 车次窗矩形圆滑程度
};
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 1, // 车身line宽
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离
trainBodyFillColor: '#000099', // 列车车身填充颜色
trainNameFormat: 'serviceNumber:targetCode'// 列车显示格式
},
hsda: {
lrPaddingHSDA: 3, // HSDA两边间隔
upPaddingHSDA: 4, // HSDA上边距离
trainHSDATextFontSize: 9, // 列车HDSA字号
textHContent: '扣', // textH文本
textSContent: '跳', // textS文本
textDContent: '门', // textD文本
textAContent: '警' // textA文本
},
trainNumber: {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'DDD', // 默认目的地码
trainTargetTextAlign: 'left', // 目的地码文字显示位置
trainNumberOffset: { x: 24, y: 4}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '000', // 服务号(表号)前缀
defaultServiceNumber: 'TTT', // 默认服务号(表号)
defaultServerNoColor: '#FFFFFF', // 默认服务号状态显示颜色
trainServerOffset: { x: 4, y: 4} // 列车服务号偏移
},
trainTarget: {
tripNumberPrefix: '000', // 车次号前缀
defaultTripNumber: 'DDD', // 默认车次号2
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
trainTargetTextAlign: 'right' // 车次号文字显示位置
},
trainTargetNumber: {
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
},
trainHead: {
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 3, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度
},
common: {
trainHeight: 20, // 列车高度
trainHeadDistance: 4, // 列车和车头之间的间距
trainWidth: 48, // 列车长度
trainTextFontSize: 12, // 列车字号
fontFamily: 'consolas', // 默认字体 族类
haveTextHSDA: true, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 7/5, // 字体宽高比例用以拼接text是计算位置
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
useSelfFormat: true, // 使用配置项的nameFormat
useSelfText: true // 使用配置项的字体大小
},
trainStatusStyle: {
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
destinationStatusSetText: 'trainWindowBorder', // 目的地状态设置的对应哪个颜色
destinationStatus: [
{status: '01', showColor: '#FFFFFF'},
{status: '02', showColor: '#00FF00'},
{status: '03', showColor: '#A0522D'}
], // 目的地状态 01准点 02早点 03晚点 04头码车
serverNoType: [
{type: '01', showColor: '#FFFFFF'},
{type: '02', showColor: '#FFF000'}
], // 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车
directionType: [
{
type: '01',
lineLShow: true,
lineRShow: true,
arrowLShow: false,
arrowRShow: false
},
{
type: '02',
lineLShow: false,
lineRShow: true,
arrowLShow: false,
arrowRShow: true
},
{
type: '03',
lineLShow: true,
lineRShow: false,
arrowLShow: true,
arrowRShow: false
}
], // 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
directionStopType: [
{
type: '01',
lineLShow: false,
lineRShow: false
},
{
type: '02',
lineLShow: false,
lineRShow: true
},
{
type: '03',
lineLShow: true,
lineRShow: false
}
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
runModeStatus: [
{
status: '01',
trainLColor: '#00FF00',
trainRColor: '#00FF00'
},
{
status: '02',
trainLColor: '#FF8000',
trainRColor: '#FF8000'
},
{
status: '03',
trainLColor: '#FFFF00',
trainRColor: '#FFFF00'
},
{
status: '04',
trainLColor: '#C2C2C2',
trainRColor: '#C2C2C2'
},
{
status: '05',
trainLColor: '#C2C2C2',
trainRColor: '#C2C2C2'
}
], // 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
runControlStatus: [
{
status: '01',
hShow: false,
sShow: false
},
{
status: '02',
hShow: true,
sShow: false
},
{
status: '03',
hShow: false,
sShow: true
}
], // 设置运行控制状态类型 01正常 02扣车 03停跳
doorStatus: [
{status: '01', dShow: false},
{status: '02', dShow: true}
], // 设置车门状态类型 01关门 02开门
communicationStatus: [
{status: '01', trainColor: '#725A64'},
{status: '02', trainColor: '#C0C0C0'}
], // 设置通信状态 01正常 02故障
alarmStatus: [
{status: '01', aShow: false},
{status: '02', aShow: true}
] // 设置报警状态 01不报警 02报警
}
};
}
}
export default new SkinStyle();

View File

@ -1,543 +0,0 @@
import defaultStyle from '../defaultStyle';
import deviceType from '../../constant/deviceType';
class SkinStyle extends defaultStyle {
constructor() {
super();
this[deviceType.Link] = {
lineWidthColor: '#FFFFFF', // line 颜色
linkWidth: 4, // link 宽度
linkColor: '#4e8de6', // link 线条颜色
linkTextColor: '#FFFFFF' // link 字体颜色
};
this[deviceType.Section] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
fontSize: 12, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: 'lightgreen', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: { // 逻辑区段名称
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: { // 站台
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 24, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: { // 折返
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: { // 转换轨
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: { // 目的地
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'bold', // 字体粗细
fontColor: 'yellow', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
line: {
width: 5, // 区段宽度
beyondWidth: 0, // 区段宽超出宽度
invadeColor: '#FFFFFF', // 区段侵入颜色
spareColor: '#5578B6', // 区段空闲颜色
communicationOccupiedColor: 'lightpink', // 区段通信车占用颜色
unCommunicationOccupiedColor: 'red', // 区段非通讯车占用颜色
routeLockColor: 'rgba(0, 255, 0, 1)', // 区段路由锁定颜色
faultLockColor: 'white', // 区段故障锁定颜色
undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FFFFFF', // 保护区段锁闭
blockColor: 'pink', // 区段封锁颜色
atcExcisionColor: '#A0522D', // 区段atc切除颜色
atsExcisionColor: '#A0522D', // 区段ats切除颜色
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
protectiveLockColor: '#92D14F', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: 'white' // 逻辑区段名称颜色 (未用)
},
axle: {
radius: 3, // 计轴 半径
distance: 5, // 计轴和区段之间的距离 (未用)
color: 'white', // 区段计轴颜色
resetColor: '#00FFFF', // 区段计轴预复位颜色
Failure: '#E6A23C' // #FFFF00 计轴失效
},
speedLimit: { // 限速元素
width: 1, // 限速线的宽度
distance: 5, // 限速线距离区段距离
lineColor: '#C0C000', // 限速线颜色 (黄色透明光)
nameBackground: '#C0C000', // 限速名称背景颜色
nameShow: true, // 名称显示
nameNumberColor: '#C00808', // 限速值颜色
nameNumberFontSize: 11, // 限速值大小
kilometerColor: '#fff', // 公里标颜色
kilometerFontSize: 8, // 公里标大小
drogueWidth: 19, // 浮标宽度
drogueHeight: 12 // 浮标高度
},
separator: {
z: 6, // 分割符层级
width: 1.5, // 分隔符宽度
endWidth: 1.5, // 尽头分隔符宽度
endColor: '#FFFFFF', // 尽头分隔符颜色
color: 'white' // 区段边界符颜色
}
};
this[deviceType.Signal] = {
distance: 3, // 设备距离区段的距离
post: {
standardColor: '#C0C0C0', // 灯柱颜色
standardWidth: 2 // 灯柱宽度
},
text: {
distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: 'white', // 信号灯字体默认色
blockColor: '#EF0C08', // 信号灯字体锁定颜色
checkColor: '#00FF00' // 信号保护区段检查颜色
},
lamp: {
borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度
borderWidth: 2, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色
radiusR: 3, // 信号灯半径
blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#C0C0C0', // 信号灯灰色
redColor: 'red', // 信号灯红色
greenColor: 'green', // 信号灯绿色
yellowColor: 'yellow', // 信号灯黄色
whiteColor: '#FFFFFF', // 信号灯白色
blueColor: '#0070C0' // 信号灯蓝色
},
route: {
direction: true, // 自动通过方向
offset: { x: 4, y: 0}, // 自动通过偏移量
routeColor: '#00FF00' // 自动进路
},
auto: {
direction: false, // 自动通过方向
offset: { x: -4, y: 0}, // 自动通过偏移量
width: 5, // 自动宽度
manualControl: '#FFFF00', // 人工控制
autoRoute: '#00FF00', // 自动进路
autoTrigger: '#FFFF00', // 自动触发
outConflict: '#C00808' // 出车冲突
},
delay: {
direction: false, // 延时解锁方向
offset: { x: -5, y: 0}, // 延时解锁偏移量
fontSize: 11, // 延迟解锁字体大小
fontColor: '#C00808', // 延迟解锁颜色
fontWeight: 'bold' // 字体粗细
},
button: {
distance: 5, // 信号灯按钮距离区段的距离
borderDashColor: '#FFFFFF', // 信号灯按钮边线
buttonColor: 'darkgreen', // 信号灯按钮颜色
buttonLightenColor: 'yellow' // 信号灯按钮闪烁颜色
}
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小
haveJumpShow: true // 站台是否有列车停跳显示
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
distance: 4, // 站台和屏蔽门之间的距离
defaultColor: 'green', // 屏蔽门默认颜色
splitDoorColor: 'green' // 屏蔽门切除颜色
},
stand: { // 站台
headFontSize: 10, // 站台首端字体大小
spareColor: 'white', // 站台空闲颜色
stopColor: 'yellow', // 站台列车停站颜色
jumpStopColor: 'blue', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径
offset: {x: 0, y: 40}, // 站台紧急关闭偏移量
closeColor: 'red' // 站台紧急关闭颜色
},
reentry: { // 站台折返策略
position: 0, // 折返方向
offset: {x: -16, y: 20}, // 折返偏移量
noHumanColor: '#0F16DA', // 站台无人折返
autoChangeEndsColor: '#0BF400' // 站台自动换端
},
detainCar: { // 扣车
text: '扣', // 扣车显示内容
position: -1, // 扣车方向
offset: {x: -8, y: -20}, // 扣车偏移量
trainColor: 'yellow', // 车站扣车颜色
centerTrainColor: 'white', // 中心扣车颜色
andCenterTrainColor: 'red', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: {x: -8, y: -4}, // 运行时间偏移量
textColor: 'white' // 停站时间字体颜色
},
jump: {
text: '跳', // 停跳显示内容
position: -1, // 停跳方向
offset: {x: -8, y: 0},
textColor: '#0000FF', // 停跳文字颜色
arcColor: '#0000FF', // 停跳圆圈颜色
fillColor: 'rgba(0,0,0,0)', // 透明填充颜色
r: 8 // 圆半径大小
},
level: { // 运行等级
position: 1, // 运行等级方向
offset: {x: -8, y: 30}, // 运行等级偏移量
textColor: '#FFF000' // 停站等级字体颜色
}
};
this[deviceType.StationControl] = {
text: {
distance: 2, // 灯和文字之间的距离
fontSize: 12, // 字体大小
fontFormat: 'consolas', // 字体格式
fontColor: '#ffffff', // 字体颜色
fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top' // 字体垂直对齐
},
lamp: {
count: 4, // 控制模式的个数
offset: {x: 0, y: 0}, // 偏移量
radiusR: 4, // 控制模式灯的半径
distance: 36, // 控制模式之间灯之间的距离
grayColor: '#C0C0C0', // 控制模式灰色
greenColor: 'green', // 控制模式绿色
redColor: 'red', // 控制模式红色
yellowColor: 'yellow' // 控制模式黄色
},
arrow: {
show: false // 控制模式箭头显隐
}
};
this[deviceType.StationCounter] = {
text: {
distance: 2, // 计数器名称和文字的距离
fontColor: '#FFFFFF', // 计数器字体颜色
borderColor: '#E4EF50' // 计数器边框颜色
}
};
this[deviceType.StationDelayUnlock] = {
text: {
distance: 3, // 延迟解锁和设备之间的距离
fontColor: '#FFFFFF', // 延时解锁字体颜色
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.Station] = {
kilometerPosition: 'up' // 公里标朝向
};
this[deviceType.Switch] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 5, y: -10}, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: 'lightgreen', // 道岔失去颜色
locateColor: 'lightgreen', // 道岔定位颜色
inversionColor: 'lightgreen', // 道岔反位颜色
monolockColor: '#FFFFFF' // 道岔单锁颜色
},
core: {
length: 10 // 道岔单边长度
},
monolock: { // 道岔单锁配置
locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
inversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
rectShow: true, // 道岔单锁 矩形框是否显示
rectWidth: 18, // 矩形框 宽高
rectBorderColor: '#fff' // 矩形边框颜色
},
block: { // 道岔封锁配置
nameBorderShow: false, // 道岔名称是否有包围框 显示
contentRectShow: true, // 道岔封锁显示
contentRectColor: 'red' // 道岔封锁边框颜色
}
};
this[deviceType.LcControl] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色
}
};
this[deviceType.ZcControl] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#00FF00' // 控制灯颜色
}
};
this[deviceType.LimitControl] = {
text: {
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 控制灯大小
controlColor: '#ECE9D8' // 控制灯颜色
}
};
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};
this[deviceType.TrainWindow] = {
lineColor: '#4DD43F', // 车次窗颜色
lineDash: null, // 车次窗虚线间隔
lineWidth: 1, // 车次窗线宽
trainWindowSmooth: 0 // 车次窗矩形圆滑程度
};
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 1, // 车身line宽
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔
upPadding: 4, // 上边距离
trainBodyFillColor: '#000099', // 列车车身填充颜色
trainNameFormat: 'serviceNumber:targetCode'// 列车显示格式
},
hsda: {
lrPaddingHSDA: 3, // HSDA两边间隔
upPaddingHSDA: 4, // HSDA上边距离
trainHSDATextFontSize: 8, // 列车HDSA字号
textHContent: '扣', // textH文本
textSContent: '跳', // textS文本
textDContent: '门', // textD文本
textAContent: '警' // textA文本
},
trainNumber: {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'DDD', // 默认目的地码
trainTargetTextAlign: 'left', // 目的地码文字显示位置
trainNumberOffset: { x: 24, y: 4}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '000', // 服务号(表号)前缀
defaultServiceNumber: 'TTT', // 默认服务号(表号)
defaultServerNoColor: '#FFFFFF', // 默认服务号状态显示颜色
trainServerOffset: { x: 4, y: 4} // 列车服务号偏移
},
trainTarget: {
tripNumberPrefix: '000', // 车次号前缀
defaultTripNumber: 'DDD', // 默认车次号2
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
trainTargetTextAlign: 'right' // 车次号文字显示位置
},
trainTargetNumber: {
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
},
trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
trainHeadRectHeight: 20 // 列车车头矩形高度
},
common: {
trainHeight: 20, // 列车高度
trainHeadDistance: 2, // 列车和车头之间的间距
trainWidth: 55, // 列车长度
trainTextFontSize: 16, // 列车字号
fontFamily: 'consolas', // 默认字体 族类
haveTextHSDA: true, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 7/5, // 字体宽高比例用以拼接text是计算位置
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
useSelfFormat: true, // 使用配置项的nameFormat
useSelfText: true // 使用配置项的字体大小
},
trainStatusStyle: {
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
destinationStatusSetText: 'trainTarget', // 目的地状态设置的对应哪个text的颜色
destinationStatus: [
{status: '01', showColor: '#FFFFFF'},
{status: '02', showColor: '#00FF00'},
{status: '03', showColor: '#A0522D'},
{status: '04', showColor: '#FFFF00'}
], // 目的地状态 01准点 02早点 03晚点 04头码车
serverNoType: [
{type: '01', showColor: '#FFFFFF'},
{type: '02', showColor: '#FFF000'}
], // 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车
directionType: [
{
type: '01',
lineLShow: true,
lineRShow: true,
arrowLShow: false,
arrowRShow: false
},
{
type: '02',
lineLShow: false,
lineRShow: true,
arrowLShow: false,
arrowRShow: true
},
{
type: '03',
lineLShow: true,
lineRShow: false,
arrowLShow: true,
arrowRShow: false
}
], // 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
directionStopType: [
{
type: '01',
lineLShow: false,
lineRShow: false
},
{
type: '02',
lineLShow: false,
lineRShow: true
},
{
type: '03',
lineLShow: true,
lineRShow: false
}
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
runModeStatus: [
{
status: '01',
trainLColor: '#FFFFFF',
trainRColor: '#FFFFFF'
},
{
status: '02',
trainLColor: '#00FF00',
trainRColor: '#00FF00'
},
{
status: '03',
trainLColor: '#FFFF00',
trainRColor: '#FFFF00'
},
{
status: '04',
trainLColor: '#A0522D',
trainRColor: '#A0522D'
},
{
status: '05',
trainLColor: '#A0522D',
trainRColor: '#A0522D'
}
], // 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
runControlStatus: [
{
status: '01',
hShow: false,
sShow: false
},
{
status: '02',
hShow: true,
sShow: false
},
{
status: '03',
hShow: false,
sShow: true
}
], // 设置运行控制状态类型 01正常 02扣车 03停跳
doorStatus: [
{status: '01', dShow: false},
{status: '02', dShow: true}
], // 设置车门状态类型 01关门 02开门
communicationStatus: [
{status: '01', trainColor: '#725A64'},
{status: '02', trainColor: '#C0C0C0'}
], // 设置通信状态 01正常 02故障
alarmStatus: [
{status: '01', aShow: false},
{status: '02', aShow: true}
] // 设置报警状态 01不报警 02报警
}
};
}
}
export default new SkinStyle();

View File

@ -1,454 +0,0 @@
import defaultStyle from '../defaultStyle';
import deviceType from '../../constant/deviceType';
class SkinStyle extends defaultStyle {
constructor() {
super();
this[deviceType.Link] = {
lineWidthColor: '#FFFFFF', // line 颜色
linkWidth: 4.4, // link 宽度
linkColor: '#3F3F3F', // link 线条颜色
linkTextColor: '#FFFFFF' // link 字体颜色
};
this[deviceType.Section] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 6, // 文字离区段距离
fontSize: 8, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 30, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 30, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 28, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
fontSize: 10, // 字体大小
fontWeight: 'bold', // 字体粗细
fontColor: 'yellow', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
line: {
width: 5, // 区段宽度
beyondWidth: 1, // 区段宽超出宽度
invadeColor: '#EF0C08', // 区段侵入颜色
spareColor: '#3F3F3F', // 区段空闲颜色
communicationOccupiedColor: '#FF329A', // 区段通信车占用颜色
unCommunicationOccupiedColor: '#FE0000', // 区段非通讯车占用颜色
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
faultLockColor: '#9B4A0A', // 区段故障锁定颜色
undefinedColor: '#0071C1', // 区段未定义颜色
protectionLockedColor: '#FEFF00', // 保护区段锁闭(未用)
blockColor: '#800080', // 区段封锁颜色
atcExcisionColor: '#A0522D', // 区段atc切除颜色
atsExcisionColor: '#A0522D', // 区段ats切除颜色
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
protectiveLockColor: '#FFFF00', // 区段保护锁闭
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
logicalTextColor: '#FFFFFF' // 逻辑区段名称颜色 (未用)
},
axle: {
radius: 3, // 计轴 半径
distance: 5, // 计轴和区段之间的距离 (未用)
color: '#FFFFFF', // 区段计轴颜色
resetColor: '#00FFFF', // 区段计轴预复位颜色
Failure: '#E6A23C' // #FFFF00 计轴失效
},
speedLimit: { // 限速元素
width: 1, // 限速线的宽短
distance: 5, // 限速线距离区段距离
lineColor: '#FFFF00', // 限速线颜色
nameShow: false // 名称显示
},
separator: {
z: 6, // 分割符层级
width: 1.2, // 分隔符宽度
endWidth: 3.5, // 尽头分隔符宽度
endColor: '#3F3F3F', // 尽头分隔符颜色
color: '#3149C3' // 区段边界符颜色
}
};
this[deviceType.Signal] = {
distance: 10, // 设备距离区段的距离
post: {
standardColor: '#3149C3', // 灯珠颜色
standardWidth: 2 // 灯珠宽度
},
text: {
distance: 0, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: true, // 信号字体对其方式
fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: '#FFFFFF', // 信号灯字体默认色
blockColor: '#EF0C08', // 信号灯字体锁定颜色
checkColor: '#00FF00', // 信号字体
nameBorderShow: true // 信号机名字边框显示
},
lamp: {
stopWidth: 2, // 禁止线宽度
borderWidth: 1, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色
radiusR: 6, // 信号灯半径
blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#7F7F7F', // 信号灯灰色
redColor: '#FF0000', // 信号灯红色
greenColor: '#00FF00', // 信号灯绿色
yellowColor: '#FFFF00', // 信号灯黄色
whiteColor: '#FFFFFF', // 信号灯白色
blueColor: '#0070C0' // 信号灯蓝色
},
route: {
direction: false, // 自动进路方向
offset: { x: -4, y: 0 }, // 自动进路偏移量
routeColor: '#00FF00' // 自动进路
},
auto: {
direction: false, // 自动通过方向
offset: { x: -4, y: 0}, // 自动通过偏移量
width: 5, // 自动宽度
autoRoute: '#00FF00', // 自动进路
autoTrigger: '#FFFF00', // 自动触发
manualControl: '#FFFF00', // 人工控制
outConflict: '#C00808' // 出车冲突
},
delay: {
direction: true, // 延时解锁方向
offset: { x: 15, y: -10}, // 延时解锁偏移量
fontSize: 11, // 延迟解锁字体大小
fontColor: '#FF0000', // 延迟解锁颜色
fontWeight: 'bold' // 字体粗细
},
button: {
distance: 5, // 信号灯按钮距离区段的距离
borderDashColor: '#FFFFFF', // 信号灯按钮边线
buttonColor: 'darkgreen', // 信号灯按钮颜色
buttonLightenColor: '#E4EF50' // 信号灯按钮闪烁颜色
}
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 11 // 站台默认字体大小
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
distance: 8, // 站台和屏蔽门之间的距离
defaultColor: '#00FF00', // 屏蔽门默认颜色
splitDoorColor: '#F61107' // 屏蔽门切除颜色
},
stand: { // 站台
headFontSize: 11, // 站台首端字体大小
spareColor: '#606060', // 站台空闲颜色
stopColor: '#FEFE00', // 站台列车停站颜色
jumpStopColor: '#9A99FF', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径
offset: {x: 0, y: 40}, // 站台紧急关闭偏移量
closeColor: '#F61107' // 站台紧急关闭颜色
},
reentry: { // 站台折返策略
position: 0, // 折返方向
offset: {x: -16, y: 20}, // 折返偏移量
noHumanColor: '#0F16DA', // 站台无人折返
autoChangeEndsColor: '#0BF400' // 站台自动换端
},
detainCar: { // 扣车
text: 'H', // 扣车显示内容
position: -1, // 扣车方向
offset: {x: -8, y: -6}, // 扣车偏移量
trainColor: '#E4EF50', // 车站扣车颜色
centerTrainColor: '#FFFFFF', // 中心扣车颜色
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
},
stopTime: { // 停站时间
position: 1, // 运行时间方向
offset: {x: -8, y: 26}, // 运行时间偏移量
textColor: '#FFFFFF' // 停站时间字体颜色
},
level: { // 运行等级
position: 1, // 运行等级方向
offset: {x: -8, y: 6}, // 运行等级偏移量
textColor: '#FFFFFF' // 停站等级字体颜色
}
};
this[deviceType.StationControl] = {
text: {
distance: 2, // 灯和文字之间的距离
fontSize: 11, // 字体大小
fontFormat: 'consolas', // 字体格式
fontColor: '#ffffff', // 字体颜色
fontWeight: 'normal', // 字体粗细
textAlign: 'middle', // 字体水平对齐
textVerticalAlign: 'top' // 字体垂直对齐
},
lamp: {
count: 2, // 控制模式灯个数
offset: {x: 0, y: 0}, // 控制模式灯偏移量
radiusR: 4, // 控制模式灯的半径
distance: 36, // 控制模式之间灯之间的距离
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
},
arrow: {
show: true // 控制模式箭头显隐
}
};
this[deviceType.StationCounter] = {
text: {
distance: 2, // 计数器名称和文字的距离
fontColor: '#FFFFFF', // 计数器字体颜色
borderColor: '#E4EF50' // 计数器边框颜色
}
};
this[deviceType.StationDelayUnlock] = {
text: {
distance: 3, // 延迟解锁和设备之间的距离
fontColor: '#FFFFFF', // 延时解锁字体颜色
borderColor: '#FFFFFF' // 延迟解锁边框颜色
}
};
this[deviceType.Station] = {
kilometerPosition: 'up' // 公里标朝向
};
this[deviceType.Switch] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 0, y: 8}, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#FFFFFF', // 道岔失去颜色
locateColor: '#00FF00', // 道岔定位颜色
inversionColor: '#9C9D09', // 道岔反位颜色
monolockColor: '#870E10' // 道岔单锁颜色
},
core: {
length: 6 // 道岔单边长度
},
block: { // 道岔封锁配置
nameBorderShow: true, // 道岔名称是否有包围框 显示
contentRectShow: false // 道岔封锁显示
},
monolock: { // 道岔单锁配置
locationColor: '#870E10', // 道岔单锁定位颜色 (红色)
inversionColor: '#870E10', // 道岔单锁反位颜色 (红色)
rectShow: false // 道岔单锁 矩形框是否显示
}
};
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};
this[deviceType.LcControl] = {};
this[deviceType.ZcControl] = {};
this[deviceType.LimitControl] = {};
this[deviceType.TrainWindow] = {
lineColor: '#4DD43F', // 车次窗颜色
lineDash: null, // 车次窗虚线间隔
lineWidth: 1, // 车次窗线宽
trainWindowSmooth: 0 // 车次窗矩形圆滑程度
};
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 0, // 车身line宽
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [
{
type: '03',
serviceNumber: 'MM',
nameFormat: 'serviceNumber:groupNumber'
}
], // 特殊列车类型需设置显示格式
lrPadding: 1, // 两边间隔
upPadding: 1, // 上边距离
trainBodyFillColor: '#000000', // 列车车身填充颜色
trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式
},
hsda: {
trainHSDATextFontSize: 8// 列车HDSA字号
},
trainNumber: {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'AAA', // 默认目的地码
trainTargetTextAlign: 'left', // 车次号文字显示位置
trainNumberOffset: { x: 1, y: 1}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀
defaultServiceNumber: 'BB', // 默认服务号(表号)
trainServerOffset: { x: 26, y: 1}// 列车服务号偏移
},
trainTarget: {
tripNumberPrefix: '0000', // 车次号前缀
defaultDirectionCode: 'D', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: 42, y: 1}// 列车车次号偏移
},
trainTargetNumber: {
groupNumberPrefix: '000', // 车组号前缀
defaultGroupNumber: 'EEE', // 默认车组号
trainTargetNumberOffset: {x: 0, y: 1}// 车组号偏移量
},
trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
},
common: {
trainHeight: 17, // 列车高度
trainHeadDistance: 2, // 列车和车头之间的间距
trainWidth: 76, // 列车长度
trainTextFontSize: 15, // 列车字号
fontFamily: 'consolas', // 默认字体 族类
nameFontSize: 15, // 字体大小
haveTextHSDA: false, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 8/15, // 字体宽高比例用以拼接text是计算位置
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 2 // 计算列车长度时--列车长比text多出尺寸
},
trainStatusStyle: {
destinationStatus: [
{status: '01', showColor: '#FFFFFF'},
{status: '02', showColor: '#00FF00'},
{status: '03', showColor: '#3265FF'},
{status: '04', showColor: '#9B4A09'},
{status: '05', showColor: '#EF0C08'},
{status: '06', showColor: '#FFFFFF'},
{status: '07', showColor: '#FFFF00'}
], // 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除
destinationStatusSetText: 'trainServer', // 目的地状态设置的对应哪个text的颜色
directionType: [
{
type: '01',
lineLShow: false,
lineRShow: false,
arrowLShow: false,
arrowRShow: false
},
{
type: '02',
lineLShow: false,
lineRShow: false,
arrowLShow: false,
arrowRShow: true
},
{
type: '03',
lineLShow: false,
lineRShow: false,
arrowLShow: true,
arrowRShow: false
}
], // 运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
directionStopType: [
{type: '01', lineLShow: false, lineRShow: false},
{type: '02', lineLShow: false, lineRShow: true},
{type: '03', lineLShow: true, lineRShow: false}
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
runModeStatus: [
{
status: '01',
trainLColor: '#EF0C08',
trainRColor: '#EF0C08'
},
{
status: '02',
trainLColor: '#00FF00',
trainRColor: '#00FF00'
},
{
status: '03',
trainLColor: '#FFFF00',
trainRColor: '#FFFF00'
},
{
status: '04',
trainLColor: '#EA700D',
trainRColor: '#EA700D'
},
{
status: '05',
trainLColor: '#A0522D',
trainRColor: '#A0522D'
}
], // 列车运行模式对应车头颜色 01信号中断 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
runControlStatus: [], // 设置运行控制状态类型 eg:{status: '01', hShow: false, sShow: false}
doorStatus: [], // 设置车门状态类型 eg:{status: '01', dShow: false}
communicationStatus: [], // 设置通信状态 eg:{status: '01', trainColor:'#725A64'}
alarmStatus: [], // 设置报警状态 eg:{status: '01', aShow: false}
serverNoType: []// 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'}
}
};
}
}
export default new SkinStyle();

View File

@ -0,0 +1,188 @@
<template>
<el-dialog
class="batong-01__systerm view-train-id"
title="列车识别号显示设置"
:visible.sync="show" width="420px" :before-close="doClose"
:z-index="2000"
v-dialogDrag :modal="false" :close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px double lightgray;">
<span class="base-label">计划车显示模式</span>
<el-radio-group v-model="planMode">
<el-row>
<el-col :span="10">
<el-radio :label="1">表号+车次号</el-radio>
</el-col>
<el-col :span="10" :offset="4">
<el-radio :label="2">表号+车组号</el-radio>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-radio :label="3">目的地号+车次号</el-radio>
</el-col>
<el-col :span="10" :offset="4">
<el-radio :label="4">目的地号+车组号</el-radio>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-radio :label="5">目的地号+表号+车次号</el-radio>
</el-col>
<el-col :span="10" :offset="4">
<el-radio :label="6">目的地号+表号+车组号</el-radio>
</el-col>
</el-row>
</el-radio-group>
</div>
<div style="padding: 10px 20px; border: 1px double lightgray; margin: 20px 0px;">
<span class="base-label">头码车显示模式</span>
<el-radio-group v-model="headMode">
<el-row>
<el-col :span="10">
<el-radio :label="3">目的地号+车次号</el-radio>
</el-col>
<el-col :span="6" :offset="8">
<el-radio :label="4">目的地号+车组号</el-radio>
</el-col>
</el-row>
</el-radio-group>
</div>
<div style="padding: 10px 20px; border: 1px double lightgray;">
<span class="base-label">字体大小</span>
<el-row>
<el-col :span="10">
<el-input v-model="fontSize" size="small" min="16" max="99" />
</el-col>
<el-col :span="10" :offset="1">
<span style="height:32px; line-height:32px;">范围16-99</span>
</el-col>
</el-row>
</div>
<el-row class="button-group">
<el-col :span="6" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="4" :offset="8">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default {
name: 'ViewTrainId',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operate: null,
operation: '',
planMode: 5,
headMode: 5,
fontSize: 16
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
}
},
mounted() {
this.$nextTick(() => {
this.setTrainDispaly();
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate) {
this.operate = operate || {};
this.operation = operate.operation;
//
if (!this.dialogShow) {
this.loading = false;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
cancel() {
const operate = {
type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
});
},
commit() {
const operate = {
over: true,
type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation,
val: [this.planMode, this.headMode, this.fontSize].join('::')
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.setTrainDispaly();
this.doClose();
}
}).catch(error => {
this.loading = false;
});
},
setTrainDispaly() {
const updatList = [];
const trainList = this.$store.getters['training/viewTrainList']();
if (trainList && trainList.length > 0) {
const nameFormat = this.trainNameFormatBy(this.planMode);
const nameFontSize = this.fontSize;
updatList.forEach(elem => {
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameFormat, nameFontSize })); //
});
this.$store.dispatch('map/updateMapDevices', updatList);
}
},
trainNameFormatBy(mode) {
switch (mode.toString()) {
case '1': return 'serverNo:trainNo'; // +
case '2': return 'serverNo:trainNumber'; // +
case '3': return 'targetCode:trainNo'; // +
case '4': return 'targetCode:trainNumber'; // +
case '5': return 'targetCode:serverNo:trainNo'; // ++
case '6': return 'targetCode:serverNo:trainNumber'; // ++
}
return ''; //
}
}
};
</script>

View File

@ -1,449 +0,0 @@
export function getAttrList(code, key, that) {
attribute[code][key].items.forEach(ele => {
if (ele.type == 'select') {
ele.options = that[ele.optionCode];
}
if (ele.change && that[ele.deviceChange]) {
ele.deviceChange = that[ele.deviceChange];
}
if (ele.isDisabled) {
ele.disabled = that[ele.isDisabled];
}
if (ele.hiddenName) {
ele.isHidden = !that[ele.hiddenName];
}
if (ele.isButtonType) {
ele.buttonShowType = that[ele.isButtonType];
}
if (ele.buttonType) {
ele.hover = that.hover;
}
if (ele.pointDisabledName) {
ele.pointDisabled = that[ele.pointDisabledName];
}
if (ele.addPointChange) {
ele.addPoint = that[ele.addPointChange];
}
if (ele.delPointChange) {
ele.delPoint = that[ele.delPointChange];
}
});
return Object.assign({}, attribute[code][key]);
}
export function getAttrRules(code, key) {
return Object.assign({}, attribute[code][key]);
}
export const attribute = {
/*
* select optionCode 表示 循环列表名称
* select 有点change事件 deviceChange 表示事件名称
* 有判断 显隐问题 使用 hiddenName 表示判断属性名称
* 有判断 是否禁用 使用 isDisabled 表示判断属性名称
*/
link: {
attr: {
labelWidth: '130px',
items: [
{ prop: 'code', label: 'Link编码:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'linkList', change: true, deviceChange: 'deviceChange' },
{ prop: 'name', label: 'Link名称:', type: 'input' },
{ prop: 'lengthShow', label: 'Link显示长度:', type: 'number', min: 50, placeholder: 'px' },
{ prop: 'lengthFact', label: 'Link实际长度:', type: 'number', min: 0, placeholder: '米' },
{ prop: 'color', label: 'Link颜色:', type: 'color' },
{ prop: 'leftFdCode', label: '左侧正向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'linkList' },
{ prop: 'leftSdCode', label: '左侧侧向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'linkList' },
{ prop: 'rightFdCode', label: '右侧正向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'linkList' },
{ prop: 'rightSdCode', label: '右侧侧向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'linkList' },
{ prop: 'lp', label: 'Link 起点坐标:', type: 'coordinate', width: '160px', children: [
{ prop: 'lp.x', firstLevel: 'lp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'lp.y', firstLevel: 'lp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] },
{ prop: 'rp', label: 'Link 终点坐标:', type: 'coordinate', width: '160px', children: [
{ prop: 'rp.x', firstLevel: 'rp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'rp.y', firstLevel: 'rp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] }
],
rules: {
code: [
{ required: true, message: '请选择设备', trigger: 'change' }
],
name: [
{ required: true, message: '请输入Link名称', trigger: 'blur' }
],
lengthFact: [
{ required: true, message: '请输入Link实际长度', trigger: 'blur' }
]
}
}
},
section: {
attr: {
labelWidth: '160px',
items: [
{ prop: 'stationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', disabled: false, options: [], optionCode: 'stationList', isDisabled: 'isStationCodeDisabled'},
{ prop: 'parentCode', label: '关联物理区段:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', disabled: true, options: [], optionCode: 'sectionList', isHidden: true, hiddenName: 'isParentCode' },
{ prop: 'code', label: '区段编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'sectionList', change: true, deviceChange: 'deviceChange' },
{ prop: 'type', label: '区段类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SectionTypeList' },
{ prop: 'name', label: '区段名称:', type: 'input' },
{ prop: 'namePoint', label: '区段名称偏移量:', type: 'coordinate', width: '160px', children: [
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] },
{ prop: 'kmRangeLeft', label: '左侧公里标(米):', type: 'number', min: 0, placeholder: '' },
{ prop: 'kmRangeRight', label: '右侧公里标(米):', type: 'number', min: 0, placeholder: '' },
{ prop: 'region', label: '区间:', type: 'select', optionLabel: 'label', optionValue: 'value', options: [], optionCode: 'regionList' },
{ prop: 'nameShow', label: '是否显示区段名称:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'axleShow', label: '是否显示计轴:', type: 'checkbox', disabled: false, isHidden: true, hiddenName: 'isSectionType', isDisabled: 'isStationAxleShow' },
{ prop: 'logicSectionShow', label: '是否显示逻辑区段:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'logicSectionNameShow', label: '是否显示逻辑区段名称:', type: 'checkbox', disabled: false, isHidden: true, hiddenName: 'isSectionType', isDisabled: 'islogicSectionNameShow' },
{ prop: 'isStandTrack', label: '是否站台轨:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'standTrackName', label: '站台轨名称:', type: 'input', isHidden: true, hiddenName: 'isstandTrackNameShow' },
{ prop: 'standTrackNamePosition', label: '站台轨名称偏移量:', type: 'coordinate', isHidden: true, hiddenName: 'isstandTrackNameShow', children: [
{ prop: 'standTrackNamePosition.x', firstLevel: 'standTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'standTrackNamePosition.y', firstLevel: 'standTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] },
{ prop: 'relStandCode', label: '站台编码:', type: 'selectHover', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'stationStandList', buttonType: 'relStandCode', hover: 'hover', isButtonType: 'isButtonType', buttonShowType: false, isHidden: true, hiddenName: 'isrelStandCode' },
{ prop: 'isReentryTrack', label: '是否折返轨:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'reentryTrackName', label: '折返轨名称:', type: 'input', isHidden: true, hiddenName: 'isreentryTrackName' },
{ prop: 'reentryTrackNamePosition', label: '折返轨名称偏移量:', type: 'coordinate', isHidden: true, hiddenName: 'isreentryTrackName', children: [
{ prop: 'reentryTrackNamePosition.x', firstLevel: 'reentryTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'reentryTrackNamePosition.y', firstLevel: 'reentryTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] },
{ prop: 'isTransferTrack', label: '是否转换轨:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'transferTrackName', label: '转换轨名称:', type: 'input', isHidden: true, hiddenName: 'istransferTrackName' },
{ prop: 'transferTrackNamePosition', label: '转换轨名称偏移量:', type: 'coordinate', isHidden: true, hiddenName: 'istransferTrackName', children: [
{ prop: 'transferTrackNamePosition.x', firstLevel: 'transferTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'transferTrackNamePosition.y', firstLevel: 'transferTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] },
{ prop: 'destinationCode', label: '目的地码:', type: 'input', isHidden: true, hiddenName: 'isdestinationCode' },
{ prop: 'destinationCodePoint', label: '目的地码坐标:', type: 'coordinate', isHidden: true, hiddenName: 'isdestinationCode', children: [
{ prop: 'destinationCodePoint.x', firstLevel: 'destinationCodePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] },
{ prop: 'destinationCodeShow', label: '是否显示目的地码:', type: 'checkbox', isHidden: true, hiddenName: 'isdestinationCode' },
{ prop: 'leftStopPointOffset', label: '左向停车点偏移量:', type: 'number', min: 0, placeholder: '', isHidden: true, hiddenName: 'isStopPointOffset' },
{ prop: 'rightStopPointOffset', label: '右向停车点偏移量:', type: 'number', min: 0, placeholder: '', isHidden: true, hiddenName: 'isStopPointOffset' },
{ prop: 'isSwitchSection', label: '是否道岔区段:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'relSwitchCode', label: '关联道岔Code:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'switchList', change: true, deviceChange: 'deviceChange', isHidden: true, hiddenName: 'isRelSwitchCode' },
{ prop: 'logicSectionNameSort', label: '逻辑区段排序:', type: 'radio', isHidden: true, hiddenName: 'isLogicSectionNameSort', radioList: [
{value: true, label: '从小到大'},
{value: false, label: '从大到小'}
] },
{ prop: 'linkCode', label: '关联的Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'linkList', disabled: true, isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'sepTypeLeft', label: '左侧分隔符类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SectionSepTypeList', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'offsetLeft', label: '左侧Link偏移量:', type: 'number', min: 0, placeholder: '米', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'sepTypeRight', label: '右侧分隔符类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SectionSepTypeList', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'offsetRight', label: '右侧Link偏移量:', type: 'number', min: 0, placeholder: '米', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'isSegmentation', label: '是否分割:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'segmentationPosition', label: '默认背景:', type: 'coordinate', isHidden: true, hiddenName: 'issegmentationPosition', children: [
{ prop: 'segmentationPosition.x', firstLevel: 'segmentationPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
{ prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
] },
{ prop: 'isCurve', label: '是否曲线:', type: 'checkbox', isHidden: true, hiddenName: 'isSectionType' },
{ prop: 'points', label: '区段显示坐标:', type: 'points', width: '160px', isHidden: true, hiddenName: 'isPointsShow', pointDisabled: true, pointDisabledName: 'pointDisabledName', addPoint: 'addPoint', addPointChange: 'addPoint', delPoint: 'delPoint', delPointChange: 'delPoint' },
{ prop: 'trainPosType', label: '列车所在方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'TrainPositionTypeList', isHidden: true, hiddenName: 'isSectionType' }
],
rules: {
code: [
{ required: true, message: '请选择设备', trigger: 'change' }
],
name: [
{ required: true, message: '请输入区段名称', trigger: 'blur' }
],
type: [
{ required: true, message: '请输入区段类型', trigger: 'blur' }
],
relStandCode: [
{ required: true, message: '请选择关联站台', trigger: 'change' }
],
leftStopPointOffset: [
{ required: true, message: '请输入左向停车点偏移量', trigger: 'blur' }
],
rightStopPointOffset: [
{ required: true, message: '请输入右向停车点偏移量', trigger: 'blur' }
],
destinationCode: [
{ required: true, message: '请输入目的地码', trigger: 'blur' }
],
'destinationCodePoint.x': [
{ required: true, message: '请输入目的地码坐标X', trigger: 'blur' }
],
'destinationCodePoint.y': [
{ required: true, message: '请输入目的地码坐标Y', trigger: 'blur' }
],
'namePoint.x': [
{ required: true, message: '请输入区段名称坐标X', trigger: 'blur' }
],
'namePoint.y': [
{ required: true, message: '请输入区段名称坐标Y', trigger: 'blur' }
],
logicSectionNameSort: [
{ required: true, message: '请选择逻辑区段名称排序', trigger: 'change' }
],
offsetLeft: [
{ required: true, message: '请输入左侧Link偏移量', trigger: 'blur' }
],
sepTypeLeft: [
{ required: true, message: '请选择左侧分隔符', trigger: 'change' }
],
offsetRight: [
{ required: true, message: '请输入右侧Link偏移量', trigger: 'blur' }
],
sepTypeRight: [
{ required: true, message: '请选择右侧分隔符', trigger: 'change' }
]
}
}
},
signal: {
attr: {
labelWidth: '150px',
items: [
{ prop: 'stationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', required: true, options: [], optionCode: 'stationList' },
{ prop: 'code', label: '信号机编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', required: true, options: [], optionCode: 'signalList', change: true, deviceChange: 'deviceChange' },
{ prop: 'name', label: '信号机名称:', type: 'input', required: true },
{ prop: 'uniqueName', label: '信号机唯一名称:', type: 'input', required: true },
{ prop: 'nameShow', label: '是否显示信号机名称:', type: 'checkbox' },
{ prop: 'lampPostType', label: '灯柱类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SignalLampPostTypeList' },
{ prop: 'lampPositionType', label: '灯位类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SignalLampPositionTypeList' },
{ prop: 'useType', label: '用途类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SignalUseTypeList' },
{ prop: 'potLampType', label: '点灯类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SignalPotLampTypeList' },
{ prop: 'directionType', label: '方向类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SignalDirectionTypeList' },
{ prop: 'positionType', label: '信号机位置类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'SignalPositionTypeList' },
{ prop: 'linkCode', label: 'LinkCode:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'linkList' },
{ prop: 'offset', label: '偏移量:', type: 'number', min: 0, placeholder: '米', required: true },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: '信号机x:', type: 'number', placeholder: '米', required: true },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: '信号机y:', type: 'number', placeholder: '米', required: true },
{ prop: 'rotate', label: '旋转角度:', type: 'number', min: -90, max: 90, placeholder: '度', required: true },
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: '信号机名字偏移量 x:', type: 'number', placeholder: 'px' },
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'x', label: '信号机名字偏移量 y:', type: 'number', placeholder: 'px' },
{ prop: 'buttonShow', label: '是否显示按钮:', type: 'checkbox' },
{ prop: 'buttonPosition.x', firstLevel: 'buttonPosition', secondLevel: 'x', label: '按钮x:', type: 'number', placeholder: 'px', required: true },
{ prop: 'buttonPosition.y', firstLevel: 'buttonPosition', secondLevel: 'x', label: '按钮y:', type: 'number', placeholder: 'px', required: true },
{ prop: 'guideShow', label: '是否显示引导信号灯:', type: 'checkbox' },
{ prop: 'guidePosition.x', firstLevel: 'guidePosition', secondLevel: 'x', label: '引导信号x:', type: 'number', placeholder: 'px', required: true },
{ prop: 'guidePosition.y', firstLevel: 'guidePosition', secondLevel: 'x', label: '引导信号y:', type: 'number', placeholder: 'px', required: true }
],
rules: {
code: [
{ required: true, message: '请选择设备', trigger: 'change' }
],
name: [
{ required: true, message: '请输入信号灯名称', trigger: 'blur' }
],
uniqueName: [
{ required: true, message: '请输入信号机唯一名称', trigger: 'blur' }
],
offset: [
{ required: true, message: '请输入偏移量', trigger: 'blur' }
],
stationCode: [
{ required: true, message: '请输入设备集中站', trigger: 'change' }
],
'position.x': [
{ required: true, message: '信号机x', trigger: 'blur' }
],
'position.y': [
{ required: true, message: '信号机y', trigger: 'blur' }
],
'buttonPosition.x': [
{ required: true, message: '请输入按钮x', trigger: 'blur' }
],
'buttonPosition.y': [
{ required: true, message: '请输入按钮y', trigger: 'blur' }
],
'guidePosition.x': [
{ required: true, message: '请输入引导信号x', trigger: 'blur' }
],
'guidePosition.y': [
{ required: true, message: '请输入引导信号y', trigger: 'blur' }
]
}
}
},
switch: {
attr: {
labelWidth: '170px',
items: [
{ prop: 'stationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'stationList' },
{ prop: 'code', label: '道岔编码:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'switchList', change: true, deviceChange: 'deviceChange' },
{ prop: 'name', label: '道岔名称:', type: 'input' },
{ prop: 'nameShow', label: '是否显示道岔名称:', type: 'checkbox' },
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: '道岔名称x偏移量:', type: 'number', placeholder: 'px' },
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: '道岔名称y偏移量:', type: 'number', placeholder: 'px' },
{ prop: 'turnTime', label: '道岔时间:', type: 'number', min: 0, max: 1000, placeholder: 's' },
{ prop: 'timeoutShow', label: '是否显示道岔时间:', type: 'checkbox' },
{ prop: 'sectionACode', label: '关联的A Section Code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'sectionList' },
{ prop: 'sectionBCode', label: '关联的B Section Code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'sectionList' },
{ prop: 'sectionCCode', label: '关联的C Section Code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'sectionList' },
{ prop: 'tp.x', firstLevel: 'tp', secondLevel: 'x', label: '时间x坐标偏移量:', type: 'number', placeholder: 'px' },
{ prop: 'tp.y', firstLevel: 'tp', secondLevel: 'y', label: '时间y坐标偏移量:', type: 'number', placeholder: 'px' }
],
rules: {
code: [
{ required: true, message: '请选择设备', trigger: 'change' }
],
name: [
{ required: true, message: '请输入道岔名称', trigger: 'blur' }
],
'namePoint.x': [
{ required: true, message: '请输入道岔名称坐标x', trigger: 'blur' }
],
'namePoint.y': [
{ required: true, message: '请输入道岔名称坐标y', trigger: 'blur' }
],
stationCode: [
{ required: true, message: '请输入设备集中站', trigger: 'change' }
],
turnTime: [
{ required: true, message: '请输入道岔时间', trigger: 'blur' }
],
'tp.x': [
{ required: true, message: '请输入时间坐标x', trigger: 'blur' }
],
'tp.y': [
{ required: true, message: '请输入时间坐标y', trigger: 'blur' }
]
}
}
},
station: {
attr: {
labelWidth: '150px',
items: [
{ prop: 'concentrateStationCode', label: '所属联锁站编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'stationList' },
{ prop: 'code', label: '车站编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'stationList', change: true, deviceChange: 'deviceChange' },
{ prop: 'zcCode', label: '所属zc区域编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'zcList' },
{ prop: 'centralized', label: '是否集中站:', type: 'checkbox' },
{ prop: 'name', label: '车站名称:', type: 'input' },
{ prop: 'runPlanName', label: '真实名称:', type: 'input' },
{ prop: 'visible', label: '是否显示:', type: 'checkbox' },
{ prop: 'nameFont', label: '车站字体:', type: 'font', placeholder: '车站字体' },
{ prop: 'nameFontColor', label: '车站字体颜色:', type: 'color' },
{ prop: 'kmPostShow', label: '是否显示公里标名称:', type: 'checkbox' },
{ prop: 'kmRange', label: '公里标距离:', type: 'number', min: 0, placeholder: '米' },
{ prop: 'kmPost', label: '公里标名称:', type: 'input' },
{ prop: 'kmPostFont', label: '公里标字体:', type: 'font', placeholder: '公里标字体' },
{ prop: 'kmPostFontColor', label: '公里标字体颜色:', type: 'color' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x坐标:', type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y坐标:', type: 'number', placeholder: 'px' }
],
rules: {
code: [
{ required: true, message: '请选择设备', trigger: 'change' }
],
name: [
{ required: true, message: '请输入车站名称', trigger: 'blur' }
],
kmRange: [
{ required: true, message: '请输入公里标距离', trigger: 'blur' }
],
kmPost: [
{ required: true, message: '请输入公里标名称', trigger: 'blur' }
],
'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'blur' }
],
'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'blur' }
]
}
}
},
stationControl: {
attr: {
labelWidth: '160px',
items: [
{ prop: 'stationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'stationList' },
{ prop: 'code', label: '控制模式编码:', type: 'select', optionLabel: 'code', optionValue: 'code', options: [], optionCode: 'stationControlList', change: true, deviceChange: 'deviceChange' },
{ prop: 'zcCode', label: '所属zc区域编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'zcList' },
{ prop: 'name', label: '控制模式名称:', type: 'input' },
{ prop: 'zokContent', label: '中控内容:', type: 'input' },
{ prop: 'zakContent', label: '站控内容:', type: 'input' },
{ prop: 'jjzkContent', label: '紧急站控/总报警内容:', type: 'input' },
{ prop: 'zzkContent', label: '站中控内容:', type: 'input' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: '坐标 x:', type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: '坐标 y:', type: 'number', placeholder: 'px' }
],
rules: {
code: [
{ required: true, message: '请选择设备', trigger: 'change' }
],
stationCode: [
{ required: true, message: '请选择所属车站', trigger: 'change' }
],
zokContent: [
{ required: true, message: '请输入中控内容', trigger: 'blur' }
],
zakContent: [
{ required: true, message: '请输入站控内容', trigger: 'blur' }
],
jjzkContent: [
{ required: true, message: '请输入紧急站控内容', trigger: 'blur' }
],
zzkContent: [
{ required: true, message: '请输入站中控内容', trigger: 'blur' }
],
'position.x': [
{ required: true, message: '请输入坐标x', trigger: 'blur' }
],
'position.y': [
{ required: true, message: '请输入坐标y', trigger: 'blur' }
]
}
}
},
stationStand: {
attr: {
labelWidth: '130px',
items: [
{ prop: 'deviceStationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'stationList' },
{ prop: 'code', label: '站台编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: [], optionCode: 'stationStandList', change: true, deviceChange: 'deviceChange' },
{ prop: 'name', label: '站台名称:', type: 'input', disabled: true },
{ prop: 'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: [], optionCode: 'stationList' },
{ prop: 'direction', label: '上下行方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'RunDirectionTypeList' },
{ prop: 'visible', label: '是否显示:', type: 'checkbox' },
{ prop: 'nameShow', label: '是否显示名称:', type: 'checkbox' },
{ prop: 'doorLocationType', label: '站台方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: [], optionCode: 'DoorLocationTypeList' },
{ prop: 'hasDoor', label: '是否显示屏蔽门:', type: 'checkbox' },
{ prop: 'width', label: '宽度 w:', type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: '高度 h', type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: '坐标 x:', type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: '坐标 y:', type: 'number', placeholder: 'px' }
],
rules: {
code: [
{ required: true, message: '请重新选择设备', trigger: 'change' }
],
stationCode: [
{ required: true, message: '请选择关联车站', trigger: 'change' }
],
name: [
{ required: true, message: '请输入计数器名称', trigger: 'change' }
],
doorLocationType: [
{ required: true, message: '请选择站台方向', trigger: 'change' }
],
deviceStationCode: [
{ required: true, message: '请选择所属设备集中站', trigger: 'change' }
],
direction: [
{ required: true, message: '请选择上下行方向', trigger: 'change' }
],
width: [
{ required: true, message: '请输入车站宽度', trigger: 'change' }
],
height: [
{ required: true, message: '请输入车站高度', trigger: 'change' }
],
'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' }
],
'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'change' }
]
}
}
}
};

456
src/scripts/translate.js Normal file
View File

@ -0,0 +1,456 @@
// 转换sheet名称
export const translateSheetTitle = {
sheetTitle: ['基本信息', '皮肤配置', '交路列表', '交路-区段', '自动信号机', '自动信号机列表', '敌对进路', '进路列表', '进路延续保护区段', '进路延续保护道岔', '进路自动触发区段', '进路侧防道岔', '进路-区段', '进路-信号机', '进路-站台', '进路-道岔', '车站计数器', '车站延时解锁表示器', '线段', 'link', '路径单元关系', '路径单元', '区段', '信号机', '速度等级', '车站控制模式', '站台', '车站', '双动道岔', '道岔', '文字信息', '列车', '列车模型', '车次窗', 'zc区域控制', 'lc控制', '全线临时限速', '图片列表'],
sheetName: ['base', 'skinVO', 'routingList', 'routingSectionList', 'autoSignalList', 'autoSignalClearList', 'accessAgainstList', 'accessList', 'routeOverlapSectionList', 'routeOverlapSwitchList', 'routeTriggerSectionList', 'routeFlankProtectionList', 'routeSectionList', 'accessSignalList', 'routeStandList', 'accessSwitchList', 'counterList', 'delayShowList', 'lineList', 'linkList', 'routeUnitRelList', 'routeUnitList', 'sectionList', 'signalList', 'speedLevel', 'stationControlList', 'stationStandList', 'stationList', 'switchCoupledList', 'switchList', 'textList', 'trainList', 'trainModelList', 'trainWindowList', 'zcList', 'lcList', 'tempSpeedLimitList', 'resourceList']
};
// 转换属性名称
export const translate = {
base: {
sheetName: '基本信息',
columns: [
{ key: 'id', tHeader: '地图id', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '地图名称', formatter: (val) => { return val || ''; } },
{ key: 'authorId', tHeader: '作者id', formatter: (val) => { return val || ''; } },
{ key: 'cityCode', tHeader: '城市code', formatter: (val) => { return val || ''; } },
{ key: 'skinCode', tHeader: '皮肤类型', formatter: (val) => { return val || ''; } },
{ key: 'updateTime', tHeader: '更新时间', formatter: (val) => { return val || ''; } },
{ key: 'version', tHeader: '版本类型', formatter: (val) => { return val || ''; } }
]
},
skinVO: {
sheetName: '皮肤配置',
columns: [
{ key: 'code', tHeader: '皮肤code', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '皮肤名称', formatter: (val) => { return val || ''; } },
{ key: 'origin', tHeader: '原点坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'scaling', tHeader: '缩放比例', formatter: (val) => { return val || ''; } },
{ key: 'linkWidth', tHeader: 'link宽度', formatter: (val) => { return val || ''; } },
{ key: 'zoneWidth', tHeader: '区段宽度', formatter: (val) => { return val || ''; } },
{ key: 'watermarkShow', tHeader: '是否显示水印', formatter: (val) => { return val || false; } }
]
},
routingList: {
sheetName: '交路列表',
columns: [
{ key: 'code', tHeader: '交路编号', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '交路名称', formatter: (val) => { return val || ''; } },
{ key: 'directionCode', tHeader: '方向码', formatter: (val) => { return val || 0; } },
{ key: 'destinationCode', tHeader: '目的地码', formatter: (val) => { return val || ''; } },
{ key: 'startSectionCode', tHeader: '起始区段', formatter: (val) => { return val || ''; } },
{ key: 'startStationCode', tHeader: '起始车站', formatter: (val) => { return val || ''; } },
{ key: 'endSectionCode', tHeader: '终到区段', formatter: (val) => { return val || ''; } },
{ key: 'endStationCode', tHeader: '终到车站', formatter: (val) => { return val || ''; } },
{ key: 'remarks', tHeader: '描述', formatter: (val) => { return val || ''; } }
]
},
routingSectionList: {
sheetName: '交路-区段',
columns: [
{ key: 'routingCode', tHeader: '交路编号', formatter: (val) => { return val || ''; } },
{ key: 'orderNum', tHeader: '顺序', formatter: (val) => { return val || 0; } },
{ key: 'sectionCode', tHeader: '区段编号', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '车站编号', formatter: (val) => { return val || ''; } }
]
},
autoSignalList: {
sheetName: '自动信号机',
columns: [
{ key: 'code', tHeader: '自动信号机编号', formatter: (val) => { return val || ''; } },
{ key: 'signalCode', tHeader: '信号机编号', formatter: (val) => { return val || ''; } },
{ key: 'skinCode', tHeader: '皮肤类型', formatter: (val) => { return val || ''; } }
]
},
autoSignalClearList: {
sheetName: '自动信号机列表',
columns: [
{ key: 'autoSignalCode', tHeader: '自动信号机编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionCode', tHeader: '区段编号', formatter: (val) => { return val || ''; } },
{ key: 'skinCode', tHeader: '皮肤类型', formatter: (val) => { return val || ''; } }
]
},
accessAgainstList: {
sheetName: '敌对进路',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'againstRouteCode', tHeader: '敌对进路编号', formatter: (val) => { return val || ''; } }
]
},
routeFlankProtectionList: {
sheetName: '进路侧防道岔',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'switchCode', tHeader: '道岔编号', formatter: (val) => { return val || ''; } },
{ key: 'switchLocateType', tHeader: '道岔位置类型', formatter: (val) => { return val || ''; } }
]
},
accessList: {
sheetName: '进路列表',
columns: [
{ key: 'name', tHeader: '进路名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'autoTriggerSectionCode', tHeader: '自动触发区段编号', formatter: (val) => { return val || ''; } },
{ key: 'nearSectionCode', tHeader: '接近区段编号', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'endSignalCode', tHeader: '终端信号机编号', formatter: (val) => { return val || ''; } },
{ key: 'endSignalName', tHeader: '终端信号机名称', formatter: (val) => { return val || ''; } },
{ key: 'startSignalCode', tHeader: '始端信号机编号', formatter: (val) => { return val || ''; } },
{ key: 'startSignalName', tHeader: '始端信号机名称', formatter: (val) => { return val || ''; } },
{ key: 'autoType', tHeader: '自动进路类型', formatter: (val) => { return val || ''; } },
{ key: 'natureType', tHeader: '进路性质类型', formatter: (val) => { return val || ''; } },
{ key: 'overlapSwitchCode', tHeader: '延续保护道岔ID', formatter: (val) => { return val || ''; } },
{ key: 'overlapSwitchLocateType', tHeader: '延续保护道岔位置类型', formatter: (val) => { return val || ''; } },
{ key: 'turnBackSectionCode', tHeader: '折返轨ID', formatter: (val) => { return val || ''; } },
{ key: 'arc', tHeader: '是否自动追踪/联锁自动触发', formatter: (val) => { return val || false; } },
{ key: 'flt', tHeader: '是否车队/联锁自动进路', formatter: (val) => { return val || false; } },
{ key: 'delayReleaseTime', tHeader: '延时解锁时间', formatter: (val) => { return val || 0; } }
]
},
routeOverlapSectionList: {
sheetName: '进路延续保护区段',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionCode', tHeader: '区段编号', formatter: (val) => { return val || ''; } }
]
},
routeOverlapSwitchList: {
sheetName: '进路延续保护道岔',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'switchCode', tHeader: '道岔编号', formatter: (val) => { return val || ''; } },
{ key: 'switchLocateType', tHeader: '道岔位置类型', formatter: (val) => { return val || ''; } }
]
},
routeTriggerSectionList: {
sheetName: '进路自动触发区段',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionCode', tHeader: '区段编号', formatter: (val) => { return val || ''; } }
]
},
routeSectionList: {
sheetName: '进路-区段',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionCode', tHeader: '区段编号', formatter: (val) => { return val || ''; } }
]
},
accessSignalList: {
sheetName: '进路-信号机',
columns: [
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
},
routeStandList: {
sheetName: '进路-站台',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'stationStandCode', tHeader: '站台编号', formatter: (val) => { return val || ''; } }
]
},
accessSwitchList: {
sheetName: '进路-道岔',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'switchCode', tHeader: '道岔编号', formatter: (val) => { return val || ''; } },
{ key: 'switchLocateType', tHeader: '道岔类型', formatter: (val) => { return val || ''; } }
]
},
counterList: {
sheetName: '车站计数器',
columns: [
{ key: 'name', tHeader: '车站计数器名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'max', tHeader: '计数器最大值', formatter: (val) => { return val || 0; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'type', tHeader: '类型', formatter: (val) => { return val || ''; } },
{ key: 'val', tHeader: '值', formatter: (val) => { return val || 0; } }
]
},
delayShowList: {
sheetName: '车站延时解锁表示器',
columns: [
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'font', tHeader: '字体大小', formatter: (val) => { return val || ''; } },
{ key: 'fontColor', tHeader: '字体颜色', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'unlockTime', tHeader: '延迟时间', formatter: (val) => { return val || ''; } }
]
},
lineList: {
sheetName: '线段',
columns: [
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'width', tHeader: '宽度', formatter: (val) => { return val || ''; } },
{ key: 'type', tHeader: '类型', formatter: (val) => { return val || ''; } },
{ key: 'points', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
},
linkList: {
sheetName: 'link',
columns: [
{ key: 'name', tHeader: 'link名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'color', tHeader: '颜色', formatter: (val) => { return val || ''; } },
{ key: 'leftFdCode', tHeader: '左正向link编号', formatter: (val) => { return val || ''; } },
{ key: 'leftSdCode', tHeader: '左侧向link编号', formatter: (val) => { return val || ''; } },
{ key: 'rightFdCode', tHeader: '右正向link编号', formatter: (val) => { return val || ''; } },
{ key: 'rightSdCode', tHeader: '右侧向link编号', formatter: (val) => { return val || ''; } },
{ key: 'lengthFact', tHeader: '实际长度', formatter: (val) => { return val || 0; } },
{ key: 'lp', tHeader: '起点坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'rp', tHeader: '终点坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'type', tHeader: '类型', formatter: (val) => { return val || ''; } }
]
},
routeUnitRelList: {
sheetName: '路径单元关系',
columns: [
{ key: 'routeCode', tHeader: '进路编号', formatter: (val) => { return val || ''; } },
{ key: 'routeUnitCode', tHeader: '路径单元编号', formatter: (val) => { return val || ''; } },
{ key: 'orderNum', tHeader: '顺序', formatter: (val) => { return val || ''; } }
]
},
routeUnitList: {
sheetName: '路径单元',
columns: [
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'startSectionCode', tHeader: '起点区段编号', formatter: (val) => { return val || ''; } },
{ key: 'endSectionCode', tHeader: '终点区段编号', formatter: (val) => { return val || ''; } },
{ key: 'orderNum', tHeader: '顺序', formatter: (val) => { return val || ''; } }
]
},
sectionList: {
sheetName: '区段',
columns: [
{ key: 'name', tHeader: '区段名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
// { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
{ key: 'axleShow', tHeader: '是否显示计轴器', formatter: (val) => { return val || false; } },
{ key: 'type', tHeader: '类型', formatter: (val) => { return val || ''; } },
{ key: 'linkCode', tHeader: 'link编号', formatter: (val) => { return val || ''; } },
// { key: 'logicSectionNameShow', tHeader: '是否显示逻辑区段名称', formatter: (val) => { return val || false; } },
{ key: 'logicSectionNameSort', tHeader: '逻辑区段按名称排序方式', formatter: (val) => { return val || false; } },
{ key: 'logicSectionNum', tHeader: '逻辑区段数量', formatter: (val) => { return val ? JSON.parse(val) : [0]; } },
{ key: 'logicSectionShow', tHeader: '是否显示逻辑区段', formatter: (val) => { return val || false; } },
{ key: 'offsetLeft', tHeader: '左端相对Link偏移量', formatter: (val) => { return val || 0; } },
{ key: 'offsetRight', tHeader: '右端相对Link偏移量', formatter: (val) => { return val || 0; } },
{ key: 'parentCode', tHeader: '父元素编号', formatter: (val) => { return val || ''; } },
{ key: 'points', tHeader: '区段坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'sepTypeLeft', tHeader: '左端分隔符类型', formatter: (val) => { return val || ''; } },
{ key: 'sepTypeRight', tHeader: '右端分隔符类型', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'trainPosType', tHeader: '列车位置类型', formatter: (val) => { return val || ''; } },
{ key: 'kmRangeLeft', tHeader: '左侧公里标(米)', formatter: (val) => { return val ? Number(val) : 0; } },
{ key: 'kmRangeRight', tHeader: '右侧公里标(米)', formatter: (val) => { return val ? Number(val) : 0; } },
{ key: 'region', tHeader: '区间编码', formatter: (val) => { return val || ''; } },
{ key: 'isStandTrack', tHeader: '是否站台轨', formatter: (val) => { return val || false; } },
{ key: 'isReentryTrack', tHeader: '是否折返轨', formatter: (val) => { return val || false; } },
{ key: 'isSwitchSection', tHeader: '是否道岔区段', formatter: (val) => { return val || false; } },
{ key: 'isTransferTrack', tHeader: '是否转换轨', formatter: (val) => { return val || false; } },
{ key: 'reentryTrackName', tHeader: '折返轨名称', formatter: (val) => { return val || ''; } },
{ key: 'reentryTrackNamePosition', tHeader: '折返轨名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'relSwitchCode', tHeader: '道岔区段关联道岔编号', formatter: (val) => { return val || ''; } },
{ key: 'relStandCode', tHeader: '关联站台编码', formatter: (val) => { return val || ''; } },
{ key: 'leftStopPointOffset', tHeader: '左向停车点偏移量', formatter: (val) => { return val || ''; } },
{ key: 'rightStopPointOffset', tHeader: '右向停车点偏移量', formatter: (val) => { return val || ''; } },
{ key: 'destinationCodeShow', tHeader: '目的地码是否显示', formatter: (val) => { return val || false; } },
{ key: 'destinationCode', tHeader: '目的地码', formatter: (val) => { return val || ''; } },
{ key: 'destinationCodePoint', tHeader: '目的地码坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'standTrackName', tHeader: '站台轨名称', formatter: (val) => { return val || ''; } },
{ key: 'standTrackNamePosition', tHeader: '站台轨名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'transferTrackName', tHeader: '转换轨名称', formatter: (val) => { return val || ''; } },
{ key: 'transferTrackNamePosition', tHeader: '转换轨名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'isCurve', tHeader: '是否曲线', formatter: (val) => { return val || false; } }
]
},
signalList: {
sheetName: '信号机',
columns: [
{ key: 'name', tHeader: '信号机名称', formatter: (val) => { return val || ''; } },
{ key: 'uniqueName', tHeader: '信号机唯一名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
// { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
{ key: 'buttonPosition', tHeader: '按钮坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'buttonShow', tHeader: '是否显示按钮', formatter: (val) => { return val || false; } },
{ key: 'directionType', tHeader: '方向类型', formatter: (val) => { return val || ''; } },
{ key: 'lampPositionType', tHeader: '灯位类型', formatter: (val) => { return val || ''; } },
{ key: 'lampPostType', tHeader: '灯柱类型', formatter: (val) => { return val || ''; } },
{ key: 'positionType', tHeader: '位置类型', formatter: (val) => { return val || ''; } },
{ key: 'useType', tHeader: '用途类型', formatter: (val) => { return val || ''; } },
{ key: 'guidePosition', tHeader: '引导信号位置坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'guideShow', tHeader: '是否显示引导信号', formatter: (val) => { return val || false; } },
{ key: 'linkCode', tHeader: 'link编号', formatter: (val) => { return val || ''; } },
{ key: 'offset', tHeader: '所属Link偏移量', formatter: (val) => { return val ? Number(val) : 0; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'rotate', tHeader: '信号机旋转角度', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } }
]
},
speedLevel: {
sheetName: '速度等级',
columns: [
{ key: 'level1', tHeader: '速度等级1', formatter: (val) => { return val || ''; } },
{ key: 'level2', tHeader: '速度等级2', formatter: (val) => { return val || ''; } },
{ key: 'level3', tHeader: '速度等级3', formatter: (val) => { return val || ''; } },
{ key: 'level4', tHeader: '速度等级4', formatter: (val) => { return val || ''; } }
]
},
stationControlList: {
sheetName: '车站控制模式',
columns: [
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'jjzkContent', tHeader: '紧急站控显示内容', formatter: (val) => { return val || ''; } },
{ key: 'zakContent', tHeader: '站控显示内容', formatter: (val) => { return val || ''; } },
{ key: 'zokContent', tHeader: '中控显示内容', formatter: (val) => { return val || ''; } },
{ key: 'zzkContent', tHeader: '站中控显示内容', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
},
stationStandList: {
sheetName: '站台',
columns: [
{ key: 'name', tHeader: '站台名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'deviceStationCode', tHeader: '所属设备集中站编号', formatter: (val) => { return val || ''; } },
{ key: 'direction', tHeader: '行驶方向', formatter: (val) => { return val || ''; } },
{ key: 'doorLocationType', tHeader: '屏蔽门方位类型', formatter: (val) => { return val || ''; } },
{ key: 'hasDoor', tHeader: '是否有屏蔽门', formatter: (val) => { return val || false; } },
{ key: 'width', tHeader: '宽度', formatter: (val) => { return val || ''; } },
{ key: 'height', tHeader: '高度', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'visible', tHeader: '是否显示', formatter: (val) => { return val || false; } }
]
},
stationList: {
sheetName: '车站',
columns: [
{ key: 'name', tHeader: '车站名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'nameFont', tHeader: '车站名称字体', formatter: (val) => { return val || ''; } },
{ key: 'runPlanName', tHeader: '真实运行图站名', formatter: (val) => { return val || ''; } },
{ key: 'nameFontColor', tHeader: '车站名称字体颜色', formatter: (val) => { return val || ''; } },
{ key: 'centralized', tHeader: '是否集中站', formatter: (val) => { return val || false; } },
{ key: 'concentrateStationCode', tHeader: '所属联锁站编码', formatter: (val) => { return val || ''; } },
{ key: 'kmPost', tHeader: '公里标内容', formatter: (val) => { return val || ''; } },
{ key: 'kmPostFont', tHeader: '公里标字体', formatter: (val) => { return val || ''; } },
{ key: 'kmPostFontColor', tHeader: '公里标颜色', formatter: (val) => { return val || ''; } },
{ key: 'kmPostShow', tHeader: '是否显示公里标', formatter: (val) => { return val || false; } },
{ key: 'kmRange', tHeader: '公里标距离', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'visible', tHeader: '是否可见', formatter: (val) => { return val || false; } }
]
},
switchCoupledList: {
sheetName: '双动道岔',
columns: [
{ key: 'switchACode', tHeader: '道岔编号A', formatter: (val) => { return val || ''; } },
{ key: 'switchBCode', tHeader: '道岔编号B', formatter: (val) => { return val || ''; } }
]
},
switchList: {
sheetName: '道岔',
columns: [
{ key: 'name', tHeader: '道岔名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
// { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
{ key: 'sectionACode', tHeader: 'A线物理区段编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionBCode', tHeader: 'B线物理区段编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionCCode', tHeader: 'C线物理区段编号', formatter: (val) => { return val || ''; } },
{ key: 'stationCode', tHeader: '所属车站编号', formatter: (val) => { return val || ''; } },
{ key: 'timeoutShow', tHeader: '是否显示倒计时', formatter: (val) => { return val || false; } },
{ key: 'tp', tHeader: '倒计时坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'turnTime', tHeader: '道岔转换时间', formatter: (val) => { return val || ''; } }
]
},
textList: {
sheetName: '文字信息',
columns: [
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'content', tHeader: '内容', formatter: (val) => { return val || ''; } },
{ key: 'font', tHeader: '字体大小', formatter: (val) => { return val || ''; } },
{ key: 'fontColor', tHeader: '字体颜色', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
},
trainList: {
sheetName: '列车',
columns: [
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'modelCode', tHeader: '列车模型编号', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'groupNumber', tHeader: '车组号', formatter: (val) => { return val || ''; } }
]
},
trainModelList: {
sheetName: '列车模型',
columns: [
{ key: 'name', tHeader: '型号名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '列车型号编号', formatter: (val) => { return val || ''; } },
{ key: 'averageDeceleration', tHeader: '平均减速度', formatter: (val) => { return val || ''; } },
{ key: 'averageVelocity', tHeader: '平均速度', formatter: (val) => { return val || ''; } },
{ key: 'length', tHeader: '车长', formatter: (val) => { return val || ''; } },
{ key: 'defaultVelocity', tHeader: '默认速度', formatter: (val) => { return val || ''; } },
{ key: 'maxSafeDistance', tHeader: '安全运行距离上限', formatter: (val) => { return val || ''; } },
{ key: 'maxVelocity', tHeader: '最大速度', formatter: (val) => { return val || ''; } },
{ key: 'safeDistance', tHeader: '安全运行距离', formatter: (val) => { return val || ''; } }
]
},
trainWindowList: {
sheetName: '车次窗',
columns: [
{ key: 'code', tHeader: '车次窗编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionCode', tHeader: '所属区段编号', formatter: (val) => { return val || ''; } },
{ key: 'width', tHeader: '车次窗宽度', formatter: (val) => { return val || 0; } },
{ key: 'height', tHeader: '车次窗高度', formatter: (val) => { return val || 0; } },
{ key: 'point', tHeader: '车次窗坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
},
zcList: {
sheetName: 'zc区域控制',
columns: [
{ key: 'code', tHeader: 'zc控制区域编号', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '名称', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'visible', tHeader: '是否显示', formatter: (val) => { return val || false; } }
]
},
lcList: {
sheetName: 'lc控制',
columns: [
{ key: 'code', tHeader: 'lc控制编号', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: 'lc控制名称', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: 'lc线路坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
},
tempSpeedLimitList: {
sheetName: '全线临时限速',
columns: [
{ key: 'code', tHeader: '全线临时限速编号', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '全线临时限速名称', formatter: (val) => { return val || ''; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
},
resourceList: {
sheetName: '图片列表',
columns: [
{ key: 'code', tHeader: '资源编号', formatter: (val) => { return val || ''; } },
{ key: 'name', tHeader: '名称', formatter: (val) => { return val || ''; } },
{ key: 'rotate', tHeader: '旋转角度', formatter: (val) => { return val || 0; } },
{ key: 'width', tHeader: '宽度', formatter: (val) => { return val || 0; } },
{ key: 'height', tHeader: '高度', formatter: (val) => { return val || 0; } },
{ key: 'url', tHeader: '图片地址', formatter: (val) => { return val || ''; } },
{ key: 'zIndex', tHeader: '层级', formatter: (val) => { return val || 0; } },
{ key: 'position', tHeader: '坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } }
]
}
};

View File

@ -1,280 +0,0 @@
<template>
<div>
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="80px" class="actionInfo" label-position="right">
<el-form-item label="动作类型" class="conditionVO" prop="action.type">
<el-select v-model="modalData.action.type " placeholder="请选择动作类型" @change="changeType" class="inputStyle">
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="完成时间" class="conditionVO">
<el-input-number v-model="modalData.action.time " class="inputStyle" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="回复消息" class="conditionVO" prop="action.reply" v-if="isConversitionAdd">
<el-input v-model="modalData.action.reply" type="textarea" class="textareaStyle" rows="3"></el-input>
</el-form-item>
<el-form-item label="设备指令" class="conditionVO" prop="action.deviceCommand" v-if="isCommandAdd">
<el-select v-model="modalData.action.deviceCommand " placeholder="请选择设备指令" @change="changeCommand" class="inputStyle">
<el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option>
</el-select>
</el-form-item>
<el-form-item label="起始站台" class="conditionVO" v-if="isJinLu" prop="param.startStation">
<el-select v-model="modalData.param.startStation " placeholder="请选择起始站台" class="inputStyle">
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
</el-select>
</el-form-item>
<el-form-item label="终点站台" class="conditionVO" v-if="isJinLu" prop="param.endStation">
<el-select v-model="modalData.param.endStation " placeholder="请选择终点站台" class="inputStyle">
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
</el-select>
</el-form-item>
<!-- <command-Form :commandParam="form" :commandParamModal="formModel" :rules="commandRules"></command-Form> -->
<!-- <div id="commandParam"></div> -->
<el-form-item>
<el-button type="primary" @click="addQuestAction('modalData')">{{buttonName}}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import Vue from 'vue';
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
// import CommandForm from "./commandForm";
import {postMemberBehaviorAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType} from '@/api/simulation';
export default {
name: 'addAction',
props: {
group: {
type: String,
required: true
},
memberId:{
type:String,
required: true
},
behaviorId:{
type:String,
required: true
},
buttonName:{
type:String,
required: true
},
operateType:{
type:String,
required: true
}
},
// components:{
// CommandForm,
// },
data() {
return {
modalData:{
action:{
reply:"",
time:0,
type:"Conversation",
deviceCommand:null,
commandParamList:[]
},
param:{
startStation:"",
endStation:"",
},
},
actionTypeList:DeviceTypeDic.ConstSelect.actionType,
isConversitionAdd:true,
isCommandAdd:false,
deviceCommandList:[],
stationList:[],
rules:{
action:{
reply: [
{ required: true, message: '请输入回复消息', trigger: 'blur' }
],
type:[
{ required: true, message: '请选择角色类型', trigger: 'change' }
],
deviceCommand:[
{ required: true, message: '请选择设备指令', trigger: 'change' }
]
},
param:{
startStation:[
{ required: true, message: '请选择起始站台', trigger: 'change' }
],
endStation:[
{ required: true, message: '请选择终点站台', trigger: 'change' }
]
}
},
commandRules:{},
formModel:{},
form:{},
isJinLu:false,
}
},
mounted(){
this.initData();
},
methods:{
addQuestAction(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
let group=this.$props.group;
let memberId=this.$props.memberId;
let behaviorId=this.$props.behaviorId;
if(this.modalData.action.deviceCommand==null){
delete this.modalData.action.deviceCommand;
}
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
{this.modalData.action.commandParamList=[this.modalData.param.startStation,this.modalData.param.endStation];}
let data=this.modalData.action;
let obj=this;
postMemberBehaviorAction(group,memberId,behaviorId,data).then(response=>{
delete this.modalData.action.id;
obj.modalData.action.type="Conversation";
obj.modalData.action.time=0;
obj.modalData.action.reply="";
obj.modalData.param.startStation="";
obj.isConversitionAdd=true;
obj.isCommandAdd=false;
obj.isJinLu=false;
obj.modalData.action.deviceCommand=null;
this.modalData.param.endStation="";
if(this.$props.operateType=="add")
{
this.$message.success('添加动作成功');
}
else
{
this.$emit('modifyButtonName');
this.$message.success('修改动作成功');
}
this.$emit('create');
}).catch(error => {
if(this.$props.operateType=="add")
{
this.$messageBox(`添加动作失败: ${error.message}`);
}
else
{
this.$messageBox(`修改动作失败: ${error.message}`);
}
});
}
else {
console.log('error submit!!');
return false;
}
});
},
initData(){
getAvailableDeviceCommand().then(response=>{
this.deviceCommandList=response.data;
});
let params = {deviceType:"StationStand"};
let group=this.$props.group;
getDeviceCodeByDeviceType(group,params).then(response =>{
let resultData=response.data;
resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));
this.stationList=resultData;
})
},
changeCommand(index){
switch(index)
{
case "Train_Manual_Route_Blocking_Drive":{
this.isJinLu=true;
this.initData();
// this.form={
// labelWidth:'100px',
// items: [
// { prop: 'startStation', label: '', type: 'select', required: false, change: true },
// ]
// };
// this.formModel={
// startStation:"",
// };
// const cfConstructor = Vue.component(CommandForm);
// const instance = new cfConstructor({}).$mount('#commandParam');
// instance.$mount('#commandParam');
break;
}
default:{
this.isJinLu=false;
this.initData();
break;
}
}
},
changeType(index){
switch(index)
{
case "Conversation":{
this.isConversitionAdd=true;
this.isCommandAdd=false;
break;
}
case "Command":{
this.isConversitionAdd=false;
this.isCommandAdd=true;
break;
}
default:{
break;
}
}
},
doShow(data){
if(data)
{
this.initData();
this.modalData.action.id=data.id;
this.modalData.action.type=data.type;
this.modalData.action.time=data.time;
if(data.type=="Conversation")
{
this.isConversitionAdd=true;
this.isCommandAdd=false;
this.modalData.action.reply=data.reply;
}
else if(data.type=="Command")
{
this.isConversitionAdd=false;
this.isCommandAdd=true;
this.modalData.action.reply="";
this.modalData.action.deviceCommand=data.deviceCommand;
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
{
this.isJinLu=true;
this.modalData.param.startStation=data.commandParamList[0];
this.modalData.param.endStation=data.commandParamList[1];
}
}
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.addAction{
margin-top: 20px;
margin-left: 5px;
font-size: 15px;
}
.actionInfo{
margin-top:20px;
margin-left: 5px;
font-size: 15px;
width:98%;
}
.inputStyle{
width:300px;
height:30px;
}
.textareaStyle{
width:300px;
}
</style>

View File

@ -1,316 +0,0 @@
<template>
<div>
<el-form :model="behavior" ref="behavior" :rules="rules" label-width="80px" class="roleAction" label-position="right">
<el-form-item label="是否主动">
<el-switch v-model="behavior.auto"></el-switch>
</el-form-item>
<el-form-item label="目标角色" class="conditionVO" prop="targetMemberId">
<el-select v-model="behavior.targetMemberId" placeholder="请选择目标角色" class="inputStyle">
<el-option v-for="targetMember in targetMemberList" :key="targetMember.id" :label="targetMember.name" :value="targetMember.id" ></el-option>
</el-select>
</el-form-item>
<el-form-item label="描述" class="conditionVO" prop="description">
<el-input type="textarea" v-model="behavior.description" class="textareaStyle" rows="3"></el-input>
</el-form-item>
<el-form-item label="触发条件" class="conditionVO" prop="conditionVO.triggerType">
<el-select v-model="behavior.conditionVO.triggerType" placeholder="请选择触发条件" @change="triggerTypeChange" class="inputStyle">
<el-option v-for="trigCondition in trigConditionList" :key="trigCondition.value" :label="trigCondition.label" :value="trigCondition.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="内容" class="conditionVO" prop="conditionVO.content" v-if="isConversationShow">
<el-input v-model="behavior.conditionVO.content" class="inputStyle"></el-input>
</el-form-item>
<el-form-item label="关键字" class="conditionVO" prop="conditionVO.keyWord" v-if="isConversationShow">
<el-input v-model="behavior.conditionVO.keyWord" class="inputStyle"></el-input>
</el-form-item>
<el-form-item label="重点内容" class="conditionVO" v-if="isConversationShow">
<el-tag :key="index" v-for="(tag,index) in behavior.conditionVO.importantList" closable :disable-transitions="false" @close="handleClose(tag)">
{{tag}}
</el-tag>
<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
></el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">添加</el-button>
</el-form-item>
</el-form>
<div v-if="isDeviceShow">
<device-condition ref="deviceCondition" :group="group" :title="conditionTitle" :ConditionVOList="behavior.conditionVO.deviceConditionList" :isAdding="isAdding" @changeAdding="changeAdding"></device-condition>
</div>
<div style="margin-top:20px;margin-left:80px;">
<el-button type="primary" @click="addQuestBehavior">{{buttonName}}</el-button>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
import DeviceCondition from './deviceCondition';
import {getQuestRecord,postMemberBehavior} from '@/api/simulation';
export default {
name: 'addBehavior',
props: {
group: {
type: String,
required: true
},
memberId:{
type:String,
required: true
},
title:{
type: String,
required: true
},
operateType:{
type: String,
required: true
},
buttonName:{
type: String,
required: true
},
},
components:{
DeviceCondition
},
data() {
return {
inputVisible: false,
inputValue: '',
conditionTitle:"设备条件",
targetMemberList:[],
deviceConditionList:[],
trigConditionList:DeviceTypeDic.ConstSelect.triggerType,
isConversationShow:false,
isDeviceShow:false,
isAdding:false,
behavior:{
auto:false,
targetMemberId:null,
description:"",
conditionVO:{
importantList:[],
content:"",
keyWord:"",
triggerType:"None",
deviceConditionList:[],
},
id:null,
},
rules:{
targetMemberId:[
{ required: true, message: '请选择目标角色', trigger: 'change' }
],
description:[
{ required: true, message: '请输入描述', trigger: 'blur' }
],
conditionVO:{
content: [
{ required: true, message: '请输入内容', trigger: 'blur' }
],
keyWord:[
{ required: true, message: '请输入关键字', trigger: 'blur' }
]
}
}
}
},
mounted(){
this.loadInitData(this.$route.query);
},
methods:{
loadInitData(obj) {
let group=obj.group;
let memberId=this.$props.memberId;
getQuestRecord(group).then(response=>{
let datalist=response.data.memberVOList;
this.targetMemberList=datalist;
});
},
showInput() {
this.inputVisible = true;
this.$nextTick(_ => {
this.$refs.saveTagInput.$refs.input.focus();
});
},
handleClose(tag) {
this.behavior.conditionVO.importantList.splice(this.behavior.conditionVO.importantList.indexOf(tag), 1);
},
handleInputConfirm() {
let inputValue = this.inputValue;
if (inputValue) {
this.behavior.conditionVO.importantList.push(inputValue);
}
this.inputVisible = false;
this.inputValue = '';
},
addQuestBehavior(){
this.$refs["behavior"].validate((valid) => {
if (valid) {
let group=this.$props.group;
let memberId=this.$props.memberId;
switch(this.behavior.conditionVO.triggerType)
{
case 'DeviceCondition':
{
if(this.isAdding)
{
this.behavior.conditionVO.deviceConditionList.pop();
this.$refs.deviceCondition.resetDisabled();
}
if(this.behavior.conditionVO.deviceConditionList.length<=0)
{
this.$messageBox(`请添加设备条件`);
return;
}
break;
}
case 'None':
{
this.behavior.conditionVO={};
this.behavior.conditionVO.triggerType="None";
break;
}
}
if(memberId)
{
let behavior=this.behavior;
postMemberBehavior(group,memberId,behavior).then(response=>{
this.behavior={
auto:false,
description:"",
conditionVO:{
triggerType:"None",
importantList:[],
content:"",
keyWord:"",
deviceConditionList:[],
},
targetMemberId:null,
id:null
};
this.isConversationShow=false;
this.isDeviceShow=false;
if(this.$props.operateType==="add")
{
this.$message.success('添加行为成功');
}
else
{
this.$emit('modifyButtonName');
this.$message.success('修改行为成功');
}
this.$emit('create');
}).catch(error => {
if(this.$props.operateType==="add")
{
this.$messageBox(`添加行为失败: ${error.message}`);
}
else
{
this.$messageBox(`修改行为失败: ${error.message}`);
}
})
}
} else {
console.log('error submit!!');
return false;
}
});
},
doShow(data){
if(data)
{
this.behavior.auto=data.auto;
this.behavior.targetMemberId=data.targetMemberId;
this.behavior.description=data.description;
this.behavior.id=data.id;
this.behavior.conditionVO.triggerType=data.conditionVO.triggerType;
switch(data.conditionVO.triggerType)
{
case "None":{
this.isConversationShow=false;
this.isDeviceShow=false;
break;
}
case "Conversation":{
this.isConversationShow=true;
this.isDeviceShow=false;
this.behavior.conditionVO.importantList=data.conditionVO.importantList;
this.behavior.conditionVO.content=data.conditionVO.content;
this.behavior.conditionVO.keyWord=data.conditionVO.keyWord;
break;
}
case 'DeviceCondition':{
this.isConversationShow=false;
this.isDeviceShow=true;
var newData=JSON.parse(JSON.stringify(data.conditionVO.deviceConditionList).replace(/\"code\"/g,'"isAdded":true,"code"'));
this.behavior.conditionVO.deviceConditionList=newData;
this.resetDisabled();
break;
}
default:{
break;
}
}
}
},
resetDisabled(){
if(this.$refs['deviceCondition'])
{
this.$refs['deviceCondition'].resetDisabled();
}
},
triggerTypeChange(data){
switch(data){
case "Conversation":{
this.isConversationShow=true;
this.isDeviceShow=false;
break;
}
case "DeviceCondition":{
this.isConversationShow=false;
this.isDeviceShow=true;
break;
}
default: {
this.isConversationShow=false;
this.isDeviceShow=false;
break;
}
}
this.$refs['behavior'].clearValidate();
},
changeAdding(data)
{
this.isAdding=data;
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.inputStyle{
width:300px;
height:20px;
}
.textareaStyle{
width:300px;
}
.button-new-tag {
margin-left: 10px;
height: 32px;
line-height: 30px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
.el-tag + .el-tag {
margin-left: 10px;
}
</style>

View File

@ -1,173 +0,0 @@
<template>
<div>
<el-form label-width="80px">
<el-form-item :label="title">
<el-button type="primary" size="small" @click="addDeviceCondition" :disabled="isdisabled">添加</el-button>
</el-form-item>
</el-form>
<el-table
:data="ConditionVOList" border style="margin-top:10px;margin-left:10px;width:901px">
<el-table-column :label="$t('scriptRecord.deviceType')" width="150">
<template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.deviceType}}</div>
<el-select v-else v-model="scope.row.deviceType" placeholder="请选择" @change="changeDeviceType($event,scope.row)">
<el-option v-for="deviceType in deviceTypeList" :key="deviceType.value" :label="deviceType.label" :value="deviceType.value"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('scriptRecord.deviceCode')" width="150">
<template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.code}}</div>
<el-select v-else v-model="scope.row.code" placeholder="请选择">
<el-option v-for="deviceCode in deviceCodeList" :key="deviceCode.code" :label="deviceCode.name" :value="deviceCode.code"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('scriptRecord.deviceCondition')" width="150">
<template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.condition}}</div>
<el-select v-else v-model="scope.row.condition" placeholder="请选择">
<el-option v-for="deviceCondition in deviceCondList" :key="deviceCondition.condition" :label="deviceCondition.label" :value="deviceCondition.condition"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('scriptRecord.paramDeviceType')" width="150">
<template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.paramDeviceType}}</div>
<el-select v-else v-model="scope.row.paramDeviceType" placeholder="请选择" @change="changeParamDeviceType">
<el-option v-for="deviceType in deviceTypeList" :key="deviceType.value" :label="deviceType.label" :value="deviceType.value"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('scriptRecord.paramDeviceCode')" width="150">
<template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.paramCode}}</div>
<el-select v-else v-model="scope.row.paramCode" placeholder="请选择">
<el-option v-for="paramDeviceCode in paramDeviceCodeList" :key="paramDeviceCode.code" :label="paramDeviceCode.name" :value="paramDeviceCode.code"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('scriptRecord.operation')" width="150">
<template slot-scope="scope">
<el-row v-if="scope.row.isAdded">
<el-button type="primary" size="mini" @click="deleteOperate(scope.$index)">删除</el-button>
</el-row>
<el-row v-else>
<el-button type="primary" size="mini" @click="determineOperate(scope.row)">确定</el-button>
<el-button type="primary" size="mini" @click="cancleOperate">取消</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
import Vue from 'vue';
import {getDeviceCodeByDeviceType,getDeviceCoditionByDeviceType} from '@/api/simulation';
export default {
name: 'deviceCondition',
props: {
group: {
type: String,
required: true
},
ConditionVOList:{
type: Array,
required: true
},
isAdding:{
type: Boolean,
required: true
},
title:{
type: String,
required: true
}
},
mounted(){
this.isdisabled=false;
},
data(){
return{
deviceTypeList:DeviceTypeDic.ConstSelect.deviceType,
deviceCodeList:[],
deviceCondList:[],
paramDeviceCodeList:[],
isdisabled:false,
}
},
methods:{
changeDeviceType(index,row){
let params = {deviceType:index};
let group=this.$props.group;
row.code="";
row.condition="";
getDeviceCodeByDeviceType(group,params).then(response =>{
let resultData=response.data;
resultData=this.changeData(index,resultData);
this.deviceCodeList=resultData;
})
getDeviceCoditionByDeviceType(params).then(response =>{
this.deviceCondList=response.data;
});
},
changeParamDeviceType(index){
let params = {deviceType:index};
let group=this.$props.group;
getDeviceCodeByDeviceType(group,params).then(response =>{
let resultData=response.data;
resultData=this.changeData(index,resultData);
this.paramDeviceCodeList=resultData;
})
},
changeData(param,data){
return param=="Train"?JSON.parse(JSON.stringify(data).replace(/groupNumber/g,"name")):data;
},
deleteOperate(data){
this.$props.ConditionVOList.splice(data,1);
},
determineOperate(data){
if(data.deviceType=="")
{
this.$messageBox(`请选择设备类型`);
return;
}
if(data.code=="")
{
this.$messageBox(`请选择设备编号`);
return;
}
if(data.condition=="")
{
this.$messageBox(`请选择设备条件`);
return;
}
this.$props.ConditionVOList[this.$props.ConditionVOList.length-1].isAdded=true;
this.isdisabled=false;
this.$emit("changeAdding",false);
},
cancleOperate(){
this.isdisabled=false;
this.$props.ConditionVOList.pop();
this.$emit("changeAdding",false);
},
addDeviceCondition(){
this.isdisabled=true;
let deviceCondition={
deviceType:"",
code:"",
condition:"",
paramCode:"",
paramDeviceType:null,
isAdded:false,
};
this.$emit("changeAdding",true);
this.$props.ConditionVOList.push(deviceCondition);
},
resetDisabled(){
this.isdisabled=false;
}
}
}
</script>

View File

@ -1,136 +0,0 @@
<template>
<div>
<div class="actionList">
<i class="el-icon-back" @click="backToMember"></i>
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
</div>
<div class="tab-pane-big">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
<el-table
v-loading="loading"
:data="actionList" border class="actionListTable">
<el-table-column prop="reply" label="回复消息" width="200">
</el-table-column>
<el-table-column prop="time" label="完成时间" width="200">
</el-table-column>
<el-table-column prop="type" label="动作类型" width="200">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-row>
<el-button type="primary" size="mini" @click="modifyAction(scope.row)">修改</el-button>
<el-button type="primary" size="mini" @click="deleteAction(scope.row)">删除</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
</el-scrollbar>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import AddAction from './addAction';
import {getQuestRecord,deleteMemberBehaviorAction} from '@/api/simulation';
export default {
name: 'getAction',
props: {
group: {
type: String,
required: true
},
memberId:{
type:String,
required: true
},
behaviorId:{
type:String,
required: true
}
},
data() {
return {
actionList:[],
loading:true,
behaviorName:"",
memberName:"",
operateType:"add",
buttonName:"添加动作",
}
},
components: {
AddAction,
},
mounted(){
this.loadInitData(this.$route.query);
this.memberName=this.$store.state.scriptRecord.memberName;
this.behaviorName=this.$store.state.scriptRecord.behaviorName;
},
methods:{
loadInitData(obj) {
let group=obj.group;
let memberId=this.$props.memberId;
let behaviorId=this.$props.behaviorId;
getQuestRecord(group).then(response=>{
let datalist=response.data.memberVOList;
let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList;
this.loading=false;
});
},
backToMember:function(){
this.$emit('backToBehavior');
},
deleteAction(row){
let group=this.$props.group;
let memberId=this.$props.memberId;
let behaviorId=this.$props.behaviorId;
deleteMemberBehaviorAction(group,memberId,behaviorId,row.id).then(resp => {
this.reloadTable();
this.$message.success('删除行为动作成功');
}).catch(error => {
this.$messageBox(`删除行为动作失败: ${error.message}`);
});
},
reloadTable(){
this.loadInitData(this.$route.query);
},
create(){
this.reloadTable();
},
modifyAction(row){
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
this.operateType="modify";
this.buttonName="修改动作"
this.$refs.addBehavior.doShow(row);
},
modifyButtonName(){
this.buttonName="添加动作",
this.operateType="add"
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.actionListTable{
margin-top: 20px;
margin-left: 5px;
font-size: 15px;
width:802px;
}
.actionList{
margin-top: 10px;
margin-left: 5px;
font-size: 15px;
margin-bottom:10px;
}
.titleStyle{
margin-left:10px;
}
.tab-pane-big{
height:380px;
}
</style>

View File

@ -1,147 +0,0 @@
<template>
<div>
<div class="behaviorList">
<i class="el-icon-back" @click="backToMember" style="cursor:pointer;"></i>
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">行为信息</span></span>
</div>
<div class="tab-pane-big">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar">
<add-behavior ref="addBehavior" :title="title" :group="group" :memberId="memberId" @create="handleCreate" :operateType="operateType" :buttonName="buttonName" @modifyButtonName="modifyButtonName"></add-behavior>
<div class="behaviorList">行为列表</div>
<el-table
v-loading="loading"
:data="behaviorList" border class="behaviorListTable">
<el-table-column label="是否主动触发" width="150">
<template slot-scope="scope">
<div>{{scope.row.auto?"是":"否"}}</div>
</template>
</el-table-column>
<el-table-column label="目标角色" width="200">
<template slot-scope="scope">
<div>{{scope.row.targetMemberId}}</div>
</template>
</el-table-column>
<el-table-column label="描述" width="200">
<template slot-scope="scope">
<div>{{scope.row.description}}</div>
</template>
</el-table-column>
<el-table-column label="触发条件" width="150">
<template slot-scope="scope">
<div>{{scope.row.conditionVO.triggerType==null?"无":scope.row.conditionVO.triggerType}}</div>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-row>
<el-button type="primary" size="mini" @click="modifyActions(scope.row)">修改</el-button>
<el-button type="primary" size="mini" @click="deleteBehavior(scope.row)">删除</el-button>
</el-row>
<el-row style="margin-top:10px"><el-button type="primary" size="mini" @click="getActions(scope.row)">动作操作</el-button></el-row>
</template>
</el-table-column>
</el-table>
</el-scrollbar>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import {getQuestRecord,deleteMemberBehavior} from '@/api/simulation';
import AddBehavior from './addBehavior';
export default {
name: 'behaviorList',
props: {
group: {
type: String,
required: true
},
memberId:{
type: String,
required: true
}
},
components:{
AddBehavior
},
data() {
return {
behaviorList:[],
memberName:"",
loading:true,
title:"",
operateType:"add",
buttonName:"添加行为",
}
},
mounted(){
this.memberName=this.$store.state.scriptRecord.memberName;
this.loadInitData(this.$route.query);
},
methods:{
loadInitData(obj) {
let group=obj.group;
let memberId=this.$props.memberId;
getQuestRecord(group).then(response=>{
let datalist=response.data.memberVOList;
this.behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
this.loading=false;
});
},
deleteBehavior(row){
let group=this.$props.group;
let memberId=this.$props.memberId;
deleteMemberBehavior(group,memberId,row.id).then(resp => {
this.reloadTable();
this.$message.success('删除任务角色行为成功');
}).catch(error => {
this.$messageBox(`删除任务角色行为失败: ${error.message}`);
});
},
reloadTable(){
this.loadInitData(this.$route.query);
},
backToMember(){
this.$emit('backToMember');
},
modifyButtonName(){
this.buttonName="添加行为",
this.operateType="add"
},
modifyActions(row){
var div = this.$refs['elScrollbar'].$refs['wrap'];
div.scrollTop=0;
this.operateType="modify";
this.buttonName="修改行为"
this.$refs.addBehavior.doShow(row);
},
getActions(row){
this.$emit('getActions',row);
},
handleCreate(){
this.reloadTable();
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.behaviorListTable{
margin-top: 20px;
margin-left: 5px;
font-size: 15px;
width:901px;
}
.behaviorList{
margin-top: 10px;
margin-left: 5px;
font-size: 15px;
margin-bottom:20px;
}
.titleStyle{
margin-left:10px;
}
.tab-pane-big{
height:370px;
}
</style>

View File

@ -1,82 +0,0 @@
<template>
<el-tabs v-model="activeName" type="card">
<el-tab-pane :label="$t('scriptRecord.roleManage')" name="first">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
</el-scrollbar>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('scriptRecord.targetCondition')" name="second">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<target-condition ref="targetCondition" :group="group"></target-condition>
</el-scrollbar>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('scriptRecord.taskScript')" name="third">
<div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper">
<task-script ref="taskScript" :group="group"></task-script>
</el-scrollbar>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import Vue from 'vue';
import RoleSection from './roleSection';
import TargetCondition from './targetCondition';
import TaskScript from './taskScript';
import {getQuestRecord} from '@/api/simulation';
export default {
name: 'roleConditionScript',
props: {
group: {
type: String,
required: true
},
},
components: {
TargetCondition,
TaskScript,
RoleSection,
},
data() {
return {
activeName:"first",
}
},
created(){
this.loadInitData(this.$route.query);
},
methods: {
loadInitData(obj) {
let group=obj.group;
getQuestRecord(group).then(response =>{
let deviceConditionList=response.data.questTargetVO.deviceConditionVOList;
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
if(response.data.mapLocation)
{
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
this.$store.dispatch('scriptRecord/updateMapLocation', mapLocation);
}
});
},
getBehaviorList(row){
this.$emit('getBehaviorList',row.id);
this.$store.dispatch('scriptRecord/updateMemberName',row.name);
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.tab-pane{
height:360px;
}
</style>

View File

@ -1,160 +0,0 @@
<template>
<div>
<el-form :model="memberVO" ref="memberVO" :rules="rules" label-width="100px" class="roleAction" label-position="right">
<el-form-item :label="$t('scriptRecord.roleName')" class="conditionVO" prop="name">
<el-input v-model="memberVO.name" class="inputStyle"></el-input>
</el-form-item>
<el-form-item :label="$t('scriptRecord.roleType')" class="conditionVO" prop="role">
<el-select v-model="memberVO.role" placeholder="请选择角色类型" @change="changeRoleType">
<el-option v-for="rolerType in roleTypeList" :key="rolerType.label" :label="rolerType.label" :value="rolerType.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('scriptRecord.deviceCode')" class="conditionVO">
<el-select v-model="memberVO.deviceCode" clearable placeholder="请选择设备编码">
<el-option v-for="deviceCode in deviceCodeList" :key="deviceCode.code" :label="deviceCode.name" :value="deviceCode.code"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addQuestMember('memberVO')">{{$t('scriptRecord.roleAdd')}}</el-button>
</el-form-item>
</el-form>
<div class="roleList">{{$t('scriptRecord.roleList')}}</div>
<el-table
v-loading="loading"
:data="memberList" border class="memberList">
<el-table-column prop="name" :label="$t('scriptRecord.roleName')" width="350">
</el-table-column>
<el-table-column :label="$t('scriptRecord.operation')" width="350">
<template slot-scope="scope">
<el-row>
<el-button type="primary" size="mini" @click="getMembers(scope.row)">{{$t('scriptRecord.behaviorOperate')}}</el-button>
<el-button type="primary" size="mini" @click="deleteMember(scope.$index,scope.row)">{{$t('scriptRecord.delete')}}</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import Vue from 'vue';
import ConstConfig from '@/scripts/ConstConfig';
import {getQuestRecord,getDevicesByRole,postQuestMember,deleteQuestMember} from '@/api/simulation';
export default {
name: 'roleSection',
props: {
group: {
type: String,
required: true
}
},
data() {
return {
deviceCodeList:[],
memberList:[],
loading:true,
memberVO:
{
role:"Admin",
deviceCode:'',
},
roleTypeList:ConstConfig.ConstSelect.roleType,
title:"添加角色",
rules:{
name:[
{ required: true, message: '请输入角色名称', trigger: 'blur' }
],
}
}
},
watch: {
'$store.state.scriptRecord.memberList': function (val, old){
this.memberList=val;
this.loading=false;
}
},
methods:{
getDeviceInfo(){
let params = { role:this.memberVO.role};
let group=this.$props.group;
getDevicesByRole(group,params).then(response => {
this.deviceCodeList=response.data;
});
},
addQuestMember(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
let data=this.memberVO;
let group=this.group;
postQuestMember(group,data).then(resp => {
this.reloadTable();
this.memberVO.role="Admin";
this.memberVO.deviceCode="";
this.memberVO.name="";
this.deviceCodeList=[];
this.$message.success('添加任务角色成功');
}).catch(error => {
this.$messageBox(`添加任务角色失败: ${error.message}`);
})
} else {
console.log('error submit!!');
return false;
}
});
},
changeRoleType(index){
this.deviceCodeList=[];
let params = { role:index};
let group=this.group;
getDevicesByRole(group,params).then(response => {
this.memberVO.deviceCode="";
let resultData=response.data;
if(index=="Driver")
{resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));}
this.deviceCodeList=resultData;
});
},
reloadTable(){
let group=this.group;
getQuestRecord(group).then(response=>{
this.memberList=response.data.memberVOList;
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
});
},
deleteMember(index,row){
let group=this.group;
deleteQuestMember(group,row.id).then(resp => {
this.reloadTable();
this.$message.success('删除任务角色成功');
}).catch(error => {
this.$messageBox(`删除任务角色失败: ${error.message}`);
});
},
getMembers(row){
this.$emit('getBehaviorList',row);
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.roleAction{
margin-top:10px;
margin-left:10px;
}
.roleList{
margin-top: 20px;
margin-left: 5px;
font-size: 15px;
}
.memberList{
// width:94%;
width:701px;
margin-top:20px;
margin-left:5px;
}
.inputStyle{
width:200px;
height:30px;
}
</style>

View File

@ -1,97 +0,0 @@
<template>
<el-form label-width="80px" label-position="right" style="margin-top:15px">
<device-condition ref="deviceCondition" :group="group" :title="conditionTitle" :ConditionVOList="deviceConditionList" :isAdding="isAdding" @changeAdding="changeAdding"></device-condition>
<el-form-item class="ConditionButton">
<el-button type="primary" @click="addQuestAction()">提交</el-button>
</el-form-item>
</el-form>
</template>
<script>
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
import DeviceCondition from './deviceCondition';
import {postTargetConditionAction} from '@/api/simulation';
export default {
name: 'targetCondition',
props: {
group: {
type: String,
required: true
},
},
watch:{
// '$store.state.menuOperation.selected': function (val) {
// if(this.fieldS!=""&&val!=null)
// {
// debugger;
// }
// }
'$store.state.scriptRecord.deviceConditionList': function (val, old){
if(val!=undefined)
{
var newData=JSON.parse(JSON.stringify(val).replace(/\"code\"/g,'"isAdded":true,"code"'));
this.deviceConditionList=newData;
}
else
{
this.deviceConditionList=[];
}
}
},
data(){
return{
deviceConditionList:[],
conditionTitle:this.$t("scriptRecord.conditionTitle"),
isAdding:false,
// fieldS:"",
}
},
components:{
DeviceCondition
},
methods:{
addQuestAction(){
if(this.isAdding)
{
this.deviceConditionList.pop();
this.$refs.deviceCondition.resetDisabled();
}
if(this.deviceConditionList.length<=0)
{
this.$messageBox(`请添加设备条件`);
return;
}
let group=this.$props.group;
let data={deviceConditionVOList:this.deviceConditionList};
let that=this;
postTargetConditionAction (group,data).then(responese => {
this.$message.success('保存目标条件成功');
this.$store.dispatch('scriptRecord/updateDeviceCondition', that.deviceConditionList);
// this.$emit('create');
}).catch((err) => {
this.$messageBox(`保存目标条件失败: ${error.message}`);
});
},
changeAdding(data)
{
this.isAdding=data;
},
// hover(field) {
// if (field == 'relStandCode') {
// this.fieldS = field === this.fieldS ? '' : field;
// // this.$emit('fieldSelect', this.fieldS);
// } else {
// this.field = field === this.field ? '' : field;
// }
// },
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.ConditionButton{
margin-top:20px;
margin-left:0px;
}
</style>

View File

@ -1,197 +0,0 @@
<template>
<el-form :model="taskScript" ref="taskScript" :rules="rules" label-width="80px" label-position="right">
<el-form-item label="角色行为" class="conditionVO" prop="behavior">
<el-select v-model="taskScript.memberId" placeholder="请选择剧本角色" @change="changeMember">
<el-option v-for="taskScriptMember in taskScriptList" :key="taskScriptMember.id" :label="taskScriptMember.name" :value="taskScriptMember.id"></el-option>
</el-select>
<el-select v-model="taskScript.behavior" placeholder="请选择角色行为" @change="changeBehavior">
<el-option v-for="behavior in behaviorList" :key="behavior.id" :label="behavior.description" :value="behavior.id"></el-option>
</el-select>
<el-button type="primary" size="small" @click="addTaskScript">添加</el-button>
</el-form-item>
<el-table
:data="data.scriptBehaviorList" border class="scriptBehaviorList">
<el-table-column label="剧本角色" width="200" prop="memberName">
</el-table-column>
<el-table-column label="角色行为" width="200" prop="behaviorName">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-row>
<el-button type="primary" size="mini" @click="deleteOperate(scope.$index)">删除</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
<el-form-item>
<el-button type="primary" @click="addTaskScriptList" style="margin-top:30px;">提交</el-button>
</el-form-item>
</el-form>
</template>
<script>
import Vue from 'vue';
import Sortable from 'sortablejs';
import {saveTaskScript,getQuestRecord} from '@/api/simulation';
export default {
name: 'taskScript',
props: {
group: {
type: String,
required: true
}
},
mounted(){
this.rowDrop();
},
data() {
return {
taskScript:{
index:"",
memberId:"",
behavior:"",
},
taskScriptMembername:"",
behaviorName:"",
taskScriptList:[],
behaviorList:[],
data:{
scriptBehaviorList:[],
},
rules:{
behavior:[
{ required: true, message: '请选择角色行为', trigger: 'change' }
],
}
}
},
watch: {
'$store.state.scriptRecord.memberList': function (val, old){
this.taskScript.memberId="";
this.taskScript.behavior="";
this.taskScriptList=val;
},
'$store.state.scriptRecord.script': function (val, old){
let script=val;
let memeberList=this.taskScriptList;
this.setScriptList(memeberList,script);
}
},
methods:{
setScriptList(memeberList,script){
if(script.behaviorIdList!=undefined)
{
let behaviorIdList=script.behaviorIdList;
let scriptBehaviorList=[];
for(var i=0;i<behaviorIdList.length;i++)
{
let behaviorId=behaviorIdList[i];
let scriptBehavior={};
for(var j=0;j<memeberList.length;j++)
{
let behaviorVOList=memeberList[j].behaviorVOList;
for(var k=0;k<behaviorVOList.length;k++)
{
if(behaviorVOList[k].id==behaviorId)
{
scriptBehavior.memberId=memeberList[j].id;
scriptBehavior.memberName=memeberList[j].name;
scriptBehavior.behavior=behaviorId;
scriptBehavior.behaviorName=behaviorVOList[k].description;
scriptBehaviorList.push(scriptBehavior);
}
}
}
}
this.data.scriptBehaviorList=scriptBehaviorList;
}
},
rowDrop(){
const that = this;
const tbody = document.querySelector('.scriptBehaviorList .el-table__body-wrapper tbody');
if (tbody) {
Sortable.create(tbody, {
onEnd({newIndex, oldIndex}) {
that.data.scriptBehaviorList.splice(newIndex, 0, that.data.scriptBehaviorList.splice(oldIndex, 1)[0]);
var newArray = that.data.scriptBehaviorList.slice(0);
that.data.scriptBehaviorList = [];
that.$nextTick(function () {
that.data.scriptBehaviorList = newArray;
});
}
})
}
},
changeMember(index)
{
this.taskScript.behavior="";
let taskScriptList=this.taskScriptList;
for(let i=0;i<taskScriptList.length;i++)
{
if(taskScriptList[i].id==index)
{
this.taskScriptMembername=taskScriptList[i].name;
this.behaviorList=taskScriptList[i].behaviorVOList;
return;
}
}
},
changeBehavior(index){
let obj = this.behaviorList.find((item)=>{
return item.id === index;
});
this.behaviorName=obj.description;
},
addTaskScript(){
this.$refs['taskScript'].validate((valid) => {
if (valid) {
let scriptBehavior={
memberId:this.taskScript.memberId,
behavior:this.taskScript.behavior,
memberName:this.taskScriptMembername,
behaviorName:this.behaviorName,
};
this.data.scriptBehaviorList.push(scriptBehavior);
this.behaviorList=[];
this.taskScript.behavior="";
this.taskScript.memberId="";
}
else {
console.log('error submit!!');
return false;
}
});
},
deleteOperate(data){
this.data.scriptBehaviorList.splice(data,1);
},
addTaskScriptList(){
if(this.data.scriptBehaviorList.length<=0)
{
this.$messageBox(`请添加角色行为`);
return;
}
let behaviorIdList=[];
for(let i=0;i<this.data.scriptBehaviorList.length;i++)
{
behaviorIdList.push(this.data.scriptBehaviorList[i].behavior);
}
let group=this.$props.group;
let that=this;
saveTaskScript(group,behaviorIdList).then(response=>{
this.$message.success('保存任务剧本成功');
this.$store.dispatch('scriptRecord/updateScript', {"behaviorIdList":behaviorIdList});
}).catch(error => {
this.$messageBox(`保存任务剧本失败: ${error.message}`);
});
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.scriptBehaviorList{
margin-top:30px;
margin-left:10px;
width:601px
}
</style>

View File

@ -1,224 +0,0 @@
<template>
<div class="reminder-drag">
<div class="reminder-box" ref="drapBox">
<div class="tip-title">
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i>
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i>
<p style="color: #fff;" v-if="isShrink">
<span>{{ title }}</span>
</p>
</div>
<div class="tip-body-box" ref="dragBody">
<div class="tip-body">
<template v-if="displayType=='role'">
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
</template>
<template v-if="displayType=='behavior'">
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions"></get-behavior>
</template>
<template v-if="displayType=='action'">
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action>
</template>
<el-button-group class="button-group">
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button>
<el-button type="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
<el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button>
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
</el-button-group>
</div>
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import GetBehavior from './scriptRecord/getBehavior';
import GetAction from './scriptRecord/getAction';
import RoleConditionScript from './scriptRecord/roleConditionScript';
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
import {updateMapLocation} from '@/api/quest';
export default {
name: 'TipScriptRecord',
props: {
group: {
type: String,
required: true
},
},
components: {
GetBehavior,
GetAction,
RoleConditionScript,
},
data() {
return {
title: this.$t('scriptRecord.scriptTitle'),
isShrink: false,
memberId:null,
behaviorId:null,
displayType:"role",
mapLocation:{},
// isSaveStage: true,
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) {
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
}
},
created() {
},
mounted(){
this.shrink();
},
methods: {
jump(obj) {
},
shrink() {
let height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top;
if (this.isShrink) {
this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = '';
this.isShrink = false;
} else {
this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top;
this.isShrink = true;
}
},
backToMember(){
this.displayType="role";
},
backToBehavior(){
this.displayType="behavior";
},
getActions(row){
this.displayType="action";
this.behaviorId=row.id;
this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
},
saveScenesStage() {
saveScriptScenes(this.group).then(resp => {
// this.isSaveStage = false;
this.$message.success('保存背景成功');
}).catch(error => {
this.$messageBox('保存背景失败!');
})
},
saveScenesData() {
saveScriptData(this.group).then(resp => {
this.$message.success('保存数据成功');
}).catch(error => {
this.$messageBox(`保存数据失败!: ${error.message}`);
})
},
dumpScenesData() {
this.$confirm('此操作将会清除已保存的录制数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
dumpScriptData(this.scriptId).then(resp => {
// this.isSaveStage = true;
this.$message.success('清除数据成功');
}).catch(error => {
this.$messageBox('清除数据失败!');
})
}).catch(error => { })
},
getBehaviorList(id){
this.displayType="behavior";
this.memberId=id;
},
saveMaplocation()
{
let data=Vue.prototype.$jlmap.$options;
let scriptId=this.$route.query.scriptId;
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
updateMapLocation(scriptId,dataZoom).then(response=>{
this.$message.success('更新定位成功');
}).catch(error => {
this.$messageBox(`更新定位失败: ${error.message}`);
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.tip-body-box {
position: relative;
// height: 540px;
}
.tab-pane-big{
height:420px;
}
.breadColor{
color:#fff;
}
.reminder-box {
position: absolute;
float: left;
left: 15px;
bottom: 15px;
width: 995px;
height: 540px;
background-color: #fff;
border-radius: 5px;
overflow: hidden;
z-index: 10;
font-size: 18px;
.tip-title {
width: 100%;
overflow: hidden;
height: 40px;
display: flex;
align-items: center;
flex-direction: row-reverse;
background-color: #409EFF;
border-radius: 5px 5px 0 0;
justify-content: space-between;
padding: 0 10px;
}
.tip-body {
height: 500px;
padding: 10px;
.list-label {
width: 105px;
}
.button-group{
margin-top:15px;
margin-left: 20px;
float:right;
}
}
.icon {
float: right;
margin-right: 10px;
cursor: pointer;
background-color: #f3f3f3;
border-radius: 50%;
}
/deep/ {
.el-tree-node__content {
margin-bottom: 4px;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background-color: #d6e5f7;
}
}
}
</style>

View File

@ -1,312 +0,0 @@
<template>
<div v-loading="loading" class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -120 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="addModel" label-width="140px">
<el-form-item label="皮肤类型:" prop="mapName">
<el-input v-model="addModel.mapName" :disabled="true" />
</el-form-item>
<el-form-item label="产品类型:" prop="prdType">
<el-radio-group v-model="addModel.prdType" :disabled="isUpdate">
<template v-for="item in chooseList">
<el-radio-button :key="item.code" :label="item.code">{{ item.name }}</el-radio-button>
</template>
</el-radio-group>
</el-form-item>
<el-form-item
label="产品编码:"
prop="code"
:rules="node && node.data.type ==='skin' ? baseRules.code:{}"
>
<el-input v-model="addModel.code" :disabled="codeDisabled" />
</el-form-item>
<el-form-item label="产品名称:" prop="name" :rules="baseRules.name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item
v-if="isShowTrainTypes"
label="关联实训类型:"
prop="trainTypes"
:rules="baseRules.trainTypes"
>
<el-select v-model="addModel.trainTypes" multiple placeholder="请选择" @change="trainTypesChange">
<el-option
v-for="item in trainTypesList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="产品说明:" prop="remarks" :rules="baseRules.remarks">
<el-input v-model="addModel.remarks" type="textarea" :rows="4" />
</el-form-item>
</el-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isCreate" type="primary" @click="create">创建</el-button>
<el-button v-if="isUpdate" type="primary" @click="update">更新</el-button>
<el-button v-if="isDelete" type="danger" @click="deleteObj">删除</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
// import { getPublishMapInfo } from '@/api/jmap/map';
import { createTrainingCategory, updateTrainingCategory, getProductDetail, deleteTrainingCategory, checkMapProductCodeExist } from '@/api/management/mapprd';
// import localStore from 'storejs';
export default {
name: 'ShowDetail',
props: {
height: {
type: Number
}
},
data() {
return {
loading: false,
node: null,
display: 1,
codeDisabled: true,
rules: {},
trainTypesList: [],
initTrainTypes: [],
chooseList: [],
addModel: {
id: '',
mapId: '',
mapName: '',
skinStyle: '',
name: '',
remarks: '',
code: '',
prdType: '01',
trainTypes: []
}
};
},
computed: {
title() {
if (this.node && this.node.data) {
if (this.node.data.type === 'skin') {
return '创建产品类目';
} else if (this.node.data.type === 'prd' ||
this.node.data.type === 'prd') {
return '编辑产品类目';
}
}
return '请选择操作';
},
isCreate() {
return this.node && this.node.data.type === 'skin';
},
isUpdate() {
return this.node && this.node.data.type === 'prd';
},
isDelete() {
return this.node && this.node.data.type === 'prd';
},
isShowTrainTypes() {
return this.addModel.prdType != '03' && this.addModel.prdType != '04';
},
baseRules() {
return {
code: [
{ required: true, message: '请输入产品编码', trigger: 'change' }
],
name: [
{ required: true, message: '请输入产品名称', trigger: 'change' }
],
remarks: [
{ required: true, message: '请输入产品说明', trigger: 'change' }
],
trainTypes: [
{ required: true, message: '请选择关联实训类型', trigger: 'change' }
]
};
}
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.$Dictionary.productPostType().then(list => {
this.chooseList = list;
});
},
methods: {
loadData(node) {
if (node) {
//
this.node = node;
this.initTrainTypes = [];
this.$refs.form.resetFields();
this.loading = true;
if (node.data.type === 'skin') {
this.codeDisabled = false;
this.addModel.mapName = node.data.name;
this.addModel.skinStyle = node.data.id;
this.loading = false;
} else if (node.data.type === 'prd') {
this.codeDisabled = true;
getProductDetail(node.data.id).then(response => {
this.addModel.mapName = node.parent.data.name;
this.addModel.mapId = node.parent.data.id;
this.addModel.name = response.data.name;
this.addModel.remarks = response.data.remarks;
this.addModel.prdType = response.data.prdType;
this.addModel.code = response.data.code;
this.addModel.skinStyle = response.data.skinStyle;
this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes;
this.addModel.id = response.data.id;
this.loading = false;
}).catch(() => {
this.loading = false;
});
} else {
this.addModel.prdType = '01';
}
//
this.$nextTick(function () {
this.$refs.form.clearValidate();
});
}
},
create() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
skinStyle: this.addModel.skinStyle,
mapName: this.addModel.mapName,
name: this.addModel.name,
remarks: this.addModel.remarks,
prdType: this.addModel.prdType,
code: this.addModel.code,
trainTypes: this.isShowTrainTypes ? this.addModel.trainTypes : []
};
checkMapProductCodeExist({ code: this.addModel.code }).then(response => {
if (!response.data) {
createTrainingCategory(data).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$emit('refresh');
this.$message.success('创建产品成功');
}).catch(() => {
this.$messageBox('创建产品失败');
});
} else {
this.$messageBox('产品Code已存在');
}
}).catch(() => {
this.$messageBox('校验产品Code是否已存在失败');
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.addModel.trainTypes = this.isShowTrainTypes ? this.addModel.trainTypes : [];
updateTrainingCategory(this.addModel).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$message.success('更新产品成功');
this.$emit('refresh');
}).catch(() => {
this.$messageBox('更新产品失败');
});
}
});
},
trainTypesChange(tag) {
if (this.initTrainTypes && this.initTrainTypes.length > 0) {
this.initTrainTypes.forEach(elem => {
if (this.addModel.trainTypes.indexOf(elem) < 0) {
this.addModel.trainTypes = this.initTrainTypes;
this.$messageBox('不能缩小上次创建的实训列表的范围');
}
});
}
},
deleteObj() {
this.$refs.form.validate((valid) => {
if (valid) {
deleteTrainingCategory(this.addModel).then(response => {
this.$message.success('删除产品成功');
this.$refs.form.resetFields();
this.node = null;
this.$emit('refresh');
}).catch(error => {
if (error.code === 500009) {
this.$messageBox('产品已被使用无法删除');
} else {
this.$messageBox('删除产品失败');
}
});
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.card-box {
padding-top: 20px;
}
.steps {
width: 980px;
margin: 0 auto;
padding-top: 20px;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 20px;
/deep/ {
.el-select {
float: left;
width: calc(600px);
}
.el-textarea {
float: left;
width: calc(600px);
}
.el-form-item__content>.el-input {
float: left;
width: calc(600px);
}
.el-input-number {
float: left;
width: calc(250px);
}
}
}
.draft {
width: 300px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -1,60 +0,0 @@
<template>
<div>
<div class="training-tree">
<training-tree-operate ref="trainingTree" :height="height" @loadData="loadData" />
</div>
<div class="training-draft" :style="{width: width +'px'}">
<edit-detail-operate ref="training" :height="height" @refresh="refresh" />
</div>
</div>
</template>
<script>
// import { deleteMap, listMap, newMap, getMapDetail, publishMap, editMap, saveAsMap } from '@/api/jmap/mapdraft';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import TrainingTreeOperate from './tree';
import EditDetailOperate from './edit';
export default {
name: 'TrainingEditOperate',
components: {
EditDetailOperate,
TrainingTreeOperate
},
mixins: [WindowResizeHandler],
data() {
return {
width: 0,
height: 0
};
},
methods: {
resizeHandler() {
this.width = this._clientWidth - 420;
this.height = this._clientHeight - 150;
},
loadData(node) {
this.$nextTick(() => {
this.$refs.training.loadData(node);
});
},
refresh() {
this.$nextTick(() => {
this.$refs.trainingTree.refresh();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.training-tree {
float: left;
width: 420px;
}
.training-draft {
float: left;
}
</style>

View File

@ -1,110 +0,0 @@
<template>
<el-card class="map-list-main" v-loading="loading">
<div slot="header" class="clearfix">
<span>产品类目</span>
</div>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" clearable> </el-input>
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{ height: height +'px' }">
<el-tree ref="trainingTree" :data="treeData" :filter-node-method="filterNode" :lazy="false"
:props="defaultProps" class="tree-height-max" expand-on-click-node highlight-current
@node-click="clickEvent">
<span slot-scope="{ node, data }">
<span v-if="node.data.type == 'skin'" class="el-icon-news">&nbsp;{{ node.label }}</span>
<span v-if="node.data.type == 'prd'" class="el-icon-tickets">&nbsp;{{ node.label }}</span>
<span v-if="node.data.type == 'trainingType'" class="el-icon-document">&nbsp;{{ node.label }}</span>
<span v-if="node.data.type == 'trainingType'" class="el-icon-edit">&nbsp;{{ node.label }}</span>
</span>
</el-tree>
</el-scrollbar>
</el-card>
</template>
<script>
import { createTraining } from '@/api/jmap/training'
import { getProductTree } from '@/api/management/mapprd';
export default {
name: 'TreeOperate',
props: {
height: {
type: Number
}
},
data() {
return {
loading: true,
defaultProps: {
children: 'children',
label: 'name',
},
filterText: '',
treeData: [],
node: {},
point: {
x: 0,
y: 0
}
}
},
watch: {
filterText(val) {
this.$refs.trainingTree.filter(val);
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
showContextMenu(e, obj, node, vueElem) {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
}
if (obj) {
this.node = node;
this.$refs.menu.show();
}
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
this.$emit('loadData', node);
},
convertTreeData(list) {
let tree = [];
if (list && list.length) {
/*去除列表的training节点*/
list.forEach(elem => {
elem.children = this.convertTreeData(elem.children);
if (elem.type !== 'trainingType') {
tree.push(elem);
}
})
}
return tree;
},
refresh() {
getProductTree().then(response => {
this.treeData = this.convertTreeData(response.data)
this.$nextTick(() => { this.loading = false; });
}).catch(error => {
this.$messageBox('刷新失败')
this.loading = false;
});
}
}
}
</script>
<style>
.el-tree {
overflow-x: hidden;
}
.el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important;
}
</style>

View File

@ -1,217 +0,0 @@
<template>
<el-dialog :title="$t('map.automaticSignalList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
<pre-view-field ref="previewField" :map-info="mapInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getAutoSignalList, delAutoSignal, getAutoSignalDetail } from '@/api/jmap/mapdraft';
import PreViewField from './preview';
export default {
name: 'RouteDetail',
components: {
PreViewField
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
signalCode: {
type: 'text',
label: this.$t('map.signal') }
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.automaticSignalCode'),
prop: 'code'
},
{
title: this.$t('map.signalCodeName'),
prop: 'signalCode'
},
{
title: this.$t('map.signalCode'),
prop: 'code'
},
{
type: 'button',
title: this.$t('map.sectionData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.sectionDetail
}
]
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: this.$t('map.delete'),
handleClick: this.deleteObj,
type: 'danger'
}
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'signalList'
])
},
watch: {
signalList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code });
}
this.queryForm.queryObject.signalCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
doClose() {
this.show = false;
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
name = device.uniqueName;
}
return name;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getAutoSignalList(this.mapInfo.id, params);
}
},
acquireMapList() {
//
listMap().then(response => {
this.mapList = response.data;
});
},
convertField(dataDict, enumList, key, value, fieldList) {
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
fieldList.forEach(field => {
enumList.forEach(elem => {
if (elem[key] === dataDict[field]) {
dataDict[field] = elem[value];
}
});
});
}
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.convertField(elem, that.mapList, 'id', 'name', ['mapId']);
elem.code = elem.signalCode;
elem.signalCode = that.formatName(elem.signalCode);
});
}
}
return data;
},
editObj(index, row) {
getAutoSignalDetail(row.id).then(response => {
const data = Object.assign({}, response.data);
data.autoSignalClearList = data.autoSignalClearList.map(elem => { return elem.sectionCode; });
this.$emit('autoMaticoSelected', data);
this.doClose();
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
delAutoSignal(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));
});
}
},
sectionDetail(index, row) {
const sectionDict = {};
this.sectionList.forEach(elem => { sectionDict[elem.code] = elem.name; });
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: this.$t('map.sectionList'),
name: row.code,
model: {
field: 'autoSignalClearList',
items: [
{ prop: 'sectionCode', label: this.$t('map.sectionName'), type: 'select', options: sectionDict }
]
}
};
this.$refs.previewField.doShow(fieldList, row.autoSignalClearList);
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>

View File

@ -1,111 +0,0 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapControl">
<el-card>
<div slot="header" class="clearfix">
<span>
{{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}
</el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.newConstruction') }}
</el-button>
</div>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane :label="$t('map.automaticSignal')" name="Route">
<route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
:card-height="cardHeight"
@handleSelectView="handleSelectView"
/>
</el-tab-pane>
</el-tabs>
</el-card>
<route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" />
</div>
</transition>
</template>
<script>
import RouteDraft from './route';
import RouteDetail from './detail';
export default {
name: 'AutomaticOperate',
components: {
RouteDraft,
RouteDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
enabledTab: 'Route',
routeData: null
};
},
methods: {
clickEvent(e, model) {
this.onSelect(model);
},
onSelect(model) {
if (model) {
this.selected = model;
} else {
this.selected = null;
}
},
setDelayUnlockStatus(data, status) {
if (data && data.delayShowList) {
data.delayShowList.forEach(elem => {
elem.status = status;
});
}
},
autoMaticoSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>

View File

@ -1,72 +0,0 @@
<template>
<el-dialog
:title="mapInfo.name + ' / ' + name + ' / ' + title"
:visible.sync="show"
width="30%"
:before-close="doClose"
center
append-to-body
>
<el-table :data="data" border style="width: 100%">
<template v-for="(item, index) in form">
<el-table-column :key="index" :label="item.label">
<template slot-scope="scope">
<template v-if="item.type === 'select'">
<el-tooltip effect="dark" :content="item.options[scope.row[item.prop]]" placement="top">
<span>{{ item.options[scope.row[item.prop]] }}</span>
</el-tooltip>
</template>
<template v-if="item.type === 'text'">
<el-tooltip effect="dark" :content="scope.row[item.prop]" placement="top">
<span>{{ scope.row[item.prop] }}</span>
</el-tooltip>
</template>
</template>
</el-table-column>
</template>
</el-table>
</el-dialog>
</template>
<script>
export default {
name: 'DictionaryDetailEdit',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
title: '',
name: '',
form: [],
data: []
};
},
methods: {
doShow(fieldList, dataList) {
if (fieldList.model) {
const items = fieldList.model.items;
if (fieldList.model.convert) {
// data = fieldList.model.convert(data);
}
if (items) {
this.form = items;
this.name = fieldList.name;
this.data = dataList;
this.title = fieldList.title;
}
this.show = true;
}
},
doClose(done) {
this.show = false;
}
}
};
</script>

View File

@ -1,200 +0,0 @@
<template>
<div :style="{ height: cardHeight +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini">
<div class="definition">
<el-form-item :label="$t('map.signalID')" prop="signalCode">
<el-select v-model="addModel.signalCode" clearable :filterable="true">
<el-option
v-for="item in signalList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">{{ $t('map.activate') }}
</el-button>
</el-form-item>
<el-form-item :label="$t('map.segmentData')" prop="autoSignalClearList">
<el-select v-model="addModel.autoSignalClearList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'autoSignalClearList' ? 'danger' : 'primary'"
@click="hover('autoSignalClearList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button>
</el-button-group>
</el-form-item>
</div>
</el-form>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { postAutoSignal, putAutoSignal } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/utils/runPlan';
export default {
name: 'RouteOperation',
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
ViewMode: ViewMode,
field: '',
isSave: true,
loading: false,
editModel: {},
addModel: {
id: '',
code: '',
mapId: '',
signalCode: '',
autoSignalClearList: []
},
editShow: false,
rules: {
signalCode: [
{ required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' }
],
autoSignalClearList: [
{ required: true, message: this.$t('map.triggerSegmentData'), trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'sectionList'
])
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = val;
this.editShow = true;
}
}
},
mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
},
methods: {
hover(field) {
this.field = field === this.field ? '' : field;
},
formatName(code) {
return formatName(code);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'signalCode'.toUpperCase()) {
this.addModel.signalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'autoSignalClearList'.toUpperCase()) {
if (this.addModel.autoSignalClearList.indexOf(selected.code) === -1) {
this.addModel.autoSignalClearList.push(selected.code);
}
}
}
},
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; }
model['mapId'] = this.mapInfo.id;
model['autoSignalId'] = this.addModel.id;
model['autoSignalClearList'] = this.addModel.autoSignalClearList.map(elem => { return { sectionCode: elem }; });
return model;
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
postAutoSignal(this.buildModel(getUID('autoSingle'))).then(resp => {
this.$message.success(this.$t('map.automaticSignalSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('map.failedCreateSignal'));
this.loading = false;
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
putAutoSignal(this.buildModel()).then(resp => {
this.$message.success(this.$t('map.automaticSignalUpdateSucceeded'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('map.automaticSignalUpdateFailed'));
this.loading = false;
});
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id;
this.addModel.autoSignalClearList = [];
this.addModel.signalCode = '';
this.addModel.code = '';
this.isSave = true;
}
}
}
};
</script>

View File

@ -1,350 +0,0 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" :rules="editRules" label-width="150px" size="mini">
<el-form-item label="停车点编码:" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option
v-for="item in stopPointList"
:key="item.code"
:label="item.code + ' (' + item.name+ ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="停车点名称:" prop="name" disabled="true">
<el-input v-model="editModel.name" />
</el-form-item>
<el-form-item label="所属车站:" prop="stationCode">
<el-select v-model="editModel.stationCode" filterable>
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="是否备用计划停车点:" prop="isBackupPlan">
<el-checkbox v-model="editModel.isBackupPlan" />
</el-form-item>
<el-form-item label="是否首选折返点:" prop="isPrimaryReentry">
<el-checkbox v-model="editModel.isPrimaryReentry" />
</el-form-item>
<el-form-item label="关联Link:" prop="linkCode">
<el-select v-model="editModel.linkCode" filterable>
<el-option
v-for="item in linkList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="偏移量:" prop="offset">
<el-input-number v-model="editModel.offset" placeholder="米" :min="0" />
</el-form-item>
<el-form-item label="是否折返点:" prop="isTurningPoint">
<el-checkbox v-model="editModel.isTurningPoint" />
</el-form-item>
<el-form-item v-if="editModel.isTurningPoint" label="目的地码:" prop="destCode">
<el-input v-model="editModel.destCode" />
</el-form-item>
<el-form-item v-if="editModel.isTurningPoint" label="目的地码是否显示:" prop="destCodeShow">
<el-checkbox v-model="editModel.destCodeShow" />
</el-form-item>
<div v-if="editModel.isTurningPoint" class="coordinate">
<span class="title">目的码名称偏移量:</span>
<el-form-item
label="x:"
prop="destCodePosition.x"
style="display: table; float: left; margin-right: 20px;"
label-width="20px"
>
<el-input-number v-model="editModel.destCodePosition.x" label="x坐标" />
</el-form-item>
<el-form-item
label="y:"
prop="destCodePosition.y"
style="display: table; float: left;"
label-width="20px"
>
<el-input-number v-model="editModel.destCodePosition.y" label="y坐标" />
</el-form-item>
</div>
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button>
</el-button-group>
</el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="120px" :model="addModel" :rules="createRules" size="mini">
<el-form-item label="Link名称:" prop="linkCode">
<el-select v-model="addModel.linkCode" filterable>
<el-option
v-for="item in linkList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="所属车站:" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable>
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="偏移量:" prop="offset">
<el-input-number v-model="addModel.offset" :min="0" />
</el-form-item>
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button>
</el-button-group>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
export default {
name: 'StopPointDraft',
components: {
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
},
cardHeight: {
type: [String, Number],
required: true
}
},
data() {
return {
activeName: 'first',
editModel: {
code: '',
name: '',
linkCode: '',
stationCode: '',
offset: '',
isTurningPoint: false,
destCode: '',
destCodeShow: true,
destCodePosition: {
x: '',
y: ''
},
isBackupPlan: false,
isPrimaryReentry: false
},
addModel: {
name: '', //
linkCode: '', // link
stationCode: '', //
offset: 0 //
}
};
},
computed: {
...mapGetters('map', [
'linkList',
'stationList',
'stopPointList',
'skinStyle'
]),
editRules: function () {
return {
code: [
{ required: true, message: '请重新选择设备', trigger: 'change' }
],
name: [
{ required: true, message: '请输入计数器名称', trigger: 'change' }
],
linkCode: [
{ required: true, message: '请选择关联Link', trigger: 'change' }
],
stationCode: [
{ required: true, message: '请选择关联车站', trigger: 'change' }
]
};
},
createRules: function () {
return {
linkCode: [
{ required: true, message: '请选择关联Link', trigger: 'change' }
],
stationCode: [
{ required: true, message: '请选择关联车站', trigger: 'change' }
],
offset: [
{ required: true, message: '请输入偏移量', trigger: 'change' }
]
};
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
},
$route() {
this.$refs.form.resetFields();
this.activeName = 'first';
}
},
mounted() {
this.$Dictionary.doorLocationType().then(list => {
this.DoorLocationTypeList = list;
});
this.$Dictionary.runDirectionType().then(list => {
this.RunDirectionTypeList = list;
});
},
methods: {
deviceChange(code) {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'StopPoint'.toUpperCase()) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
this.editModel.code = selected.code;
this.editModel.name = selected.name;
this.editModel.linkCode = selected.linkCode;
this.editModel.stationCode = selected.stationCode;
this.editModel.offset = selected.offset;
this.editModel.isTurningPoint = selected.isTurningPoint;
this.editModel.destCode = selected.destCode;
this.editModel.destCodeShow = selected.destCodeShow || true;
this.editModel.isBackupPlan = selected.isBackupPlan || false;
this.editModel.isPrimaryReentry = selected.isPrimaryReentry || false;
this.editModel.destCodePosition.x = selected.destCodePosition.x;
this.editModel.destCodePosition.y = selected.destCodePosition.y;
this.activeName = 'first';
} else if (selected && selected._type.toUpperCase() === 'Link'.toUpperCase()) {
this.addModel.linkCode = selected.code;
this.activeName = 'second';
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = selected.code;
this.activeName = 'second';
} else {
this.activeName = 'second';
}
},
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID('StopPoint');
const model = {
_type: 'StopPoint',
code: uid,
stationCode: this.addModel.stationCode,
offset: this.addModel.offset,
isTurningPoint: false,
isBackupPlan: false,
isPrimaryReentry: false,
destCodePosition: {
x: 0,
y: 0
}
};
this.linkList.forEach(elem => {
if (elem.code === this.addModel.linkCode) {
model.name = 'StopPoint_' + elem.name.replace('Link_', '');
model.linkCode = elem.code;
}
});
this.$emit('addOrUpdateMapModel', model);
}
});
},
//
edit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.$emit('addOrUpdateMapModel', this.buildEditModel());
}
});
},
buildEditModel() {
const model = {
_type: 'StopPoint',
code: this.editModel.code,
name: this.editModel.name,
linkCode: this.editModel.linkCode,
stationCode: this.editModel.stationCode,
offset: this.editModel.offset,
isTurningPoint: this.editModel.isTurningPoint,
destCode: this.editModel.destCode,
destCodeShow: this.editModel.destCodeShow,
destCodePosition: {
x: this.editModel.destCodePosition.x,
y: this.editModel.destCodePosition.y
},
isBackupPlan: this.editModel.isBackupPlan,
isPrimaryReentry: this.editModel.isPrimaryReentry
};
return model;
},
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'StopPoint'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info('已取消删除');
});
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.coordinate {
overflow: hidden;
.title {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 40px;
padding: 0 12px 0 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 28px;
width: 140px;
font-weight: bold;
display: block;
float: left;
}
}
</style>

View File

@ -1,297 +0,0 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" label-width="110px" size="mini" :rules="rules">
<el-form-item :label="$t('map.trainCode')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option
v-for="item in trainList"
:key="item.code"
:label="item.code"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.groupNumber')" prop="groupNumber">
<el-input v-model="editModel.groupNumber" />
</el-form-item>
<el-form-item :label="$t('map.modelCode')" prop="modelCode">
<el-select v-model="editModel.modelCode" filterable>
<el-option
v-for="item in trainModelList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button-group>
<el-button type="primary" size="small" @click="newTrainMode">{{ $t('map.add') }}</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(editModel.modelCode)">{{ $t('map.updata') }}
</el-button>
<el-button type="primary" size="small" @click="delTrainMode(editModel.modelCode)">{{ $t('map.deleteObj') }}
</el-button>
</el-button-group>
</el-form-item>
<el-form-item :label="$t('map.pointX')" prop="position.x">
<el-input-number v-model="editModel.position.x" />
</el-form-item>
<el-form-item :label="$t('map.pointY')" prop="position.y">
<el-input-number v-model="editModel.position.y" />
</el-form-item>
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="100px" :rules="createRules" :model="addModel" size="mini">
<el-form-item :label="$t('map.groupNumber')" prop="groupNumber">
<el-input v-model="addModel.groupNumber" />
</el-form-item>
<el-form-item :label="$t('map.modelCode')" prop="modelCode">
<el-select v-model="addModel.modelCode" filterable>
<el-option
v-for="item in trainModelList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button-group>
<el-button type="primary" size="small" @click="newTrainMode">{{ $t('map.add') }}</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(addModel.modelCode)">{{ $t('map.updata') }}
</el-button>
<el-button type="primary" size="small" @click="delTrainMode(addModel.modelCode)">{{ $t('map.deleteObj') }}
</el-button>
</el-button-group>
</el-form-item>
<el-form-item :label="$t('map.pointX')" prop="position.x">
<el-input-number v-model="addModel.position.x" />
</el-form-item>
<el-form-item :label="$t('map.pointY')" prop="position.y">
<el-input-number v-model="addModel.position.y" />
</el-form-item>
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</el-tab-pane>
</el-tabs>
<train-model ref="trainMode" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import TrainModel from './trainmodel';
export default {
name: 'TrainDraft',
components: {
TrainModel
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
},
cardHeight: {
type: [String, Number],
required: true
}
},
data() {
return {
activeName: 'first',
mapData: null,
editModel: {
code: '',
groupNumber: '',
modelCode: '',
position: {
x: 0,
y: 0
}
},
addModel: {
modelCode: '',
groupNumber: '',
position: {
x: 0,
y: 0
}
},
rules: {
code: [
{ required: true, message: this.$t('rules.pleaseReSelectDevice'), trigger: 'change' }
],
groupNumber: [
{ required: true, message: this.$t('rules.pleaseEnterGroupNumber'), trigger: 'blur' }
],
modelCode: [
{ required: true, message: this.$t('rules.selectTrainType'), trigger: 'change' }
],
'position.x': [
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
],
'position.y': [
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'trainList',
'trainModelList',
'skinStyle'
]),
createRules: function () {
return {
modelCode: [
{ required: true, message: this.$t('rules.selectTrainType'), trigger: 'change' }
],
groupNumber: [
{ required: true, message: this.$t('rules.pleaseEnterTrainNumber'), trigger: 'blur' }
],
'position.x': [
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'change' }
],
'position.y': [
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'change' }
]
};
}
},
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
},
$route() {
this.$refs.form.resetFields();
this.activeName = 'first';
}
},
methods: {
deviceChange(code) {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form.resetFields();
this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Train'.toUpperCase()) {
this.editModel.code = selected.code;
this.editModel.modelCode = selected.modelCode;
this.editModel.groupNumber = selected.groupNumber;
this.editModel.position = {
x: selected.position.x,
y: selected.position.y
};
this.activeName = 'first';
} else {
this.activeName = 'second';
}
},
create() {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID('Train');
const model = {
_type: 'Train',
code: uid,
safeDistance: '100',
maxSafeDistance: '100',
modelCode: this.addModel.modelCode,
groupNumber: this.addModel.groupNumber,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
}
};
this.$emit('addOrUpdateMapModel', model);
}
});
},
//
edit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$emit('addOrUpdateMapModel', this.buildEditModel());
}
});
},
buildEditModel() {
const model = {
_type: 'Train',
code: this.editModel.code,
safeDistance: this.editModel.safeDistance,
maxSafeDistance: this.editModel.maxSafeDistance,
modelCode: this.editModel.modelCode,
groupNumber: this.editModel.groupNumber,
position: {
x: this.editModel.position.x,
y: this.editModel.position.y
}
};
return model;
},
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Train'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
});
}
},
newTrainMode() {
if (Object.keys(this.$store.state.map.map || {}).length) {
this.$refs.trainMode.doShow({}, 'ADD');
} else {
this.$messageBox(this.$t('tip.selectMap'));
}
},
uptTrainMode(code) {
if (code) {
this.trainModelList.forEach(elem => {
if (elem.code === code) {
this.$refs.trainMode.doShow(elem, 'UPT');
return;
}
});
} else {
this.$messageBox(this.$t('tip.selectTrainType'));
}
},
delTrainMode(code) {
if (code) {
const model = { code };
this.$refs.trainMode.operateTrainModel({ model, type: 'DEL' });
this.addModel.modelCode = this.editModel.modelCode = '';
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>

View File

@ -1,178 +0,0 @@
<template>
<el-dialog :title="isNew? $t('map.trainmodelCreate'): $t('map.trainmodelUpdate')" :visible.sync="dialogShow" width="30%" :before-close="doClose">
<el-card shadow="never">
<el-form
ref="form"
:model="formModel"
:rules="rules"
label-width="120px"
size="mini"
style="margin: 20px 20px;"
>
<el-input v-model="formModel.code" :disabled="!isNew" type="hidden" />
<el-form-item :label="$t('map.trainTypeName')" prop="name">
<el-input v-model="formModel.name" :disabled="!isNew" />
</el-form-item>
<el-form-item :label="$t('map.trainLength')" prop="length">
<el-input-number v-model="formModel.length" :min="0" />{{ $t('map.meter') }}
</el-form-item>
<el-form-item :label="$t('map.trainSafeDistance')" prop="safeDistance">
<el-input-number v-model="formModel.safeDistance" :min="0" />{{ $t('map.meter') }}
</el-form-item>
<el-form-item :label="$t('map.trainMaxSafeDistance')" prop="maxSafeDistance">
<el-input-number v-model="formModel.maxSafeDistance" :min="0" />{{ $t('map.meter') }}
</el-form-item>
<el-form-item :label="$t('map.averageVelocity')" prop="averageVelocity">
<el-input-number v-model="formModel.averageVelocity" :min="0" />km/h
</el-form-item>
<el-form-item :label="$t('map.averageDeceleration')" prop="averageDeceleration">
<el-input-number v-model="formModel.averageDeceleration" :min="0" />km/h
</el-form-item>
<el-form-item :label="$t('map.defaultVelocity')" prop="defaultVelocity">
<el-input-number v-model="formModel.defaultVelocity" :min="0" />km/h
</el-form-item>
<el-form-item :label="$t('map.maxVelocity')" prop="maxVelocity">
<el-input-number v-model="formModel.maxVelocity" :min="0" />km/h
</el-form-item>
</el-form>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSure">{{ isNew? $t('map.create'): $t('map.updata') }}</el-button>
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
// import { mapGetters } from 'vuex';
// import { listMap } from '@/api/jmap/mapdraft';
import { getUID } from '@/jmap/utils/Uid';
export default {
name: 'TrainModeOperate',
data() {
return {
dialogShow: false,
isNew: false,
loading: false,
rules: null,
mapList: [],
formModel: {
code: '',
name: '',
length: 0,
safeDistance: '',
maxSafeDistance: '',
averageVelocity: 0,
averageDeceleration: 0,
defaultVelocity: 0,
maxVelocity: 0
}
};
},
computed: {
addRules: function () {
return {
code: [
{ required: true, message: this.$t('rules.trainCode'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.pleaseEnterTrainTypeName'), trigger: 'change' }
],
length: [
{ required: true, message: this.$t('rules.trainLength'), trigger: 'change' }
],
safeDistance: [
{ required: true, message: this.$t('rules.safeDistance'), trigger: 'change' }
],
maxSafeDistance: [
{ required: true, message: this.$t('rules.maxSafeDistance'), trigger: 'change' }
],
averageVelocity: [
{ required: true, message: this.$t('rules.averageVelocity'), trigger: 'change' }
],
averageDeceleration: [
{ required: true, message: this.$t('rules.averageDeceleration'), trigger: 'change' }
],
defaultVelocity: [
{ required: true, message: this.$t('rules.defaultVelocity'), trigger: 'change' }
],
maxVelocity: [
{ required: true, message: this.$t('rules.maxVelocity'), trigger: 'change' }
]
};
},
viewRules: function () {
return {};
}
},
methods: {
doShow(model, type) {
this.dialogShow = true;
this.$nextTick(() => {
if (this.$refs && this.$refs.form) {
this.$refs.form.resetFields();
}
if (type !== 'ADD') {
this.isNew = false;
if (model) {
this.formModel.code = model.code;
this.formModel.name = model.name;
this.formModel.length = model.length;
this.formModel.safeDistance = model.safeDistance;
this.formModel.maxSafeDistance = model.maxSafeDistance;
this.formModel.averageVelocity = model.averageVelocity;
this.formModel.averageDeceleration = model.averageDeceleration;
this.formModel.defaultVelocity = model.defaultVelocity;
this.formModel.maxVelocity = model.maxVelocity;
}
this.rules = this.viewRules;
} else {
this.isNew = true;
this.rules = this.addRules;
}
this.$nextTick(() => {
this.$refs.form.clearValidate();
});
});
},
doClose() {
this.dialogShow = false;
},
handleSure() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.isNew) {
this.formModel.code = getUID('TrainModel');
this.operateTrainModel({ model: this.formModel, type: 'ADD' });
} else {
this.operateTrainModel({ model: this.formModel, type: 'UPT' });
}
this.doClose();
}
});
},
operateTrainModel({ model, type }) {
this.$store.dispatch('map/operateTrainModel', { model, type });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.create-box {
width: 800px;
margin: 0 auto;
padding-top: 20px;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
</style>

View File

@ -1,209 +0,0 @@
<template>
<el-dialog :title="$t('map.pathUnitList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getRouteUnitList, delRouteUnit, getRouteUnit } from '@/api/jmap/pathunit';
export default {
name: 'RouteDetail',
components: {
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
startSectionCode: {
type: 'select',
label: this.$t('map.startSectionCode'),
config: {
data: []
}
},
endSectionCode: {
type: 'select',
label: this.$t('map.endSectionCode'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.pathUnitCode'),
prop: 'code'
},
{
title: this.$t('map.pathUnitMapName'),
prop: 'mapId'
},
{
title: this.$t('map.startSectionCode'),
prop: 'startSectionCode'
},
{
title: this.$t('map.endSectionCode'),
prop: 'endSectionCode'
},
{
title: this.$t('map.orderNum'),
prop: 'orderNum'
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
}
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList'
])
},
watch: {
sectionList: function (val, old) {
const list = [];
if (val && val.length) {
val.forEach(elem => {
if (elem.isStandTrack || elem.isReentryTrack || elem.isTransferTrack) {
list.push({ label: this.formatName(elem.code), value: elem.code });
}
});
this.queryForm.queryObject.startSectionCode.config.data = list;
this.queryForm.queryObject.endSectionCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
doClose() {
this.show = false;
},
formatName(code) {
let name = '';
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
name += `${station.name} `;
}
name += `${section.name} (${section.code})`;
}
return name;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getRouteUnitList(this.mapInfo.id, params);
}
},
acquireMapList() {
//
listMap().then(response => {
this.mapList = response.data;
});
},
convertField(dataDict, enumList, key, value, fieldList) {
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
fieldList.forEach(field => {
enumList.forEach(elem => {
if (elem[key] === dataDict[field]) {
dataDict[field] = elem[value];
}
});
});
}
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.convertField(elem, that.mapList, 'id', 'name', ['mapId']);
elem.startSectionCode = that.formatName(elem.startSectionCode);
elem.endSectionCode = that.formatName(elem.endSectionCode);
});
}
}
return data;
},
editObj(index, row) {
getRouteUnit(row.id).then(response => {
const data = response.data;
this.$emit('routeSelected', data);
this.doClose();
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
delRouteUnit(row.id).then(response => {
this.$message.success(this.$t('tip.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('tip.failDelete'));
});
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>

View File

@ -1,109 +0,0 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapControl">
<el-card>
<div slot="header" class="clearfix">
<span>
{{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.newConstruction') }}</el-button>
</div>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane :label="$t('map.pathUnit')" name="Route">
<route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
:card-height="cardHeight"
@handleSelectView="handleSelectView"
/>
</el-tab-pane>
</el-tabs>
</el-card>
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
</div>
</transition>
</template>
<script>
import RouteDraft from './route';
import RouteDetail from './detail';
export default {
name: 'PathOperate',
components: {
RouteDraft,
RouteDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
enabledTab: 'Route',
routeData: null
};
},
methods: {
clickEvent(e, model) {
this.onSelect(model);
},
onSelect(model) {
if (model) {
this.selected = model;
} else {
this.selected = null;
}
},
setDelayUnlockStatus(data, status) {
if (data && data.delayShowList) {
data.delayShowList.forEach(elem => {
elem.status = status;
});
}
},
routeSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>

View File

@ -1,211 +0,0 @@
<template>
<el-dialog :title="$t('map.pathUnitList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap, listRouteAccess } from '@/api/jmap/mapdraft';
export default {
name: 'PathAccess',
components: {
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
name: {
type: 'select',
label: this.$t('map.pathName'),
config: {
data: []
}
},
stationCode: {
type: 'select',
label: this.$t('map.affiliationStationCode'),
config: {
data: []
}
},
startSignalCode: {
type: 'select',
label: this.$t('map.startingSignalName'),
config: {
data: []
}
},
endSignalCode: {
type: 'select',
label: this.$t('map.endingSignalName'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: true,
indexShow: true,
columns: [
{
title: this.$t('map.routeID'),
prop: 'code'
},
{
title: this.$t('map.pathName'),
prop: 'name'
},
{
title: this.$t('map.routeMapId'),
prop: 'mapId'
},
{
title: this.$t('map.routeStationName'),
prop: 'stationCode'
},
{
title: this.$t('map.routeStartSignalCode'),
prop: 'startSignalCode'
},
{
title: this.$t('map.routeEndSignalCode'),
prop: 'endSignalCode'
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.add'),
handleClick: this.addObj
}
]
}
],
selectAllClick: this.selectAll
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
])
},
watch: {
signalList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code });
}
this.queryForm.queryObject.startSignalCode.config.data = list;
this.queryForm.queryObject.endSignalCode.config.data = list;
}
},
stationList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].name, value: val[i].code });
}
this.queryForm.queryObject.stationCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
doClose() {
this.show = false;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return listRouteAccess(this.mapInfo.id, params);
}
},
acquireMapList() {
//
listMap().then(response => {
this.mapList = response.data;
});
},
convertField(dataDict, enumList, key, value, fieldList) {
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
fieldList.forEach(field => {
enumList.forEach(elem => {
if (elem[key] === dataDict[field]) {
dataDict[field] = elem[value];
}
});
});
}
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.convertField(elem, that.mapList, 'id', 'name', ['mapId']);
that.convertField(elem, that.stationList, 'code', 'name', ['stationCode']);
that.convertField(elem, that.signalList, 'code', 'uniqueName', ['startSignalCode', 'endSignalCode']);
});
}
}
return data;
},
addObj(index, row) {
const data = [];
data.push(row);
this.$emit('routeSelected', data);
this.doClose();
},
selectAll(data) {
this.$emit('routeSelected', data);
this.doClose();
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>

View File

@ -1,328 +0,0 @@
<template>
<div :style="{ height: cardHeight +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
<div class="path-box">
<el-steps :active="display" style="display: none;">
<el-step title="路径单元创建" icon="el-icon-edit" />
<el-step title="路径单元整合" icon="el-icon-setting" />
</el-steps>
<div v-show="display == 1" class="definition">
<el-form-item :label="$t('map.startSectionCodeColon')" prop="startSectionCode">
<el-select v-model="addModel.startSectionCode" clearable :filterable="true">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="formatName(item.code)"
:value="item.code"
/>
<!-- </el-input> -->
</el-select>
<el-button
:type=" field === 'startSectionCode' ? 'danger' : 'primary'"
@click="hover('startSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endSectionCodeColon')" prop="endSectionCode">
<el-select v-model="addModel.endSectionCode" clearable :filterable="true">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="formatName(item.code)"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'endSectionCode' ? 'danger' : 'primary'"
@click="hover('endSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" size="small" style="margin-top: 10px" @click="nextStep">下一步
</el-button>
</el-button-group>
</el-form-item>
</div>
<div v-show="display == 2" class="rule">
<el-button
type="primary"
size="small"
style="float: right; margin-right: 20px; margin-bottom: 10px;"
@click="pushSwitch"
>{{ $t('map.add') }}</el-button>
<el-table
:data="addModel.mapRouteUnitRelList"
row-key="id"
border
style="width: 95%; margin: 0 auto"
>
<el-table-column type="index" />
<el-table-column prop="routeCode" label="进路ID" />
<el-table-column prop="routeName" label="进路名称" />
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deletePathUnit(scope.$index, addModel.mapRouteUnitRelList)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-form-item>
<el-button-group>
<el-button type="primary" size="small" style="margin-top: 10px" @click="lastStep">{{ $t('map.lastStep') }}
</el-button>
</el-button-group>
<el-button-group>
<el-button
v-if="!editShow"
type="primary"
size="small"
:loading="loading"
style="margin-top: 10px"
@click="save"
>{{ $t('map.save') }}</el-button>
<el-button
v-if="editShow"
type="warning"
size="small"
:loading="loading"
style="margin-top: 10px"
@click="save"
>{{ $t('map.updata') }}</el-button>
</el-button-group>
</el-form-item>
</div>
</div>
</el-form>
</el-scrollbar>
<path-access ref="pathAccess" :map-info="mapInfo" @routeSelected="routeSelected" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { addRouteUnit, setRouteUnit } from '@/api/jmap/pathunit';
import PathAccess from './pathAccess';
import { ViewMode } from '@/scripts/ConstDic';
import Sortable from 'sortablejs';
export default {
name: 'RouteOperation',
components: {
PathAccess
},
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
ViewMode: ViewMode,
field: '',
code: '',
type: '',
loading: false,
addModel: {
mapId: '',
code: getUID('RouteUnit'),
startSectionCode: '',
endSectionCode: '',
mapRouteUnitRelList: []
},
editShow: false,
display: 1,
rules: {
startSectionCode: [
{ required: true, message: this.$t('rules.pleaseSelectStartSignal'), trigger: 'change' }
],
endSectionCode: [
{ required: true, message: this.$t('rules.pleaseSelectEndSignal'), trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList'
]),
filterSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.isStandTrack || elem.isReentryTrack || elem.isTransferTrack; });
} else {
return [];
}
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = val;
this.display = 1;
this.editShow = true;
}
}
},
mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
this.rowDrop();
},
methods: {
//
rowDrop() {
const that = this;
const tbody = document.querySelector('.el-table__body-wrapper tbody');
if (tbody) {
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
const currRow = that.addModel.mapRouteUnitRelList.splice(oldIndex, 1)[0];
that.addModel.mapRouteUnitRelList.splice(newIndex, 0, currRow);
}
});
}
},
hover(field) {
this.field = field === this.field ? '' : field;
},
formatName(code) {
let name = '';
const section = this.$store.getters['map/getDeviceByCode'](code);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
name += `${station.name} `;
}
name += `${section.name} (${section.code})`;
}
return name;
},
pushSwitch() {
if (this.$refs && this.$refs.pathAccess) {
this.$refs.pathAccess.doShow();
}
},
routeSelected(data) {
data.forEach((element, index) => {
this.addModel.mapRouteUnitRelList.push({
routeCode: element.code,
routeName: element.name,
mapId: this.mapInfo.id,
id: element.id,
routeUnitCode: this.addModel.code
});
});
},
//
nextStep() {
this.$refs.form.validate((valid) => {
if (valid) {
this.display = 2;
this.handleSelectView(ViewMode.MIX);
}
});
},
lastStep() {
this.display = 1;
this.handleSelectView(ViewMode.PHYSICAL);
},
buildModel() {
this.addModel.mapRouteUnitRelList.forEach((elem, index) => {
elem['orderNum'] = index + 1;
});
const model = Object.assign({}, this.addModel);
model['mapId'] = this.mapInfo.id;
return model;
},
save() {
this.loading = true;
if (this.editShow) {
setRouteUnit(this.buildModel()).then(response => {
this.$message.success(this.$t('tip.updateSuccessfully'));
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
this.loading = false;
});
} else {
[
addRouteUnit(this.buildModel()).then(response => {
this.$message.success(this.$t('tip.createSuccess'));
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
this.loading = false;
})
];
}
},
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.display = 1;
this.editShow = false;
this.addModel = {
mapId: this.mapInfo.id,
code: getUID('RouteUnit'),
startSectionCode: '',
endSectionCode: '',
mapRouteUnitRelList: []
};
this.loading = false;
}
},
//
deletePathUnit(index, data) {
this.addModel.mapRouteUnitRelList.splice(index, 1);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
this.addModel.startSectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
this.addModel.endSectionCode = selected.code;
}
}
}
}
};
</script>

View File

@ -1,611 +0,0 @@
<template>
<el-dialog :title="$t('map.routePreview')" :visible.sync="show" width="95%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
<pre-view-field ref="previewField" :map-info="mapInfo" />
<related-route ref="relatedRoute" :map-info="mapInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap, listRouteAccess, listRouteMapAccess, deleteRouteAccess, queryRouteAccessDetail } from '@/api/jmap/mapdraft';
import {
listOverlapSwitch, listTriggerSection, listOverlapSection, listPhysicsSection, listStationStand,
listSwitch, listAgainstRoute, listFlankProtectionSwitch
} from '@/api/jmap/mapdraft';
import PreViewField from './preview';
import RelatedRoute from './related';
export default {
name: 'RouteDetail',
components: {
PreViewField,
RelatedRoute
},
props: {
mapInfo: {
type: Object,
required: true
}
},
data() {
return {
show: false,
mapList: [],
RouteNatureTypeList: [],
RouteAutoTypeList: [],
SwitchLocateTypeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
name: {
type: 'text',
label: this.$t('map.pathName')
},
stationCode: {
type: 'select',
label: this.$t('map.affiliationStationCode'),
config: {
data: []
}
},
startSignalCode: {
type: 'select',
label: this.$t('map.startingSignalName'),
config: {
data: []
}
},
endSignalCode: {
type: 'select',
label: this.$t('map.endingSignalName'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.routeID'),
prop: 'code'
},
{
title: this.$t('map.pathName'),
prop: 'name'
},
{
title: this.$t('map.pathUnitMapName'),
prop: 'mapId'
},
{
title: this.$t('map.affiliationStationCode'),
prop: 'stationCode'
},
{
title: this.$t('map.accessType'),
prop: 'natureType'
},
{
title: this.$t('map.automaticAccessType'),
prop: 'autoType'
},
{
title: this.$t('map.startingSignalName'),
prop: 'startSignalCode'
},
{
title: this.$t('map.endingSignalName'),
prop: 'endSignalCode'
},
{
title: this.$t('map.nearSectionCode'),
prop: 'nearSectionCode'
},
{
type: 'button',
title: this.$t('map.continueProtectSwitchData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.overlapSwitchDetail
}
]
},
{
type: 'button',
title: this.$t('map.accessSideTurnoutData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.flankProtectionSwitchDetail
}
]
},
{
title: this.$t('map.turnBackRailName'),
prop: 'turnBackSectionCode'
},
{
type: 'button',
title: this.$t('map.routeSegmentData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.routeTrigger
}
]
},
{
type: 'button',
title: this.$t('map.routeProtectsData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.routeOverlap
}
]
},
{
type: 'button',
title: this.$t('map.accessPhysical'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.sectionDetail
}
]
},
{
type: 'button',
title: this.$t('map.routeAccessScreenData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.stationStandDetail
}
]
},
{
type: 'button',
title: this.$t('map.routeAccessTurnoutData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.accessSwitchDetail
}
]
},
{
type: 'button',
title: this.$t('map.hostileApproachData'),
buttons: [
{
name: this.$t('map.relation'),
handleClick: this.related
}
]
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.edit
},
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
}
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
])
},
watch: {
signalList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].uniqueName, value: val[i].code });
}
this.queryForm.queryObject.startSignalCode.config.data = list;
this.queryForm.queryObject.endSignalCode.config.data = list;
}
},
stationList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].name, value: val[i].code });
}
this.queryForm.queryObject.stationCode.config.data = list;
}
}
},
mounted() {
this.$Dictionary.routeNatureType().then(list => {
this.RouteNatureTypeList = list;
});
this.$Dictionary.routeAutoType().then(list => {
this.RouteAutoTypeList = list;
});
this.$Dictionary.switchLocateType().then(list => {
this.SwitchLocateTypeList = list;
});
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
doClose() {
this.show = false;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return listRouteAccess(this.mapInfo.id, params);
}
},
acquireMapList() {
listMap().then(response => {
this.mapList = response.data;
});
},
convertField(dataDict, enumList, key, value, fieldList) {
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
fieldList.forEach(field => {
enumList.forEach(elem => {
if (elem[key] === dataDict[field]) {
dataDict[field] = elem[value];
}
});
});
}
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.convertField(elem, that.RouteAutoTypeList, 'code', 'name', ['autoType']);
that.convertField(elem, that.RouteNatureTypeList, 'code', 'name', ['natureType']);
that.convertField(elem, that.SwitchLocateTypeList, 'code', 'name', ['overlapSwitchLocateType']);
that.convertField(elem, that.mapList, 'id', 'name', ['mapId']);
that.convertField(elem, that.switchList, 'code', 'name', ['routeOverlapSwitchList']);
that.convertField(elem, that.signalList, 'code', 'uniqueName', ['startSignalCode', 'endSignalCode']);
that.convertField(elem, that.stationList, 'code', 'name', ['stationCode']);
that.convertField(elem, that.sectionList, 'code', 'name', ['nearSectionCode', 'autoTriggerSectionCode', 'turnBackSectionCode']);
});
}
}
return data;
},
//
async routeTrigger(index, row) {
if (this.$refs && this.$refs.previewField && row) {
const sectionDict = {};
this.sectionList.map(elem => { sectionDict[elem.code] = elem.name; });
const res = await listTriggerSection(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: this.$t('map.routeSegmentData'),
name: row.name,
model: {
field: 'routeTriggerSectionList',
items: [
{ prop: 'sectionCode', label: '物理区段ID', type: 'text' },
{
prop: 'sectionCode', label: '物理区段名称', type: 'select', options: sectionDict
}
]
}
};
this.$refs.previewField.doShow(fieldList, res.data);
}
},
//
async routeOverlap(index, row) {
if (this.$refs && this.$refs.previewField && row) {
const sectionDict = {};
this.sectionList.map(elem => { sectionDict[elem.code] = elem.name; });
const res = await listOverlapSection(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路延续保护区段数据',
name: row.name,
model: {
items: [
{ prop: 'sectionCode', label: '物理区段ID', type: 'text' },
{
prop: 'sectionCode', label: '物理区段名称', type: 'select', options: sectionDict
}
]
}
};
this.$refs.previewField.doShow(fieldList, res.data);
}
},
//
async sectionDetail(index, row) {
if (this.$refs && this.$refs.previewField && row) {
const sectionDict = {};
this.sectionList.map(elem => { sectionDict[elem.code] = elem.name; });
const res = await listPhysicsSection(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路物理区段数据',
name: row.name,
model: {
items: [
{ prop: 'sectionCode', label: '物理区段ID', type: 'text' },
{
prop: 'sectionCode', label: '物理区段名称', type: 'select', options: sectionDict
}
]
}
};
this.$refs.previewField.doShow(fieldList, res.data);
}
},
//
async stationStandDetail(index, row) {
if (this.$refs && this.$refs.previewField && row) {
const stationStandDict = {};
this.stationStandList.map(elem => { stationStandDict[elem.code] = elem.name; });
const res = await listStationStand(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路屏蔽门数据',
name: row.name,
model: {
field: 'accessStandList',
items: [
{ prop: 'stationStandCode', label: '屏蔽门ID', type: 'text' },
{
prop: 'stationStandCode', label: '屏蔽门名称', type: 'select', options: stationStandDict
}
]
}
};
this.$refs.previewField.doShow(fieldList, res.data);
}
},
async overlapSwitchDetail(index, row) {
if (this.$refs && this.$refs.previewField && row) {
const switchDict = {};
const switchTypeDict = {};
this.switchList.map(elem => { switchDict[elem.code] = elem.name; });
this.SwitchLocateTypeList.map(elem => { switchTypeDict[elem.code] = elem.name; });
const res = await listOverlapSwitch(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '延续保护道岔数据',
name: row.name,
model: {
items: [
{ prop: 'switchCode', label: '道岔ID', type: 'text' },
{
prop: 'switchCode', label: '道岔名称', type: 'select', options: switchDict
},
{ prop: 'switchLocateType', label: '道岔类型', type: 'select', options: switchTypeDict }
]
}
};
this.$refs.previewField.doShow(fieldList, res.data);
}
},
async flankProtectionSwitchDetail(index, row) {
if (this.$refs && this.$refs.previewField && row) {
const switchDict = {};
const switchTypeDict = {};
this.switchList.map(elem => { switchDict[elem.code] = elem.name; });
this.SwitchLocateTypeList.map(elem => { switchTypeDict[elem.code] = elem.name; });
const res = await listFlankProtectionSwitch(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路侧防道',
name: row.name,
model: {
items: [
{ prop: 'switchCode', label: '道岔ID', type: 'text' },
{
prop: 'switchCode', label: '道岔名称', type: 'select', options: switchDict
},
{ prop: 'switchLocateType', label: '道岔类型', type: 'select', options: switchTypeDict }
]
}
};
this.$refs.previewField.doShow(fieldList, res.data);
}
},
//
async accessSwitchDetail(index, row) {
if (this.$refs && this.$refs.previewField && row) {
const switchDict = {};
const switchTypeDict = {};
this.switchList.map(elem => { switchDict[elem.code] = elem.name; });
this.SwitchLocateTypeList.map(elem => { switchTypeDict[elem.code] = elem.name; });
const res = await listSwitch(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '进路道岔数据',
name: row.name,
model: {
field: 'accessSwitchList',
items: [
{ prop: 'switchCode', label: '道岔ID', type: 'text' },
{
prop: 'switchCode', label: '道岔名称', type: 'select', options: switchDict
},
{ prop: 'switchLocateType', label: '道岔类型', type: 'select', options: switchTypeDict }
]
}
};
this.$refs.previewField.doShow(fieldList, res.data);
}
},
againstDetail(index, row) {
if (this.$refs && this.$refs.previewField && row) {
listRouteMapAccess(row.mapId).then(response => {
const againstDict = {};
const data = response.data;
data.forEach(elem => {
againstDict[elem.code] = elem.name;
});
function convert(data) {
if (data) {
data.accessAgainstList = data.accessAgainstList.map(elem => {
if (data.code === elem.accessCode) {
return { code: elem.againstAccessCode };
} else if (data.code === elem.againstAccessCode) {
return { code: elem.accessCode };
}
});
return data;
}
}
this.mapList.forEach(elem => {
if (elem.name === row.mapId) {
const fieldList = {
id: row.id,
mapId: elem.id,
title: '敌对进路',
model: {
field: 'accessAgainstList',
convert: convert,
items: [
{ prop: 'code', label: '敌对进路ID', type: 'text' },
{
prop: 'code', label: '敌对进路名称', type: 'select', options: againstDict
}
]
}
};
this.$refs.previewField.doShow(fieldList);
}
});
}).catch(() => {
this.$messageBox('操作错误');
});
}
},
//
async related(index, row) {
if (this.$refs && this.$refs.relatedRoute) {
const res = await listAgainstRoute(this.$route.params.mapId, row.code);
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
code: row.code,
name: row.name
};
this.$refs.relatedRoute.doShow(fieldList, res.data);
}
},
edit(index, row) {
this.mapList.forEach(elem => {
if (elem.name === row.mapId) {
const model = {
mapId: elem.id,
id: row.id
};
queryRouteAccessDetail(model).then(response => {
const data = response.data;
this.RouteNatureTypeList.forEach(elem => {
if (elem.name === data.natureType) {
data.natureType = elem.code;
}
});
this.RouteAutoTypeList.forEach(elem => {
if (elem.name === data.autoType) {
data.autoType = elem.code;
}
});
this.SwitchLocateTypeList.forEach(elem => {
if (elem.name === data.overlapSwitchLocateType) {
data.overlapSwitchLocateType = elem.code;
}
});
data.accessSectionList = data.accessSectionList.map(elem => { return elem.sectionCode; });
data.routeOverlapSectionList = data.routeOverlapSectionList.map(elem => { return elem.sectionCode; });
data.routeTriggerSectionList = data.routeTriggerSectionList.map(elem => { return elem.sectionCode; });
data.accessStandList = data.accessStandList.map(elem => { return elem.stationStandCode; });
this.$emit('routeSelected', data);
this.doClose();
});
}
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRouteAccess(this.mapInfo.id, row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
}).catch(() => {
this.$messageBox('删除失败');
});
}).catch(() => {
this.$message.info('已取消删除');
});
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>

View File

@ -1,112 +0,0 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapControl">
<el-card>
<div slot="header" class="clearfix">
<span>
地图名称
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">预览
</el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">创建
</el-button>
</div>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane label="进路" name="Route">
<route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
:card-height="cardHeight"
@handleSelectView="handleSelectView"
@setCenter="setCenter"
/>
</el-tab-pane>
</el-tabs>
</el-card>
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
</div>
</transition>
</template>
<script>
import RouteDraft from './route';
import RouteDetail from './detail';
export default {
name: 'RouteOperate',
components: {
RouteDraft,
RouteDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
enabledTab: 'Route',
routeData: null
};
},
methods: {
clickEvent(e, model) {
this.onSelect(model);
},
onSelect(model) {
if (model) {
this.selected = model;
} else {
this.selected = null;
}
},
setDelayUnlockStatus(data, status) {
if (data && data.delayShowList) {
data.delayShowList.forEach(elem => {
elem.status = status;
});
}
},
routeSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>

View File

@ -1,73 +0,0 @@
<template>
<el-dialog
:title="mapInfo.name + ' / ' + name + ' / ' + title"
:visible.sync="show"
width="30%"
:before-close="doClose"
center
append-to-body
>
<el-table :data="data" border style="width: 100%">
<template v-for="(item, index) in form">
<el-table-column :key="index" :label="item.label">
<template slot-scope="scope">
<template v-if="item.type === 'select'">
<el-tooltip effect="dark" :content="item.options[scope.row[item.prop]]" placement="top">
<span>{{ item.options[scope.row[item.prop]] }}</span>
</el-tooltip>
</template>
<template v-if="item.type === 'text'">
<el-tooltip effect="dark" :content="scope.row[item.prop]" placement="top">
<span>{{ scope.row[item.prop] }}</span>
</el-tooltip>
</template>
</template>
</el-table-column>
</template>
</el-table>
</el-dialog>
</template>
<script>
export default {
name: 'DictionaryDetailEdit',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
title: '',
name: '',
form: [],
data: []
};
},
methods: {
doShow(fieldList, dataList) {
if (fieldList.model) {
const items = fieldList.model.items;
if (fieldList.model.convert) {
// data = fieldList.model.convert(data);
}
if (items) {
this.form = items;
this.name = fieldList.name;
this.data = dataList;
this.title = fieldList.title;
}
this.show = true;
}
},
doClose(done) {
this.show = false;
}
}
};
</script>

View File

@ -1,110 +0,0 @@
<template>
<el-dialog
:title="mapInfo.name + ' / ' + editModel.name + ' / ' + title"
:visible.sync="show"
width="40%"
:before-close="doClose"
center
append-to-body
>
<el-form ref="form" :model="editModel" label-width="120px" size="mini">
<el-form-item :label="$t('map.routeName')" prop="name" readonly="true">
<el-input v-model="editModel.name" :disabled="true" />
</el-form-item>
<el-form-item :label="$t('map.associatedRoute')">
<el-transfer
v-model="routeColloction"
filterable
:filter-method="filterRoute"
:filter-placeholder="$t('map.pleaseEnterNameQuery')"
:data="routeData"
:titles="['进路集合', '关联进路ID']"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('map.save') }}</el-button>
<el-button @click="show = false">{{ $t('map.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { listRouteMapAccess, updateAgainstAccess } from '@/api/jmap/mapdraft';
export default {
name: 'DictionaryDetailEdit',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
title: this.$t('map.associatedHostileRecord'),
routes: [],
routeColloction: [],
routeData: [],
editModel: {
code: '',
name: ''
}
};
},
methods: {
filterRoute(query, item) {
return item.pinyin.indexOf(query) > -1;
},
doShow(fieldList, dataList) {
this.routeColloction = [];
this.routeData = [];
this.editModel.id = fieldList.id;
this.editModel.code = fieldList.code;
this.editModel.name = fieldList.name;
dataList.forEach(elem => {
if (this.editModel.code === elem.againstAccessCode) {
this.routeColloction.push(elem.accessCode);
} else if (this.editModel.code === elem.accessCode) {
this.routeColloction.push(elem.againstAccessCode);
}
});
listRouteMapAccess(fieldList.mapId).then(response => {
if (response.data) {
this.routes = response.data;
this.routes.forEach(elem => {
if (elem.code !== this.editModel.code) {
this.routeData.push({
label: elem.name,
key: elem.code,
pinyin: elem.code
});
}
});
}
this.show = true;
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
});
},
doClose(done) {
this.show = false;
},
doSave() {
const model = {
id: this.editModel.id,
routeCode: this.editModel.code,
mapId: this.mapInfo.id,
accessAgainstList: this.routeColloction.map(elem => { return { againstRouteCode: elem }; })
};
updateAgainstAccess(model).then(response => {
this.$message.success(this.$t('tip.saveSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
});
}
}
};
</script>

View File

@ -1,626 +0,0 @@
<template>
<div :style="{ height: cardHeight +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="190px" size="mini">
<el-form-item :label="$t('map.routeName')" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item :label="$t('map.equipmentStation')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable @change="deviceChange">
<el-option v-for="item in stationList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item :label="$t('map.routeArc')" prop="arc">
<el-radio-group v-model="addModel.arc">
<el-radio :label="true">{{ $t('map.are') }}</el-radio>
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('map.routeFlt')" prop="flt">
<el-radio-group v-model="addModel.flt">
<el-radio :label="true">{{ $t('map.are') }}</el-radio>
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('map.delayUnlockingTime')" prop="delayReleaseTime">
<el-input-number v-model="addModel.delayReleaseTime" :min="0" />
<span>s</span>
</el-form-item>
<el-form-item :label="$t('map.accessTypeColon')" prop="natureType">
<el-select v-model="addModel.natureType" :filterable="true">
<el-option
v-for="item in RouteNatureTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.automaticAccessTypeColon')" prop="autoType">
<el-select v-model="addModel.autoType" :filterable="true">
<el-option
v-for="item in RouteAutoTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.startSignalId')" prop="startSignalCode">
<el-select v-model="addModel.startSignalCode" clearable :filterable="true">
<el-option
v-for="item in signalList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'startSignalCode' ? 'danger' : 'primary'"
@click="hover('startSignalCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endSignalId')" prop="endSignalCode">
<el-select v-model="addModel.endSignalCode" clearable :filterable="true">
<el-option
v-for="item in signalList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'endSignalCode' ? 'danger' : 'primary'"
@click="hover('endSignalCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.nearSectionCodeColon')" prop="nearSectionCode">
<el-select v-model="addModel.nearSectionCode" clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'nearSectionCode' ? 'danger' : 'primary'"
@click="hover('nearSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<!-- <el-form-item label="自动触发区段ID:" prop="autoTriggerSectionCode">
<el-select v-model="addModel.autoTriggerSectionCode" clearable :filterable="true">
<el-option v-for="item in sectionList" :key="item.code" :label="item.name + ' (' + item.code+ ')'"
:value="item.code"></el-option>
</el-select>
<el-button @click="hover('autoTriggerSectionCode')" :type=" field === 'autoTriggerSectionCode' ? 'danger' : 'primary'">{{ $t('map.activate') }}</el-button>
</el-form-item> -->
<el-form-item :label="$t('map.routeTriggerSectionList')" prop="routeTriggerSectionList">
<el-select v-model="addModel.routeTriggerSectionList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeTriggerSectionList' ? 'danger' : 'primary'"
@click="hover('routeTriggerSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.routeOverlapSectionList')" prop="routeOverlapSectionList">
<el-select v-model="addModel.routeOverlapSectionList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeOverlapSectionList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<!-- <el-form-item label="延续保护道岔ID:" prop="routeOverlapSwitchList">
<el-select v-model="addModel.routeOverlapSwitchList" multiple :filterable="true">
<el-option v-for="item in switchList" :key="item.code" :label="item.name + ' (' + item.code+ ')'"
:value="item.code"></el-option>
</el-select>
<el-button @click="hover('routeOverlapSwitchList')" :type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'">{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item label="延续保护道岔位置类型:" prop="overlapSwitchLocateType">
<el-select v-model="addModel.overlapSwitchLocateType" :filterable="true">
<el-option v-for="item in SwitchLocateTypeList" :key="item.code" :label="item.name" :value="item.code"></el-option>
</el-select>
</el-form-item> -->
<el-form-item :label="$t('map.routeOverlapSwitchList')" prop="routeOverlapSwitchList">
<el-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeOverlapSwitchList' ? 'danger' : 'primary'"
@click="hover('routeOverlapSwitchList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeOverlapSwitchList, {switchCode:overlapCode, switchLocateType:overlapType})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="overlapType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.routeOverlapSwitchList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchLocateType" :label="$t('map.switchType')" />
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.routeOverlapSwitchList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="$t('map.routeFlankProtectionList')" prop="routeFlankProtectionList">
<el-select v-model="flankCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routeFlankProtectionList' ? 'danger' : 'primary'"
@click="hover('routeFlankProtectionList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.routeFlankProtectionList, {switchCode:flankCode, switchLocateType:flankType})"
>{{ $t('map.add') }}
</el-button>
<el-select v-model="flankType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.routeFlankProtectionList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchLocateType" :label="$t('map.switchType')" />
<el-table-column fixed="right" label="操作" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.routeFlankProtectionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="$t('map.turnBackSectionCode')" prop="turnBackSectionCode">
<el-select v-model="addModel.turnBackSectionCode" clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'turnBackSectionCode' ? 'danger' : 'primary'"
@click="hover('turnBackSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.accessSectionList')" prop="accessSectionList">
<el-select v-model="addModel.accessSectionList" multiple :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'accessSectionList' ? 'danger' : 'primary'"
@click="hover('accessSectionList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.accessStandList')" prop="accessStandList">
<el-select v-model="addModel.accessStandList" multiple :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in stationStandList"
:key="item.code"
:label="item.code"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'accessStandList' ? 'danger' : 'primary'"
@click="hover('accessStandList')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.accessSwitchList')" prop="accessSwitchList">
<el-select v-model="accessCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in switchList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'accessSwitchList' ? 'danger' : 'primary'"
@click="hover('accessSwitchList')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSwitch(addModel.accessSwitchList, { switchCode: accessCode, switchLocateType: accessType } )"
>{{ $t('map.add') }}</el-button>
<el-select v-model="accessType" :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in SwitchLocateTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-table :data="addModel.accessSwitchList" border style="width: 97%">
<el-table-column prop="switchCode" :label="$t('map.switchId')">
<template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="switchLocateType" :label="$t('map.switchType')" />
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSwitch(addModel.accessSwitchList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}</el-button>
</el-button-group>
</el-form-item>
</el-form>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { createRouteAccess, updateRouteAccess } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
export default {
name: 'RouteOperation',
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
isSave: true,
field: '',
overlapCode: '',
overlapType: '',
flankCode: '',
flankType: '',
accessCode: '',
accessType: '',
loading: false,
RouteNatureTypeList: [],
/*
{ code: '01', name: '列车进路' },
{ code: '02', name: '调车进路' },
{ code: '03', name: '折返进路' }
*/
RouteAutoTypeList: [],
/*
{ code: '01', name: '自动进路' },
{ code: '02', name: '非自动进路' }
*/
SwitchLocateTypeList: [],
/*
{ code: '01', name: '定位' },
{ code: '02', name: '反位' }
*/
addModel: {
mapId: '',
code: '',
name: '',
stationCode: '',
startSignalCode: '',
endSignalCode: '',
nearSectionCode: '',
autoTriggerSectionCode: '',
routeOverlapSwitchList: [],
turnBackSectionCode: '',
natureType: '',
autoType: '',
arc: false,
flt: false,
delayReleaseTime: '',
routeFlankProtectionList: [],
routeTriggerSectionList: [],
routeOverlapSectionList: [],
accessSectionList: [],
accessStandList: [],
accessSwitchList: []
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
]),
routeName() {
let beg = ''; let end = '';
if (this.isSave) {
if (this.signalList) {
this.signalList.forEach(elem => {
if (elem.code === this.addModel.startSignalCode) beg = elem.name;
if (elem.code === this.addModel.endSignalCode) end = elem.name;
});
}
}
return beg + '-' + end;
},
rules() {
const baseRules = {
name: [
{ required: true, message: this.$t('rules.pleaseEnterPathName'), trigger: 'change' }
],
stationCode: [
{ required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
],
startSignalCode: [
{ required: true, message: this.$t('rules.pleaseSelectStartSignal'), trigger: 'change' }
],
endSignalCode: [
{ required: true, message: this.$t('rules.pleaseSelectEndSignal'), trigger: 'change' }
],
nearSectionCode: [
{ required: true, message: this.$t('rules.proximitySection'), trigger: 'change' }
],
natureType: [
{ required: true, message: this.$t('rules.accessPropertyType'), trigger: 'change' }
],
autoType: [
{ required: true, message: this.$t('rules.autoAccessType'), trigger: 'change' }
],
accessSectionList: [
{ required: true, message: this.$t('rules.physicalSegmentData'), trigger: 'change' }
]
};
return baseRules;
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = val;
}
},
routeName(val, old) {
if (val) {
this.addModel.name = val;
}
}
},
mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
this.$Dictionary.routeNatureType().then(list => {
this.RouteNatureTypeList = list;
});
this.$Dictionary.routeAutoType().then(list => {
this.RouteAutoTypeList = list;
});
this.$Dictionary.switchLocateType().then(list => {
this.SwitchLocateTypeList = list;
});
},
methods: {
swictchName(code) {
let name = '';
if (code) {
const swch = this.$store.getters['map/getDeviceByCode'](code);
if (swch) {
name = `${swch.name}(${swch.code})`;
}
}
return name;
},
deviceChange(code) {
this.$emit('setCenter', code);
},
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
hover(field) {
this.field = field === this.field ? '' : field;
},
pushSwitch(list, data) {
const index = list.findIndex(elem => { return elem.switchCode == data.switchCode; });
if (index < 0) {
list.push(data);
} else {
this.$messageBox(this.$t('tip.routeSameID'));
}
},
deleteSwitch(list, index) {
list.splice(index, 1);
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
model['mapId'] = this.mapInfo.id;
model['accessSectionList'] = this.addModel.accessSectionList.map(elem => { return { sectionCode: elem }; });
model['routeTriggerSectionList'] = this.addModel.routeTriggerSectionList.map(elem => { return { mapId: this.mapInfo.id, routeCode: model.code, sectionCode: elem }; });
model['routeOverlapSectionList'] = this.addModel.routeOverlapSectionList.map(elem => { return { mapId: this.mapInfo.id, routeCode: model.code, sectionCode: elem }; });
model['accessStandList'] = this.addModel.accessStandList.map(elem => { return { stationStandCode: elem }; });
if (code) { model['code'] = code; }
return model;
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
createRouteAccess(this.buildModel(getUID('Route'))).then(response => {
this.$message.success(this.$t('tip.createSuccess'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
this.loading = false;
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
updateRouteAccess(this.buildModel()).then(response => {
this.$message.success(this.$t('tip.updateSuccessfully'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
this.loading = false;
});
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id;
this.addModel.accessSwitchList = [];
this.addModel.routeFlankProtectionList = [];
this.addModel.routeOverlapSwitchList = [];
if (this.selected && this.selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = this.selected.code;
}
this.isSave = true;
}
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'startSignalCode'.toUpperCase()) {
this.addModel.startSignalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() === 'endSignalCode'.toUpperCase()) {
this.addModel.endSignalCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'nearSectionCode'.toUpperCase()) {
this.addModel.nearSectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'autoTriggerSectionCode'.toUpperCase()) {
this.addModel.autoTriggerSectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeTriggerSectionList'.toUpperCase()) {
if (this.addModel.routeTriggerSectionList.indexOf(selected.code) === -1) {
this.addModel.routeTriggerSectionList.push(selected.code);
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSectionList'.toUpperCase()) {
if (this.addModel.routeOverlapSectionList.indexOf(selected.code) === -1) {
this.addModel.routeOverlapSectionList.push(selected.code);
}
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'turnBackSectionCode'.toUpperCase()) {
this.addModel.turnBackSectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'accessSectionList'.toUpperCase()) {
if (this.addModel.accessSectionList.indexOf(selected.code) === -1) {
this.addModel.accessSectionList.push(selected.code);
}
} else if (selected._type.toUpperCase() === 'StationStand'.toUpperCase() && this.field.toUpperCase() === 'accessStandList'.toUpperCase()) {
if (this.addModel.accessStandList.indexOf(selected.code) === -1) {
this.addModel.accessStandList.push(selected.code);
}
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapSwitchList'.toUpperCase()) {
this.overlapCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'accessSwitchList'.toUpperCase()) {
this.accessCode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'routeFlankProtectionList'.toUpperCase()) {
this.flankCode = selected.code;
}
}
}
}
};
</script>

View File

@ -1,258 +0,0 @@
<template>
<el-dialog :title="$t('map.thenList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
<pre-view-field ref="previewField" :map-info="mapInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { listRouting, deleteRouting, getRouting } from '@/api/jmap/mapdraft';
import PreViewField from './preview';
export default {
name: 'RouteDetail',
components: {
PreViewField
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
startStationCode: {
type: 'select',
label: this.$t('map.startStation'),
config: {
data: []
}
},
endStationCode: {
type: 'select',
label: this.$t('map.endStation'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.routingCode'),
prop: 'code'
},
{
title: this.$t('map.startStation'),
prop: 'startStationCode'
},
{
title: this.$t('map.startStationCode'),
prop: 'startSectionCode'
},
{
title: this.$t('map.endStation'),
prop: 'endStationCode'
},
{
title: this.$t('map.endStationCode'),
prop: 'endSectionCode'
},
{
title: this.$t('map.routingDirection'),
prop: 'directionCode',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.directionCode, 'DirectionCodeList'); },
tagType: (row) => { if (row.directionCode === '0') { return 'primary'; } else { return 'success'; } }
},
{
title: this.$t('map.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('map.sectionData'),
buttons: [
{
name: this.$t('map.preview'),
handleClick: this.sectionDetail
}
]
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: this.$t('map.delete'),
handleClick: this.deleteObj,
type: 'danger'
}
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList'
])
},
watch: {
stationList: function (val, old) {
const list = [];
if (val && val.length) {
val.forEach(elem => {
list.push({ label: this.formatName(elem.code), value: elem.code });
});
this.queryForm.queryObject.startStationCode.config.data = list;
this.queryForm.queryObject.endStationCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
doClose() {
this.show = false;
},
formatName(code) {
let name = '';
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
name = device.name;
}
return name;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return listRouting(this.mapInfo.id, params);
}
},
acquireMapList() {
//
listMap().then(response => {
this.mapList = response.data;
});
},
convertField(dataDict, enumList, key, value, fieldList) {
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
fieldList.forEach(field => {
enumList.forEach(elem => {
if (elem[key] === dataDict[field]) {
dataDict[field] = elem[value];
}
});
});
}
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.convertField(elem, that.mapList, 'id', 'name', ['mapId']);
elem.startStationCode = that.formatName(elem.startStationCode);
elem.startSectionCode = that.formatName(elem.startSectionCode);
elem.endStationCode = that.formatName(elem.endStationCode);
elem.endSectionCode = that.formatName(elem.endSectionCode);
});
}
}
return data;
},
editObj(index, row) {
getRouting(row.id).then(response => {
const data = Object.assign({ code: response.data.id }, response.data);
this.$emit('routingSelected', data);
this.doClose();
});
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
deleteRouting(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));
});
}
},
sectionDetail(index, row) {
const sectionDict = {};
const stationDict = {};
this.sectionList.forEach(elem => { sectionDict[elem.code] = elem.name; });
this.stationList.forEach(elem => { stationDict[elem.code] = elem.name; });
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '区段列表',
name: row.name,
model: {
field: 'routingSectionList',
items: [
{ prop: 'stationCode', label: this.$t('map.stationCodeClomn'), type: 'text' },
{
prop: 'stationCode', label: this.$t('map.sectionName'), type: 'select', options: stationDict
},
{ prop: 'sectionCode', label: this.$t('map.blockCodingClomn'), type: 'text' },
{
prop: 'sectionCode', label: this.$t('map.sectionName'), type: 'select', options: sectionDict
}
]
}
};
this.$refs.previewField.doShow(fieldList, row.routingSectionList);
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>

View File

@ -1,111 +0,0 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapControl">
<el-card>
<div slot="header" class="clearfix">
<span>
{{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}
</el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.newConstruction') }}
</el-button>
</div>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane :label="$t('map.routing')" name="Route">
<route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
:card-height="cardHeight"
@handleSelectView="handleSelectView"
/>
</el-tab-pane>
</el-tabs>
</el-card>
<route-detail ref="routeDetail" :map-info="mapInfo" @routingSelected="routingSelected" />
</div>
</transition>
</template>
<script>
import RouteDraft from './route';
import RouteDetail from './detail';
export default {
name: 'PathOperate',
components: {
RouteDraft,
RouteDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
enabledTab: 'Route',
routeData: null
};
},
methods: {
clickEvent(e, model) {
this.onSelect(model);
},
onSelect(model) {
if (model) {
this.selected = model;
} else {
this.selected = null;
}
},
setDelayUnlockStatus(data, status) {
if (data && data.delayShowList) {
data.delayShowList.forEach(elem => {
elem.status = status;
});
}
},
routingSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>

View File

@ -1,73 +0,0 @@
<template>
<el-dialog
:title="mapInfo.name + ' / ' + name + ' / ' + title"
:visible.sync="show"
width="30%"
:before-close="doClose"
center
append-to-body
>
<el-table :data="data" border style="width: 100%">
<template v-for="(item, index) in form">
<el-table-column :key="index" :label="item.label">
<template slot-scope="scope">
<template v-if="item.type === 'select'">
<el-tooltip effect="dark" :content="item.options[scope.row[item.prop]]" placement="top">
<span>{{ item.options[scope.row[item.prop]] }}</span>
</el-tooltip>
</template>
<template v-if="item.type === 'text'">
<el-tooltip effect="dark" :content="scope.row[item.prop]" placement="top">
<span>{{ scope.row[item.prop] }}</span>
</el-tooltip>
</template>
</template>
</el-table-column>
</template>
</el-table>
</el-dialog>
</template>
<script>
// import { queryRouteAccessDetail } from '@/api/jmap/mapdraft';
export default {
name: 'DictionaryDetailEdit',
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
title: '',
name: '',
form: [],
data: []
};
},
methods: {
doShow(fieldList, dataList) {
if (fieldList.model) {
const items = fieldList.model.items;
if (fieldList.model.convert) {
// data = fieldList.model.convert(data);
}
if (items) {
this.form = items;
this.name = fieldList.name;
this.data = dataList;
this.title = fieldList.title;
}
this.show = true;
}
},
doClose(done) {
this.show = false;
}
}
};
</script>

View File

@ -1,375 +0,0 @@
<template>
<div :style="{ height: cardHeight +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
<div class="definition">
<el-form-item :label="$t('map.routingName')" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode">
<el-select v-model="addModel.startStationCode" clearable :filterable="true">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'startStationCode' ? 'danger' : 'primary'"
@click="hover('startStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode">
<el-select v-model="addModel.startSectionCode" clearable :filterable="true">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'startSectionCode' ? 'danger' : 'primary'"
@click="hover('startSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endStationColon')" prop="endStationCode">
<el-select v-model="addModel.endStationCode" clearable :filterable="true">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'endStationCode' ? 'danger' : 'primary'"
@click="hover('endStationCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode">
<el-select v-model="addModel.endSectionCode" clearable :filterable="true">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'endSectionCode' ? 'danger' : 'primary'"
@click="hover('endSectionCode')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.routingDirection')" prop="directionCode">
<el-select v-model="addModel.directionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in DirectionCodeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.remarksColon')" prop="remarks">
<el-input v-model="addModel.remarks" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
</el-form-item>
<el-form-item :label="$t('map.trafficSegmentData')" prop="routingSectionList">
<div>
<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'routingStation' ? 'danger' : 'primary'"
@click="hover('routingStation')"
>{{ $t('map.activate') }}</el-button>
</div>
<div>
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-button
:type=" field === 'routingSection' ? 'danger' : 'primary'"
@click="hover('routingSection')"
>{{ $t('map.activate') }}</el-button>
<el-button
type="primary"
@click="pushSection(addModel.routingSectionList, {stationCode: stationCode, sectionCode: sectionCode})"
>
{{ $t('map.add') }}
</el-button>
</div>
<el-table :data="addModel.routingSectionList" border style="width: 97%">
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.stationCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
<template slot-scope="scope">
<span>{{ formatName(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteSection(addModel.routingSectionList, scope.$index)"
>
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button>
</el-button-group>
</el-form-item>
</div>
</el-form>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { addRouting, updateRouting } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/utils/runPlan';
import Sortable from 'sortablejs';
export default {
name: 'RouteOperation',
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
ViewMode: ViewMode,
field: '',
stationCode: '',
sectionCode: '',
isSave: true,
loading: false,
DirectionCodeList: this.$ConstSelect.DirectionCodeList,
addModel: {
name: '',
mapId: '',
code: '',
directionCode: '',
startStationCode: '',
startSectionCode: '',
endStationCode: '',
endSectionCode: '',
remarks: '',
routingSectionList: []
},
editShow: false,
rules: {
name: [
{ required: true, message: this.$t('map.routingName'), trigger: 'change' }
],
startStationCode: [
{ required: true, message: this.$t('map.startStationCode'), trigger: 'change' }
],
startSectionCode: [
{ required: true, message: this.$t('map.startSectionCode'), trigger: 'change' }
],
endStationCode: [
{ required: true, message: this.$t('map.endStationCode'), trigger: 'change' }
],
endSectionCode: [
{ required: true, message: this.$t('map.endSectionCode'), trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'sectionList',
'stationList'
]),
filterSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.isStandTrack || elem.isReentryTrack || elem.isTransferTrack; });
} else {
return [];
}
},
filterStationList() {
if (this.stationList) {
return this.stationList.filter(elem => { return true; });
} else {
return [];
}
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = val;
this.editShow = true;
}
}
},
mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
this.rowDrop();
},
methods: {
//
rowDrop() {
const that = this;
const tbody = document.querySelector('.el-table__body-wrapper tbody');
if (tbody) {
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
const currRow = that.addModel.mapRouteUnitRelList.splice(oldIndex, 1)[0];
that.addModel.mapRouteUnitRelList.splice(newIndex, 0, currRow);
}
});
}
},
hover(field) {
this.field = field === this.field ? '' : field;
},
formatName(code) {
return formatName(code);
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'startStationCode'.toUpperCase()) {
this.addModel.startStationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'endStationCode'.toUpperCase()) {
this.addModel.endStationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
this.addModel.startSectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
this.addModel.endSectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) {
this.sectionCode = selected.code;
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) {
this.stationCode = selected.code;
}
}
},
pushSection(list, data) {
if (data) {
const index = list.findIndex(elem => { return elem.sectionCode == data.sectionCode; });
if (index < 0) {
list.push(data);
} else {
this.$messageBox(this.$t('tip.routeSameID'));
}
}
},
deleteSection(list, index) {
list.splice(index, 1);
},
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
buildModel(code) {
this.addModel.routingSectionList.forEach((elem, index) => {
elem['orderNum'] = index + 1;
});
const model = Object.assign({}, this.addModel);
model['mapId'] = this.mapInfo.id;
if (code) { model['code'] = code; }
return model;
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
addRouting(this.buildModel(getUID('Routing'))).then(resp => {
this.$message.success(this.$t('tip.pathCreationSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.createRoutingFailed'));
this.loading = false;
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
updateRouting(this.buildModel()).then(resp => {
this.$message.success(this.$t('tip.pathUpdataSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.pathUpdataFailed'));
this.loading = false;
});
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id;
this.addModel.routingSectionList = [];
this.addModel.code = '';
this.stationCode = '';
this.sectionCode = '';
this.isSave = true;
}
}
}
};
</script>

View File

@ -1,164 +0,0 @@
<template>
<el-dialog :title="$t('map.linkageSwitchList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
/>
</div>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { listMap, listLinkageSwitch, deleteLinkageSwitch } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
components: {
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
show: false,
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
queryObject: {
switchCode: {
type: 'select',
label: this.$t('map.switchNameC'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
afterQuery: this.afterQuery,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.pathUnitMapName'),
prop: 'mapId'
},
{
title: this.$t('map.switchACode'),
prop: 'switchACode'
},
{
title: this.$t('map.switchBCode'),
prop: 'switchBCode'
},
{
type: 'button',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: this.$t('map.deleteObj'),
handleClick: this.deleteObj,
type: 'danger'
}
]
}
]
}
};
},
computed: {
...mapGetters('map', [
'switchList'
])
},
watch: {
switchList: function (val, old) {
const list = [];
if (val && val.length) {
for (let i = 0; i < val.length; i++) {
list.push({ label: val[i].name, value: val[i].code });
}
this.queryForm.queryObject.switchCode.config.data = list;
}
}
},
mounted() {
this.acquireMapList();
},
methods: {
doShow() {
this.show = true;
this.reloadTable();
},
doClose() {
this.show = false;
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
//
return listLinkageSwitch(this.mapInfo.id, params);
}
},
acquireMapList() {
//
listMap().then(response => {
this.mapList = response.data;
});
},
convertField(dataDict, enumList, key, value, fieldList) {
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
fieldList.forEach(field => {
enumList.forEach(elem => {
if (elem[key] === dataDict[field]) {
dataDict[field] = elem[value];
}
});
});
}
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
that.convertField(elem, that.mapList, 'id', 'name', ['mapId']);
that.convertField(elem, that.switchList, 'code', 'name', ['switchACode', 'switchBCode']);
});
}
}
return data;
},
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
deleteLinkageSwitch(this.mapInfo.id, row.id).then(response => {
this.$message.success(this.$t('tip.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('tip.failDelete'));
});
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>

View File

@ -1,109 +0,0 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapControl">
<el-card>
<div slot="header" class="clearfix">
<span>
{{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.reset') }}</el-button>
</div>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane :label="$t('map.setSwitch')" name="Route">
<route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
:card-height="cardHeight"
@handleSelectView="handleSelectView"
/>
</el-tab-pane>
</el-tabs>
</el-card>
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
</div>
</transition>
</template>
<script>
import RouteDraft from './route';
import RouteDetail from './detail';
export default {
name: 'SwitchOperate',
components: {
RouteDraft,
RouteDetail
},
props: {
mapInfo: {
type: Object,
default() {
return null;
}
},
selected: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
return {
enabledTab: 'Route',
routeData: null
};
},
methods: {
clickEvent(e, model) {
this.onSelect(model);
},
onSelect(model) {
if (model) {
this.selected = model;
} else {
this.selected = null;
}
},
setDelayUnlockStatus(data, status) {
if (data && data.delayShowList) {
data.delayShowList.forEach(elem => {
elem.status = status;
});
}
},
routeSelected: function (data) {
this.routeData = data;
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.isSave = false;
}
},
previewRouteEvent: function () {
if (this.$refs && this.$refs.routeDetail) {
this.$refs.routeDetail.doShow();
}
},
createRouteEvent: function () {
if (this.$refs && this.$refs.routeEdit) {
this.$refs.routeEdit.clear();
}
},
setSelected(selected) {
this.$refs.routeEdit.setSelected(selected);
},
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) {
this.$emit('setCenter', code);
}
}
};
</script>

View File

@ -1,198 +0,0 @@
<template>
<div :style="{ height: cardHeight +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
<el-form-item :label="$t('map.switchACodeNum')" prop="switchACode">
<el-select v-model="addModel.switchACode" clearable :filterable="true">
<el-option
v-for="item in switchList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button :type=" field === 'switchACode' ? 'danger' : 'primary'" @click="hover('switchACode')">{{ $t('map.activate') }}
</el-button>
</el-form-item>
<el-form-item :label="$t('map.switchBCodeNum')" prop="switchBCode">
<el-select v-model="addModel.switchBCode" clearable :filterable="true">
<el-option
v-for="item in switchList"
:key="item.code"
:label="item.name + ' (' + item.code+ ')'"
:value="item.code"
/>
</el-select>
<el-button :type=" field === 'switchBCode' ? 'danger' : 'primary'" @click="hover('switchBCode')">{{ $t('map.activate') }}
</el-button>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}</el-button>
</el-button-group>
</el-form-item>
</el-form>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { createLinkageSwitch } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
export default {
name: 'RouteOperation',
components: {
},
props: {
selected: {
type: Object,
default() {
return null;
}
},
mapInfo: {
type: Object,
default() {
return null;
}
},
routeData: {
type: Object,
default() {
return null;
}
},
cardHeight: {
type: Number || String,
required: true
}
},
data() {
var switchBCode = (rule, value, callback) => {
if (!value) {
return callback(new Error(this.$t('rules.selectTurnoutID')));
}
setTimeout(() => {
if (value == this.addModel.switchACode) {
callback(new Error(this.$t('rules.switchesCannot')));
} else {
callback();
}
}, 100);
};
return {
field: '',
code: '',
type: '',
loading: false,
addModel: {
mapId: '',
name: '',
switchACode: '',
switchBCode: ''
},
rules: {
switchACode: [
{ required: true, message: this.$t('rules.selectTurnoutID'), trigger: 'change' }
],
switchBCode: [
{ required: true, validator: switchBCode, trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'signalList',
'switchList',
'sectionList',
'stationList',
'stationStandList'
]),
routeName: {
get: function () {
let beg = ''; let end = '';
if (this.signalList) {
this.signalList.forEach(elem => {
if (elem.code === this.addModel.startSignalCode) beg = elem.name;
if (elem.code === this.addModel.endSignalCode) end = elem.name;
});
}
return beg + '-' + end;
}
}
},
watch: {
mapInfo(val) {
if (val) {
this.addModel.mapId = val.id;
}
},
routeData(val, old) {
if (val) {
this.addModel = val;
}
},
routeName(val, old) {
if (val) {
this.addModel.name = val;
}
}
},
mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
},
methods: {
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
hover(field) {
this.field = field === this.field ? '' : field;
},
buildModel() {
const model = Object.assign({}, this.addModel);
model['mapId'] = this.mapInfo.id;
return model;
},
save() {
this.$refs.form.validate((valid) => {
if (valid) {
//
this.loading = true;
createLinkageSwitch(this.buildModel()).then(response => {
this.$message.success(this.$t('tip.createSuccess'));
this.loading = false;
}).catch(() => {
this.$messageBox(this.$t('tip.operationAbnormal'));
this.loading = false;
});
}
});
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id;
this.$refs.form.resetFields();
this.addModel = {
mapId: this.mapInfo.id,
switchACode: '',
switchBCode: ''
};
}
},
setSelected(selected) {
if (selected) {
if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchACode'.toUpperCase()) {
this.addModel.switchACode = selected.code;
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchBCode'.toUpperCase()) {
this.addModel.switchBCode = selected.code;
}
}
}
}
};
</script>

View File

@ -1,318 +0,0 @@
<template>
<div>
<turnback-bar :title="turnbackBarTitle" />
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-scrollbar
wrap-class="scrollbar-wrapper"
:style="{height:height - 300 + 'px'}"
style="padding-top: 60px"
>
<el-form ref="form" :model="addModel" label-width="140px">
<el-form-item label="所属地图名称:" prop="mapName">
<el-input v-model="addModel.mapName" :disabled="true" />
</el-form-item>
<el-form-item label="产品类型:" prop="prdType">
<el-radio-group v-model="addModel.prdType">
<template v-for="item in chooseList">
<el-radio-button :key="item" :label="item.code">{{ item.name }}</el-radio-button>
</template>
</el-radio-group>
</el-form-item>
<el-form-item
label="产品编码:"
prop="code"
:rules="node && node.data.type ==='map' ? baseRules.code:{}"
>
<el-input v-model="addModel.code" :disabled="codeDisabled" />
</el-form-item>
<el-form-item label="产品名称:" prop="name" :rules="baseRules.name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item label="产品说明:" prop="remarks" :rules="baseRules.remarks">
<el-input v-model="addModel.remarks" type="textarea" />
</el-form-item>
<el-form-item label="关联实训类型:" prop="trainTypes" :rules="baseRules.trainTypes">
<el-select
v-model="addModel.trainTypes"
multiple
placeholder="请选择"
@change="trainTypesChange"
>
<el-option
v-for="item in trainTypesList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isAdd" type="primary" @click="create">创建</el-button>
<el-button v-if="isEdit" type="warning" @click="update">更新</el-button>
<el-button v-if="isEdit" type="danger" @click="deleteObj">删除</el-button>
</el-button-group>
</div>
</div>
</div>
</template>
<script>
import { createTrainingCategory, updateTrainingCategory, deleteTrainingCategory } from '@/api/management/mapprd';
import { getProductDetail } from '@/api/management/mapprd';
import localStore from 'storejs';
import { getPublishMapInfo } from '@/api/jmap/map';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default {
name: 'ShowDetail',
mixins: [
WindowResizeHandler
],
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
node: null,
display: 1,
// height: 0,
codeDisabled: true,
rules: {},
trainTypesList: [],
initTrainTypes: [],
chooseList: [],
addModel: {
id: '',
mapId: '',
mapName: '',
skinStyle: '',
name: '',
remarks: '',
code: '',
prdType: '01',
trainTypes: []
}
};
},
computed: {
title() {
if (this.isAdd) {
return '创建实训类目';
} else if (this.isEdit) {
return '编辑实训类目';
}
return '';
},
turnbackBarTitle() {
return '';
},
isAdd() {
return this.$route.params.mode == 'add';
},
isEdit() {
return this.$route.params.mode == 'edit';
},
baseRules() {
return {
code: [
{ required: true, message: '请输入产品编码', trigger: 'change' }
],
name: [
{ required: true, message: '请输入产品名称', trigger: 'change' }
],
remarks: [
{ required: true, message: '请输入产品说明', trigger: 'change' }
],
trainTypes: [
{ required: true, message: '请选择关联实训类型', trigger: 'change' }
]
};
}
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.$Dictionary.productPostType().then(list => {
this.chooseList = list;
});
},
methods: {
resizeHandler: function () {
this.height = this._clientHeight;
},
loadData(node) {
if (node) {
//
this.node = node;
this.initTrainTypes = [];
this.$refs.form.resetFields();
if (node.data.type === 'map') {
this.codeDisabled = false;
getPublishMapInfo(node.data.id).then(response => {
const data = response.data;
this.addModel.mapName = data.name;
this.addModel.skinStyle = data.skinStyle;
this.loading = false;
}).catch(() => {
this.loading = false;
});
} else if (node.data.type === 'prd') {
this.codeDisabled = true;
getProductDetail(node.data.id).then(response => {
this.addModel.mapName = node.parent.data.name;
this.addModel.mapId = node.parent.data.id;
this.addModel.name = response.data.name;
this.addModel.remarks = response.data.remarks;
this.addModel.prdType = response.data.prdType || '01';
this.addModel.code = response.data.code;
this.addModel.skinStyle = response.data.skinStyle;
this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes;
this.addModel.id = response.data.id;
this.loading = false;
}).catch(() => {
this.loading = false;
});
}
//
this.$nextTick(function () {
this.$refs.form.clearValidate();
});
}
},
create() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
skinStyle: this.addModel.skinStyle,
mapName: this.addModel.mapName,
name: this.addModel.name,
remarks: this.addModel.remarks,
prdType: this.addModel.prdType,
code: this.addModel.code,
trainTypes: this.addModel.trainTypes
};
createTrainingCategory(data).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
this.$message.success('创建产品成功');
}).catch(() => {
this.$messageBox('创建产品失败');
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
updateTrainingCategory(this.addModel).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$message.success('更新产品成功');
// this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
}).catch(() => {
this.$messageBox('更新产品失败');
});
}
});
},
trainTypesChange(tag) {
if (this.initTrainTypes && this.initTrainTypes.length > 0) {
this.initTrainTypes.forEach(elem => {
if (this.addModel.trainTypes.indexOf(elem) < 0) {
this.addModel.trainTypes = this.initTrainTypes;
this.$messageBox('不能缩小上次创建的实训列表的范围');
}
});
}
},
deleteObj() {
this.$refs.form.validate((valid) => {
if (valid) {
deleteTrainingCategory(this.addModel).then(response => {
this.$message.success('删除产品成功');
this.$refs.form.resetFields();
this.node = null;
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
}).catch(error => {
if (error.code === 500009) {
this.$messageBox('产品已被使用无法删除');
} else {
this.$messageBox('删除产品失败');
}
});
}
});
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.card-box {
padding-top: 10px;
}
.steps {
width: 980px;
margin: 0 auto;
padding-top: 20px;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 15px;
/deep/ {
.el-select {
float: left;
width: calc(600px);
}
.el-textarea {
float: left;
width: calc(600px);
}
.el-form-item__content>.el-input {
float: left;
width: calc(600px);
}
.el-input-number {
float: left;
width: calc(250px);
}
}
}
.draft {
width: 300px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -1,154 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { getPublishMapList, delPublishMap } from '@/api/jmap/map';
import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
export default {
name: 'ProductList',
data() {
return {
cityList: [],
skinStyleList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: '名称'
},
cityCode: {
type: 'select',
label: '所属城市',
config: {
data: []
}
}
}
},
queryList: {
query: getPublishMapList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinStyle',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
tagType: (row) => { return ''; }
},
{
title: '更新时间',
prop: 'updateTime'
},
{
type: 'button',
title: '操作',
width: '250',
buttons: [
{
name: '产品列表',
handleClick: this.handleList,
type: ''
},
{
name: '修改',
handleClick: this.handleEdit,
type: 'warning'
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd }
]
},
currentModel: {}
};
},
computed: {
isShow() {
return this.$store.getters['roles'].indexOf('05');
}
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.cityList = [];
this.$Dictionary.cityType().then(list => {
this.cityList = list;
this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
});
}).catch(() => {
this.$messageBox('加载城市列表失败');
});
this.skinStyleList = [];
getSkinStyleList().then(response => {
this.skinStyleList = response.data;
});
},
//
handleAdd() {
this.$router.push({ path: `${UrlConfig.map.productDraft}/add/0` });
},
//
handleList(index, row) {
},
//
handleEdit(index, row) {
this.$router.push({ path: `${UrlConfig.map.productDraft}/edit/0` });
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPublishMap(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
localStore.remove('mapId');
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
});
}).catch(() => { });
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -1,108 +0,0 @@
<template>
<el-dialog :title="title" :visible.sync="dialogVisible" width="25%" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate"> </el-button>
<el-button @click="doClose"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { listPublishMap } from '@/api/jmap/map'
import { getQuestById} from '@/api/quest';
export default {
name: 'ScriptDraft',
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
disabled:null,
formModel: {
name: '',
mapId: '',
description:''
},
isShow: false,
}
},
props: {
title: String,
},
computed: {
form() {
let isAdd = this.type === 'ADD'
let form = {
labelWidth: '100px',
items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true},
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true},
]
}
return form
},
rules() {
let crules = {
name: [
{ required: true, message: '请输入剧本', trigger: 'blur' },
],
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' },
],
description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
]
}
return crules
},
// title() {
// return ''
// }
},
mounted() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
doShow(questid) {
if(questid)
{
getQuestById(questid).then(resp=>{
let data={'name':resp.data.name,'description':resp.data.description,'mapId':resp.data.mapId};
this.formModel=data;
this.formModel.id=questid;
this.disabled="disabled";
this.dialogVisible = true
});
}
else
{
this.disabled=null;
this.dialogVisible = true
}
},
doCreate() {
let self = this
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose()
})
},
doClose() {
this.$refs.dataform.resetForm();
this.isShow = false;
this.dialogVisible = false
}
}
}
</script>

View File

@ -1,178 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<create-script ref='createScript' @reloadTable="reloadTable" @create="handleConfirmCreate" title="创建脚本">
</create-script>
<create-script ref='modifyScript' @reloadTable="reloadTable" @create="handleConfirmModify" title="修改脚本">
</create-script>
</div>
</template>
<script>
import { superAdmin } from '@/router';
// import { listPublishMap } from '@/api/jmap/mapdraft';
import { listPublishMap } from '@/api/jmap/map';
// import { getSkinStyleList } from '@/api/management/mapskin'
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
import { scriptRecordNotify } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import CreateScript from './create';
export default {
name: 'ScriptManage',
components: {
CreateScript,
},
data() {
return {
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: '地图',
config: {
data: []
}
}
}
},
queryList: {
query: getQuestPageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '剧本名称',
prop: 'name'
},
{
title: '地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.mapId, this.mapList, ['id', 'name'])
},
tagType: (row) => { return '' }
},
{
title: '创建时间',
prop: 'createTime'
},
{
type: 'button',
title: '操作',
width: '350',
// hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [
{
name: '录制',
handleClick: this.handleRecord,
type: 'success',
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger',
},
{
name: '修改',
handleClick: this.handleModify,
type: '',
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreate }
]
},
currentModel: {},
}
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data;
// this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
response.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
})
})
},
//
handleConfirmCreate(data) {
createQuest(data).then(resp => {
this.reloadTable();
this.$message.success('创建剧本成功');
}).catch(error => {
this.$messageBox(`创建剧本失败: ${error.message}`);
})
},
//
handleModify(index, row){
this.$refs.modifyScript.doShow(row.id);
},
//
handleConfirmModify(data){
updateQuest(data.id,data).then(resp => {
this.reloadTable();
this.$message.success('修改剧本成功');
}).catch(error => {
this.$messageBox(`修改剧本失败: ${error.message}`);
})
},
//
handleCreate(index, row) {
this.$refs.createScript.doShow(null);
},
//
handleRecord(index, row) {
scriptRecordNotify(row.id).then(resp => {
let query = { mapId: row.mapId, group: resp.data, scriptId: row.id };
this.$router.push({ path: `${UrlConfig.display}/script`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
})
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除此剧本脚本, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuest(row.id).then(response => {
this.$message.success('删除成功')
this.reloadTable()
}).catch(error => {
this.reloadTable()
if (error.code == 500) {
this.$messageBox('删除失败')
} else if (error.code == 500009) {
this.$messageBox('该模板已被加载计划使用,无法删除')
}
})
}).catch(() => { })
},
reloadTable() {
this.queryList.reload()
}
}
}
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 KiB