desc: 增加加载运行图模板接口,调整地图绘制优化

This commit is contained in:
zyy 2019-09-06 14:21:01 +08:00
parent 063b6392fc
commit 11a49d1442
16 changed files with 768 additions and 144 deletions

View File

@ -383,3 +383,19 @@ export function listAllTempLateRunPlan() {
method: 'get' method: 'get'
}); });
} }
// 删除加载计划
export function deleteDailyRunPlanLoad(id) {
return request({
url: `/api/runPlan/daily/runPlanLoad/${id}`,
method: 'DELETE'
});
}
// 从加载计划创建每日计划
export function postDailyRunPlanLoadGenerate(id) {
return request({
url: `/api/runPlan/daily/runPlanLoad/${id}/generate`,
method: 'post'
});
}

View File

@ -10,6 +10,574 @@ class SkinCode extends defaultStyle {
linkColor: '#3F3F3F', // link 线条颜色 linkColor: '#3F3F3F', // link 线条颜色
linkTextColor: '#FFFFFF' // link 字体颜色 linkTextColor: '#FFFFFF' // link 字体颜色
}; };
this[deviceType.Section] = {
active: {
routeColor: false // 进路触发颜色
},
text: { // 物理区段名称
show: true, // 物理区段名称显示
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: { // 逻辑区段名称
show: false, // 逻辑区段名称显示
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: { // 站台轨名称
show: true, // 站台轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: { // 折返轨名称
show: true, // 折返轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: { // 转换轨名称
show: true, // 转换轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细
fontColor: '#FFFFFF', // 字体颜色
textAlign: 'center', // 水平对齐方式
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: { // 目的码名称
show: true, // 目的码名称显示
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: {
show: true, // 信号机名称显示
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', // 控制模式黄色
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
interconnectedControlShow: false // 联锁控显示
},
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] = {
// text: {
// show: true // 公里标名称显示
// },
kmPostShow: true, // 公里标显示
kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold' // 文字错细
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: -15, y: -10}, // 道岔名称与区段距离
fontSize: 10, // 字体大小
fontColor: '#C0C0C0', // 道岔名称颜色
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: [
{
type: '03',
serviceNumber: 'M0',
nameFormat: 'serviceNumber:groupNumber'
},
{
type: '02',
nameFormat: 'targetCode:groupNumber'
}
], // 特殊列车类型需设置显示格式
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: 'left'// 车次号文字显示位置
},
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对象
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' // 默认服务号状态显示颜色
}
};
} }
} }

View File

@ -0,0 +1,39 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
// import Vue from 'vue';
// import store from '@/store';
class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.create();
}
create() {
if (this.device.link) {
const rect = this.device.link.getBoundingRect();
this.lineBorder = new Rect({
zlevel: this.device.zlevel,
z: this.device.z - 1,
shape: rect,
style: {
lineDash: [3, 3],
stroke: '#fff',
fill: this.device.style.transparentColor
}
});
this.add(this.lineBorder);
this.lineBorder.hide();
}
}
mouseover(e) {
this.lineBorder && this.lineBorder.show();
}
mouseout(e) {
this.lineBorder && this.lineBorder.hide();
}
}
export default EMouse;

View File

@ -1,5 +1,6 @@
import Line from 'zrender/src/graphic/shape/Line'; import Line from 'zrender/src/graphic/shape/Line';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import EMouse from './EMouse';
class Link extends Group { class Link extends Group {
constructor(model, style) { constructor(model, style) {
@ -20,7 +21,7 @@ class Link extends Group {
if (model.lp.x !== model.rp.x && model.lp.y !== model.rp.y) { if (model.lp.x !== model.rp.x && model.lp.y !== model.rp.y) {
textPosition = model.lp.y > model.rp.y ? 'insideLeft' : 'insideRight'; textPosition = model.lp.y > model.rp.y ? 'insideLeft' : 'insideRight';
} }
// 标准link
this.link = new Line({ this.link = new Line({
zlevel: this.zlevel, zlevel: this.zlevel,
z: 0, z: 0,
@ -43,6 +44,14 @@ class Link extends Group {
} }
}); });
this.add(this.link); this.add(this.link);
const path = window.location.href;
if (path.includes('/map/draw')) {
// 鼠标事件
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
} }
setState(model) { setState(model) {

View File

@ -4,8 +4,8 @@ export function getBaseUrl() {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.4:9000' // 琰培 // BASE_API = 'http://192.168.3.4:9000' // 琰培
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -127,3 +127,19 @@ export function getCountTime(data) {
return -1; return -1;
} }
} }
// 对象 深拷贝
export function deepClone(item) {
const target = item.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象
for (const keys in item) {
if (item.hasOwnProperty(keys) && keys != 'instance') { // instance 对面不拷贝
if (item[keys] && typeof item[keys] === 'object') { // 如果值是对象,就递归一下
target[keys] = item[keys].constructor === Array ? [] : {};
target[keys] = deepClone(item[keys]);
} else {
target[keys] = item[keys];
}
}
}
return target;
}

View File

@ -18,7 +18,8 @@
style="padding: 5px" style="padding: 5px"
:style="{ height: height-160 +'px' }" :style="{ height: height-160 +'px' }"
> >
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height-170 +'px' }"> <div>
<!-- <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height-170 +'px' }"> -->
<p class="list-item"> <p class="list-item">
<span class="list-label">{{ $t('demonstration.productDescription') }}</span> <span class="list-label">{{ $t('demonstration.productDescription') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span> <span class="list-elem">{{ courseModel.remarks }}</span>
@ -27,7 +28,8 @@
<span class="list-label">{{ $t('global.permissionList') }}</span> <span class="list-label">{{ $t('global.permissionList') }}</span>
</p> </p>
<limit-list :ref="`limit_${item.code}`" :course-model="courseModel" @initLoadPage="initLoadPage" /> <limit-list :ref="`limit_${item.code}`" :course-model="courseModel" @initLoadPage="initLoadPage" />
</el-scrollbar> <!-- </el-scrollbar> -->
</div>
</el-tab-pane> </el-tab-pane>
<div v-if="hasProduct" class="btn-buy"> <div v-if="hasProduct" class="btn-buy">
<el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button> <el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button>

View File

@ -50,8 +50,6 @@
<script> <script>
import { getScriptPageListOnline, getScriptById } from '@/api/script'; import { getScriptPageListOnline, getScriptById } from '@/api/script';
import { listPublishMap } from '@/api/jmap/map';
// import { roleType } from '@/scripts/ConstConfig';
export default { export default {
name: 'AddQuest', name: 'AddQuest',
@ -73,7 +71,6 @@ export default {
return { return {
show: false, show: false,
roleShow: false, roleShow: false,
mapList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -149,11 +146,7 @@ export default {
return getScriptPageListOnline(params); return getScriptPageListOnline(params);
}, },
async loadInitData() { async loadInitData() {
//
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data;
});
}, },
async handleLoad(index, row) { async handleLoad(index, row) {
this.row = row; this.row = row;

View File

@ -56,6 +56,7 @@ import { getUID } from '@/jmap/utils/Uid';
import { getUName } from '@/jmap/utils/Uname'; import { getUName } from '@/jmap/utils/Uname';
import ConfigList from './config/list'; import ConfigList from './config/list';
import ConfigData from './config/data'; import ConfigData from './config/data';
import { deepClone } from '@/utils/index';
export default { export default {
name: 'LinkDraft', name: 'LinkDraft',
@ -290,7 +291,8 @@ export default {
this.$refs.make.resetFields(); this.$refs.make.resetFields();
this.activeName = 'first'; this.activeName = 'first';
if (selected && selected._type.toUpperCase() === 'Link'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Link'.toUpperCase()) {
Object.assign(this.editModel, selected); const data = deepClone(selected);
Object.assign(this.editModel, data);
} }
}); });
}, },
@ -439,71 +441,49 @@ export default {
edit() { edit() {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (valid) { if (valid) {
this.$emit('addOrUpdateMapModel', this.buildEditModel()); const data = Object.assign({_type: 'Link'}, this.editModel);
this.$emit('addOrUpdateMapModel', data);
} }
}); });
}, },
buildEditModel() { updateRelatedModel(node, code) {
const model = { if (node.leftFdCode == code) {
_type: 'Link', return { _type: 'Link', code: node.code, leftFdCode: '' };
code: this.editModel.code, }
name: this.editModel.name,
color: this.editModel.color == '' ? '#4e8de6' : this.editModel.color, if (node.leftSdCode == code) {
leftFdCode: this.editModel.leftFdCode, return { _type: 'Link', code: node.code, leftSdCode: '' };
leftSdCode: this.editModel.leftSdCode, }
rightFdCode: this.editModel.rightFdCode, if (node.rightFdCode == code) {
rightSdCode: this.editModel.rightSdCode, return { _type: 'Link', code: node.code, rightFdCode: '' };
lengthFact: this.editModel.lengthFact }
};
return model; if (node.rightSdCode == code) {
return { _type: 'Link', code: node.code, rightSdCode: '' };
}
return { _type: 'Link', code: node.code };
}, },
//
deleteObj() { deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Link'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Link'.toUpperCase()) {
var node = null; var node = null;
var _that = this; var _that = this;
var updates = []; var updates = [];
if (selected.leftFdCode) { if (selected.leftFdCode) {
node = this.findLinkData(selected.leftFdCode); node = this.findLinkData(selected.leftFdCode);
if (node) { node && updates.push(this.updateRelatedModel(node, selected.code));
if (selected.lp.y === selected.rp.y) {
updates.push({ _type: 'Link', code: node.code, rightFdCode: '' });
} else {
updates.push({ _type: 'Link', code: node.code, rightSdCode: '' });
}
}
} }
if (selected.leftSdCode) { if (selected.leftSdCode) {
node = this.findLinkData(selected.leftSdCode); node = this.findLinkData(selected.leftSdCode);
if (node) { node && updates.push(this.updateRelatedModel(node, selected.code));
if (selected.lp.y === selected.rp.y) {
updates.push({ _type: 'Link', code: node.code, rightFdCode: '' });
} else {
updates.push({ _type: 'Link', code: node.code, rightSdCode: '' });
}
}
} }
if (selected.rightFdCode) { if (selected.rightFdCode) {
node = this.findLinkData(selected.rightFdCode); node = this.findLinkData(selected.rightFdCode);
if (node) { node && updates.push(this.updateRelatedModel(node, selected.code));
if (selected.lp.y === selected.rp.y) {
updates.push({ _type: 'Link', code: node.code, leftFdCode: '' });
} else {
updates.push({ _type: 'Link', code: node.code, leftSdCode: '' });
}
}
} }
if (selected.rightSdCode) { if (selected.rightSdCode) {
node = this.findLinkData(selected.rightSdCode); node = this.findLinkData(selected.rightSdCode);
if (node) { node && updates.push(this.updateRelatedModel(node, selected.code));
if (selected.lp.y === selected.rp.y) {
updates.push({ _type: 'Link', code: node.code, leftFdCode: '' });
} else {
updates.push({ _type: 'Link', code: node.code, leftSdCode: '' });
}
}
} }
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {

View File

@ -145,6 +145,7 @@ import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid'; import { getUID } from '@/jmap/utils/Uid';
import JTriangle from '@/jmap/utils/JTriangle'; import JTriangle from '@/jmap/utils/JTriangle';
import ConfigList from './config/list'; import ConfigList from './config/list';
import { deepClone } from '@/utils/index';
export default { export default {
name: 'SectionDraft', name: 'SectionDraft',
@ -514,6 +515,7 @@ export default {
this.regionList = this.$ConstSelect.RegionTypeList; this.regionList = this.$ConstSelect.RegionTypeList;
}, },
methods: { methods: {
//
computedLogicSectionNumList(logicSectionNum) { computedLogicSectionNumList(logicSectionNum) {
this.tableData = []; this.tableData = [];
this.logicSectionNums = [...logicSectionNum]; this.logicSectionNums = [...logicSectionNum];
@ -543,14 +545,15 @@ export default {
this.$refs.dataform.clearValidate(); this.$refs.dataform.clearValidate();
this.activeName = 'first'; this.activeName = 'first';
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
Object.assign(this.editModel, selected); const data = deepClone(selected);
Object.assign(this.editModel, data);
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
this.editModel.isSegmentation = selected.isSegmentation || false;
this.editModel.points = selected.points.slice(); this.editModel.points = selected.points.slice();
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz); this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2; this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
this.computedLogicSectionNumList(this.editModel.logicSectionNum); this.computedLogicSectionNumList(this.editModel.logicSectionNum);
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) { if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
this.addModel.code = selected.code; this.addModel.code = selected.code;
} else if (this.field.toUpperCase() === 'leftSection'.toUpperCase()) { } else if (this.field.toUpperCase() === 'leftSection'.toUpperCase()) {
@ -707,7 +710,7 @@ export default {
isTransferTrack: false, isTransferTrack: false,
transferTrackName: '', transferTrackName: '',
transferTrackNamePosition: { x: 0, y: 0 }, transferTrackNamePosition: { x: 0, y: 0 },
isSwitchSection: false, isSwitchSection: false, //
isSegmentation: false, isSegmentation: false,
segmentationPosition: { x: 0, y: 0 }, segmentationPosition: { x: 0, y: 0 },
relSwitchCode: '', relSwitchCode: '',
@ -719,7 +722,7 @@ export default {
logicSectionShow: true, logicSectionShow: true,
logicSectionNameSort: true, logicSectionNameSort: true,
linkCode: link.code, linkCode: link.code,
sepTypeLeft: '01', sepTypeLeft: '01', //
offsetLeft: 0, offsetLeft: 0,
sepTypeRight: '01', sepTypeRight: '01',
trainPosType: '01', trainPosType: '01',

View File

@ -70,6 +70,7 @@ import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid'; import { getUID } from '@/jmap/utils/Uid';
import JTriangle from '@/jmap/utils/JTriangle'; import JTriangle from '@/jmap/utils/JTriangle';
import ConfigList from './config/list'; import ConfigList from './config/list';
import { deepClone } from '@/utils/index';
export default { export default {
name: 'SignalDraft', name: 'SignalDraft',
@ -291,8 +292,8 @@ export default {
this.$refs.make.resetFields(); this.$refs.make.resetFields();
this.activeName = 'first'; this.activeName = 'first';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
Object.assign(this.editModel, selected); const data = deepClone(selected);
this.editModel.potLampType = selected.potLampType || '01'; Object.assign(this.editModel, data);
this.editModel.rotate = selected.rotate || 0; // this.editModel.rotate = selected.rotate || 0; //
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
// //
@ -366,48 +367,11 @@ export default {
edit() { edit() {
this.$refs['dataform'].validate((valid) => { this.$refs['dataform'].validate((valid) => {
if (valid) { if (valid) {
this.$emit('addOrUpdateMapModel', this.buildEditModel()); const data = Object.assign({_type: 'Link'}, this.editModel);
this.$emit('addOrUpdateMapModel', data);
} }
}); });
}, },
buildEditModel() {
const model = {
_type: 'Signal',
code: this.editModel.code,
name: this.editModel.name,
uniqueName: this.editModel.uniqueName,
useType: this.editModel.useType,
lampPostType: this.editModel.lampPostType,
lampPositionType: this.editModel.lampPositionType,
potLampType: this.editModel.potLampType,
positionType: this.editModel.positionType,
directionType: this.editModel.directionType,
nameShow: this.editModel.nameShow,
buttonShow: this.editModel.buttonShow,
guideShow: this.editModel.guideShow,
offset: this.editModel.offset,
rotate: this.editModel.rotate,
position: {
x: this.editModel.position.x,
y: this.editModel.position.y
},
namePosition: {
x: this.editModel.namePosition.x,
y: this.editModel.namePosition.y
},
guidePosition: {
x: this.editModel.guidePosition.x,
y: this.editModel.guidePosition.y
},
buttonPosition: {
x: this.editModel.buttonPosition.x,
y: this.editModel.buttonPosition.y
},
stationCode: this.editModel.stationCode,
linkCode: this.editModel.linkCode
};
return model;
},
// //
deleteObj() { deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);

View File

@ -187,9 +187,26 @@ export default {
this.$refs.make.resetFields(); this.$refs.make.resetFields();
this.activeName = 'first'; this.activeName = 'first';
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
Object.assign(this.editModel, selected); // Object.assign(this.editModel, selected);
this.editModel.runPlanName = selected.runPlanName || '';
this.editModel.centralized = selected.centralized;
this.editModel.concentrateStationCode = selected.concentrateStationCode;
this.editModel.code = selected.code;
this.editModel.zcCode = selected.zcCode;
this.editModel.visible = selected.visible || false; this.editModel.visible = selected.visible || false;
this.editModel.runPlanName = selected.runPlanName || ''; this.editModel.runPlanName = selected.runPlanName || '';
this.editModel.name = selected.name;
this.editModel.nameFont = selected.nameFont;
this.editModel.nameFontColor = selected.nameFontColor;
this.editModel.kmPostShow = selected.kmPostShow;
this.editModel.kmRange = selected.kmRange;
this.editModel.kmPost = selected.kmPost;
this.editModel.kmPostFont = selected.kmPostFont;
this.editModel.kmPostFontColor = selected.kmPostFontColor;
this.editModel.isShowControlMode = selected.isShowControlMode;
if (selected.position) {
this.editModel.position = { x: selected.position.x, y: selected.position.y };
}
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
// //
if (selected.type !== '01') { if (selected.type !== '01') {

View File

@ -179,12 +179,17 @@ export default {
this.$refs.make.resetFields(); this.$refs.make.resetFields();
this.activeName = 'first'; this.activeName = 'first';
if (selected && selected._type.toUpperCase() === 'StationControl'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'StationControl'.toUpperCase()) {
Object.assign(this.editModel, selected); // Object.assign(this.editModel, selected);
if (selected.hasOwnProperty('position')) { this.editModel.name = selected.name;
this.editModel.position = { this.editModel.code = selected.code;
x: selected.position.x, this.editModel.zokContent = selected.zokContent;
y: selected.position.y this.editModel.zakContent = selected.zakContent;
}; this.editModel.jjzkContent = selected.jjzkContent;
this.editModel.zzkContent = selected.zzkContent;
this.editModel.stationCode = selected.stationCode;
this.editModel.zbjkContent = selected.zbjkContent;
if (selected.position) {
this.editModel.position = { x: selected.position.x, y: selected.position.y };
} }
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { } else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.addModel.stationCode = selected.code; this.addModel.stationCode = selected.code;

View File

@ -246,7 +246,7 @@ export default {
this.editModel.stationCode = selected.stationCode; this.editModel.stationCode = selected.stationCode;
this.editModel.doorLocationType = selected.doorLocationType; this.editModel.doorLocationType = selected.doorLocationType;
this.editModel.deviceStationCode = selected.deviceStationCode; this.editModel.deviceStationCode = selected.deviceStationCode;
if (selected.hasOwnProperty('position')) { if (selected.position) {
this.editModel.position = { this.editModel.position = {
x: selected.position.x, x: selected.position.x,
y: selected.position.y y: selected.position.y

View File

@ -86,17 +86,16 @@ export default {
const list = []; const list = [];
if (this.sectionList && this.sectionList.length) { if (this.sectionList && this.sectionList.length) {
this.sectionList.forEach(elem => { this.sectionList.forEach(elem => {
if (elem.type === '01' && elem.isSwitchSection) { // if (elem.type === '01' && elem.isSwitchSection) {
const link = this.findLinkData(elem.linkCode); // const link = this.findLinkData(elem.linkCode);
if ((link.leftFdCode && link.leftSdCode) || (link.rightFdCode && link.rightSdCode)) { // if ((link.leftFdCode && link.leftSdCode) || (link.rightFdCode && link.rightSdCode)) {
list.push({ list.push({
label: elem.name, label: elem.name,
key: elem.code, key: elem.code,
pinyin: elem.name pinyin: elem.name
}); });
} // }
// }
}
}); });
} }
return list; return list;

View File

@ -6,7 +6,7 @@
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { getRunPlanLoadList, runPlanTemplateList, listAllTempLateRunPlan } from '@/api/runplan'; import { getRunPlanLoadList, listAllTempLateRunPlan, deleteDailyRunPlanLoad, postDailyRunPlanLoadGenerate } from '@/api/runplan';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
@ -58,15 +58,20 @@ export default {
width: '350', width: '350',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; }, hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [ buttons: [
// {
// name: this.$t('global.delete'),
// handleClick: this.handleDelete,
// type: 'danger',
// },
{ {
name: this.$t('global.preview'), name: this.$t('global.preview'),
handleClick: this.handleView, handleClick: this.handleView,
type: '' type: ''
},
{
name: '生成每日运行图',
handleClick: this.createActionChart,
type: ''
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
} }
] ]
} }
@ -104,24 +109,32 @@ export default {
this.$router.push({ path: `${UrlConfig.publish.runPlanCommon}/add` }); this.$router.push({ path: `${UrlConfig.publish.runPlanCommon}/add` });
}, },
// //
// handleDelete(index, row) { handleDelete(index, row) {
// this.$confirm(', ?', this.$t('global.tips'), { this.$confirm('此操作将删除此运行图, 是否继续?', this.$t('global.tips'), {
// confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
// cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
// type: 'warning' type: 'warning'
// }).then(() => { }).then(async () => {
await deleteDailyRunPlanLoad(row.id);
// }).catch(() => { }) this.reloadTable();
// }, this.$message.success('删除加载计划成功!');
}).catch(() => { });
},
//
createActionChart(index, row) {
this.$confirm('此操作将生成每日运行图, 是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(async () => {
await postDailyRunPlanLoadGenerate(row.id);
this.$message.success('加载计划创建每日计划成功!');
}).catch(() => { });
},
// //
handleView(index, row) { handleView(index, row) {
runPlanTemplateList({ pageSize: 10000 }).then(resp => { const init = this.mapList.findIndex(elem => { return elem.id == row.mapId; });
const list = resp.data.list || []; this.$router.push({ path: `${UrlConfig.publish.runPlanView}/common`, query: { skinCode: this.mapList[init].skinCode, planId: row.templatePlanId } });
const index = list.findIndex(elem => { return list.id == row.templateId; });
if (index >= 0) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/common`, query: { skinCode: list[index].skinCode, planId: list[index].id } });
}
});
}, },
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();