Merge remote-tracking branch 'remotes/origin/master' into test

This commit is contained in:
ival 2019-08-12 18:30:33 +08:00
commit a779d6ad29
132 changed files with 6961 additions and 6510 deletions

View File

@ -1,5 +1,5 @@
# just a flag # just a flag
NODE_ENV = 'test' NODE_ENV = 'production'
# base api # base api
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud' VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'

View File

@ -18,6 +18,7 @@
"axios": "0.18.0", "axios": "0.18.0",
"echarts": "^4.2.1", "echarts": "^4.2.1",
"element-ui": "2.7.2", "element-ui": "2.7.2",
"file-saver": "^1.3.3",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"lodash": "^4.17.11", "lodash": "^4.17.11",
@ -49,8 +50,8 @@
"babel-eslint": "10.0.1", "babel-eslint": "10.0.1",
"babel-jest": "23.6.0", "babel-jest": "23.6.0",
"chalk": "2.4.2", "chalk": "2.4.2",
"copy-webpack-plugin": "^4.5.2",
"connect": "3.6.6", "connect": "3.6.6",
"copy-webpack-plugin": "^4.5.2",
"eslint": "5.15.3", "eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2", "eslint-plugin-vue": "5.2.2",
"file-loader": "^3.0.1", "file-loader": "^3.0.1",
@ -60,7 +61,7 @@
"runjs": "^4.3.2", "runjs": "^4.3.2",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3", "script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2", "script-loader": "^0.7.2",
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3", "svg-sprite-loader": "4.1.3",
"svgo": "1.2.2", "svgo": "1.2.2",

View File

@ -1,17 +1,17 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 获取地图版本信息*/ /** 根据皮肤获取地图版本信息*/
export function getPublishMapVersion(skinStyle) { export function getPublishMapVersion(skinStyle) {
return request({ return request({
url: `/api/map/${skinStyle}/version`, url: `/api/map/skin/${skinStyle}/version`,
method: 'get' method: 'get'
}); });
} }
/** 获取发布地图详细内容*/ /** 根据皮肤获取发布地图详细内容*/
export function getPublishMapDetail(skinStyle) { export function getPublishMapDetail(skinStyle) {
const datad = request({ const datad = request({
url: `/api/map/${skinStyle}/details`, url: `/api/map/skin/${skinStyle}/details`,
method: 'get' method: 'get'
}); });
return datad.then(); return datad.then();

View File

@ -17,18 +17,34 @@ export function getPublishMapListBySkinStyle(skinStyle) {
}); });
} }
/** 获取地图版本信息*/ /** 根据皮肤获取地图版本信息*/
export function getPublishMapVersion(skinStyle) { export function getPublishMapVersion(skinStyle) {
return request({ return request({
url: `/api/map/${skinStyle}/version`, url: `/api/map/skin/${skinStyle}/version`,
method: 'get' method: 'get'
}); });
} }
/** 获取发布地图详细内容*/ /** 根据皮肤获取发布地图详细内容*/
export function getPublishMapDetail(skinStyle) { export function getPublishMapDetail(skinStyle) {
return request({ return request({
url: `/api/map/${skinStyle}/details`, url: `/api/map/skin/${skinStyle}/details`,
method: 'get'
});
}
/** 根据地图id获取地图版本信息*/
export function getPublishMapVersionById(id) {
return request({
url: `/api/map/${id}/version`,
method: 'get'
});
}
/** 根据地图id获取发布地图详细内容*/
export function getPublishMapDetailById(id) {
return request({
url: `/api/map/${id}/details`,
method: 'get' method: 'get'
}); });
} }

View File

@ -5,5 +5,6 @@ export default {
getMapStepsFailed: 'Failed to get map step data', getMapStepsFailed: 'Failed to get map step data',
resetFailed: 'Reset failure', resetFailed: 'Reset failure',
startTrainingFailed: 'Failure to start training', startTrainingFailed: 'Failure to start training',
saveBackgroundFailed: 'Failed to save background' saveBackgroundFailed: 'Failed to save background',
deleteFailed: 'Failed to delete'
}; };

View File

@ -6,5 +6,9 @@ export default {
cancel: 'Cancel', cancel: 'Cancel',
reset: 'Reset', reset: 'Reset',
coachingModel: 'Coaching model', coachingModel: 'Coaching model',
normalMode: 'Normal mode' normalMode: 'Normal mode',
operate: 'Operate',
edit: 'Edit',
delete: 'Delete',
add: 'Add'
}; };

View File

@ -1,15 +1,23 @@
import enLocale from 'element-ui/lib/locale/lang/en'; import enLocale from 'element-ui/lib/locale/lang/en';
import map from './map';
import global from './global'; import global from './global';
import router from './router'; import router from './router';
import lesson from './lesson'; import lesson from './lesson';
import error from './error'; import error from './error';
import rules from './rules'; import rules from './rules';
import scriptRecord from './scriptRecord';
import tip from './tip';
import system from './system';
export default { export default {
...enLocale, ...enLocale,
map,
global, global,
router, router,
lesson, lesson,
error, error,
rules rules,
scriptRecord,
tip,
system
}; };

306
src/i18n/langs/en/map.js Normal file
View File

@ -0,0 +1,306 @@
export default {
pleaseSelect: '请选择',
sketchMap: '草稿地图列表',
newConstruction: '新建',
importMap: '导入地图',
createNewMap: '新建地图',
normalCreate: '正常创建',
saveMapAs: '地图另存为',
create: '创建',
dataVerification: '数据校验',
logicalView: '逻辑视图',
physicalView: '物理视图',
mixedView: '混合视图',
normal: '正常',
save: '保存',
updata: '更新',
updateObj: '修改',
updateObjAxis: '更新坐标',
saveAs: '另存为',
publish: '发布',
deleteObj: '删除',
confirm: '确 定',
cancel: '取 消',
cancelledDelete: '已取消删除',
confirmDeletion: '是否确认删除?',
hint: '提示',
link: 'link',
section: '区段',
switch: '道岔',
signal: '信号机',
zcZoneControl: 'zc区域控制',
temporaryLimit: '全线临时限速',
lcControl: 'Lc控制',
image: '图片',
station: '车站',
controlMode: '控制模式',
platform: '站台',
counter: '计数器',
delayUnlock: '延迟解锁',
train: '列车',
trainWindow: '车次窗',
line: '线条',
text: '文字',
mapName: '地图名称:',
skinName: '皮肤风格:',
selectCity: '所属城市:',
offsetXColon: 'X偏移:',
offsetYColon: 'Y偏移:',
scalingColon: '缩放比例:',
operationUnusual: '操作异常:',
offsetX: 'X偏移',
offsetY: 'Y偏移',
scaling: '缩放比例',
statusSignalName: '状态信号名称:',
stateSignalsPlotCoordinates: '状态信号画图坐标:',
equipmentStation: '所属设备集中站:',
lineCoding: '线条编码:',
lineType: '线条类型:',
lineWidth: '线条宽度:',
segmentCoordinates: '区段显示坐标:',
publishMapCreation: '从发布地图创建',
pleaseEnterMapName: '请输入地图名称',
pleaseChooseSkinStyle: '请选择皮肤风格',
pleaseSelectMapSource: '请选择地图来源',
pleaseSelectAssociatedCity: '请选择关联城市',
pleaseSelectAssociatedSkin: '请选择关联皮肤',
pleaseEnteMapLinkWidth: '请输入地图Link宽度',
pleaseEnterMapSectionWidth: '请输入地图区段宽度',
failedLoadListPublishedMaps: '加载已发布地图列表失败',
creatingSuccessful: '创建成功!',
mapUpdateSuccessful: '更新地图成功!',
createFailure: '创建失败',
importSuccessful: '导入成功!',
importFailure: '导入失败',
updateSuccessfully: '更新成功',
updateFailed: '更新失败',
failedLoadCityList: '加载城市列表失败',
successfullyDelete: '删除成功',
failDelete: '删除失败',
dataValidationFailed: '发布失败,数据校验不通过',
releaseSuccess: '发布成功!',
abnormalOperation: '操作异常',
datQuestion: '有问题数据',
dataList: '数据列表',
saveFailed: '另存失败',
mapEditor: '地图编辑',
mapPublished: '地图发布为',
publishingAssociatedCity: '发布关联城市:',
publishMapName: '发布地图名称:',
editRoute: '编辑进路',
editRouting: '编辑交路',
editAutoRouting: '编辑自动信号',
setSwitch: '联动道岔',
pathUnit: '路径单元',
jlmap3d: '三维化编辑',
automaticSignalList: '自动信号列表',
automaticSignalCode: '自动信号编码',
signalCodeName: '信号机名称',
signalCode: '信号机code',
sectionData: '区段数据',
preview: '预览',
operation: '操作',
compile: '编辑',
delete: '删除',
empty: '清空',
sectionName: '区段名称',
sectionList: '区段列表',
automaticSignal: '自动信号',
signalID: '信号机ID:',
activate: '激活',
segmentData: '进路自动触发区段数据:',
pleaseSelectSignal: '请选择信号机',
triggerSegmentData: '请选择进路自动触发区段数据',
automaticSignalSuccessful: '创建自动信号成功!',
failedCreateSignal: '创建自动信号失败',
automaticSignalUpdateSucceeded: '更新自动信号成功!',
automaticSignalUpdateFailed: '更新自动信号失败',
stationName: '车站名称:',
property: '属性',
counterCoding: '计数器编码:',
counterName: '计数器名称:',
belongsStation: '所属车站:',
counterType: '计数器类型:',
countMax: '计数器最大值:',
pointX: '坐标 x:',
pointY: '坐标 y:',
code: '编码:',
imageName: '图片名称:',
imageWidth: '图片宽度:',
imageHeight: '图片高度:',
imagePoint: '图片坐标:',
imageZindex: '图片层级:',
imageSelect: '图片选择:',
rotateAngle: '旋转角度:',
areaSolution: '区故解',
alwaysSolution: '总人解',
pleaseSelectMap: '请选择地图',
selectCounterType: '请选择计数器类型',
selectStation: '请选择车站',
pleaseSelectDevice: '请重新选择设备',
pleaseSelectCountName: '请输入计数器名称',
pleaseCounterValue: '请输入计数器最大值',
pleaseEnterXCoordinate: '请输入x坐标',
pleaseEnterYCoordinate: '请输入y坐标',
pleaseEnterDelayTime: '请输入延时时间',
pleaseEnterFontColor: '请输入字体颜色',
pleaseEnterFontFormat: '请输入字体格式',
pleaseEnterImageWidth: '请输入图片宽度',
pleaseEnterImageHeight: '请输入图片高度',
delayUnlockingCode: '延时解锁编码:',
delayTime: '延时时间:',
font: '字体:',
color: '颜色:',
upside: '上段',
hypomere: '下段',
linkType: 'Link类型',
linkCode: 'Link编码:',
linkName: 'Link名称:',
linkDisplayLength: 'Link显示长度:',
linkActualLength: 'Link实际长度:',
linkColor: 'Link颜色:',
linkLeftFdCode: '左侧正向Link:',
linkLeftSdCode: '左侧侧向Link:',
linkRightFdCode: '右侧正向Link:',
linkRightSdCode: '右侧侧向Link:',
linkLp: 'Link 起点坐标:',
linkRp: 'Link 终点坐标:',
rulesChange: '规则修改',
sectionNameC: '区段名称:',
splitMerge: '拆分/合并',
linkSet: 'Link集合',
selectLink: '选择Link',
splitOffset: '拆分偏移量:',
split: '拆分',
merge: '合并',
logicBlock: '逻辑区段',
aux: '第',
sectionLine: '段折线',
sectionPolyline: '区段折线',
switchSection: '道岔区段',
trainDirection: '列车所在方向:',
deleteSwitchSection: '一键删除道岔区段',
createSwitchSection: '一键创建道岔区段',
sectionLogicalNumber: '逻辑区段数量',
sectionLsectioncode: '左侧区段名称:',
sectionRsectioncode: '右侧区段名称:',
associatedSection: '关联物理区段:',
blockCoding: '区段编码:',
sectionType: '区段类型:',
sectionNameColon: '区段名称:',
sectionNameOffset: '区段名称偏移量:',
leftKilometerMark: '左侧公里标(米):',
rightKilometerMark: '右侧公里标(米):',
sectionColon: '区间:',
displayExtentName: '是否显示区段名称:',
displayAxleCounter: '是否显示计轴:',
displayLogicalExtents: '是否显示逻辑区段:',
displayLogicalWxtentNames: '是否显示逻辑区段名称:',
isStandTrack: '是否站台轨:',
standTrackName: '站台轨名称:',
standTrackNamePosition: '站台轨名称偏移量:',
relStandCode: '站台编码:',
isReentryTrack: '是否折返轨:',
reentryTrackName: '折返轨名称:',
reentryTrackNamePosition: '折返轨名称偏移量:',
isTransferTrack: '是否转换轨:',
transferTrackName: '转换轨名称:',
transferTrackNamePosition: '转换轨名称偏移量:',
destinationCode: '目的地码:',
destinationCodePoint: '目的地码坐标:',
destinationCodeShow: '是否显示目的地码:',
leftStopPointOffset: '左向停车点偏移量:',
rightStopPointOffset: '右向停车点偏移量:',
isSwitchSection: '是否道岔区段:',
relSwitchCode: '关联道岔Code:',
logicSectionNameSort: '逻辑区段排序:',
fromSmallToLarge: '从小到大',
fromLargeToSmall: '从大到小',
relevanceLinkCode: '关联的Link:',
sepTypeLeft: '左侧分隔符类型:',
sectionOffsetLeft: '左侧Link偏移量:',
sepTypeRight: '右侧分隔符类型:',
sectionOffsetRight: '右侧Link偏移量:',
isSegmentation: '是否分割:',
segmentationPosition: '默认背景:',
isCurve: '是否曲线:',
sectionPoints: '区段显示坐标:',
trainPosType: '列车所在方向:',
physicalSegmentName: '物理区段名称:',
directionType: '形式方向:',
leftOrRight: '左右位置:',
positionType: '上下位置:',
signalFilamentAlarm: '灯丝报警',
signalCodeColon: '信号机编码:',
signalNameColon: '信号机名称:',
signalUniqueName: '信号机唯一名称:',
signalDisplayName: '是否显示信号机名称:',
lampPostType: '灯柱类型:',
lampPositionType: '灯位类型:',
signalUseType: '用途类型:',
potLampType: '点灯类型:',
signalDirectionType: '方向类型:',
signalPositionType: '信号机位置类型:',
signalOffset: '偏移量:',
signalPositionX: '信号机x:',
signalPositionY: '信号机y:',
signalRotate: '旋转角度:',
signalNamePositionX: '信号机名字偏移量 x:',
signalNamePositionY: '信号机名字偏移量 y:',
signalButtonShow: '是否显示按钮:',
signalButtonPositionX: '按钮x:',
signalButtonPositionY: '按钮y:',
signalGuideShow: '是否显示引导信号灯:',
signalGuidePositionX: '引导信号x:',
signalGuidePositionY: '引导信号y:',
concentrateStationCode: '所属联锁站编码:',
stationCode: '车站编码:',
zcCode: '所属zc区域编码:',
centralized: '是否集中站:',
stationNameColon: '车站名称:',
stationRunPlanName: '真实名称:',
stationVisible: '是否显示:',
stationNameFont: '车站字体:',
stationNameFontColor: '车站字体颜色:',
stationKmPostShow: '是否显示公里标名称:',
stationKmRange: '公里标距离:',
stationKmPost: '公里标名称:',
stationKmPostFont: '公里标字体:',
stationKmPostFontColor: '公里标字体颜色:',
stationPositionX: 'x坐标:',
stationPositionY: 'y坐标:',
stationControlCode: '控制模式编码:',
stationControlName: '控制模式名称:',
zokContent: '中控内容:',
zakContent: '站控内容:',
jjzkContent: '紧急站控/总报警内容:',
zzkContent: '站中控内容:',
stationControlPositionX: '坐标 x:',
stationControlPositionY: '坐标 y:',
stationControlZok: '中控'
};

View File

@ -23,7 +23,7 @@ export default {
dpSystem: 'Large screen', dpSystem: 'Large screen',
planSystem: 'Lian classroom', planSystem: 'Lian Plan',
replayManage: 'Playback', replayManage: 'Playback',
@ -33,9 +33,9 @@ export default {
publishMapManage: 'Publishing map management', publishMapManage: 'Publishing map management',
productStateManage: 'Product state management', productStateManage: 'Product state management',
publishLessonManage: 'Publishing lesson management', publishLessonManage: 'Publishing lesson management',
runPlanTemplateManage: 'Template run plan management', runPlanTemplateManage: 'Template plan management',
runPlanCommonManage: 'General run plan management', runPlanCommonManage: 'General plan management',
runPlanEveryDayManage: 'Daily run plan Management', runPlanEveryDayManage: 'Daily plan Management',
examRuleManage: 'Management of examination rules', examRuleManage: 'Management of examination rules',
orderAuthorityManage: 'Order&Authority', orderAuthorityManage: 'Order&Authority',

View File

@ -1,5 +1,85 @@
export default { export default {
deviceTypeNotNull: 'Device type code cannot be empty', pleaseSelect: '请选择',
operationTypeNotNull: 'Operator code cannot be empty', selectEquipment: '请选择设备',
tipsNotNull: 'Tips cannot be empty' deviceTypeNotNull: '设备类型码不能为空',
operationTypeNotNull: '操作码不能为空',
tipsNotNull: '提示信息不能为空',
pleaseSelectEncoding: '请选择唯一编码',
pleaseEnterStatusSignal: '请输入状态信号名称',
pleaseEnterXCoordinate: '请输入x坐标',
pleaseEnterYCoordinate: '请输入y坐标',
pleaseSelectLine: '请选择Line',
pleaseSelectLineType: '请选择Line类型',
pleaseSelectLineWidth: '请输入线条宽度',
linkXCoordinate: '请输入Link x坐标',
linkYCoordinate: '请输入Link y坐标',
linkEnterLength: '请输入显示长度',
linkEnterDisplayLength: '请输入真实长度',
linkSelectBase: '请选择基础Link',
linkEnterLeft: '请输入左侧正向Link',
linkEnterRight: '请输入右侧正向Link',
linkSelectName: '请输入Link名称',
linkSelectDisplayLength: '请输入Link实际长度',
lengthShow: '显示长度:',
lengthFact: '真实长度:',
color: '颜色:',
pointX: '坐标 x:',
pointY: '坐标 y:',
direct: '方向:',
basisLink: '基础Link:',
pleaseSelectSectionName: '请选择区段名称',
pleaseFillOffset: '请填写偏移量',
pleaseFillValue: '请填写数值',
pleaseSelectLeftSectionName: '请选择左侧区段名称',
pleaseSelectRightSectionName: '请选择右侧区段名称',
pleaseEnterYValue: '请输入坐标Y值',
pleaseEnterSectionType: '请输入区段类型',
pleaseEnterSectionName: '请输入区段名称',
pleaseSelectAssociatedPlatform: '请选择关联站台',
pleaseEnterLeftStopPointOffset: '请输入左向停车点偏移量',
rightStopPointOffset: '请输入右向停车点偏移量',
destinationCode: '请输入目的地码',
destinationCodePointX: '请输入目的地码坐标X',
destinationCodePointY: '请输入目的地码坐标Y',
sectionNamePointX: '请输入区段名称坐标X',
sectionNamePointY: '请输入区段名称坐标Y',
logicSectionNameSort: '请选择逻辑区段名称排序',
sectionOffsetLeft: '请输入左侧Link偏移量',
sectionSepTypeLeft: '请选择左侧分隔符',
sectionOffsetRight: '请输入右侧Link偏移量',
sectionSepTypeRight: '请选择右侧分隔符',
selectPhysicalExtentName: '请选择物理区段名称',
pleaseEnterSemaphoreName: '请输入信号灯名称',
pleaseEnterSignalName: '请输入信号机唯一名称',
pleaseEnterSignalOffset: '请输入偏移量',
pleaseEnterSignalStation: '请输入设备集中站',
pleaseEnterSignalPositionX: '请输入信号机x',
pleaseEnterSignalPositionY: '请输入信号机y',
signalButtonPositionX: '请输入按钮x',
signalButtonPositionY: '请输入按钮y',
signalGuidePositionX: '请输入引导信号x',
signalGuidePositionY: '请输入引导信号y',
stationName: '请输入车站名称',
stationKmRange: '请输入公里标距离',
stationKmPost: '请输入公里标名称',
stationPositionX: '请输入x坐标',
stationPositionY: '请输入y坐标',
stationControlStationName: '请选择车站名称',
stationControlStationCode: '请选择所属车站',
stationControlZokContent: '请输入中控内容',
stationControlZakContent: '请输入站控内容',
stationControlJjzkContent: '请输入紧急站控内容',
stationControlZzkContent: '请输入站中控内容',
stationControlPositionX: '请输入坐标x',
stationControlPositionY: '请输入坐标y'
}; };

View File

@ -0,0 +1,22 @@
export default {
scriptTitle: 'Task Recording',
saveMaplocation: 'Update Location',
saveBackground: 'Save Background',
saveData: 'Save Data',
roleManage: 'Role Manage',
targetCondition: 'Task Target',
taskScript: 'Task Script',
roleName: 'Role Name',
roleType: 'Role Type',
deviceCode: 'Device Code',
roleList: 'Role List',
operation: 'Operation',
roleAdd: 'Add',
delete: 'Delete',
behaviorOperate: 'Behavior Operate',
conditionTitle: 'Target condition',
deviceType: 'Device Type',
deviceCondition: 'Device Condition',
paramDeviceType: 'Param DeviceType',
paramDeviceCode: 'Param DeviceCode'
};

View File

@ -0,0 +1,8 @@
export default {
code: 'code',
name: 'name',
status: 'status',
remarks: 'remarks',
createDirectory: 'Create dictionary',
editDictionary: 'Edit dictionary'
};

26
src/i18n/langs/en/tip.js Normal file
View File

@ -0,0 +1,26 @@
export default {
confirm: '确 定',
cancel: '取 消',
creatingSuccessful: '创建成功!',
confirmDeletion: '是否确认删除?',
confirmBatchGeneration: '是否确认批量生成?',
hint: '提示',
cancelledDelete: '已取消删除',
cancelGeneration: '已取消批量生成',
updateSuccessfully: '更新成功',
updateFailed: '更新失败',
successfullyDelete: '删除成功',
failDelete: '删除失败',
cannotCoincide: '起始坐标和结束坐标不能重合',
cannotMerged: '存在非物理区段,不能合并',
linkCannotMerged: '不在同一Link上的物理区段不能合并',
selectedSectionEmpty: '选择的区段为空',
stationFont: '车站字体',
kilometerFont: '公里标字体',
meter: '米',
angle: '度'
};

View File

@ -5,5 +5,6 @@ export default {
getMapStepsFailed: '获取地图步骤数据', getMapStepsFailed: '获取地图步骤数据',
resetFailed: '重置失败', resetFailed: '重置失败',
startTrainingFailed: '开始实训失败', startTrainingFailed: '开始实训失败',
saveBackgroundFailed: '保存背景失败' saveBackgroundFailed: '保存背景失败',
deleteFailed: '删除失败'
}; };

View File

@ -1,10 +1,14 @@
export default { export default {
offset: '偏移', offset: '偏 移',
zoom: '缩放', zoom: '缩 放',
tips: '提示', tips: '提 示',
confirm: '确定', reset: '重 置',
cancel: '取消', confirm: '确 定',
reset: '重置', cancel: '取 消',
coachingModel: '教练模式', coachingModel: '教练模式',
normalMode: '正常模式' normalMode: '正常模式',
operate: '操 作',
edit: '编 辑',
delete: '删 除',
add: '新 增'
}; };

View File

@ -1,15 +1,23 @@
import cnLocale from 'element-ui/lib/locale/lang/zh-CN'; import cnLocale from 'element-ui/lib/locale/lang/zh-CN';
import map from './map';
import global from './global'; import global from './global';
import router from './router'; import router from './router';
import lesson from './lesson'; import lesson from './lesson';
import error from './error'; import error from './error';
import rules from './rules'; import rules from './rules';
import scriptRecord from './scriptRecord';
import tip from './tip';
import system from './system';
export default { export default {
...cnLocale, ...cnLocale,
map,
global, global,
router, router,
lesson, lesson,
error, error,
rules rules,
scriptRecord,
tip,
system
}; };

306
src/i18n/langs/zh/map.js Normal file
View File

@ -0,0 +1,306 @@
export default {
pleaseSelect: '请选择',
sketchMap: '草稿地图列表',
newConstruction: '新建',
importMap: '导入地图',
createNewMap: '新建地图',
normalCreate: '正常创建',
saveMapAs: '地图另存为',
create: '创建',
dataVerification: '数据校验',
logicalView: '逻辑视图',
physicalView: '物理视图',
mixedView: '混合视图',
normal: '正常',
save: '保存',
updata: '更新',
updateObj: '修改',
updateObjAxis: '更新坐标',
saveAs: '另存为',
publish: '发布',
deleteObj: '删除',
confirm: '确 定',
cancel: '取 消',
cancelledDelete: '已取消删除',
confirmDeletion: '是否确认删除?',
hint: '提示',
link: 'link',
section: '区段',
switch: '道岔',
signal: '信号机',
zcZoneControl: 'zc区域控制',
temporaryLimit: '全线临时限速',
lcControl: 'Lc控制',
image: '图片',
station: '车站',
controlMode: '控制模式',
platform: '站台',
counter: '计数器',
delayUnlock: '延迟解锁',
train: '列车',
trainWindow: '车次窗',
line: '线条',
text: '文字',
mapName: '地图名称:',
skinName: '皮肤风格:',
selectCity: '所属城市:',
offsetXColon: 'X偏移:',
offsetYColon: 'Y偏移:',
scalingColon: '缩放比例:',
operationUnusual: '操作异常:',
offsetX: 'X偏移',
offsetY: 'Y偏移',
scaling: '缩放比例',
statusSignalName: '状态信号名称:',
stateSignalsPlotCoordinates: '状态信号画图坐标:',
equipmentStation: '所属设备集中站:',
lineCoding: '线条编码:',
lineType: '线条类型:',
lineWidth: '线条宽度:',
segmentCoordinates: '区段显示坐标:',
publishMapCreation: '从发布地图创建',
pleaseEnterMapName: '请输入地图名称',
pleaseChooseSkinStyle: '请选择皮肤风格',
pleaseSelectMapSource: '请选择地图来源',
pleaseSelectAssociatedCity: '请选择关联城市',
pleaseSelectAssociatedSkin: '请选择关联皮肤',
pleaseEnteMapLinkWidth: '请输入地图Link宽度',
pleaseEnterMapSectionWidth: '请输入地图区段宽度',
failedLoadListPublishedMaps: '加载已发布地图列表失败',
creatingSuccessful: '创建成功!',
mapUpdateSuccessful: '更新地图成功!',
createFailure: '创建失败',
importSuccessful: '导入成功!',
importFailure: '导入失败',
updateSuccessfully: '更新成功',
updateFailed: '更新失败',
failedLoadCityList: '加载城市列表失败',
successfullyDelete: '删除成功',
failDelete: '删除失败',
dataValidationFailed: '发布失败,数据校验不通过',
releaseSuccess: '发布成功!',
abnormalOperation: '操作异常',
datQuestion: '有问题数据',
dataList: '数据列表',
saveFailed: '另存失败',
mapEditor: '地图编辑',
mapPublished: '地图发布为',
publishingAssociatedCity: '发布关联城市:',
publishMapName: '发布地图名称:',
editRoute: '编辑进路',
editRouting: '编辑交路',
editAutoRouting: '编辑自动信号',
setSwitch: '联动道岔',
pathUnit: '路径单元',
jlmap3d: '三维化编辑',
automaticSignalList: '自动信号列表',
automaticSignalCode: '自动信号编码',
signalCodeName: '信号机名称',
signalCode: '信号机code',
sectionData: '区段数据',
preview: '预览',
operation: '操作',
compile: '编辑',
delete: '删除',
empty: '清空',
sectionName: '区段名称',
sectionList: '区段列表',
automaticSignal: '自动信号',
signalID: '信号机ID:',
activate: '激活',
segmentData: '进路自动触发区段数据:',
pleaseSelectSignal: '请选择信号机',
triggerSegmentData: '请选择进路自动触发区段数据',
automaticSignalSuccessful: '创建自动信号成功!',
failedCreateSignal: '创建自动信号失败',
automaticSignalUpdateSucceeded: '更新自动信号成功!',
automaticSignalUpdateFailed: '更新自动信号失败',
stationName: '车站名称:',
property: '属性',
counterCoding: '计数器编码:',
counterName: '计数器名称:',
belongsStation: '所属车站:',
counterType: '计数器类型:',
countMax: '计数器最大值:',
pointX: '坐标 x:',
pointY: '坐标 y:',
code: '编码:',
imageName: '图片名称:',
imageWidth: '图片宽度:',
imageHeight: '图片高度:',
imagePoint: '图片坐标:',
imageZindex: '图片层级:',
imageSelect: '图片选择:',
rotateAngle: '旋转角度:',
areaSolution: '区故解',
alwaysSolution: '总人解',
pleaseSelectMap: '请选择地图',
selectCounterType: '请选择计数器类型',
selectStation: '请选择车站',
pleaseSelectDevice: '请重新选择设备',
pleaseSelectCountName: '请输入计数器名称',
pleaseCounterValue: '请输入计数器最大值',
pleaseEnterXCoordinate: '请输入x坐标',
pleaseEnterYCoordinate: '请输入y坐标',
pleaseEnterDelayTime: '请输入延时时间',
pleaseEnterFontColor: '请输入字体颜色',
pleaseEnterFontFormat: '请输入字体格式',
pleaseEnterImageWidth: '请输入图片宽度',
pleaseEnterImageHeight: '请输入图片高度',
delayUnlockingCode: '延时解锁编码:',
delayTime: '延时时间:',
font: '字体:',
color: '颜色:',
upside: '上段',
hypomere: '下段',
linkType: 'Link类型',
linkCode: 'Link编码:',
linkName: 'Link名称:',
linkDisplayLength: 'Link显示长度:',
linkActualLength: 'Link实际长度:',
linkColor: 'Link颜色:',
linkLeftFdCode: '左侧正向Link:',
linkLeftSdCode: '左侧侧向Link:',
linkRightFdCode: '右侧正向Link:',
linkRightSdCode: '右侧侧向Link:',
linkLp: 'Link 起点坐标:',
linkRp: 'Link 终点坐标:',
rulesChange: '规则修改',
sectionNameC: '区段名称:',
splitMerge: '拆分/合并',
linkSet: 'Link集合',
selectLink: '选择Link',
splitOffset: '拆分偏移量:',
split: '拆分',
merge: '合并',
logicBlock: '逻辑区段',
aux: '第',
sectionLine: '段折线',
sectionPolyline: '区段折线',
switchSection: '道岔区段',
trainDirection: '列车所在方向:',
deleteSwitchSection: '一键删除道岔区段',
createSwitchSection: '一键创建道岔区段',
sectionLogicalNumber: '逻辑区段数量',
sectionLsectioncode: '左侧区段名称:',
sectionRsectioncode: '右侧区段名称:',
associatedSection: '关联物理区段:',
blockCoding: '区段编码:',
sectionType: '区段类型:',
sectionNameColon: '区段名称:',
sectionNameOffset: '区段名称偏移量:',
leftKilometerMark: '左侧公里标(米):',
rightKilometerMark: '右侧公里标(米):',
sectionColon: '区间:',
displayExtentName: '是否显示区段名称:',
displayAxleCounter: '是否显示计轴:',
displayLogicalExtents: '是否显示逻辑区段:',
displayLogicalWxtentNames: '是否显示逻辑区段名称:',
isStandTrack: '是否站台轨:',
standTrackName: '站台轨名称:',
standTrackNamePosition: '站台轨名称偏移量:',
relStandCode: '站台编码:',
isReentryTrack: '是否折返轨:',
reentryTrackName: '折返轨名称:',
reentryTrackNamePosition: '折返轨名称偏移量:',
isTransferTrack: '是否转换轨:',
transferTrackName: '转换轨名称:',
transferTrackNamePosition: '转换轨名称偏移量:',
destinationCode: '目的地码:',
destinationCodePoint: '目的地码坐标:',
destinationCodeShow: '是否显示目的地码:',
leftStopPointOffset: '左向停车点偏移量:',
rightStopPointOffset: '右向停车点偏移量:',
isSwitchSection: '是否道岔区段:',
relSwitchCode: '关联道岔Code:',
logicSectionNameSort: '逻辑区段排序:',
fromSmallToLarge: '从小到大',
fromLargeToSmall: '从大到小',
relevanceLinkCode: '关联的Link:',
sepTypeLeft: '左侧分隔符类型:',
sectionOffsetLeft: '左侧Link偏移量:',
sepTypeRight: '右侧分隔符类型:',
sectionOffsetRight: '右侧Link偏移量:',
isSegmentation: '是否分割:',
segmentationPosition: '默认背景:',
isCurve: '是否曲线:',
sectionPoints: '区段显示坐标:',
trainPosType: '列车所在方向:',
physicalSegmentName: '物理区段名称:',
directionType: '形式方向:',
leftOrRight: '左右位置:',
positionType: '上下位置:',
signalFilamentAlarm: '灯丝报警',
signalCodeColon: '信号机编码:',
signalNameColon: '信号机名称:',
signalUniqueName: '信号机唯一名称:',
signalDisplayName: '是否显示信号机名称:',
lampPostType: '灯柱类型:',
lampPositionType: '灯位类型:',
signalUseType: '用途类型:',
potLampType: '点灯类型:',
signalDirectionType: '方向类型:',
signalPositionType: '信号机位置类型:',
signalOffset: '偏移量:',
signalPositionX: '信号机x:',
signalPositionY: '信号机y:',
signalRotate: '旋转角度:',
signalNamePositionX: '信号机名字偏移量 x:',
signalNamePositionY: '信号机名字偏移量 y:',
signalButtonShow: '是否显示按钮:',
signalButtonPositionX: '按钮x:',
signalButtonPositionY: '按钮y:',
signalGuideShow: '是否显示引导信号灯:',
signalGuidePositionX: '引导信号x:',
signalGuidePositionY: '引导信号y:',
concentrateStationCode: '所属联锁站编码:',
stationCode: '车站编码:',
zcCode: '所属zc区域编码:',
centralized: '是否集中站:',
stationNameColon: '车站名称:',
stationRunPlanName: '真实名称:',
stationVisible: '是否显示:',
stationNameFont: '车站字体:',
stationNameFontColor: '车站字体颜色:',
stationKmPostShow: '是否显示公里标名称:',
stationKmRange: '公里标距离:',
stationKmPost: '公里标名称:',
stationKmPostFont: '公里标字体:',
stationKmPostFontColor: '公里标字体颜色:',
stationPositionX: 'x坐标:',
stationPositionY: 'y坐标:',
stationControlCode: '控制模式编码:',
stationControlName: '控制模式名称:',
zokContent: '中控内容:',
zakContent: '站控内容:',
jjzkContent: '紧急站控/总报警内容:',
zzkContent: '站中控内容:',
stationControlPositionX: '坐标 x:',
stationControlPositionY: '坐标 y:',
stationControlZok: '中控'
};

View File

@ -23,7 +23,7 @@ export default {
dpSystem: '大屏系统', dpSystem: '大屏系统',
planSystem: '涟课堂', planSystem: '琏计划',
replayManage: '回放管理', replayManage: '回放管理',
@ -32,6 +32,7 @@ export default {
pulishManage: '发布内容管理', pulishManage: '发布内容管理',
publishMapManage: '发布地图管理', publishMapManage: '发布地图管理',
productStateManage: '产品状态管理', productStateManage: '产品状态管理',
publishLessonManage: '发布课程管理',
runPlanTemplateManage: '模板运行图管理', runPlanTemplateManage: '模板运行图管理',
runPlanCommonManage: '通用运行图管理', runPlanCommonManage: '通用运行图管理',
runPlanEveryDayManage: '每日运行图管理', runPlanEveryDayManage: '每日运行图管理',

View File

@ -1,5 +1,85 @@
export default { export default {
pleaseSelect: '请选择',
selectEquipment: '请选择设备',
deviceTypeNotNull: '设备类型码不能为空', deviceTypeNotNull: '设备类型码不能为空',
operationTypeNotNull: '操作码不能为空', operationTypeNotNull: '操作码不能为空',
tipsNotNull: '提示信息不能为空' tipsNotNull: '提示信息不能为空',
pleaseSelectEncoding: '请选择唯一编码',
pleaseEnterStatusSignal: '请输入状态信号名称',
pleaseEnterXCoordinate: '请输入x坐标',
pleaseEnterYCoordinate: '请输入y坐标',
pleaseSelectLine: '请选择Line',
pleaseSelectLineType: '请选择Line类型',
pleaseSelectLineWidth: '请输入线条宽度',
linkXCoordinate: '请输入Link x坐标',
linkYCoordinate: '请输入Link y坐标',
linkEnterLength: '请输入显示长度',
linkEnterDisplayLength: '请输入真实长度',
linkSelectBase: '请选择基础Link',
linkEnterLeft: '请输入左侧正向Link',
linkEnterRight: '请输入右侧正向Link',
linkSelectName: '请输入Link名称',
linkSelectDisplayLength: '请输入Link实际长度',
lengthShow: '显示长度:',
lengthFact: '真实长度:',
color: '颜色:',
pointX: '坐标 x:',
pointY: '坐标 y:',
direct: '方向:',
basisLink: '基础Link:',
pleaseSelectSectionName: '请选择区段名称',
pleaseFillOffset: '请填写偏移量',
pleaseFillValue: '请填写数值',
pleaseSelectLeftSectionName: '请选择左侧区段名称',
pleaseSelectRightSectionName: '请选择右侧区段名称',
pleaseEnterYValue: '请输入坐标Y值',
pleaseEnterSectionType: '请输入区段类型',
pleaseEnterSectionName: '请输入区段名称',
pleaseSelectAssociatedPlatform: '请选择关联站台',
pleaseEnterLeftStopPointOffset: '请输入左向停车点偏移量',
rightStopPointOffset: '请输入右向停车点偏移量',
destinationCode: '请输入目的地码',
destinationCodePointX: '请输入目的地码坐标X',
destinationCodePointY: '请输入目的地码坐标Y',
sectionNamePointX: '请输入区段名称坐标X',
sectionNamePointY: '请输入区段名称坐标Y',
logicSectionNameSort: '请选择逻辑区段名称排序',
sectionOffsetLeft: '请输入左侧Link偏移量',
sectionSepTypeLeft: '请选择左侧分隔符',
sectionOffsetRight: '请输入右侧Link偏移量',
sectionSepTypeRight: '请选择右侧分隔符',
selectPhysicalExtentName: '请选择物理区段名称',
pleaseEnterSemaphoreName: '请输入信号灯名称',
pleaseEnterSignalName: '请输入信号机唯一名称',
pleaseEnterSignalOffset: '请输入偏移量',
pleaseEnterSignalStation: '请输入设备集中站',
pleaseEnterSignalPositionX: '请输入信号机x',
pleaseEnterSignalPositionY: '请输入信号机y',
signalButtonPositionX: '请输入按钮x',
signalButtonPositionY: '请输入按钮y',
signalGuidePositionX: '请输入引导信号x',
signalGuidePositionY: '请输入引导信号y',
stationName: '请输入车站名称',
stationKmRange: '请输入公里标距离',
stationKmPost: '请输入公里标名称',
stationPositionX: '请输入x坐标',
stationPositionY: '请输入y坐标',
stationControlStationName: '请选择车站名称',
stationControlStationCode: '请选择所属车站',
stationControlZokContent: '请输入中控内容',
stationControlZakContent: '请输入站控内容',
stationControlJjzkContent: '请输入紧急站控内容',
stationControlZzkContent: '请输入站中控内容',
stationControlPositionX: '请输入坐标x',
stationControlPositionY: '请输入坐标y'
}; };

View File

@ -0,0 +1,22 @@
export default {
scriptTitle: '任务录制',
saveMaplocation: '更新定位',
saveBackground: '保存背景',
saveData: '保存数据',
roleManage: '角色管理',
targetCondition: '任务目标',
taskScript: '任务剧本',
roleName: '角色名称',
roleType: '角色类型',
deviceCode: '设备编码',
roleList: '角色列表',
operation: '操作',
roleAdd: '添加',
delete: '删除',
behaviorOperate: '行为操作',
conditionTitle: '目标条件',
deviceType: '设备类型',
deviceCondition: '设备条件',
paramDeviceType: '参数设备类型',
paramDeviceCode: '参数设备编号'
};

View File

@ -0,0 +1,8 @@
export default {
code: '编码',
name: '名称',
status: '状态',
remarks: '备注',
createDirectory: '创建目录',
editDictionary: '编辑目录'
};

26
src/i18n/langs/zh/tip.js Normal file
View File

@ -0,0 +1,26 @@
export default {
confirm: '确 定',
cancel: '取 消',
creatingSuccessful: '创建成功!',
confirmDeletion: '是否确认删除?',
confirmBatchGeneration: '是否确认批量生成?',
hint: '提示',
cancelledDelete: '已取消删除',
cancelGeneration: '已取消批量生成',
updateSuccessfully: '更新成功',
updateFailed: '更新失败',
successfullyDelete: '删除成功',
failDelete: '删除失败',
cannotCoincide: '起始坐标和结束坐标不能重合',
cannotMerged: '存在非物理区段,不能合并',
linkCannotMerged: '不在同一Link上的物理区段不能合并',
selectedSectionEmpty: '选择的区段为空',
stationFont: '车站字体',
kilometerFont: '公里标字体',
meter: '米',
angle: '度'
};

View File

@ -456,7 +456,12 @@ class SkinStyle extends defaultStyle {
fontFamily: 'consolas', // 默认字体 族类 fontFamily: 'consolas', // 默认字体 族类
haveTextHSDA: true, // 是否需创建textHSDA对象 haveTextHSDA: true, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象 haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false// 是否需创建trainBorder对象 haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 7/5, // 字体宽高比例用以拼接text是计算位置
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
useSelfFormat: true, // 使用配置项的nameFormat
useSelfText: true // 使用配置项的字体大小
}, },
trainStatusStyle: { trainStatusStyle: {
destinationStatus: [ destinationStatus: [

View File

@ -422,7 +422,12 @@ class SkinStyle extends defaultStyle {
fontFamily: 'consolas', // 默认字体 族类 fontFamily: 'consolas', // 默认字体 族类
haveTextHSDA: true, // 是否需创建textHSDA对象 haveTextHSDA: true, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象 haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false // 是否需创建trainBorder对象 haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 7/5, // 字体宽高比例用以拼接text是计算位置
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
useSelfFormat: true, // 使用配置项的nameFormat
useSelfText: true // 使用配置项的字体大小
}, },
trainStatusStyle: { trainStatusStyle: {
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色 defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色

View File

@ -419,7 +419,12 @@ class SkinStyle extends defaultStyle {
fontFamily: 'consolas', // 默认字体 族类 fontFamily: 'consolas', // 默认字体 族类
haveTextHSDA: true, // 是否需创建textHSDA对象 haveTextHSDA: true, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象 haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false // 是否需创建trainBorder对象 haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 7/5, // 字体宽高比例用以拼接text是计算位置
textOffset: 4, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 8, // 计算列车长度时--列车长比text多出尺寸
useSelfFormat: true, // 使用配置项的nameFormat
useSelfText: true // 使用配置项的字体大小
}, },
trainStatusStyle: { trainStatusStyle: {
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色 defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色

View File

@ -370,7 +370,10 @@ class SkinStyle extends defaultStyle {
nameFontSize: 15, // 字体大小 nameFontSize: 15, // 字体大小
haveTextHSDA: false, // 是否需创建textHSDA对象 haveTextHSDA: false, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象 haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false// 是否需创建trainBorder对象 haveTrainBorder: false, // 是否需创建trainBorder对象
aspectRatio: 8/15, // 字体宽高比例用以拼接text是计算位置
textOffset: 1, // 字体偏移(用以控制字体据车头的距离)
trainWidthMoreText: 2 // 计算列车长度时--列车长比text多出尺寸
}, },
trainStatusStyle: { trainStatusStyle: {
destinationStatus: [ destinationStatus: [

View File

@ -7,7 +7,7 @@ import MouseController from './mouseController';
import deviceState from './constant/deviceState'; import deviceState from './constant/deviceState';
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import { selectSkinStyle } from './config/deviceStyle'; import { selectSkinStyle } from './config/deviceStyle';
import { parser, deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser'; import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser';
const renderer = 'canvas'; const renderer = 'canvas';
const devicePixelRatio = 1; const devicePixelRatio = 1;
@ -76,7 +76,7 @@ class Jlmap {
return defaultStateDict; return defaultStateDict;
} }
setMap(map) { setMap(map, mapDevice) {
// 保存皮肤类型 // 保存皮肤类型
if (map.skinVO) { if (map.skinVO) {
this.skinStyle = map.skinVO.code; this.skinStyle = map.skinVO.code;
@ -85,12 +85,12 @@ class Jlmap {
// 保存原始数据 // 保存原始数据
this.data = map; this.data = map;
// 解析地图数据
this.mapDevice = mapDevice;
// 加载对应皮肤 // 加载对应皮肤
this.style = this.loadStyle(this.skinStyle); this.style = this.loadStyle(this.skinStyle);
// 解析地图数据
this.mapDevice = parser(map, this);
// 数据加载完成 回调 // 数据加载完成 回调
if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.mapDevice); } if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.mapDevice); }

View File

@ -11,6 +11,7 @@ export default class TrainBody extends Group {
super(); super();
this.model = model; this.model = model;
this.deviceModel = model.model; this.deviceModel = model.model;
this.nameFormat = model.nameFormat;
this.create(); this.create();
this.createMouse(); // 鼠标事件 this.createMouse(); // 鼠标事件
} }
@ -158,7 +159,7 @@ export default class TrainBody extends Group {
style.Train.trainBody.specialTrainType.some((item) =>{ style.Train.trainBody.specialTrainType.some((item) =>{
if (model.type === item.type) { if (model.type === item.type) {
serviceNumber = item.serviceNumber; serviceNumber = item.serviceNumber;
style.Train.trainBody.nameFormat = item.nameFormat; this.nameFormat = item.nameFormat;
return true; return true;
} }
}); });
@ -213,20 +214,25 @@ export default class TrainBody extends Group {
this.trainBodyBox && this.trainBodyBox.setColor(key, color); this.trainBodyBox && this.trainBodyBox.setColor(key, color);
} }
formatChangePosition(model, style) { formatChangePosition(model, style) {
if (style.Train.trainBody.trainNameFormat) { if (this.nameFormat) {
const arr = style.Train.trainBody.trainNameFormat.split(':'); const arr = this.nameFormat.split(':');
let fontNumber = 0;
arr.forEach(ele => { arr.forEach(ele => {
if (ele == 'targetCode') { if (ele == 'targetCode') {
this.textTrainNumber.setStyle('x', parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x)); this.textTrainNumber.setStyle('x', parseInt(model.point.x + fontNumber * model.fontSize * style.Train.common.aspectRatio + style.Train.common.textOffset) );
fontNumber += (style.Train.trainNumber.targetCodePrefix || '').length;
this.add(this.textTrainNumber); this.add(this.textTrainNumber);
} else if (ele == 'serviceNumber') { } else if (ele == 'serviceNumber') {
this.textTrainServer.setStyle('x', parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x)); this.textTrainServer.setStyle('x', parseInt(model.point.x + fontNumber * model.fontSize * style.Train.common.aspectRatio + style.Train.common.textOffset));
fontNumber += (style.Train.trainServer.serviceNumberPrefix || '').length;
this.add(this.textTrainServer); this.add(this.textTrainServer);
} else if (ele == 'tripNumber') { } else if (ele == 'tripNumber') {
this.textTrainTarget.setStyle('x', parseInt(model.point.x + style.Train.trainTarget.trainTargetOffset.x)); this.textTrainTarget.setStyle('x', parseInt(model.point.x + fontNumber * model.fontSize * style.Train.common.aspectRatio + style.Train.common.textOffset));
fontNumber += (style.Train.trainTarget.tripNumberPrefix || '').length;
this.add(this.textTrainTarget); this.add(this.textTrainTarget);
} else if (ele == 'groupNumber') { } else if (ele == 'groupNumber') {
this.textTrainTargetNumber.setStyle('x', parseInt(model.point.x + style.Train.textTrainTargetNumber.trainTargetNumberOffset.x)); this.textTrainTargetNumber.setStyle('x', parseInt(model.point.x + fontNumber * model.fontSize * style.Train.common.aspectRatio + style.Train.common.textOffset));
fontNumber += (style.Train.trainTargetNumber.groupNumberPrefix || '').length;
this.add(this.textTrainTargetNumber); this.add(this.textTrainTargetNumber);
} }
}); });

View File

@ -28,6 +28,6 @@ export default class TrainBodyBox extends Group {
this.add(this.trainBodyBox); this.add(this.trainBodyBox);
} }
setColor(key, color) { setColor(key, color) {
this.train.setStyle(key, color); this.trainBodyBox.setStyle(key, color);
} }
} }

View File

@ -16,8 +16,9 @@ export default class Train extends Group {
this.z = 40; this.z = 40;
this.size = 0; this.size = 0;
this.section = null; this.section = null;
this.fontSize = style.Train.common.nameFontSize || style.Train.common.trainTextFontSize; this.fontSize = style.Train.common.useSelfText?style.Train.common.nameFontSize || style.Train.common.trainTextFontSize:model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize;
this.newScale = this.fontSize / style.Train.common.trainTextFontSize; this.newScale = this.fontSize / style.Train.common.trainTextFontSize;
this.nameFormat = style.Train.common.useSelfFormat?style.Train.trainBody.trainNameFormat:model.nameFormat || style.Train.trainBody.trainNameFormat;
this.create(); this.create();
this.setState(model); this.setState(model);
} }
@ -68,6 +69,7 @@ export default class Train extends Group {
runControlStatus: model.runControlStatus, runControlStatus: model.runControlStatus,
runStatus: model.runStatus, runStatus: model.runStatus,
fontSize: this.fontSize, fontSize: this.fontSize,
nameFormat: this.nameFormat,
type: model.type, type: model.type,
speed: model.speed, speed: model.speed,
maLen: model.maLen, maLen: model.maLen,
@ -290,24 +292,24 @@ export default class Train extends Group {
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
isChangeTrainWidth(model, style) { isChangeTrainWidth(model, style) {
if (!style.Train.trainBody.changeTrainWidth) { return; } if (!style.Train.trainBody.changeTrainWidth) { return; }
if (style.Train.trainBody.trainNameFormat) { if (this.nameFormat) {
const arr = style.Train.trainBody.trainNameFormat.split(':'); const arr = this.nameFormat.split(':');
arr.forEach(ele => { arr.forEach(ele => {
switch (ele) { switch (ele) {
case 'targetCode': { case 'targetCode': {
this.size += style.Train.trainNumber.targetCodePrefix.length || 0; this.size += (style.Train.trainNumber.targetCodePrefix || '').length;
break; break;
} }
case 'serviceNumber': { case 'serviceNumber': {
this.size += style.Train.trainServer.serviceNumberPrefix.length || 0; this.size += (style.Train.trainServer.serviceNumberPrefix || '').length;
break; break;
} }
case 'tripNumber': { case 'tripNumber': {
this.size += style.Train.trainTarget.tripNumberPrefix.length || 0; this.size += (style.Train.trainTarget.tripNumberPrefix || '').length;
break; break;
} }
case 'groupNumber': { case 'groupNumber': {
this.size += style.Train.trainTargetNumber.groupNumberPrefix.length || 0; this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length;
break; break;
} }
} }
@ -315,7 +317,7 @@ export default class Train extends Group {
} else { } else {
this.size = 9; this.size = 9;
} }
this.style.Train.common.trainWidth = this.size * this.fontSize * (2 / 3) -16; this.style.Train.common.trainWidth = this.size * this.fontSize * this.style.Train.common.aspectRatio + this.style.Train.common.trainWidthMoreText;
} }
removeTrainDetail() { removeTrainDetail() {
this.trainB && this.trainB.removeTrainDetail(); this.trainB && this.trainB.removeTrainDetail();

View File

@ -750,7 +750,9 @@ export default {
}, },
initMenu(menu) { initMenu(menu) {
this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode); this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
this.menu[2].children = this.initStationList(); if (this.menu[2]){
this.menu[2].children = this.initStationList();
}
this.clickEvent(); this.clickEvent();
this.closeMenu(true); this.closeMenu(true);
}, },

View File

@ -74,35 +74,34 @@ export default {
}; };
}, },
initMenu() { initMenu() {
// this.menuNormal = []; this.menuNormal = [];
// this.stationList.forEach(station => { // this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) { // if (station.code === station.concentrateStationCode) {
// let node = { // let node = {
// label: station.name, // label: station.name,
// children: [] // children: []
// } // }
//
// this.stationList.forEach(elem => { // this.stationList.forEach(elem => {
// if (elem.visible) { // if (elem.visible) {
// let next = elem; // let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { // while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); // next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// } // }
//
// if (station.code == next.code) { // if (station.code == next.code) {
// node.children.push({ // node.children.push({
// code: elem.code, // code: elem.code,
// label: elem.name, // label: elem.name,
// handler: this.mapLocation, // handler: this.mapLocation,
// }); // });
// } // }
// } // }
// }) // })
//
// this.menuNormal.push(node); // this.menuNormal.push(node);
// } // }
// }); // });
if (this.isScreen) { if (this.isScreen) {
this.menu = [...this.menuScreen]; this.menu = [...this.menuScreen];
} }

View File

@ -1,70 +1,75 @@
<template> <template>
<div v-if="show"> <div v-if="show">
<template v-if="maxmini"> <template v-if="maxmini">
<div class="nav"> <div class="nav">
<div class="cls-status" @click="touch('Close')" v-show="config.showClose"><span></span></div> <div v-show="config.showClose" class="cls-status" @click="touch('Close')"><span /></div>
<div class="min-status" @click="touch('Minim')"><span></span></div> <div class="min-status" @click="touch('Minim')"><span /></div>
</div> </div>
<el-table ref="table" :data="config.data" :highlight-current-row="config.highlightCurrentRow" <el-table
@current-change="handleChange" :height="height" border> ref="table"
<template v-for="item in config.columns"> :data="config.data"
<el-table-column :prop="item.prop" :label="item.label" :width="item.width"> :highlight-current-row="config.highlightCurrentRow"
</el-table-column> :height="height"
</template> border
</el-table> @current-change="handleChange"
>
<template v-for="(item,index) in config.columns">
<el-table-column :key="index" :prop="item.prop" :label="item.label" :width="item.width" />
</template> </template>
<template v-else> </el-table>
<div class="nav"> </template>
<div class=" max-status" @click="touch('Maxim')"><span></span></div> <template v-else>
</div> <div class="nav">
</template> <div class=" max-status" @click="touch('Maxim')"><span /></div>
</div> </div>
</template>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'DataTable', name: 'DataTable',
props: { props: {
height: { height: {
type: Number, type: Number,
required: true required: true
}, },
config: { config: {
type: Object, type: Object,
required: true, required: true
} }
}, },
data() { data() {
return { return {
show: true, show: true,
maxmini: true, maxmini: true,
touchStrategy: { touchStrategy: {
'Close': [false, true], 'Close': [false, true],
'Minim': [true, false], 'Minim': [true, false],
'Maxim': [true, true] 'Maxim': [true, true]
} }
} };
}, },
methods: { methods: {
handleChange(row) { handleChange(row) {
if (this.config.handleChange) { if (this.config.handleChange) {
this.config.handleChange(row); this.config.handleChange(row);
} }
}, },
setCurrentRow(row) { setCurrentRow(row) {
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
}, },
touch(operate) { touch(operate) {
this.$nextTick(() => { this.$nextTick(() => {
[this.show, this.maxmini] = this.touchStrategy[operate]; [this.show, this.maxmini] = this.touchStrategy[operate];
this.$emit('touch', this.maxmini); this.$emit('touch', this.maxmini);
}) });
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss" >
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
$height: 20px; $height: 20px;
$width: 20px; $width: 20px;
@ -85,7 +90,6 @@
line-height: $height; line-height: $height;
} }
/deep/ { /deep/ {
.el-table--border th.gutter { .el-table--border th.gutter {
background: #EBEADB !important; background: #EBEADB !important;
@ -119,7 +123,6 @@
font-size: smaller !important; font-size: smaller !important;
} }
} }
.current-row>td { .current-row>td {
@ -143,7 +146,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(45deg); transform: rotate(45deg);
} }
span::after { span::after {
@ -152,7 +155,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -170,7 +173,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -187,7 +190,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(0deg); transform: rotate(0deg);
} }
span::after { span::after {
@ -196,8 +199,8 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(90deg); transform: rotate(90deg);
} }
} }
} }
</style> </style>

View File

@ -1,152 +1,152 @@
<template> <template>
<el-dialog class="beijing-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule edit-planning-train"
<el-col :offset="10">列车线路</el-col> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="17"> :before-close="doClose"
<el-table :data="serviceData" border style="width: 100%" height="160"> :z-index="2000"
<el-table-column prop="startStationCode" label="起点站"> :modal="false"
</el-table-column> :close-on-click-modal="false"
<el-table-column prop="startStationStandCode" label="起点站台"> >
</el-table-column> <el-row>
<el-table-column prop="endStationCode" label="终点站"> <el-col :offset="10">列车线路</el-col>
</el-table-column> </el-row>
<el-table-column prop="endStationStandCode" label="终点站台"> <el-row>
</el-table-column> <el-col :span="17">
</el-table> <el-table :data="serviceData" border style="width: 100%" height="160">
</el-col> <el-table-column prop="startStationCode" label="起点站" />
<el-col :span="6" :offset="1"> <el-table-column prop="startStationStandCode" label="起点站台" />
<el-row type="flex" justify="center"> <el-table-column prop="endStationCode" label="终点站" />
<el-button class="view-button" @click="handleAddTask">加任务</el-button> <el-table-column prop="endStationStandCode" label="终点站台" />
</el-row> </el-table>
<el-row type="flex" justify="center"> </el-col>
<el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button> <el-col :span="6" :offset="1">
</el-row> <el-row type="flex" justify="center">
<el-row type="flex" justify="center"> <el-button class="view-button" @click="handleAddTask">加任务</el-button>
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
</el-row>
<div class="view-box">
<el-row type="flex" justify="center">
<el-radio-group v-model="storeInOut">
<el-radio :label="1">进库</el-radio>
<el-radio :label="2">出库</el-radio>
</el-radio-group>
</el-row>
</div>
</el-col>
</el-row>
<el-row class="view-box">
<el-col :span="9" style="padding-left: 10px">
<el-input v-model="oldServiceNumber" size="small" :disabled="true"></el-input>
</el-col>
<el-col :span="9" style="padding-left: 20px">
<el-input v-model="newServiceNumber" size="small"></el-input>
</el-col>
<el-col :span="5" style="padding-left: 20px">
<el-button @click="handleModifyingTripNumber" style="width: 150px;">改车次号</el-button>
</el-col>
</el-row>
<el-row style="margin-top: 10px">
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
<el-col :span="8">
<el-time-select v-model="serviceStartTime" size="small"></el-time-select>
</el-col>
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
<el-col :span="8">
<el-time-select v-model="serviceEndTime" size="small"></el-time-select>
</el-col>
</el-row>
<el-row style="margin-top: 20px">
<el-col :offset="10">线路详细信息</el-col>
</el-row>
<el-row>
<el-table :data="tripData" border style="width: 100%" height="200">
<el-table-column prop="arriveTime" label="到站时间">
</el-table-column>
<el-table-column prop="stationCode" label="车站">
</el-table-column>
<el-table-column prop="stationStandCode" label="站台">
</el-table-column>
<el-table-column prop="stopTime" label="停站时间">
</el-table-column>
<el-table-column prop="level" label="运行等级">
</el-table-column>
</el-table>
</el-row>
<el-row style="margin-top: 20px">
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
</el-row> </el-row>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-button @click="handleCommit"> </el-button> <el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button>
<el-button @click="doClose"> </el-button>
</el-row> </el-row>
</el-dialog> <el-row type="flex" justify="center">
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
</el-row>
<div class="view-box">
<el-row type="flex" justify="center">
<el-radio-group v-model="storeInOut">
<el-radio :label="1">进库</el-radio>
<el-radio :label="2">出库</el-radio>
</el-radio-group>
</el-row>
</div>
</el-col>
</el-row>
<el-row class="view-box">
<el-col :span="9" style="padding-left: 10px">
<el-input v-model="oldServiceNumber" size="small" :disabled="true" />
</el-col>
<el-col :span="9" style="padding-left: 20px">
<el-input v-model="newServiceNumber" size="small" />
</el-col>
<el-col :span="5" style="padding-left: 20px">
<el-button style="width: 150px;" @click="handleModifyingTripNumber">改车次号</el-button>
</el-col>
</el-row>
<el-row style="margin-top: 10px">
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
<el-col :span="8">
<el-time-select v-model="serviceStartTime" size="small" />
</el-col>
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
<el-col :span="8">
<el-time-select v-model="serviceEndTime" size="small" />
</el-col>
</el-row>
<el-row style="margin-top: 20px">
<el-col :offset="10">线路详细信息</el-col>
</el-row>
<el-row>
<el-table :data="tripData" border style="width: 100%" height="200">
<el-table-column prop="arriveTime" label="到站时间" />
<el-table-column prop="stationCode" label="车站" />
<el-table-column prop="stationStandCode" label="站台" />
<el-table-column prop="stopTime" label="停站时间" />
<el-table-column prop="level" label="运行等级" />
</el-table>
</el-row>
<el-row style="margin-top: 20px">
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
</el-row>
<el-row type="flex" justify="center">
<el-button @click="handleCommit"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'modifyingPlan', name: 'ModifyingPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
effect: false, effect: false,
storeInOut: '1', storeInOut: '1',
oldServiceNumber: '', oldServiceNumber: '',
newServiceNumber: '', newServiceNumber: '',
serviceStartTime: '', serviceStartTime: '',
serviceEndTime: '', serviceEndTime: '',
serviceData: [], serviceData: [],
tripData: [], tripData: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改' return '修改';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
formatTime(time) { formatTime(time) {
return formatTime(time); return formatTime(time);
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
// //
handleAddTask() { handleAddTask() {
this.$emit('dispatchDialog', { name: 'addTask', params: {} }) this.$emit('dispatchDialog', { name: 'addTask', params: {} });
}, },
// //
handleReplace() { handleReplace() {
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
}, },
// //
handleDeleteTask() { handleDeleteTask() {
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} }) this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
}, },
// //
handleModifyingTripNumber() { handleModifyingTripNumber() {
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
}, },
// //
handleCommit() { handleCommit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -157,13 +157,11 @@
margin-left: 0px; margin-left: 0px;
} }
.view-label { .view-label {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.view-box { .view-box {
padding: 10px 0px; padding: 10px 0px;
border: 1px inset gray; border: 1px inset gray;
@ -176,4 +174,4 @@
margin: 5px 20px; margin: 5px 20px;
} }
} }
</style> </style>

View File

@ -223,14 +223,14 @@ export default {
'$store.state.runPlan.planSizeCount': function () { '$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height }); this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
}, },
'$store.state.runPlan.select.serviceNumber': function (val) { '$store.state.runPlan.selected.serviceNumber': function (val) {
const index = this.serviceNumberConfig.data.findIndex(elem => { const index = this.serviceNumberConfig.data.findIndex(elem => {
return elem.serviceNumber == val; return elem.serviceNumber == val;
}); });
this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]); this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]);
}, },
'$store.state.runPlan.select.tripNumber': function (val) { '$store.state.runPlan.selected.tripNumber': function (val) {
const index = this.tripNumberConfig.data.findIndex(elem => { const index = this.tripNumberConfig.data.findIndex(elem => {
return elem.tripNumber == val; return elem.tripNumber == val;
}); });

View File

@ -1,95 +1,102 @@
<template> <template>
<data-table id="PlanStatusBar" ref="dataTable" :height="height-11" :config="stationListConfig" :close="false" <data-table
:style="{top: maxmini? maxTop-110+'px':maxTop-21+'px'}" @touch="touch"></data-table> id="PlanStatusBar"
ref="dataTable"
:height="height-11"
:config="stationListConfig"
:close="false"
:style="{top: maxmini? maxTop-110+'px':maxTop-21+'px'}"
@touch="touch"
/>
</template> </template>
<script> <script>
import DataTable from '../menusPlan/components/dataTable'; import DataTable from '../menusPlan/components/dataTable';
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'PlanStatusBar', name: 'PlanStatusBar',
props: { components: {
maxTop: { DataTable
type: Number, },
required: true props: {
} maxTop: {
}, type: Number,
components: { required: true
DataTable }
}, },
data() { data() {
return { return {
maxmini: true, maxmini: true,
height: 100, height: 100,
stationListConfig: { stationListConfig: {
data: [], data: [],
showClose: true, showClose: true,
highlightCurrentRow: true, highlightCurrentRow: true,
columns: [ columns: [
{ {
prop: 'stationName', prop: 'stationName',
label: '站台', label: '站台',
width: 400 width: 400
}, },
{ {
prop: 'startTime', prop: 'startTime',
label: '到点', label: '到点'
}, },
{ {
prop: 'stopTime', prop: 'stopTime',
label: '停站时间', label: '停站时间'
}, },
{ {
prop: 'endTime', prop: 'endTime',
label: '发点', label: '发点'
}, },
{ {
prop: 'level', prop: 'level',
label: '运行等级' label: '运行等级'
} }
] ]
} }
} };
}, },
watch: { watch: {
'$store.state.runPlan.select': function (select) { '$store.state.runPlan.selected': function (select) {
this.stationListConfig.data = []; this.stationListConfig.data = [];
let serviceObj = this.$store.state.runPlan.editData[select.serviceNumber]; const serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
if (serviceObj) { if (serviceObj) {
let trainMap = serviceObj.trainMap; const trainMap = serviceObj.trainMap;
if (trainMap) { if (trainMap) {
let trainObj = trainMap[select.tripNumber]; const trainObj = trainMap[select.tripNumber];
if (trainObj) { if (trainObj) {
let stationTimeList = trainObj.stationTimeList; const stationTimeList = trainObj.stationTimeList;
if (stationTimeList && stationTimeList.length) { if (stationTimeList && stationTimeList.length) {
stationTimeList.forEach((elem, index) => { stationTimeList.forEach((elem, index) => {
let stationObj = { const stationObj = {
stationName: formatName(elem.stationCode), stationName: formatName(elem.stationCode),
startTime: formatTime(index == 0 ? null : stationTimeList[index - 1].secondTime), startTime: formatTime(index == 0 ? null : stationTimeList[index - 1].secondTime),
stopTime: formatTime(index == 0 ? null : elem.secondTime - stationTimeList[index - 1].secondTime), stopTime: formatTime(index == 0 ? null : elem.secondTime - stationTimeList[index - 1].secondTime),
endTime: formatTime(elem.secondTime), endTime: formatTime(elem.secondTime),
level: '' level: ''
} };
this.stationListConfig.data.push(stationObj); this.stationListConfig.data.push(stationObj);
}); });
} }
} }
} }
} }
} }
}, },
methods: { methods: {
touch(maxmini) { touch(maxmini) {
this.maxmini = maxmini; this.maxmini = maxmini;
this.$emit('setPosition'); this.$emit('setPosition');
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
#PlanStatusBar { #PlanStatusBar {
@ -97,4 +104,4 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
} }
</style> </style>

View File

@ -76,21 +76,21 @@ export default {
}; };
}, },
initMenu() { initMenu() {
// this.menuNormal = []; this.menuNormal = [];
// this.stationList.forEach(station => { // this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) { // if (station.code === station.concentrateStationCode) {
// let node = { // let node = {
// label: station.name, // label: station.name,
// children: [] // children: []
// } // }
//
// this.stationList.forEach(elem => { // this.stationList.forEach(elem => {
// if (elem.visible) { // if (elem.visible) {
// let next = elem; // let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { // while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); // next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// } // }
//
// if (station.code == next.code) { // if (station.code == next.code) {
// node.children.push({ // node.children.push({
// code: elem.code, // code: elem.code,
@ -100,7 +100,7 @@ export default {
// } // }
// } // }
// }) // })
//
// this.menuNormal.push(node); // this.menuNormal.push(node);
// } // }
// }); // });

View File

@ -1,70 +1,75 @@
<template> <template>
<div v-if="show"> <div v-if="show">
<template v-if="maxmini"> <template v-if="maxmini">
<div class="nav"> <div class="nav">
<div class="cls-status" @click="touch('Close')" v-show="config.showClose"><span></span></div> <div v-show="config.showClose" class="cls-status" @click="touch('Close')"><span /></div>
<div class="min-status" @click="touch('Minim')"><span></span></div> <div class="min-status" @click="touch('Minim')"><span /></div>
</div> </div>
<el-table ref="table" :data="config.data" :highlight-current-row="config.highlightCurrentRow" <el-table
@current-change="handleChange" :height="height" border> ref="table"
<template v-for="item in config.columns"> :data="config.data"
<el-table-column :prop="item.prop" :label="item.label" :width="item.width"> :highlight-current-row="config.highlightCurrentRow"
</el-table-column> :height="height"
</template> border
</el-table> @current-change="handleChange"
>
<template v-for="(item,index) in config.columns">
<el-table-column :key="index" :prop="item.prop" :label="item.label" :width="item.width" />
</template> </template>
<template v-else> </el-table>
<div class="nav"> </template>
<div class=" max-status" @click="touch('Maxim')"><span></span></div> <template v-else>
</div> <div class="nav">
</template> <div class=" max-status" @click="touch('Maxim')"><span /></div>
</div> </div>
</template>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'DataTable', name: 'DataTable',
props: { props: {
height: { height: {
type: Number, type: Number,
required: true required: true
}, },
config: { config: {
type: Object, type: Object,
required: true, required: true
} }
}, },
data() { data() {
return { return {
show: true, show: true,
maxmini: true, maxmini: true,
touchStrategy: { touchStrategy: {
'Close': [false, true], 'Close': [false, true],
'Minim': [true, false], 'Minim': [true, false],
'Maxim': [true, true] 'Maxim': [true, true]
} }
} };
}, },
methods: { methods: {
handleChange(row) { handleChange(row) {
if (this.config.handleChange) { if (this.config.handleChange) {
this.config.handleChange(row); this.config.handleChange(row);
} }
}, },
setCurrentRow(row) { setCurrentRow(row) {
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
}, },
touch(operate) { touch(operate) {
this.$nextTick(() => { this.$nextTick(() => {
[this.show, this.maxmini] = this.touchStrategy[operate]; [this.show, this.maxmini] = this.touchStrategy[operate];
this.$emit('touch', this.maxmini); this.$emit('touch', this.maxmini);
}) });
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
$height: 20px; $height: 20px;
$width: 20px; $width: 20px;
@ -85,7 +90,6 @@
line-height: $height; line-height: $height;
} }
/deep/ { /deep/ {
.el-table--border th.gutter { .el-table--border th.gutter {
background: #EBEADB !important; background: #EBEADB !important;
@ -119,7 +123,6 @@
font-size: smaller !important; font-size: smaller !important;
} }
} }
.current-row>td { .current-row>td {
@ -143,7 +146,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(45deg); transform: rotate(45deg);
} }
span::after { span::after {
@ -152,7 +155,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -170,7 +173,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -187,7 +190,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(0deg); transform: rotate(0deg);
} }
span::after { span::after {
@ -196,8 +199,8 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(90deg); transform: rotate(90deg);
} }
} }
} }
</style> </style>

View File

@ -208,14 +208,14 @@
'$store.state.runPlan.planSizeCount': function () { '$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height }); this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
}, },
'$store.state.runPlan.select.serviceNumber': function (val) { '$store.state.runPlan.selected.serviceNumber': function (val) {
let index = this.serviceNumberConfig.data.findIndex(elem => { let index = this.serviceNumberConfig.data.findIndex(elem => {
return elem.serviceNumber == val; return elem.serviceNumber == val;
}) })
this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]); this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]);
}, },
'$store.state.runPlan.select.tripNumber': function (val) { '$store.state.runPlan.selected.tripNumber': function (val) {
let index = this.tripNumberConfig.data.findIndex(elem => { let index = this.tripNumberConfig.data.findIndex(elem => {
return elem.tripNumber == val; return elem.tripNumber == val;
}) })

View File

@ -54,7 +54,7 @@
} }
}, },
watch: { watch: {
'$store.state.runPlan.select': function (select) { '$store.state.runPlan.selected': function (select) {
this.stationListConfig.data = []; this.stationListConfig.data = [];
let serviceObj = this.$store.state.runPlan.editData[select.serviceNumber]; let serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
if (serviceObj) { if (serviceObj) {

View File

@ -1,70 +1,75 @@
<template> <template>
<div v-if="show"> <div v-if="show">
<template v-if="maxmini"> <template v-if="maxmini">
<div class="nav"> <div class="nav">
<div class="cls-status" @click="touch('Close')" v-show="config.showClose"><span></span></div> <div v-show="config.showClose" class="cls-status" @click="touch('Close')"><span /></div>
<div class="min-status" @click="touch('Minim')"><span></span></div> <div class="min-status" @click="touch('Minim')"><span /></div>
</div> </div>
<el-table ref="table" :data="config.data" :highlight-current-row="config.highlightCurrentRow" <el-table
@current-change="handleChange" :height="height" border> ref="table"
<template v-for="item in config.columns"> :data="config.data"
<el-table-column :prop="item.prop" :label="item.label" :width="item.width"> :highlight-current-row="config.highlightCurrentRow"
</el-table-column> :height="height"
</template> border
</el-table> @current-change="handleChange"
>
<template v-for="(item,index) in config.columns">
<el-table-column :key="index" :prop="item.prop" :label="item.label" :width="item.width" />
</template> </template>
<template v-else> </el-table>
<div class="nav"> </template>
<div class=" max-status" @click="touch('Maxim')"><span></span></div> <template v-else>
</div> <div class="nav">
</template> <div class=" max-status" @click="touch('Maxim')"><span /></div>
</div> </div>
</template>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'DataTable', name: 'DataTable',
props: { props: {
height: { height: {
type: Number, type: Number,
required: true required: true
}, },
config: { config: {
type: Object, type: Object,
required: true, required: true
} }
}, },
data() { data() {
return { return {
show: true, show: true,
maxmini: true, maxmini: true,
touchStrategy: { touchStrategy: {
'Close': [false, true], 'Close': [false, true],
'Minim': [true, false], 'Minim': [true, false],
'Maxim': [true, true] 'Maxim': [true, true]
} }
} };
}, },
methods: { methods: {
handleChange(row) { handleChange(row) {
if (this.config.handleChange) { if (this.config.handleChange) {
this.config.handleChange(row); this.config.handleChange(row);
} }
}, },
setCurrentRow(row) { setCurrentRow(row) {
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
}, },
touch(operate) { touch(operate) {
this.$nextTick(() => { this.$nextTick(() => {
[this.show, this.maxmini] = this.touchStrategy[operate]; [this.show, this.maxmini] = this.touchStrategy[operate];
this.$emit('touch', this.maxmini); this.$emit('touch', this.maxmini);
}) });
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
$height: 20px; $height: 20px;
$width: 20px; $width: 20px;
@ -85,7 +90,6 @@
line-height: $height; line-height: $height;
} }
/deep/ { /deep/ {
.el-table--border th.gutter { .el-table--border th.gutter {
background: #EBEADB !important; background: #EBEADB !important;
@ -119,7 +123,6 @@
font-size: smaller !important; font-size: smaller !important;
} }
} }
.current-row>td { .current-row>td {
@ -143,7 +146,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(45deg); transform: rotate(45deg);
} }
span::after { span::after {
@ -152,7 +155,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -170,7 +173,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -187,7 +190,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(0deg); transform: rotate(0deg);
} }
span::after { span::after {
@ -196,8 +199,8 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(90deg); transform: rotate(90deg);
} }
} }
} }
</style> </style>

View File

@ -223,14 +223,14 @@ export default {
'$store.state.runPlan.planSizeCount': function () { '$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height }); this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
}, },
'$store.state.runPlan.select.serviceNumber': function (val) { '$store.state.runPlan.selected.serviceNumber': function (val) {
const index = this.serviceNumberConfig.data.findIndex(elem => { const index = this.serviceNumberConfig.data.findIndex(elem => {
return elem.serviceNumber == val; return elem.serviceNumber == val;
}); });
this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]); this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]);
}, },
'$store.state.runPlan.select.tripNumber': function (val) { '$store.state.runPlan.selected.tripNumber': function (val) {
const index = this.tripNumberConfig.data.findIndex(elem => { const index = this.tripNumberConfig.data.findIndex(elem => {
return elem.tripNumber == val; return elem.tripNumber == val;
}); });

View File

@ -54,7 +54,7 @@
} }
}, },
watch: { watch: {
'$store.state.runPlan.select': function (select) { '$store.state.runPlan.selected': function (select) {
this.stationListConfig.data = []; this.stationListConfig.data = [];
let serviceObj = this.$store.state.runPlan.editData[select.serviceNumber]; let serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
if (serviceObj) { if (serviceObj) {

File diff suppressed because it is too large Load Diff

View File

@ -1,108 +1,114 @@
<template> <template>
<el-dialog :title="title" class="fuzhou-01__schedule choose-plan-template" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> :title="title"
</QueryListPage> class="fuzhou-01__schedule choose-plan-template"
<el-row type="flex" justify="center" class="button-group"> :visible.sync="dialogShow"
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button> width="80%"
<el-button @click="dialogShow = false"> </el-button> :before-close="doClose"
</el-row> :modal="false"
</el-dialog> :close-on-click-modal="false"
>
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-row type="flex" justify="center" class="button-group">
<el-button type="primary" :loading="loading" @click="handleConfirm"> </el-button>
<el-button @click="dialogShow = false"> </el-button>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getSkinStyleList } from '@/api/management/mapskin' import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'ChooseTemplatePlan', name: 'ChooseTemplatePlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '100px', labelWidth: '100px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '选择模板运行图' return '选择模板运行图';
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinStyle'] = this.$store.getters['map/skinStyle']; params['skinStyle'] = this.$store.getters['map/skinStyle'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
handleConfirm() { handleConfirm() {
this.doClose(); this.doClose();
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose) { if (choose) {
this.$emit('chooseConfirm', choose); this.$emit('chooseConfirm', choose);
} else { } else {
this.$messageBox(`请选择模板运行图`); this.$messageBox(`请选择模板运行图`);
} }
} }
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
</style> </style>

View File

@ -1,70 +1,75 @@
<template> <template>
<div v-if="show"> <div v-if="show">
<template v-if="maxmini"> <template v-if="maxmini">
<div class="nav"> <div class="nav">
<div class="cls-status" @click="touch('Close')" v-show="config.showClose"><span></span></div> <div v-show="config.showClose" class="cls-status" @click="touch('Close')"><span /></div>
<div class="min-status" @click="touch('Minim')"><span></span></div> <div class="min-status" @click="touch('Minim')"><span /></div>
</div> </div>
<el-table ref="table" :data="config.data" :highlight-current-row="config.highlightCurrentRow" <el-table
@current-change="handleChange" :height="height" border> ref="table"
<template v-for="item in config.columns"> :data="config.data"
<el-table-column :prop="item.prop" :label="item.label" :width="item.width"> :highlight-current-row="config.highlightCurrentRow"
</el-table-column> :height="height"
</template> border
</el-table> @current-change="handleChange"
>
<template v-for="(item,index) in config.columns">
<el-table-column :key="index" :prop="item.prop" :label="item.label" :width="item.width" />
</template> </template>
<template v-else> </el-table>
<div class="nav"> </template>
<div class=" max-status" @click="touch('Maxim')"><span></span></div> <template v-else>
</div> <div class="nav">
</template> <div class=" max-status" @click="touch('Maxim')"><span /></div>
</div> </div>
</template>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'DataTable', name: 'DataTable',
props: { props: {
height: { height: {
type: Number, type: Number,
required: true required: true
}, },
config: { config: {
type: Object, type: Object,
required: true, required: true
} }
}, },
data() { data() {
return { return {
show: true, show: true,
maxmini: true, maxmini: true,
touchStrategy: { touchStrategy: {
'Close': [false, true], 'Close': [false, true],
'Minim': [true, false], 'Minim': [true, false],
'Maxim': [true, true] 'Maxim': [true, true]
} }
} };
}, },
methods: { methods: {
handleChange(row) { handleChange(row) {
if (this.config.handleChange) { if (this.config.handleChange) {
this.config.handleChange(row); this.config.handleChange(row);
} }
}, },
setCurrentRow(row) { setCurrentRow(row) {
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
}, },
touch(operate) { touch(operate) {
this.$nextTick(() => { this.$nextTick(() => {
[this.show, this.maxmini] = this.touchStrategy[operate]; [this.show, this.maxmini] = this.touchStrategy[operate];
this.$emit('touch', this.maxmini); this.$emit('touch', this.maxmini);
}) });
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
$height: 20px; $height: 20px;
$width: 20px; $width: 20px;
@ -85,7 +90,6 @@
line-height: $height; line-height: $height;
} }
/deep/ { /deep/ {
.el-table--border th.gutter { .el-table--border th.gutter {
background: #EBEADB !important; background: #EBEADB !important;
@ -119,7 +123,6 @@
font-size: smaller !important; font-size: smaller !important;
} }
} }
.current-row>td { .current-row>td {
@ -143,7 +146,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(45deg); transform: rotate(45deg);
} }
span::after { span::after {
@ -152,7 +155,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -170,7 +173,7 @@
width: 2px; width: 2px;
height: 12px; height: 12px;
vertical-align: middle; vertical-align: middle;
-webkit-transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }
@ -187,7 +190,7 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(0deg); transform: rotate(0deg);
} }
span::after { span::after {
@ -196,8 +199,8 @@
background: black; background: black;
width: 2px; width: 2px;
height: 12px; height: 12px;
-webkit-transform: rotate(90deg); transform: rotate(90deg);
} }
} }
} }
</style> </style>

View File

@ -1,142 +1,147 @@
<template> <template>
<el-dialog :title="title" class="fuzhou-01__schedule reload-today-plan" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> :title="title"
</QueryListPage> class="fuzhou-01__schedule reload-today-plan"
<el-row type="flex" justify="center" class="button-group"> :visible.sync="dialogShow"
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button> width="80%"
<el-button @click="dialogShow = false"> </el-button> :before-close="doClose"
</el-row> :modal="false"
</el-dialog> :close-on-click-modal="false"
>
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-row type="flex" justify="center" class="button-group">
<el-button type="primary" :loading="loading" @click="handleConfirm"> </el-button>
<el-button @click="dialogShow = false"> </el-button>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { listPublishMap } from '@/api/jmap/mapdraft'; import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
import { runPlanTemplateList, deleteRunPlanTemplate, generateUserRunPlanEveryDay } from '@/api/runplan'; import { getStationListBySkinStyle } from '@/api/runplan';
import { getStationListBySkinStyle } from '@/api/runplan'; import { getEveryDayRunPlanData } from '@/api/simulation';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getSkinStyleList } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin'
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'ReloadTodayPlan', name: 'ReloadTodayPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '100px', labelWidth: '100px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '加载当天计划' return '加载当天计划';
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinStyle'] = this.$store.getters['map/skinStyle']; params['skinStyle'] = this.$store.getters['map/skinStyle'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
// //
handleConfirm() { handleConfirm() {
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => { generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable() this.reloadTable();
this.loadRunData(); this.loadRunData();
this.doClose(); this.doClose();
this.$message.success(`生成用户每日运行图成功`); this.$message.success(`生成用户每日运行图成功`);
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.reloadTable() this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`); this.$messageBox(`生成用户每日运行图失败`);
}) });
} else { } else {
this.$messageBox(`请选择需要加载的运行图`); this.$messageBox(`请选择需要加载的运行图`);
} }
} }
}, },
loadRunData() { loadRunData() {
let skinStyle = this.$route.query.skinStyle; const skinStyle = this.$route.query.skinStyle;
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
if (skinStyle) { if (skinStyle) {
getStationListBySkinStyle(skinStyle).then(response => { getStationListBySkinStyle(skinStyle).then(response => {
let stations = response.data; const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle); this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => { getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(error => { }).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []); this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`); this.$messageBox(`获取运行图数据失败`);
}) });
}) });
}).catch(error => { }).catch(() => {
this.$messageBox(`获取车站列表失败`); this.$messageBox(`获取车站列表失败`);
}); });
} }
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
</style> </style>

View File

@ -1,4 +1,4 @@
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, formatTime, convertSheetToList } from '@/utils/runPlan'; import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
export default { export default {
/** 边缘高度*/ /** 边缘高度*/
@ -64,7 +64,7 @@ export default {
} }
/** 设置标志*/ /** 设置标志*/
[need, flag] = [true, false]; [need, flag] = [true, true];
} else if (reg2.test(value)) { } else if (reg2.test(value)) {
/** 含有特殊字符的时间格式*/ /** 含有特殊字符的时间格式*/
[, begTime, endTime] = reg2.exec(value); [, begTime, endTime] = reg2.exec(value);
@ -101,8 +101,8 @@ export default {
stationName: stationName stationName: stationName
}; };
if (begTime) { stationObj['arriveTime'] = formatTime(begTime); } if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
if (endTime) { stationObj['departureTime'] = formatTime(endTime); } if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
if (flag) { stationObj['flag'] = flag; } if (flag) { stationObj['flag'] = flag; }
JsonData[JsonData.length - 1].arrivalList.push(stationObj); JsonData[JsonData.length - 1].arrivalList.push(stationObj);
} }

View File

@ -1,102 +1,98 @@
<template> <template>
<div class="plan-schedule" style="width: 100%"> <div class="plan-schedule" style="width: 100%">
<title-bar ref="titleBar" @back="back"></title-bar> <title-bar ref="titleBar" @back="back" />
<menu-bar ref="menuBar" :skinStyle="skinStyle" @dispatchDialog="dispatchDialog"></menu-bar> <menu-bar ref="menuBar" :skin-style="skinStyle" @dispatchDialog="dispatchDialog" />
<!-- <menu-tool ref="menuTool" :skinStyle="skinStyle"></menu-tool> --> <schedule ref="schedule" :skin-style="skinStyle" :group="group" :max-height="height" :max-width="width" />
<schedule ref="schedule" :skinStyle="skinStyle" :group="group" :maxHeight="height" :maxWidth="width"> <status-bar ref="statusBar" :max-top="height" @setPosition="setPosition" />
</schedule>
<status-bar ref="statusBar" :maxTop="height" @setPosition="setPosition"></status-bar>
<manage-plan-list ref="managePlanList" @dispatchDialog="dispatchDialog"></manage-plan-list> <manage-plan-list ref="managePlanList" @dispatchDialog="dispatchDialog" />
<create-week-plan ref="createWeekPlan" @reloadTable="reloadTable"></create-week-plan> <create-week-plan ref="createWeekPlan" @reloadTable="reloadTable" />
<create-today-plan ref="createTodayPlan"></create-today-plan> <create-today-plan ref="createTodayPlan" />
<modifying-plan ref="modifyingPlan" @dispatchDialog="dispatchDialog"></modifying-plan> <modifying-plan ref="modifyingPlan" @dispatchDialog="dispatchDialog" />
<add-task ref="addTask"></add-task> <add-task ref="addTask" />
<delete-task ref="deleteTask"></delete-task> <delete-task ref="deleteTask" />
<modifying-task ref="modifyingTask"></modifying-task> <modifying-task ref="modifyingTask" />
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import TitleBar from './titleBar';
import TitleBar from './titleBar'; import MenuBar from './menuBar';
import MenuBar from './menuBar'; import StatusBar from './statusBar';
import MenuTool from './menuTool'; import Schedule from './schedule';
import StatusBar from './statusBar'; import ManagePlanList from '../menusPlan/managePlanList';
import Schedule from './schedule'; import CreateWeekPlan from '../menusPlan/createWeekPlan';
import ManagePlanList from '../menusPlan/managePlanList' import CreateTodayPlan from '../menusPlan/createTodayPlan';
import CreateWeekPlan from '../menusPlan/createWeekPlan'; import ModifyingPlan from '../menusPlan/modifyingPlan';
import CreateTodayPlan from '../menusPlan/createTodayPlan'; import AddTask from '../menusPlan/addTask';
import ModifyingPlan from '../menusPlan/modifyingPlan'; import DeleteTask from '../menusPlan/deleteTask';
import AddTask from '../menusPlan/addTask'; import ModifyingTask from '../menusPlan/modifyingTask';
import DeleteTask from '../menusPlan/deleteTask' import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import ModifyingTask from '../menusPlan/modifyingTask';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default { export default {
name: 'Menus', name: 'Menus',
mixins: [ components: {
WindowResizeHandler TitleBar,
], MenuBar,
props: { StatusBar,
group: { Schedule,
type: String ManagePlanList,
} CreateWeekPlan,
}, CreateTodayPlan,
components: { ModifyingPlan,
TitleBar, AddTask,
MenuBar, DeleteTask,
MenuTool, ModifyingTask
StatusBar, },
Schedule, mixins: [
ManagePlanList, WindowResizeHandler
CreateWeekPlan, ],
CreateTodayPlan, props: {
ModifyingPlan, group: {
AddTask, type: String,
DeleteTask, required: true
ModifyingTask }
}, },
data() { data() {
return { return {
width: 0, width: 0,
height: 0 height: 0
} };
}, },
computed: { computed: {
skinStyle() { skinStyle() {
return this.$route.query.skinStyle || '02'; return this.$route.query.skinStyle || '02';
} }
}, },
methods: { methods: {
resizeHandler() { resizeHandler() {
this.width = this._clientWidth; this.width = this._clientWidth;
this.height = this._clientHeight; this.height = this._clientHeight;
}, },
setPosition() { setPosition() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.schedule.setPosition(); this.$refs.schedule.setPosition();
}) });
}, },
dispatchDialog(dialogObj) { dispatchDialog(dialogObj) {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs[dialogObj.name]) { if (this.$refs[dialogObj.name]) {
this.$refs[dialogObj.name].doShow(dialogObj.params); this.$refs[dialogObj.name].doShow(dialogObj.params);
} }
}) });
}, },
reloadTable(dialogObj) { reloadTable(dialogObj) {
if (this.$refs[dialogObj.name]) { if (this.$refs[dialogObj.name]) {
this.$refs[dialogObj.name].reloadTable(); this.$refs[dialogObj.name].reloadTable();
} }
}, },
confirm(params) { confirm(params) {
}, },
back() { back() {
this.$emit('back'); this.$emit('back');
} }
} }
} };
</script> </script>
<style> <style>
@ -207,7 +203,6 @@
background: #ECE9D8 !important; background: #ECE9D8 !important;
} }
.fuzhou-01__schedule .el-dialog .el-button { .fuzhou-01__schedule .el-dialog .el-button {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
@ -244,7 +239,6 @@
text-align: center !important; text-align: center !important;
} }
.fuzhou-01__schedule .el-dialog .el-input { .fuzhou-01__schedule .el-dialog .el-input {
border: 2px inset #E9E9E9; border: 2px inset #E9E9E9;
} }
@ -410,4 +404,4 @@
background: #E9E9E9 !important; background: #E9E9E9 !important;
color: #000 !important; color: #000 !important;
} }
</style> </style>

View File

@ -1,172 +0,0 @@
<template>
<div id="PlanMenuTool">
<div class="nav">
<div class="tool" v-for="(item,index) in tools" :key="index">
<img :src="item.src" :alt="item.title" />
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { prefixIntrger } from '@/utils/date';
import logo_ from '@/assets/logo_.png';
export default {
name: 'PlanMenuTool',
data() {
return {
tools: [
{
title: '服务器1',
operate: '',
src: logo_,
click: this.undeveloped,
},
{
title: '服务器2',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '前置机1',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '前置机2',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '主调',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '调度台1',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '调度台2',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '调度台3',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '大屏',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '维护工作站',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '运行图显示人工站',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '跳停',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '扣车',
operate: '',
src: '',
click: this.undeveloped,
},
{
title: '列车报警',
operate: '',
src: logo_,
click: this.undeveloped,
}
]
}
},
watch: {
'$store.state.training.initTime': function (initTime) {
let date = new Date(initTime);
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`
}
},
computed: {
isShowSystemTime() {
return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode;
}
},
mounted() {
this.initTools();
},
methods: {
initTools() {
this.tools = [];
}
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
$top: 48px;
$width: 25px;
$height: 25px;
#PlanMenuTool {
z-index: 5;
position: absolute;
width: 100%;
top: $top;
}
.nav {
display: block;
color: #0000;
background: #EBEADB;
border: 1px solid #B6BCCC !important;
border-bottom: 2px solid #B6BCCC !important;
list-style: none;
height: $height;
line-height: $height;
}
.tool {
padding-left: 10px;
display: flex;
justify-content: center;
cursor: pointer;
position: relative;
float: left;
margin: 1px;
width: $width;
img {
display: block;
text-align: center;
padding-top: 2px;
height: $height - 5;
width: $width - 5;
}
}
</style>

View File

@ -1,473 +1,482 @@
<template> <template>
<div id="PlanSchedule" :style="{top: top+'px', height: height+'px'}"> <div id="PlanSchedule" :style="{top: top+'px', height: height+'px'}">
<div class="left"> <div class="left">
<div :id="runPlanId"></div> <div :id="runPlanId" />
</div>
<div class="right">
<data-table ref="serviceTable" :height="height/2" :config="serviceNumberConfig" @touch="scheduleTouch"
:style="{top: top-height/2+'px'}"></data-table>
<data-table ref="tripTable" :height="height/2" :config="tripNumberConfig" @touch="trainNumTouch"
:style="{top: top-height/2+'px'}"></data-table>
</div>
</div> </div>
<div class="right">
<data-table
ref="serviceTable"
:height="height/2"
:config="serviceNumberConfig"
:style="{top: top-height/2+'px'}"
@touch="scheduleTouch"
/>
<data-table
ref="tripTable"
:height="height/2"
:config="tripNumberConfig"
:style="{top: top-height/2+'px'}"
@touch="trainNumTouch"
/>
</div>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { runDiagramGetTime } from '@/api/simulation'; import { runDiagramGetTime } from '@/api/simulation';
import { getStationListBySkinStyle } from '@/api/runplan'; import DataTable from '../menusPlan/components/dataTable';
import DataTable from '../menusPlan/components/dataTable';
export default { export default {
name: 'PlanSchedule', name: 'PlanSchedule',
props: { components: {
group: { DataTable
type: String, },
required: true props: {
}, group: {
skinStyle: { type: String,
type: String, required: true
required: true },
}, skinStyle: {
maxWidth: { type: String,
type: Number, required: true
require: true },
}, maxWidth: {
maxHeight: { type: Number,
type: Number, required: true
required: true },
} maxHeight: {
}, type: Number,
components: { required: true
DataTable }
}, },
data() { data() {
return { return {
top: 0, top: 0,
height: 0, height: 0,
heights: [100, 100], heights: [100, 100],
runPlanId: 'plan-schedule-id', runPlanId: 'plan-schedule-id',
myChart: null, myChart: null,
PlanConvert: {}, PlanConvert: {},
serviceNumberConfig: { serviceNumberConfig: {
data: [], data: [],
highlightCurrentRow: true, highlightCurrentRow: true,
handleChange: this.serviceNumberChange, handleChange: this.serviceNumberChange,
showClose: false, showClose: false,
columns: [ columns: [
{ {
prop: 'serviceNumber', prop: 'serviceNumber',
label: '表号', label: '表号'
}, },
{ {
width: 40 width: 40
} }
] ]
}, },
tripNumberConfig: { tripNumberConfig: {
data: [], data: [],
highlightCurrentRow: true, highlightCurrentRow: true,
handleChange: this.tripNumberChange, handleChange: this.tripNumberChange,
showClose: false, showClose: false,
columns: [ columns: [
{ {
prop: 'tripNumber', prop: 'tripNumber',
label: '车次号', label: '车次号'
}, },
{ {
width: 40 width: 40
} }
] ]
}, },
realData: {}, realData: {},
kmRangeCoordMap: {}, kmRangeCoordMap: {},
option: { option: {
title: { title: {
text: '', text: '',
left: 'center' left: 'center'
}, },
grid: { grid: {
top: '30px', top: '30px',
left: '120px', left: '120px',
right: '40px', right: '40px',
bottom: '65px', bottom: '65px',
containLabel: true, containLabel: true,
backgroundColor: 'floralwhite' backgroundColor: 'floralwhite'
}, },
toolbox: { toolbox: {
right: '30px', right: '30px',
feature: { feature: {
dataZoom: { dataZoom: {
yAxisIndex: 'none' yAxisIndex: 'none'
}, },
restore: {}, restore: {},
saveAsImage: {} saveAsImage: {}
} }
}, },
tooltip: { tooltip: {
axisPointer: { axisPointer: {
trigger: 'item', trigger: 'item',
type: 'cross' type: 'cross'
}, },
formatter: this.axisTooltip, formatter: this.axisTooltip,
borderWidth: 1, borderWidth: 1
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: [], data: [],
axisLine: { axisLine: {
onZero: false, onZero: false,
lineStyle: { lineStyle: {
width: 2, width: 2,
color: '#d14a61' color: '#d14a61'
} }
}, },
axisLabel: { axisLabel: {
formatter: this.xAxisLableFormat, formatter: this.xAxisLableFormat,
textStyle: { textStyle: {
color: '#333' color: '#333'
} }
}, },
axisPointer: { axisPointer: {
snap: true, snap: true,
label: { label: {
formatter: this.xAxisPointFormat, formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)', backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white', color: 'white'
} }
} }
} }
], ],
yAxis: { yAxis: {
type: 'value', type: 'value',
splitLine: { splitLine: {
show: false show: false
}, },
axisTick: { axisTick: {
show: false, show: false
}, },
axisLine: { axisLine: {
onZero: false, onZero: false,
lineStyle: { lineStyle: {
width: 2, width: 2,
color: '#d14a61' color: '#d14a61'
} }
}, },
axisLabel: { axisLabel: {
interval: 'auto', interval: 'auto',
formatter: this.yAxisLableFormat, formatter: this.yAxisLableFormat
}, },
axisPointer: { axisPointer: {
xAxisIndex: 'all', xAxisIndex: 'all',
label: { label: {
formatter: this.yAxisPointFormat, formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)', backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white', color: 'white'
} }
}, },
min: 0, min: 0,
max: 0, max: 0
}, },
series: [], series: [],
dataZoom: [ dataZoom: [
{ {
type: 'inside', type: 'inside'
}, },
{ {
fiterMode: 'filter', fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z', handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%', handleSize: '80%',
handleStyle: { handleStyle: {
color: '#fff', color: '#fff',
shadowBlur: 3, shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)', shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2, shadowOffsetX: 2,
shadowOffsetY: 2 shadowOffsetY: 2
}, },
bottom: '20px' bottom: '20px'
} }
] ]
}, },
absoluteTime: 2 * 3600, absoluteTime: 2 * 3600,
indexKmRangeMap: {} indexKmRangeMap: {}
} };
}, },
watch: { computed: {
maxWidth() { ...mapGetters('runPlan', [
this.setPosition(); 'stations'
}, ])
maxHeight() { },
this.setPosition(); watch: {
}, maxWidth() {
'$store.state.runPlan.planLoadedCount': async function () { this.setPosition();
await this.loadChartPage(); },
}, maxHeight() {
'$store.state.runPlan.planSizeCount': function () { this.setPosition();
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height }); },
}, '$store.state.runPlan.planLoadedCount': async function () {
'$store.state.runPlan.select.serviceNumber': function (val) { await this.loadChartPage();
let index = this.serviceNumberConfig.data.findIndex(elem => { },
return elem.serviceNumber == val; '$store.state.runPlan.planSizeCount': function () {
}) this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
},
'$store.state.runPlan.selected.serviceNumber': function (val) {
const index = this.serviceNumberConfig.data.findIndex(elem => {
return elem.serviceNumber == val;
});
this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]); this.$refs.serviceTable.setCurrentRow(this.serviceNumberConfig.data[index]);
}, },
'$store.state.runPlan.select.tripNumber': function (val) { '$store.state.runPlan.selected.tripNumber': function (val) {
let index = this.tripNumberConfig.data.findIndex(elem => { const index = this.tripNumberConfig.data.findIndex(elem => {
return elem.tripNumber == val; return elem.tripNumber == val;
}) });
this.$refs.tripTable.setCurrentRow(this.tripNumberConfig.data[index]); this.$refs.tripTable.setCurrentRow(this.tripNumberConfig.data[index]);
} }
}, },
computed: { mounted() {
...mapGetters('runPlan', [ this.PlanConvert = this.$theme.loadPlanConvert(this.skinStyle);
'stations' },
]) beforeDestroy() {
}, this.destroy();
mounted() { },
this.PlanConvert = this.$theme.loadPlanConvert(this.skinStyle); methods: {
}, serviceNumberChange(row) {
beforeDestroy() { if (row) {
this.destroy(); this.$store.dispatch('runPlan/setSelected', { serviceNumber: row.serviceNumber, tripNumber: null });
}, const serviceObj = this.$store.state.runPlan.editData[row.serviceNumber];
methods: { if (serviceObj) {
serviceNumberChange(row) { this.analyticalTripNumber(serviceObj.trainMap);
if (row) { }
this.$store.dispatch('runPlan/setSelected', { serviceNumber: row.serviceNumber, tripNumber: null }); }
let serviceObj = this.$store.state.runPlan.editData[row.serviceNumber] },
if (serviceObj) { tripNumberChange(row) {
this.analyticalTripNumber(serviceObj.trainMap); if (row) {
} this.$store.dispatch('runPlan/setSelected', { serviceNumber: this.$store.state.runPlan.selected.serviceNumber, tripNumber: row.tripNumber });
} }
}, },
tripNumberChange(row) { async analyticalServiceNumber(data) {
if (row) { this.serviceNumberConfig.data = Object.keys(data || {})
this.$store.dispatch('runPlan/setSelected', { serviceNumber: this.$store.state.runPlan.selected.serviceNumber, tripNumber: row.tripNumber }); .sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
} .map(serviceNumber => { return { serviceNumber }; });
}, },
async analyticalServiceNumber(data) { async analyticalTripNumber(data) {
this.serviceNumberConfig.data = Object.keys(data || {}) this.tripNumberConfig.data = Object.keys(data || {})
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex }) .sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
.map(serviceNumber => { return { serviceNumber } }); .map(tripNumber => { return { tripNumber }; });
}, },
async analyticalTripNumber(data) { async setPosition() {
this.tripNumberConfig.data = Object.keys(data || {}) this.$nextTick(() => {
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex }) let top = 3;
.map(tripNumber => { return { tripNumber } }); const width = this.maxWidth * 0.85;
}, let height = this.maxHeight;
async setPosition() {
this.$nextTick(() => {
let top = 3;
let width = this.maxWidth * 0.85;
let height = this.maxHeight;
let titleBar = document.getElementById('PlanTitleBar'); const titleBar = document.getElementById('PlanTitleBar');
let menuBar = document.getElementById('PlanMenuBar'); const menuBar = document.getElementById('PlanMenuBar');
let menuTool = document.getElementById('PlanMenuTool'); const menuTool = document.getElementById('PlanMenuTool');
let statusBar = document.getElementById('PlanStatusBar'); const statusBar = document.getElementById('PlanStatusBar');
if (titleBar) { if (titleBar) {
top += (titleBar.offsetHeight || 0); top += (titleBar.offsetHeight || 0);
} }
if (menuBar) { if (menuBar) {
top += (menuBar.offsetHeight || 0); top += (menuBar.offsetHeight || 0);
} }
if (menuTool) { if (menuTool) {
top += (menuTool.offsetHeight || 0); top += (menuTool.offsetHeight || 0);
} }
if (statusBar) { if (statusBar) {
height -= (statusBar.offsetHeight || 0); height -= (statusBar.offsetHeight || 0);
} }
height = height - top; height = height - top;
this.$store.dispatch('runPlan/resize', { width, height }); this.$store.dispatch('runPlan/resize', { width, height });
if (this.top != top) { if (this.top != top) {
this.top = top; this.top = top;
} }
if (this.height != height) { if (this.height != height) {
this.height = height - 20 * 2; this.height = height - 20 * 2;
} }
}) });
}, },
async loadChartPage() { async loadChartPage() {
try { try {
let series = []; let series = [];
let planData = this.$store.state.runPlan.planData || []; const planData = this.$store.state.runPlan.planData || [];
let stations = this.$store.state.runPlan.stations || []; const stations = this.$store.state.runPlan.stations || [];
this.viewDisabled = true; this.viewDisabled = true;
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations); this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
series = this.pushModels(series, [this.PlanConvert.initializeYaxis(stations)]); series = this.pushModels(series, [this.PlanConvert.initializeYaxis(stations)]);
series = this.pushModels(series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5 })); series = this.pushModels(series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5 }));
await this.loadInitData(series); await this.loadInitData(series);
await this.analyticalServiceNumber(this.$store.state.runPlan.editData); await this.analyticalServiceNumber(this.$store.state.runPlan.editData);
this.viewDisabled = false; this.viewDisabled = false;
} catch (error) { } catch (error) {
this.viewDisabled = false; this.viewDisabled = false;
this.$messageBox(`加载运行图数据失败`); this.$messageBox(`加载运行图数据失败`);
} }
}, },
async loadInitData(series) { async loadInitData(series) {
this.myChart && this.myChart.showLoading(); this.myChart && this.myChart.showLoading();
await this.xAxisInit(); await this.xAxisInit();
await this.yAxisInit(); await this.yAxisInit();
await this.loadInitChart(series); await this.loadInitChart(series);
this.myChart && this.myChart.hideLoading(); this.myChart && this.myChart.hideLoading();
}, },
pushModels(series, models) { pushModels(series, models) {
if (models && models.length) { if (models && models.length) {
models.forEach(elem => { models.forEach(elem => {
if (elem) { if (elem) {
series.push(elem); series.push(elem);
} }
}) });
} }
return series; return series;
}, },
popModels(series, models) { popModels(series, models) {
if (models && models.length) { if (models && models.length) {
models.forEach(elem => { models.forEach(elem => {
let index = series.indexOf(elem); const index = series.indexOf(elem);
if (index >= 0) { if (index >= 0) {
series.split(index, 1); series.split(index, 1);
} }
}) });
} }
return series; return series;
}, },
loadInitChart(series) { loadInitChart(series) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
let that = this; const that = this;
//echart // echart
require.config( require.config(
{ {
paths: { paths: {
echarts: './js/dist' echarts: './js/dist'
} }
} }
); );
// //
require( require(
[ [
'echarts', 'echarts',
'echarts/lib/chart/line', 'echarts/lib/chart/line'
], ],
function (ec) { function (ec) {
that.destroy(); that.destroy();
let startValue = 3600 + that.PlanConvert.TranslationTime; let startValue = 3600 + that.PlanConvert.TranslationTime;
let offsetTime = 3600; const offsetTime = 3600;
runDiagramGetTime(that.group).then(resp => { runDiagramGetTime(that.group).then(resp => {
startValue = resp.data - that.PlanConvert.TranslationTime; startValue = resp.data - that.PlanConvert.TranslationTime;
that.option.dataZoom[0].startValue = that.option.dataZoom[1].startValue = startValue - offsetTime; that.option.dataZoom[0].startValue = that.option.dataZoom[1].startValue = startValue - offsetTime;
that.option.dataZoom[0].endValue = that.option.dataZoom[1].endValue = startValue + offsetTime; that.option.dataZoom[0].endValue = that.option.dataZoom[1].endValue = startValue + offsetTime;
that.option.series = series; that.option.series = series;
that.myChart = ec.init(document.getElementById(that.runPlanId)); that.myChart = ec.init(document.getElementById(that.runPlanId));
if (that.myChart) { if (that.myChart) {
that.myChart.setOption(that.option); that.myChart.setOption(that.option);
that.reSize({ width: that.$store.state.runPlan.width, height: that.$store.state.runPlan.height }); that.reSize({ width: that.$store.state.runPlan.width, height: that.$store.state.runPlan.height });
that.myChart.on('click', that.mouseClick); that.myChart.on('click', that.mouseClick);
} }
resolve(true); resolve(true);
}) });
} }
); );
} catch (error) { } catch (error) {
reject(error); reject(error);
} }
}); });
}, },
xAxisPointFormat(params) { xAxisPointFormat(params) {
return timeFormat(params.value); return timeFormat(params.value);
}, },
yAxisPointFormat(params) { yAxisPointFormat(params) {
return this.PlanConvert.computedFormatYAxis(this.stations, params); return this.PlanConvert.computedFormatYAxis(this.stations, params);
}, },
xAxisLableFormat(value, index) { xAxisLableFormat(value, index) {
if (value % 60 === 0) { if (value % 60 === 0) {
return timeFormat(value); return timeFormat(value);
} }
}, },
yAxisLableFormat(value, index) { yAxisLableFormat(value, index) {
return ''; return '';
}, },
xAxisInit() { xAxisInit() {
let list = []; const list = [];
for (var time = 0 + this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) { for (var time = 0 + this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
list.push(time); list.push(time);
} }
let startValue = 3600 * 6; const startValue = 3600 * 6;
let offsetTime = 3600 * 1; const offsetTime = 3600 * 1;
this.option.xAxis[0].data = list; this.option.xAxis[0].data = list;
if (!this.option.dataZoom[0].startValue) { if (!this.option.dataZoom[0].startValue) {
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = startValue - offsetTime; this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = startValue - offsetTime;
} }
if (!this.option.dataZoom[0].endValue) { if (!this.option.dataZoom[0].endValue) {
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = startValue + offsetTime; this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = startValue + offsetTime;
} }
}, },
yAxisInit() { yAxisInit() {
if (Object.keys(this.PlanConvert).length) { if (Object.keys(this.PlanConvert).length) {
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations); this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations); this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
} }
}, },
axisTooltip(param) { axisTooltip(param) {
let station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' }; const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [ return [
`Point Data <hr size=1 style=" margin: 3px 0">`, `Point Data <hr size=1 style=" margin: 3px 0">`,
`车站名称: ${station.name}<br>`, `车站名称: ${station.name}<br>`,
`车站公里标: ${station.kmRange} km <br>`, `车站公里标: ${station.kmRange} km <br>`,
`到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>` `到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join(''); ].join('');
}, },
mouseClick(params) { mouseClick(params) {
let model = { const model = {
serviceNumber: params.seriesName serviceNumber: params.seriesName
} };
this.$store.dispatch('runPlan/setSelected', model); this.$store.dispatch('runPlan/setSelected', model);
}, },
reSize(opt) { reSize(opt) {
if (this.myChart) { if (this.myChart) {
this.myChart.resize({ this.myChart.resize({
width: opt.width, width: opt.width,
height: opt.height, height: opt.height,
silent: false silent: false
}); });
} }
}, },
destroy() { destroy() {
if (this.myChart && this.myChart.isDisposed) { if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose(); this.myChart.dispose();
this.myChart = null; this.myChart = null;
} }
}, },
scheduleTouch() { scheduleTouch() {
}, },
trainNumTouch() { trainNumTouch() {
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
#PlanSchedule { #PlanSchedule {
@ -487,4 +496,4 @@
float: right; float: right;
} }
} }
</style> </style>

View File

@ -1,95 +1,102 @@
<template> <template>
<data-table id="PlanStatusBar" ref="dataTable" :height="height-11" :config="stationListConfig" :close="false" <data-table
:style="{top: maxmini? maxTop-110+'px':maxTop-21+'px'}" @touch="touch"></data-table> id="PlanStatusBar"
ref="dataTable"
:height="height-11"
:config="stationListConfig"
:close="false"
:style="{top: maxmini? maxTop-110+'px':maxTop-21+'px'}"
@touch="touch"
/>
</template> </template>
<script> <script>
import DataTable from '../menusPlan/components/dataTable'; import DataTable from '../menusPlan/components/dataTable';
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'PlanStatusBar', name: 'PlanStatusBar',
props: { components: {
maxTop: { DataTable
type: Number, },
required: true props: {
} maxTop: {
}, type: Number,
components: { required: true
DataTable }
}, },
data() { data() {
return { return {
maxmini: true, maxmini: true,
height: 100, height: 100,
stationListConfig: { stationListConfig: {
data: [], data: [],
showClose: true, showClose: true,
highlightCurrentRow: true, highlightCurrentRow: true,
columns: [ columns: [
{ {
prop: 'stationName', prop: 'stationName',
label: '站台', label: '站台',
width: 400 width: 400
}, },
{ {
prop: 'startTime', prop: 'startTime',
label: '到点', label: '到点'
}, },
{ {
prop: 'stopTime', prop: 'stopTime',
label: '停站时间', label: '停站时间'
}, },
{ {
prop: 'endTime', prop: 'endTime',
label: '发点', label: '发点'
}, },
{ {
prop: 'level', prop: 'level',
label: '运行等级' label: '运行等级'
} }
] ]
} }
} };
}, },
watch: { watch: {
'$store.state.runPlan.select': function (select) { '$store.state.runPlan.selected': function (select) {
this.stationListConfig.data = []; this.stationListConfig.data = [];
let serviceObj = this.$store.state.runPlan.editData[select.serviceNumber]; const serviceObj = this.$store.state.runPlan.editData[select.serviceNumber];
if (serviceObj) { if (serviceObj) {
let trainMap = serviceObj.trainMap; const trainMap = serviceObj.trainMap;
if (trainMap) { if (trainMap) {
let trainObj = trainMap[select.tripNumber]; const trainObj = trainMap[select.tripNumber];
if (trainObj) { if (trainObj) {
let stationTimeList = trainObj.stationTimeList; const stationTimeList = trainObj.stationTimeList;
if (stationTimeList && stationTimeList.length) { if (stationTimeList && stationTimeList.length) {
stationTimeList.forEach((elem, index) => { stationTimeList.forEach((elem, index) => {
let stationObj = { const stationObj = {
stationName: formatName(elem.stationCode), stationName: formatName(elem.stationCode),
startTime: formatTime(index == 0 ? null : stationTimeList[index - 1].secondTime), startTime: formatTime(index == 0 ? null : stationTimeList[index - 1].secondTime),
stopTime: formatTime(index == 0 ? null : elem.secondTime - stationTimeList[index - 1].secondTime), stopTime: formatTime(index == 0 ? null : elem.secondTime - stationTimeList[index - 1].secondTime),
endTime: formatTime(elem.secondTime), endTime: formatTime(elem.secondTime),
level: '' level: ''
} };
this.stationListConfig.data.push(stationObj); this.stationListConfig.data.push(stationObj);
}); });
} }
} }
} }
} }
} }
}, },
methods: { methods: {
touch(maxmini) { touch(maxmini) {
this.maxmini = maxmini; this.maxmini = maxmini;
this.$emit('setPosition'); this.$emit('setPosition');
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
#PlanStatusBar { #PlanStatusBar {
@ -97,4 +104,4 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
} }
</style> </style>

View File

@ -1,44 +1,44 @@
<template> <template>
<div id="PlanTitleBar"> <div id="PlanTitleBar">
<img class="logo" :src="logoImg" /> <img class="logo" :src="logoImg">
<span> {{mapName}} &ensp;</span> <span> {{ mapName }} &ensp;</span>
<span v-if="runPlanName">({{runPlanName}})</span> <span v-if="runPlanName">({{ runPlanName }})</span>
<span class="system-close el-icon-close" @click="back"></span> <span class="system-close el-icon-close" @click="back" />
</div> </div>
</template> </template>
<script> <script>
import logo_ from '@/assets/logo_.png'; import logo_ from '@/assets/logo_.png';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
export default { export default {
name: 'PlanTitleBar', name: 'PlanTitleBar',
data() { data() {
return { return {
mapName: '', mapName: '',
logoImg: logo_ logoImg: logo_
} };
}, },
computed: { computed: {
runPlanName() { runPlanName() {
return this.$route.query.planName || ''; return this.$route.query.planName || '';
} }
}, },
mounted() { mounted() {
if (this.$route.query.mapId) { if (this.$route.query.mapId) {
getPublishMapInfo(this.$route.query.mapId).then(resp => { getPublishMapInfo(this.$route.query.mapId).then(resp => {
this.mapName = resp.data.name; this.mapName = resp.data.name;
}) });
} }
}, },
methods: { methods: {
back() { back() {
this.$emit('back'); this.$emit('back');
} }
} }
} };
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
$width: 25px; $width: 25px;
$height: 25px; $height: 25px;
@ -72,4 +72,4 @@
right: 1px; right: 1px;
} }
} }
</style> </style>

View File

@ -33,80 +33,85 @@ export function deviceFactory(type, elem) {
return Object.assign({ _type: type }, deviceRender[type], elem); return Object.assign({ _type: type }, deviceRender[type], elem);
} }
export function parser(data, jmap) { export function createDevice(type, model, propConvert) {
const device = deviceFactory(type, model);
return propConvert ? propConvert.initPrivateProps(device) : device;
}
export function parser(data, skinStyle) {
var mapDevice = {}; var mapDevice = {};
var propConvert = Vue.prototype.$theme.loadPropConvert(jmap.skinStyle); var propConvert = skinStyle ? Vue.prototype.$theme.loadPropConvert(skinStyle): null;
if (data) { if (data) {
zrUtil.each(data.linkList || [], elem => { zrUtil.each(data.linkList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Link, elem)); mapDevice[elem.code] = createDevice(deviceType.Link, elem, propConvert);
}, this); }, this);
zrUtil.each(data.sectionList || [], elem => { zrUtil.each(data.sectionList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Section, elem)); mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert);
}, this); }, this);
zrUtil.each(data.signalList || [], elem => { zrUtil.each(data.signalList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Signal, elem)); mapDevice[elem.code] = createDevice(deviceType.Signal, elem, propConvert);
}, this); }, this);
zrUtil.each(data.stationList || [], elem => { zrUtil.each(data.stationList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Station, elem)); mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert);
}, this); }, this);
zrUtil.each(data.stationStandList || [], elem => { zrUtil.each(data.stationStandList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.StationStand, elem)); mapDevice[elem.code] = createDevice(deviceType.StationStand, elem, propConvert);
}, this); }, this);
zrUtil.each(data.stationControlList || [], elem => { zrUtil.each(data.stationControlList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.StationControl, elem)); mapDevice[elem.code] = createDevice(deviceType.StationControl, elem, propConvert);
}, this); }, this);
zrUtil.each(data.counterList || [], elem => { zrUtil.each(data.counterList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.StationCounter, elem)); mapDevice[elem.code] = createDevice(deviceType.StationCounter, elem, propConvert);
}, this); }, this);
zrUtil.each(data.delayShowList || [], elem => { zrUtil.each(data.delayShowList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.StationDelayUnlock, elem)); mapDevice[elem.code] = createDevice(deviceType.StationDelayUnlock, elem, propConvert);
}, this); }, this);
zrUtil.each(data.lineList || [], elem => { zrUtil.each(data.lineList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Line, elem)); mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert);
}, this); }, this);
zrUtil.each(data.textList || [], elem => { zrUtil.each(data.textList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Text, elem)); mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert);
}, this); }, this);
zrUtil.each(data.zcList || [], elem => { zrUtil.each(data.zcList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.ZcControl, elem)); mapDevice[elem.code] = createDevice(deviceType.ZcControl, elem, propConvert);
}, this); }, this);
zrUtil.each(data.lcList || [], elem => { zrUtil.each(data.lcList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.LcControl, elem)); mapDevice[elem.code] = createDevice(deviceType.LcControl, elem, propConvert);
}, this); }, this);
zrUtil.each(data.tempSpeedLimitList || [], elem => { zrUtil.each(data.tempSpeedLimitList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.LimitControl, elem)); mapDevice[elem.code] = createDevice(deviceType.LimitControl, elem, propConvert);
}, this); }, this);
zrUtil.each(data.resourceList || [], elem => { zrUtil.each(data.resourceList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.ImageControl, elem)); mapDevice[elem.code] = createDevice(deviceType.ImageControl, elem, propConvert);
}, this); }, this);
zrUtil.each(data.trainList || [], elem => { zrUtil.each(data.trainList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Train, elem)); mapDevice[elem.code] = createDevice(deviceType.Train, elem, propConvert);
}, this); }, this);
zrUtil.each(data.Line || [], elem => { zrUtil.each(data.Line || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Line, elem)); mapDevice[elem.code] = createDevice(deviceType.Line, elem, propConvert);
}, this); }, this);
zrUtil.each(data.Text || [], elem => { zrUtil.each(data.Text || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Text, elem)); mapDevice[elem.code] = createDevice(deviceType.Text, elem, propConvert);
}, this); }, this);
zrUtil.each(data.trainWindowList || [], elem => { zrUtil.each(data.trainWindowList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.TrainWindow, elem)); mapDevice[elem.code] = createDevice(deviceType.TrainWindow, elem, propConvert);
if (elem.sectionCode) { if (elem.sectionCode) {
const section = mapDevice[elem.sectionCode]; const section = mapDevice[elem.sectionCode];
if (section) { if (section) {
@ -116,7 +121,7 @@ export function parser(data, jmap) {
}, this); }, this);
zrUtil.each(data.switchList || [], elem => { zrUtil.each(data.switchList || [], elem => {
mapDevice[elem.code] = propConvert.initPrivateProps(deviceFactory(deviceType.Switch, elem)); mapDevice[elem.code] = createDevice(deviceType.Switch, elem, propConvert);
const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode]; const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode]; const lnodeSection = mapDevice[mapDevice[elem.code].sectionBCode];
const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode]; const rnodeSection = mapDevice[mapDevice[elem.code].sectionCCode];

View File

@ -3,16 +3,25 @@
<el-menu-item v-for="item in entryList" :key="item.name" class="avatar-wrapper" index="" @click="item.handle"> <el-menu-item v-for="item in entryList" :key="item.name" class="avatar-wrapper" index="" @click="item.handle">
<span style="color: white;">{{ item.name }}</span> <span style="color: white;">{{ item.name }}</span>
</el-menu-item> </el-menu-item>
<deomon-list ref="deomonList" />
</div> </div>
</template> </template>
<script> <script>
import DeomonList from '@/views/demonstration/deomonList';
export default { export default {
name: 'Entry', name: 'Entry',
components: {
DeomonList
},
data() { data() {
return { return {
entryList: [ entryList: [
{
name: '快速入口',
handle: this.quickEntry
}
], ],
stomp: null, stomp: null,
header: null header: null
@ -28,6 +37,9 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
quickEntry() {
this.$refs.deomonList.doShow();
}
} }
}; };
</script> </script>

View File

@ -8,58 +8,63 @@
text-color="#fff" text-color="#fff"
active-text-color="#ffd04b" active-text-color="#ffd04b"
> >
<template v-for="item in routers" v-if="!item.hidden&&item.children"> <template v-for="(item,idx) in routers">
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow"> <template v-if="!item.hidden&&item.children">
<el-menu-item :index="item.redirect"> <template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
<a <template>
:href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)" <el-menu-item :key="idx" index="">
target="_blank" <a
style="width: 100%; height: 100%; display: block;" :href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)"
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</a> target="_blank"
</el-menu-item> style="width: 100%; height: 100%; display: block;"
</template> >{{ $t(item.children[0].meta.i18n) }}</a>
<template
v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow"
:to="item.path+'/'+item.children[0].path"
>
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span
v-if="item.children[0].meta"
slot="title"
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</span>
</el-menu-item>
</template>
<el-submenu v-else :key="item.name" :index="item.name||item.path" :show-timeout="100">
<template slot="title">
<span v-if="item.meta" slot="title">{{ $t(item.meta.i18n) || item.meta.title }}</span>
</template>
<template v-for="child in item.children" v-if="!child.hidden">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<el-submenu :key="child.name" :index="child.name||child.path" :show-timeout="100">
<template slot="title">
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(item.meta.i18n) }}</span>
</template>
<template v-for="grandchild in child.children" v-if="!grandchild.hidden">
<template :to="child.path+'/'+grandchild.path">
<el-menu-item
:index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)"
>
<span
v-if="grandchild.meta"
slot="title"
>{{ $t(grandchild.meta.title || grandchild.meta.i18n) }}</span>
</el-menu-item>
</template>
</template>
</el-submenu>
</template>
<template v-else :to="item.path+'/'+child.path">
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(child.meta.i18n) }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
</template> </template>
</el-submenu> <template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
<template :to="item.path+'/'+item.children[0].path">
<el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span
v-if="item.children[0].meta&&item.children[0].meta.i18n"
slot="title"
>{{ $t(item.children[0].meta.i18n) }}</span>
</el-menu-item>
</template>
</template>
<el-submenu v-else :key="idx" :index="item.name||item.path" :show-timeout="100">
<template slot="title">
<span v-if="item.meta" slot="title">{{ $t(item.meta.i18n) }}</span>
</template>
<template v-for="(child,cdx) in item.children">
<template v-if="!child.hidden">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<el-submenu :key="cdx" :index="child.name||child.path" :show-timeout="100">
<template slot="title">
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
</template>
<template v-for="(grandchild,gdx) in child.children">
<template v-if="!grandchild.hidden">
<template :to="child.path+'/'+grandchild.path">
<el-menu-item :key="gdx" :index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)">
<span
v-if="grandchild.meta"
slot="title"
>{{ $t(grandchild.meta.i18n) }}</span>
</el-menu-item>
</template>
</template>
</template>
</el-submenu>
</template>
<template v-else :to="item.path+'/'+child.path">
<el-menu-item :key="cdx" :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
</el-menu-item>
</template>
</template>
</template>
</el-submenu>
</template>
</template> </template>
<quick-entry ref="quickEntry" /> <quick-entry ref="quickEntry" />
<user-logout ref="userLogout" /> <user-logout ref="userLogout" />

View File

@ -1,36 +1,37 @@
<template> <template>
<div class="menu-wrapper"> <div class="menu-wrapper">
<template v-for="item in routes" v-if="!item.hidden&&item.children"> <template v-if="!item.hidden&&item.children">
<template v-for="item in routes">
<router-link
v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow"
:key="item.children[0].name"
:to="item.path+'/'+item.children[0].path"
>
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon" />
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{ item.children[0].meta.title }}</span>
</el-menu-item>
</router-link>
<router-link <el-submenu v-else :key="item.name" :index="item.name||item.path">
v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" <template slot="title">
:key="item.children[0].name" <svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon" />
:to="item.path+'/'+item.children[0].path" <span v-if="item.meta&&item.meta.title" slot="title">{{ item.meta.title }}</span>
> </template>
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon" />
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{ item.children[0].meta.title }}</span>
</el-menu-item>
</router-link>
<el-submenu v-else :key="item.name" :index="item.name||item.path">
<template slot="title">
<svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon" />
<span v-if="item.meta&&item.meta.title" slot="title">{{ item.meta.title }}</span>
</template>
<template v-for="child in item.children" v-if="!child.hidden">
<sidebar-item v-if="child.children&&child.children.length>0" :key="child.path" :is-nest="true" class="nest-menu" :routes="[child]" />
<router-link v-else :key="child.name" :to="item.path+'/'+child.path">
<el-menu-item :index="item.path+'/'+child.path">
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon" />
<span v-if="child.meta&&child.meta.title" slot="title">{{ child.meta.title }}</span>
</el-menu-item>
</router-link>
</template>
</el-submenu>
<template v-if="!child.hidden">
<template v-for="child in item.children">
<sidebar-item v-if="child.children&&child.children.length>0" :key="child.path" :is-nest="true" class="nest-menu" :routes="[child]" />
<router-link v-else :key="child.name" :to="item.path+'/'+child.path">
<el-menu-item :index="item.path+'/'+child.path">
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon" />
<span v-if="child.meta&&child.meta.title" slot="title">{{ child.meta.title }}</span>
</el-menu-item>
</router-link>
</template>
</template>
</el-submenu>
</template>
</template> </template>
</div> </div>
</template> </template>

View File

@ -5,6 +5,95 @@ Vue.use(Router);
/* Layout */ /* Layout */
import Layout from '@/layout'; import Layout from '@/layout';
import LoginNew from '@/views/login/loginNew';
import Login from '@/views/login/index';
import LoginNewScreen from '@/views/login/loginNewScreen';
import LoginScreen from '@/views/login/loginScreen';
import LoginNewPlan from '@/views/login/loginNewPlan';
import LoginPlan from '@/views/login/loginPlan';
import Jlmap3dedit from '@/views/jlmap3d/jlmap3dedit';
import Jlmap3d from '@/views/jlmap3d/index';
import Display from '@/views/display/index';
import TrainRoom from '@/views/trainRoom/index';
import JointTraining from '@/views/jointTraining/index';
import Error401 from '@/views/error-page/401';
import Errpr404 from '@/views/error-page/404';
import Dashboard from '@/views/dashboard/index';
import Dashboard1 from '@/views/dashboard/index.vue';
import SkinStyle from '@/views/map/skinStyle/index';
import SkinStyleDraft from '@/views/map/skinStyle/draft';
import Mapdraft from '@/views/map/mapdraft/index';
import Mapedit from '@/views/map/mapdraft/mapedit/index';
import Runplan from '@/views/map/runplan/index';
import RunplanView from '@/views/map/runplan/chart';
import Trainingcategory from '@/views/lesson/trainingcategory/index';
import Trainingrecord from '@/views/lesson/trainingrecord/index';
import TrainingrecordManage from '@/views/lesson/trainingrecord/manage/index';
import Taskmanage from '@/views/lesson/taskmanage/list';
import TrainingRuleList from '@/views/lesson/trainingRule/list';
import TrainingRuleEdit from '@/views/lesson/trainingRule/detail/index';
import Trainingmanage from '@/views/lesson/trainingmanage/index';
import Lessoncategory from '@/views/lesson/lessoncategory/index';
import Scriptmanage from '@/views/lesson/scriptmanage/list';
import Teach from '@/views/teach/index';
import TeachHome from '@/views/teach/home';
import TeachDetail from '@/views/teach/detail/index';
import TeachPractical from '@/views/teach/practical/index';
import Pay from '@/views/components/pay/index';
import Exam from '@/views/exam/index';
import ExamHome from '@/views/exam/home';
import ExamDetail from '@/views/exam/detail/examDetail';
import ExamCourseDetail from '@/views/exam/detail/courseDetail';
import ExamQuestionDetail from '@/views/exam/detail/questionDetail';
import ExamResult from '@/views/exam/result';
import PublishExamRule from '@/views/publish/examRule/index';
import PublishExamRuleDraft from '@/views/publish/examRule/draft/index';
import Demonstration from '@/views/demonstration/index';
import DemonstrationHome from '@/views/demonstration/home';
import DemonstrationDetail from '@/views/demonstration/detail/index';
import ScreenMonitor from '@/views/screenMonitor/index';
import ScreenMonitorHome from '@/views/screenMonitor/home';
import ScreenMonitorDetail from '@/views/screenMonitor/detail/index';
import PlanMonitorEditTool from '@/views/planMonitor/editTool/index';
import PlanMonitor from '@/views/planMonitor/index';
import PlanMonitorHome from '@/views/planMonitor/home';
import PlanMonitorDetail from '@/views/planMonitor/detail';
import Replay from '@/views/replay/index';
import Package from '@/views/package/index';
import PackageDraft from '@/views/package/draft/ruleForm';
import PublishMap from '@/views/publish/publishMap/index';
import PublishMapDraft from '@/views/publish/publishMap/draft';
import RunPlanCommon from '@/views/publish/runPlanCommon/index';
import RunPlanCommonDraft from '@/views/publish/runPlanCommon/draft';
import RunPlanTemplate from '@/views/publish/runPlanTemplate/index';
import RunPlanEveryDay from '@/views/publish/runPlanEveryDay/index';
import ProductStatus from '@/views/publish/productStatus/index';
import PublishLesson from '@/views/publish/publishLesson/index';
// import SimulationScript from '@/views/publish/simulationScript/index';
import Commodity from '@/views/orderauthor/commodity/index';
import CommodityDraft from '@/views/orderauthor/commodity/draft';
import OrderList from '@/views/orderauthor/order/list';
import OrderDraft from '@/views/orderauthor/order/draft';
import Author from '@/views/orderauthor/author/index';
import AuthorDraft from '@/views/orderauthor/author/draft';
import Permission from '@/views/orderauthor/permission/index';
import PermissionDetail from '@/views/orderauthor/permission/detail';
import PermissionDraft from '@/views/orderauthor/permission/draft/ruleForm';
import Dictionary from '@/views/management/dictionary/index';
import DictionaryDetail from '@/views/management/dictionaryDetail/index';
import UserControl from '@/views/management/userControl/index';
import UserTraining from '@/views/management/userTraining/index';
import UserExam from '@/views/management/userExam/index';
import UserSimulation from '@/views/management/userSimulation/index';
import ExistingSimulation from '@/views/management/existingSimulation/index';
/** /**
* Note: sub-menu only appear when route children.length >= 1 * Note: sub-menu only appear when route children.length >= 1
@ -125,53 +214,53 @@ export const UrlConfig = {
export const constantRoutes = [ export const constantRoutes = [
{ {
path: '/login', path: '/login',
component: () => import('@/views/login/loginNew'), component: LoginNew,
hidden: true hidden: true
}, },
{ {
path: '/login1', path: '/login1',
component: () => import('@/views/login/index'), component: Login,
hidden: true hidden: true
}, },
// 扫码登录 // 扫码登录
{ {
path: '/dp/login', path: '/dp/login',
component: resolve => require(['@/views/login/loginNewScreen'], resolve), component: LoginNewScreen,
hidden: true hidden: true
}, },
// 密码登录 // 密码登录
{ {
path: '/dp/login1', path: '/dp/login1',
component: resolve => require(['@/views/login/loginScreen'], resolve), component: LoginScreen,
hidden: true hidden: true
}, },
// 扫码登录 // 扫码登录
{ {
path: '/plan/login', path: '/plan/login',
component: resolve => require(['@/views/login/loginNewPlan'], resolve), component: LoginNewPlan,
hidden: true hidden: true
}, },
// 密码登录 // 密码登录
{ {
path: '/plan/login1', path: '/plan/login1',
component: resolve => require(['@/views/login/loginPlan'], resolve), component: LoginPlan,
hidden: true hidden: true
}, },
{ {
path: '/jlmap3d/edit', path: '/jlmap3d/edit',
component: resolve => require(['@/views/jlmap3d/jlmap3dedit'], resolve), component: Jlmap3dedit,
hidden: true hidden: true
}, },
{ {
path: '/401', path: '/401',
component: () => import('@/views/error-page/401'), component: Error401,
hidden: true hidden: true
}, },
{ {
path: '/404', path: '/404',
component: () => import('@/views/error-page/404'), component: Errpr404,
hidden: true hidden: true
}, },
@ -181,7 +270,7 @@ export const constantRoutes = [
redirect: '/dashboard', redirect: '/dashboard',
children: [{ children: [{
path: 'dashboard', path: 'dashboard',
component: () => import('@/views/dashboard/index'), component: Dashboard,
meta: { meta: {
i18n: 'router.homePage', i18n: 'router.homePage',
icon: 'dashboard' icon: 'dashboard'
@ -201,32 +290,32 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'dashboard', path: 'dashboard',
component: resolve => require(['@/views/dashboard/index.vue'], resolve) component: Dashboard1
} }
] ]
}, },
{ {
path: '/display/:mode', path: '/display/:mode',
component: resolve => require(['@/views/display/index'], resolve), component: Display,
meta: { meta: {
}, },
hidden: true hidden: true
}, },
{ {
path: '/trainroom', path: '/trainroom',
component: resolve => require(['@/views/trainRoom/index'], resolve), component: TrainRoom,
meta: { meta: {
}, },
hidden: true hidden: true
}, },
{ {
path: '/jointTraining', path: '/jointTraining',
component: resolve => require(['@/views/jointTraining/index'], resolve), component: JointTraining,
hidden: true hidden: true
}, },
{ {
path: '/jlmap3d', path: '/jlmap3d',
component: resolve => require(['@/views/jlmap3d/index'], resolve), component: Jlmap3d,
meta: { meta: {
}, },
hidden: true hidden: true
@ -241,7 +330,7 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'skinStyle', path: 'skinStyle',
component: resolve => require(['@/views/map/skinStyle/index'], resolve), component: SkinStyle,
meta: { meta: {
i18n: 'router.skinManage' i18n: 'router.skinManage'
} }
@ -249,19 +338,19 @@ export const asyncRouter = [
{ {
path: 'skinStyle/draft/:mode/:skinStyleId', path: 'skinStyle/draft/:mode/:skinStyleId',
hidden: true, hidden: true,
component: resolve => require(['@/views/map/skinStyle/draft'], resolve) component: SkinStyleDraft
}, },
{ {
path: 'draw', path: 'draw',
redirect: '/map/draw/0/draft', redirect: '/map/draw/0/draft',
component: resolve => require(['@/views/map/mapdraft/index'], resolve), component: Mapdraft,
meta: { meta: {
i18n: 'router.mapDraw' i18n: 'router.mapDraw'
}, },
children: [ children: [
{ {
path: ':mapId/:view', path: ':mapId/:view',
component: resolve => require(['@/views/map/mapdraft/mapedit/index'], resolve), component: Mapedit,
hidden: true hidden: true
} }
] ]
@ -269,19 +358,19 @@ export const asyncRouter = [
{ {
path: 'runPlan', path: 'runPlan',
redirect: '/map/runPlan/view/draft', redirect: '/map/runPlan/view/draft',
component: resolve => require(['@/views/map/runplan/index'], resolve), component: Runplan,
meta: { meta: {
i18n: 'router.runPlanManage' i18n: 'router.runPlanManage'
}, },
children: [{ children: [{
path: 'view/:mode', path: 'view/:mode',
component: resolve => require(['@/views/map/runplan/chart'], resolve), component: RunplanView,
hidden: true hidden: true
}] }]
}, },
{ {
path: 'product', path: 'product',
component: resolve => require(['@/views/lesson/trainingcategory/index'], resolve), component: Trainingcategory,
meta: { meta: {
i18n: 'router.productEdit' i18n: 'router.productEdit'
} }
@ -299,28 +388,28 @@ export const asyncRouter = [
{ {
path: 'record', path: 'record',
redirect: '/lesson/record/training/0/null', redirect: '/lesson/record/training/0/null',
component: resolve => require(['@/views/lesson/trainingrecord/index'], resolve), component: Trainingrecord,
meta: { meta: {
i18n: 'router.trainingRecord' i18n: 'router.trainingRecord'
}, },
children: [ children: [
{ {
path: 'training/:trainingId/:trainingName', path: 'training/:trainingId/:trainingName',
component: resolve => require(['@/views/lesson/trainingrecord/manage/index'], resolve), component: TrainingrecordManage,
hidden: true hidden: true
} }
] ]
}, },
{ {
path: 'manage/taskManage', path: 'manage/taskManage',
component: resolve => require(['@/views/lesson/taskmanage/list'], resolve), component: Taskmanage,
meta: { meta: {
i18n: 'router.taskManage' i18n: 'router.taskManage'
} }
}, },
{ {
path: 'manage/trainingRule', path: 'manage/trainingRule',
component: resolve => require(['@/views/lesson/trainingRule/list'], resolve), component: TrainingRuleList,
meta: { meta: {
i18n: 'router.trainingRule' i18n: 'router.trainingRule'
} }
@ -328,20 +417,20 @@ export const asyncRouter = [
{ {
path: 'manage/trainingRule/detail', path: 'manage/trainingRule/detail',
hidden: true, hidden: true,
component: resolve => require(['@/views/lesson/trainingRule/detail/index'], resolve), component: TrainingRuleEdit,
meta: { meta: {
} }
}, },
{ {
path: 'manage/training', path: 'manage/training',
component: resolve => require(['@/views/lesson/trainingmanage/index'], resolve), component: Trainingmanage,
meta: { meta: {
i18n: 'router.trainingManage' i18n: 'router.trainingManage'
} }
}, },
{ {
path: 'edit', path: 'edit',
component: resolve => require(['@/views/lesson/lessoncategory/index'], resolve), component: Lessoncategory,
meta: { meta: {
i18n: 'router.lessonEdit' i18n: 'router.lessonEdit'
} }
@ -352,12 +441,12 @@ export const asyncRouter = [
path: '/script', path: '/script',
component: Layout, component: Layout,
meta: { meta: {
roles: [admin, lessonCreater] roles: [admin, lessonCreater, user]
}, },
children: [ children: [
{ {
path: 'scriptManage', path: 'scriptManage',
component: resolve => require(['@/views/lesson/scriptmanage/list'], resolve), component: Scriptmanage,
meta: { meta: {
i18n: 'router.scriptManage' i18n: 'router.scriptManage'
} }
@ -367,14 +456,14 @@ export const asyncRouter = [
{ {
path: '/teach', path: '/teach',
redirect: '/teach/home', redirect: '/teach/home',
component: resolve => require(['@/views/teach/index'], resolve), component: Teach,
meta: { meta: {
roles: [admin, userLesson, user] roles: [admin, userLesson, user]
}, },
children: [ children: [
{ {
path: 'home', path: 'home',
component: resolve => require(['@/views/teach/home'], resolve), component: TeachHome,
meta: { meta: {
i18n: 'router.teachSystem' i18n: 'router.teachSystem'
} }
@ -382,7 +471,7 @@ export const asyncRouter = [
{ {
// 课程详情 // 课程详情
path: 'detail/:lessonId', path: 'detail/:lessonId',
component: resolve => require(['@/views/teach/detail/index'], resolve), component: TeachDetail,
meta: { meta: {
}, },
hidden: true hidden: true
@ -390,14 +479,14 @@ export const asyncRouter = [
{ {
// 实训详情 // 实训详情
path: 'practical/:trainingId/:lessonId', path: 'practical/:trainingId/:lessonId',
component: resolve => require(['@/views/teach/practical/index'], resolve), component: TeachPractical,
meta: { meta: {
}, },
hidden: true hidden: true
}, },
{ {
path: 'pay/:lessonId', path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve), component: Pay,
meta: { meta: {
}, },
hidden: true hidden: true
@ -407,14 +496,14 @@ export const asyncRouter = [
{ {
path: '/exam', path: '/exam',
redirect: '/exam/home', redirect: '/exam/home',
component: resolve => require(['@/views/exam/index'], resolve), component: Exam,
meta: { meta: {
roles: [admin, userExam, user] roles: [admin, userExam, user]
}, },
children: [ children: [
{ {
path: 'home', path: 'home',
component: resolve => require(['@/views/exam/home'], resolve), component: ExamHome,
meta: { meta: {
i18n: 'router.examSystem' i18n: 'router.examSystem'
} }
@ -422,40 +511,40 @@ export const asyncRouter = [
{ {
// 试卷详情 // 试卷详情
path: 'detail/:examId', path: 'detail/:examId',
component: resolve => require(['@/views/exam/detail/examDetail'], resolve), component: ExamDetail,
hidden: true hidden: true
}, },
{ {
path: 'course/:lessonId', path: 'course/:lessonId',
component: resolve => require(['@/views/exam/detail/courseDetail'], resolve), component: ExamCourseDetail,
hidden: true hidden: true
}, },
{ {
// 规则管理 // 规则管理
path: 'examRule/manage', path: 'examRule/manage',
component: resolve => require(['@/views/publish/examRule/index'], resolve), component: PublishExamRule,
hidden: true hidden: true
}, },
{ {
path: 'examRule/draft/:mode/:ruleId/:lessonId', path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true, hidden: true,
component: resolve => require(['@/views/publish/examRule/draft/index'], resolve) component: PublishExamRuleDraft
}, },
{ {
path: 'pay/:lessonId', path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve), component: Pay,
hidden: true hidden: true
}, },
{ {
// 开始考试 // 开始考试
path: 'questionDetail/:examQuestionId', path: 'questionDetail/:examQuestionId',
component: resolve => require(['@/views/exam/detail/questionDetail'], resolve), component: ExamQuestionDetail,
hidden: true hidden: true
}, },
{ {
// 考试结果 // 考试结果
path: 'result/:userExamId', path: 'result/:userExamId',
component: resolve => require(['@/views/exam/result'], resolve), component: ExamResult,
hidden: true hidden: true
} }
] ]
@ -463,26 +552,26 @@ export const asyncRouter = [
{ {
path: '/demonstration', path: '/demonstration',
redirect: '/demonstration/home', redirect: '/demonstration/home',
component: resolve => require(['@/views/demonstration/index'], resolve), component: Demonstration,
meta: { meta: {
roles: [admin, userSimulation, user] roles: [admin, userSimulation, user]
}, },
children: [ children: [
{ {
path: 'home', path: 'home',
component: resolve => require(['@/views/demonstration/home'], resolve), component: DemonstrationHome,
meta: { meta: {
i18n: 'router.demonstrationSystem' i18n: 'router.demonstrationSystem'
} }
}, },
{ {
path: 'detail/:mapId', path: 'detail/:mapId',
component: resolve => require(['@/views/demonstration/detail/index'], resolve), component: DemonstrationDetail,
hidden: true hidden: true
}, },
{ {
path: 'pay/:lessonId', path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve), component: Pay,
hidden: true hidden: true
} }
] ]
@ -490,14 +579,14 @@ export const asyncRouter = [
{ {
path: '/dp', path: '/dp',
redirect: '/dp/home', redirect: '/dp/home',
component: resolve => require(['@/views/screenMonitor/index'], resolve), component: ScreenMonitor,
meta: { meta: {
roles: [admin, userScreen, user] roles: [admin, userScreen, user]
}, },
children: [ children: [
{ {
path: 'home', path: 'home',
component: resolve => require(['@/views/screenMonitor/home'], resolve), component: ScreenMonitorHome,
meta: { meta: {
i18n: 'router.dpSystem' i18n: 'router.dpSystem'
}, },
@ -505,19 +594,19 @@ export const asyncRouter = [
}, },
{ {
path: 'detail/:lessonId', path: 'detail/:lessonId',
component: resolve => require(['@/views/screenMonitor/detail/index'], resolve), component: ScreenMonitorDetail,
hidden: true hidden: true
}, },
{ {
path: 'pay/:lessonId', path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve), component: Pay,
hidden: true hidden: true
} }
] ]
}, },
{ {
path: '/plan/tool', path: '/plan/tool',
component: resolve => require(['@/views/planMonitor/editTool/index'], resolve), component: PlanMonitorEditTool,
meta: { meta: {
}, },
hidden: true hidden: true
@ -525,14 +614,14 @@ export const asyncRouter = [
{ {
path: '/plan', path: '/plan',
redirect: '/plan/home', redirect: '/plan/home',
component: resolve => require(['@/views/planMonitor/index'], resolve), component: PlanMonitor,
meta: { meta: {
roles: [admin, user] roles: [admin, user]
}, },
children: [ children: [
{ {
path: 'home', path: 'home',
component: resolve => require(['@/views/planMonitor/home'], resolve), component: PlanMonitorHome,
meta: { meta: {
i18n: 'router.planSystem' i18n: 'router.planSystem'
}, },
@ -540,12 +629,12 @@ export const asyncRouter = [
}, },
{ {
path: 'detail/:lessonId', path: 'detail/:lessonId',
component: resolve => require(['@/views/planMonitor/detail'], resolve), component: PlanMonitorDetail,
hidden: true hidden: true
}, },
{ {
path: 'pay/:lessonId', path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve), component: Pay,
hidden: true hidden: true
} }
] ]
@ -559,7 +648,7 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'manage', path: 'manage',
component: resolve => require(['@/views/replay/index'], resolve), component: Replay,
meta: { meta: {
i18n: 'router.replayManage' i18n: 'router.replayManage'
} }
@ -575,14 +664,14 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'manage', path: 'manage',
component: resolve => require(['@/views/package/index'], resolve), component: Package,
meta: { meta: {
i18n: 'router.permissionManage' i18n: 'router.permissionManage'
} }
}, },
{ {
path: 'draft', path: 'draft',
component: resolve => require(['@/views/package/draft/ruleForm'], resolve), component: PackageDraft,
hidden: true hidden: true
} }
] ]
@ -597,78 +686,78 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'map', path: 'map',
component: resolve => require(['@/views/publish/publishMap/index'], resolve), component: PublishMap,
meta: { meta: {
i18n: 'router.publishMapManage' i18n: 'router.publishMapManage'
} }
}, },
{ {
path: 'product', path: 'product',
component: resolve => require(['@/views/publish/productStatus/index'], resolve), component: ProductStatus,
meta: { meta: {
i18n: 'router.productStateManage' i18n: 'router.productStateManage'
} }
}, },
{ {
path: 'lesson', path: 'lesson',
component: resolve => require(['@/views/publish/publishLesson/index'], resolve), component: PublishLesson,
meta: { meta: {
i18n: 'router.publishLessonManage' i18n: 'router.publishLessonManage'
} }
}, },
// { // {
// path: 'script', // path: 'script',
// component: resolve => require(['@/views/publish/simulationScript/index'], resolve), // component: SimulationScript,
// meta: { // meta: {
// title: '仿真脚本管理', // title: '仿真脚本管理',
// } // }
// }, // },
{ {
path: 'runPlan/template', path: 'runPlan/template',
component: resolve => require(['@/views/publish/runPlanTemplate/index'], resolve), component: RunPlanTemplate,
meta: { meta: {
i18n: 'router.runPlanTemplateManage' i18n: 'router.runPlanTemplateManage'
} }
}, },
{ {
path: 'runPlan/common', path: 'runPlan/common',
component: resolve => require(['@/views/publish/runPlanCommon/index'], resolve), component: RunPlanCommon,
meta: { meta: {
i18n: 'router.runPlanCommonManage' i18n: 'router.runPlanCommonManage'
} }
}, },
{ {
path: 'runPlan/everyDay', path: 'runPlan/everyDay',
component: resolve => require(['@/views/publish/runPlanEveryDay/index'], resolve), component: RunPlanEveryDay,
meta: { meta: {
i18n: 'router.runPlanEveryDayManage' i18n: 'router.runPlanEveryDayManage'
} }
}, },
{ {
path: 'examRule/manage', path: 'examRule/manage',
component: resolve => require(['@/views/publish/examRule/index'], resolve), component: PublishExamRule,
meta: { meta: {
i18n: 'router.examRuleManage' i18n: 'router.examRuleManage'
} }
}, },
{ {
path: 'map/draft/:mode/:mapId', path: 'map/draft/:mode/:mapId',
component: resolve => require(['@/views/publish/publishMap/draft'], resolve), component: PublishMapDraft,
hidden: true hidden: true
}, },
{ {
path: 'examRule/draft/:mode/:ruleId/:lessonId', path: 'examRule/draft/:mode/:ruleId/:lessonId',
component: resolve => require(['@/views/publish/examRule/draft/index'], resolve), component: PublishExamRuleDraft,
hidden: true hidden: true
}, },
{ {
path: 'runPlan/common/:mode', path: 'runPlan/common/:mode',
component: resolve => require(['@/views/publish/runPlanCommon/draft'], resolve), component: RunPlanCommonDraft,
hidden: true hidden: true
}, },
{ {
path: 'runPlan/view/:mode', path: 'runPlan/view/:mode',
component: resolve => require(['@/views/map/runplan/chart'], resolve), component: RunplanView,
hidden: true hidden: true
} }
] ]
@ -683,28 +772,28 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'commodity/manage', path: 'commodity/manage',
component: resolve => require(['@/views/orderauthor/commodity/index'], resolve), component: Commodity,
meta: { meta: {
i18n: 'router.commodityManage' i18n: 'router.commodityManage'
} }
}, },
{ {
path: 'order/manage', path: 'order/manage',
component: resolve => require(['@/views/orderauthor/order/list'], resolve), component: OrderList,
meta: { meta: {
i18n: 'router.orderManage' i18n: 'router.orderManage'
} }
}, },
{ {
path: 'author/manage', path: 'author/manage',
component: resolve => require(['@/views/orderauthor/author/index'], resolve), component: Author,
meta: { meta: {
i18n: 'router.authorityManage' i18n: 'router.authorityManage'
} }
}, },
{ {
path: 'transfer/manage', path: 'transfer/manage',
component: resolve => require(['@/views/orderauthor/permission/index'], resolve), component: Permission,
meta: { meta: {
i18n: 'router.authorityTransferManage' i18n: 'router.authorityTransferManage'
} }
@ -712,7 +801,7 @@ export const asyncRouter = [
{ {
path: 'commodity/draft/:mode/:commodityId', path: 'commodity/draft/:mode/:commodityId',
hidden: true, hidden: true,
component: resolve => require(['@/views/orderauthor/commodity/draft'], resolve), component: CommodityDraft,
meta: { meta: {
i18n: 'router.addCommodity' i18n: 'router.addCommodity'
} }
@ -720,7 +809,7 @@ export const asyncRouter = [
{ {
path: 'order/draft/:mode/:orderId', path: 'order/draft/:mode/:orderId',
hidden: true, hidden: true,
component: resolve => require(['@/views/orderauthor/order/draft'], resolve), component: OrderDraft,
meta: { meta: {
i18n: 'router.addOrder' i18n: 'router.addOrder'
} }
@ -728,19 +817,19 @@ export const asyncRouter = [
{ {
path: 'author/draft/:mode/:userId', path: 'author/draft/:mode/:userId',
hidden: true, hidden: true,
component: resolve => require(['@/views/orderauthor/author/draft'], resolve), component: AuthorDraft,
meta: { meta: {
i18n: 'router.addCoursePermissions' i18n: 'router.addCoursePermissions'
} }
}, },
{ {
path: 'transfer/detail/:permissionId', path: 'transfer/detail/:permissionId',
component: resolve => require(['@/views/orderauthor/permission/detail'], resolve), component: PermissionDetail,
hidden: true hidden: true
}, },
{ {
path: 'transfer/package', path: 'transfer/package',
component: resolve => require(['@/views/orderauthor/permission/draft/ruleForm'], resolve), component: PermissionDraft,
hidden: true hidden: true
} }
] ]
@ -755,7 +844,7 @@ export const asyncRouter = [
children: [ children: [
{ {
path: 'dictionary', path: 'dictionary',
component: resolve => require(['@/views/management/dictionary/index'], resolve), component: Dictionary,
meta: { meta: {
i18n: 'router.dataDictionary' i18n: 'router.dataDictionary'
} }
@ -763,42 +852,42 @@ export const asyncRouter = [
{ {
path: 'dictionary/detail', path: 'dictionary/detail',
hidden: true, hidden: true,
component: resolve => require(['@/views/management/dictionaryDetail/index'], resolve), component: DictionaryDetail,
meta: { meta: {
i18n: 'router.dataDictionaryDetails' i18n: 'router.dataDictionaryDetails'
} }
}, },
{ {
path: 'userManage', path: 'userManage',
component: resolve => require(['@/views/management/userControl/index'], resolve), component: UserControl,
meta: { meta: {
i18n: 'router.userManage' i18n: 'router.userManage'
} }
}, },
{ {
path: 'userTrainingManage', path: 'userTrainingManage',
component: resolve => require(['@/views/management/userTraining/index'], resolve), component: UserTraining,
meta: { meta: {
i18n: 'router.userTrainingManage' i18n: 'router.userTrainingManage'
} }
}, },
{ {
path: 'userExamManage', path: 'userExamManage',
component: resolve => require(['@/views/management/userExam/index'], resolve), component: UserExam,
meta: { meta: {
i18n: 'router.userExamManage' i18n: 'router.userExamManage'
} }
}, },
{ {
path: 'userSimulationManage', path: 'userSimulationManage',
component: resolve => require(['@/views/management/userSimulation/index'], resolve), component: UserSimulation,
meta: { meta: {
i18n: 'router.userSimulationManage' i18n: 'router.userSimulationManage'
} }
}, },
{ {
path: 'existingSimulation', path: 'existingSimulation',
component: resolve => require(['@/views/management/existingSimulation/index'], resolve), component: ExistingSimulation,
meta: { meta: {
i18n: 'router.existingSimulation' i18n: 'router.existingSimulation'
} }

View File

@ -73,13 +73,13 @@ export default {
{ label: 'SHD三联段线', value: '18' }, { label: 'SHD三联段线', value: '18' },
{ label: 'SHD四联段线', value: '19' } { label: 'SHD四联段线', value: '19' }
], ],
roleType:[ roleType: [
{label:'管理员',value:'Admin'}, {label: '管理员', value: 'Admin'},
{label:'教员',value:'Instructor'}, {label: '教员', value: 'Instructor'},
{label:'行调',value:'Dispatcher'}, {label: '行调', value: 'Dispatcher'},
{label:'车站',value:'Attendant'}, {label: '车站', value: 'Attendant'},
{label:'观众',value:'Audience'}, {label: '观众', value: 'Audience'},
{label:'司机',value:'Driver'}, {label: '司机', value: 'Driver'}
], ],
SimulationType: [ SimulationType: [
@ -88,14 +88,14 @@ export default {
{ label: '综合演练', value: 'Joint'}, { label: '综合演练', value: 'Joint'},
{ label: '大屏', value: 'BigScreen'}, { label: '大屏', value: 'BigScreen'},
{ label: '琏计划', value: 'RunPlan'}, { label: '琏计划', value: 'RunPlan'},
{ label: '任务录制', value: 'ScriptRecord'}, { label: '任务录制', value: 'ScriptRecord'}
], ],
skinCode: [ skinCode: [
{ label: '福州一号线', value: '02'}, { label: '福州一号线', value: '02'},
{ label: '北京一号线', value: '03'}, { label: '北京一号线', value: '03'},
{ label: '成都三号线', value: '04'}, { label: '成都三号线', value: '04'},
{ label: '北京八通线', value: '05'}, { label: '北京八通线', value: '05'}
] ]
} }

View File

@ -1,4 +1,5 @@
import deviceType from '@/jmap/constant/deviceType'; import deviceType from '@/jmap/constant/deviceType';
import { parser } from '@/jmap/utils/parser';
import Vue from 'vue'; import Vue from 'vue';
/** /**
@ -190,7 +191,9 @@ const map = {
state: { state: {
map: null, // 地图数据 map: null, // 地图数据
mapDevice: {}, // 解析后的地图数据
mapList: {}, // 地图数据列表 mapList: {}, // 地图数据列表
mapIdList: {}, // 地图数据列表(以id为标识)
mapViewLoadedCount: 0, // 地图视图加载完成标识 mapViewLoadedCount: 0, // 地图视图加载完成标识
mapDataLoadedCount: 0, // 地图数据加载完成标识 mapDataLoadedCount: 0, // 地图数据加载完成标识
trainDetails: null // 地图'列车详情'显示 trainDetails: null // 地图'列车详情'显示
@ -351,25 +354,21 @@ const map = {
trainDetails: (state) => { trainDetails: (state) => {
return state.trainDetails; return state.trainDetails;
}, },
getDeviceByCode: () => (code) => { getDeviceByCode: (state) => (code) => {
if (Vue.prototype.$jlmap) { return state.mapDevice[code];
return Vue.prototype.$jlmap.getDeviceByCode(code);
}
}, },
// 查询区段关联的计数器 // 查询区段关联的计数器
getCounterBySectionCode: (state) => (code, type) => { getCounterBySectionCode: (state) => (code, type) => {
let device = null; let device = null;
if (Vue.prototype.$jlmap) { var section = state.mapDevice[code];
var section = Vue.prototype.$jlmap.mapDevice[code]; if (section) {
if (section) { state.map.counterList.forEach(counter => {
state.map.counterList.forEach(counter => { if (counter.stationCode === section.model.stationCode && type == counter.type) {
if (counter.stationCode === section.model.stationCode && type == counter.type) { device = state.mapDevice[counter.code];
device = Vue.prototype.$jlmap.mapDevice[counter.code]; return;
return; }
} });
});
}
} }
return device; return device;
@ -378,16 +377,14 @@ const map = {
// 查询信号机关联的计数器 // 查询信号机关联的计数器
getCounterBySingalCode: (state) => (code, type) => { getCounterBySingalCode: (state) => (code, type) => {
let device = null; let device = null;
if (Vue.prototype.$jlmap) { var signal = state.mapDevice[code];
var signal = Vue.prototype.$jlmap.mapDevice[code]; if (signal) {
if (signal) { state.map.counterList.forEach(counter => {
state.map.counterList.forEach(counter => { if (counter.stationCode === signal.model.stationCode && type == counter.type) {
if (counter.stationCode === signal.model.stationCode && type == counter.type) { device = state.mapDevice[counter.code];
device = Vue.prototype.$jlmap.mapDevice[counter.code]; return;
return; }
} });
});
}
} }
return device; return device;
}, },
@ -395,12 +392,12 @@ const map = {
// 查询所属车站关联的控制模式 // 查询所属车站关联的控制模式
getStationControlByStationCode: (state) => (code) => { getStationControlByStationCode: (state) => (code) => {
let device = null; let device = null;
if (Vue.prototype.$jlmap && code && if (code &&
state.map && state.map &&
state.map.stationControlList && state.map.stationControlList.length) { state.map.stationControlList && state.map.stationControlList.length) {
state.map.stationControlList.forEach(elem => { state.map.stationControlList.forEach(elem => {
if (elem.stationCode == code) { if (elem.stationCode == code) {
device = Vue.prototype.$jlmap.mapDevice[elem.code]; device = state.mapDevice[elem.code];
} }
}); });
} }
@ -411,7 +408,12 @@ const map = {
mutations: { mutations: {
setMapData: (state, map) => { setMapData: (state, map) => {
state.map = map; if (map && map.skinVO) {
state.map = map;
state.mapDevice = parser(map, map.skinVO.code);
} else {
state.mapDevice = {};
}
}, },
mapRender: (state, devices) => { mapRender: (state, devices) => {
Vue.prototype.$jlmap && Vue.prototype.$jlmap.render(devices); Vue.prototype.$jlmap && Vue.prototype.$jlmap.render(devices);
@ -450,6 +452,7 @@ const map = {
}, },
mapClear: (state) => { mapClear: (state) => {
state.map = null; state.map = null;
state.mapDevice = {};
Vue.prototype.$jlmap && Vue.prototype.$jlmap.clear(); Vue.prototype.$jlmap && Vue.prototype.$jlmap.clear();
} }
}, },
@ -474,6 +477,10 @@ const map = {
} }
}, },
setMapDataIdList: ({ state }, data) => {
state.mapIdList[`mapDate_${data.mapId}`] = data.mapData;
},
updateMapDevices: ({ commit }, models) => { updateMapDevices: ({ commit }, models) => {
return new Promise((resolve) => { return new Promise((resolve) => {
if (!(models instanceof Array)) { if (!(models instanceof Array)) {

View File

@ -63,9 +63,9 @@ function convertRouterRoles({ roles, permissionType }) {
*/ */
function filterAsyncRouter(asyncRouter, roles, parentsRoles) { function filterAsyncRouter(asyncRouter, roles, parentsRoles) {
return asyncRouter.filter(route => { return asyncRouter.filter(route => {
if (route.name === '大屏系统' && roles.indexOf(admin)===-1 && roles.indexOf(userScreen) ===-1){ if (route.name === '大屏系统' && roles.indexOf(admin)===-1 && roles.indexOf(userScreen) ===-1) {
route.hidden = true; route.hidden = true;
} }
if (hasPermission(roles, route, parentsRoles)) { if (hasPermission(roles, route, parentsRoles)) {
if (route.children && route.children.length) { if (route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, roles, route.meta ? route.meta.roles : undefined); route.children = filterAsyncRouter(route.children, roles, route.meta ? route.meta.roles : undefined);

View File

@ -9,9 +9,10 @@ const runPlan = {
planSizeCount: 0, // 运行图canvas 大小变更标识 planSizeCount: 0, // 运行图canvas 大小变更标识
planLoadedCount: 0, // 运行图数据更新 planLoadedCount: 0, // 运行图数据更新
planUpdateCount: 0, // 运行图更新标识 planUpdateCount: 0, // 运行图更新标识
selected: {}, // 选择的对象 selected: {}, // 选择的对象
width: 800, // 运行图canvas 容器 宽度 width: 800, // 运行图canvas 容器 宽度
height: 600 // 运行图canvas 容器 高度 height: 600, // 运行图canvas 容器 高度
refreshCount: 0 // 刷新页面重新加载
}, },
getters: { getters: {
stations: (state) => { stations: (state) => {
@ -95,6 +96,9 @@ const runPlan = {
state.planData = {}; state.planData = {};
state.editData = {}; state.editData = {};
state.selected = {}; state.selected = {};
},
refresh: (state) => {
state.refreshCount++;
} }
}, },
actions: { actions: {
@ -130,6 +134,10 @@ const runPlan = {
/** 清空数据*/ /** 清空数据*/
clear: ({ commit }) => { clear: ({ commit }) => {
commit('clear'); commit('clear');
},
/** 刷新页面*/
refresh: ({commit}) => {
commit('refresh');
} }
} }
}; };

View File

@ -100,8 +100,8 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 设置user域token值 // 设置user域token值
commit(token.key, token.value); commit(token.key, token.value);
// let header = { group: '', 'X-Token': token.value }; const header = { group: '', 'X-Token': token.value };
// creatSubscribe(perpetualTopic, header); creatSubscribe(perpetualTopic, header);
// 获取用户参数 // 获取用户参数
dispatch('GetUserConfigInfo').then(response => { dispatch('GetUserConfigInfo').then(response => {
resolve(response); resolve(response);

View File

@ -1,5 +1,9 @@
/* eslint-disable */ /* eslint-disable */
require('script-loader!file-saver');
require('script-loader!@/utils/Blob');
import XLSX from 'xlsx'; import XLSX from 'xlsx';
import { translate } from '@/scripts/translate';
function generateArray(table) { function generateArray(table) {
var out = []; var out = [];
@ -81,7 +85,6 @@ function sheet_from_array_of_arrays(data, opts) {
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range); if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws; return ws;
} }
function encode_row(row) { return "" + (row + 1); }; function encode_row(row) { return "" + (row + 1); };
function encode_col(col) { var s = ""; for (++col; col; col = Math.floor((col - 1) / 26)) s = String.fromCharCode(((col - 1) % 26) + 65) + s; return s; } function encode_col(col) { var s = ""; for (++col; col; col = Math.floor((col - 1) / 26)) s = String.fromCharCode(((col - 1) % 26) + 65) + s; return s; }
function safe_format_cell(cell, v) { function safe_format_cell(cell, v) {
@ -179,7 +182,6 @@ export function sheet_to_json(sheet, opts) {
out.length = outi; out.length = outi;
return out; return out;
} }
function safe_decode_range(range) { function safe_decode_range(range) {
var o = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } }; var o = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
var idx = 0, i = 0, cc = 0; var idx = 0, i = 0, cc = 0;
@ -227,12 +229,14 @@ function s2ab(s) {
export function export_table_to_excel(id) { export function export_table_to_excel(id) {
var theTable = document.getElementById(id); var theTable = document.getElementById(id);
console.log('a')
var oo = generateArray(theTable); var oo = generateArray(theTable);
var ranges = oo[1]; var ranges = oo[1];
/* original data */ /* original data */
var data = oo[0]; var data = oo[0];
var ws_name = "SheetJS"; var ws_name = "SheetJS";
console.log(data);
var wb = new Workbook(), ws = sheet_from_array_of_arrays(data); var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
@ -249,6 +253,9 @@ export function export_table_to_excel(id) {
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), "test.xlsx") saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), "test.xlsx")
} }
function formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]))
}
export function export_json_to_excel(th, jsonData, defaultTitle) { export function export_json_to_excel(th, jsonData, defaultTitle) {
/* original data */ /* original data */
@ -268,3 +275,43 @@ export function export_json_to_excel(th, jsonData, defaultTitle) {
var title = defaultTitle || '列表' var title = defaultTitle || '列表'
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), title + ".xlsx") saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), title + ".xlsx")
} }
export function export_json_excel(jsonData, defaultTitle) {
let data = jsonData;
let wb = new Workbook();
for (let index in data) {
let filterVal = handelData(index);
if (filterVal.tHeader.length) {
let dataDetail = formatJson(filterVal.tHeaderF, data[index]);
dataDetail.unshift(filterVal.tHeader); // 设置表头的
let ws = sheet_from_array_of_arrays(dataDetail);
/* add worksheet to workbook */
let title = translate[index].sheetName || index;
wb.SheetNames.push(title);
wb.Sheets[`${title}`] = ws;
}
}
let wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: false, type: 'binary' });
var title = defaultTitle || '列表'
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), title + ".xlsx")
}
// 转换数据格式
function handelData(key) {
let tHeader = [];
let tHeaderF = [];
if (translate[key]) {
translate[key].columns.forEach(item => {
tHeader.push(item.tHeader);
tHeaderF.push(item.key);
});
}
let filterVal = {
tHeader: tHeader,
tHeaderF: tHeaderF,
};
return filterVal;
}

View File

@ -1,5 +1,5 @@
import store from '@/store'; import store from '@/store';
import { getPublishMapVersion, getPublishMapDetail } from '@/api/jmap/map'; import { getPublishMapVersion, getPublishMapDetail,getPublishMapVersionById,getPublishMapDetailById} from '@/api/jmap/map';
// 获取地图版本数据和store里面的map版本做比较如果不同 // 获取地图版本数据和store里面的map版本做比较如果不同
// 获取发布的地图数据 // 获取发布的地图数据
@ -34,3 +34,33 @@ export function loadMapData(skinStyle) {
}); });
}); });
} }
export function loadMapDataById(mapId) {
return new Promise((resolve, reject) => {
getPublishMapVersionById(mapId).then(resp => {
var version = resp.data;
var mapData = store.state.map.mapIdList[`mapDate_${mapId}`];
if (mapData && mapData.version == version) {
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
} else {
getPublishMapDetailById(mapId).then(res => {
mapData = res.data;
store.dispatch('map/setMapDataIdList', {mapData, mapId});
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
}).catch(error => {
reject(error);
});
}
}).catch(error => {
reject(error);
});
});
}

View File

@ -1,3 +1,6 @@
import store from '@/store';
import { timeFormat } from '@/utils/date';
/** 创建一个车次数据点*/ /** 创建一个车次数据点*/
export function createMartPoint(opt) { export function createMartPoint(opt) {
const rotate = opt.directionCode === '2' ? 45 : (opt.directionCode === '1' ? -45 : 0); const rotate = opt.directionCode === '2' ? 45 : (opt.directionCode === '1' ? -45 : 0);
@ -218,19 +221,6 @@ export function ascToNum(asc) {
return num; return num;
} }
/** 将时间格式化前补零*/
export function formatTime(time) {
let str = `${time}` || '';
if (str) {
const list = str.split(':');
str = list.map(elem => {
return `00000${elem}`.substr(-2);
}).join(':');
}
return str;
}
/** 根据索引获取单元格的数据*/ /** 根据索引获取单元格的数据*/
export function getCellValue(Sheet, index) { export function getCellValue(Sheet, index) {
let value; let value;
@ -280,3 +270,35 @@ export function convertSheetToList(Sheet, isReverse) {
return dataList; return dataList;
} }
/** 通过time将时间格式化*/
export function formatTime(time) {
if (Number.isInteger(time)) {
return timeFormat(time);
} else {
return '';
}
}
/** 通过code将名称格式化*/
export function formatName(code) {
let name = '';
const device = store.getters['map/getDeviceByCode'](code);
if (device) {
name = device.name;
}
return name;
}
/** 将时间格式化前补零*/
export function prefixTime(time) {
let str = `${time}` || '';
if (str) {
const list = str.split(':');
str = list.map(elem => {
return `00000${elem}`.substr(-2);
}).join(':');
}
return str;
}

View File

@ -1,12 +1,11 @@
import { handleToken } from '@/utils/auth'; import { handleToken } from '@/utils/auth';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { getBaseUrl } from '@/utils/baseUrl' import { getBaseUrl } from '@/utils/baseUrl';
var SockJS = require('sockjs-client'); var SockJS = require('sockjs-client');
var Stomp = require('stompjs'); var Stomp = require('stompjs');
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test';
const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`; const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`;
var StompClient = function (headers) { var StompClient = function (headers) {
@ -29,7 +28,7 @@ StompClient.prototype = {
sockStatus: 0, sockStatus: 0,
headers: { headers: {
'X-Token': handleToken(), 'X-Token': handleToken()
}, },
count: 0, count: 0,
@ -59,7 +58,7 @@ StompClient.prototype = {
this.closeStompDebug(); this.closeStompDebug();
// 向服务器发起websocket连接并发送CONNECT帧 // 向服务器发起websocket连接并发送CONNECT帧
this.clientIns.connect({ 'X-Token': handleToken(), }, () => { this.clientIns.connect({ 'X-Token': handleToken() }, () => {
console.info('连接成功.'); console.info('连接成功.');
this.count = 0; this.count = 0;
this.status = true; this.status = true;
@ -129,7 +128,7 @@ StompClient.prototype = {
closeStompDebug() { closeStompDebug() {
if (this.clientIns) { if (this.clientIns) {
this.clientIns.debug = undefined; this.clientIns.debug = undefined;
if (isDev || isTest) { if (isDev) {
this.clientIns.debug = function (message) { this.clientIns.debug = function (message) {
console.debug(message); console.debug(message);
}; };
@ -168,11 +167,11 @@ StompClient.prototype = {
unsubscribe(topic) { unsubscribe(topic) {
if (this.subscribeMap) { if (this.subscribeMap) {
let subscription = this.subscribeMap.get(topic); const subscription = this.subscribeMap.get(topic);
if (subscription) { if (subscription) {
subscription.unsubscribe(); subscription.unsubscribe();
this.subscribeMap.delete(topic); this.subscribeMap.delete(topic);
console.log("取消订阅"); console.log('取消订阅');
} }
} }
}, },
@ -204,7 +203,7 @@ StompClient.prototype = {
this.clientIns = null; this.clientIns = null;
} }
this.status = false; this.status = false;
console.log("断开连接"); console.log('断开连接');
} }
}; };

View File

@ -211,7 +211,7 @@
top: 0px; top: 0px;
width: 60px; width: 60px;
height: 60px; height: 60px;
-webkit-transform: rotate(180deg); transform: rotate(180deg);
-moz-transform: rotate(180deg); -moz-transform: rotate(180deg);
-ms-transform: rotate(180deg); -ms-transform: rotate(180deg);
-o-transform: rotate(180deg); -o-transform: rotate(180deg);
@ -231,7 +231,7 @@
top: 35%; top: 35%;
margin-top: -1.5px; margin-top: -1.5px;
left: 16px; left: 16px;
-webkit-transform-origin: 0% 50%; transform-origin: 0% 50%;
-moz-transform-origin: 0% 50%; -moz-transform-origin: 0% 50%;
-ms-transform-origin: 0% 50%; -ms-transform-origin: 0% 50%;
-o-transform-origin: 0% 50%; -o-transform-origin: 0% 50%;
@ -248,7 +248,7 @@
background: #fff; background: #fff;
position: absolute; position: absolute;
left: 0px; left: 0px;
-webkit-transform-origin: 0% 50%; transform-origin: 0% 50%;
-moz-transform-origin: 0% 50%; -moz-transform-origin: 0% 50%;
-ms-transform-origin: 0% 50%; -ms-transform-origin: 0% 50%;
-o-transform-origin: 0% 50%; -o-transform-origin: 0% 50%;
@ -303,14 +303,14 @@
} }
&.active { &.active {
-webkit-transform: rotate(0deg) !important; transform: rotate(0deg) !important;
-moz-transform: rotate(0deg) !important; -moz-transform: rotate(0deg) !important;
-ms-transform: rotate(0deg) !important; -ms-transform: rotate(0deg) !important;
-o-transform: rotate(0deg) !important; -o-transform: rotate(0deg) !important;
transform: rotate(0deg) !important; transform: rotate(0deg) !important;
.menu { .menu {
-webkit-transform: scale(0.7); transform: scale(0.7);
-moz-transform: scale(0.7); -moz-transform: scale(0.7);
-ms-transform: scale(0.7); -ms-transform: scale(0.7);
-o-transform: scale(0.7); -o-transform: scale(0.7);
@ -321,24 +321,24 @@
margin-top: -1.5px; margin-top: -1.5px;
left: 50%; left: 50%;
margin-left: -12px; margin-left: -12px;
-webkit-transform-origin: 50% 50%; transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%; -moz-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%; -ms-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%; -o-transform-origin: 50% 50%;
transform-origin: 50% 50%; transform-origin: 50% 50%;
-webkit-transform: rotate(405deg); transform: rotate(405deg);
-moz-transform: rotate(405deg); -moz-transform: rotate(405deg);
-ms-transform: rotate(405deg); -ms-transform: rotate(405deg);
-o-transform: rotate(405deg); -o-transform: rotate(405deg);
transform: rotate(405deg); transform: rotate(405deg);
&:before { &:before {
-webkit-transform-origin: 50% 50%; transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%; -moz-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%; -ms-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%; -o-transform-origin: 50% 50%;
transform-origin: 50% 50%; transform-origin: 50% 50%;
-webkit-transform: rotate(-450deg); transform: rotate(-450deg);
-moz-transform: rotate(-450deg); -moz-transform: rotate(-450deg);
-ms-transform: rotate(-450deg); -ms-transform: rotate(-450deg);
-o-transform: rotate(-450deg); -o-transform: rotate(-450deg);
@ -358,23 +358,23 @@
0%, 0%,
100% { 100% {
-webkit-transform: translateY(0px); transform: translateY(0px);
} }
10% { 10% {
-webkit-transform: translateY(6px); transform: translateY(6px);
} }
30% { 30% {
-webkit-transform: translateY(-4px); transform: translateY(-4px);
} }
70% { 70% {
-webkit-transform: translateY(3px); transform: translateY(3px);
} }
90% { 90% {
-webkit-transform: translateY(-2px); transform: translateY(-2px);
} }
} }
@ -406,7 +406,7 @@
0%, 0%,
100% { 100% {
-webkit-transform: translateY(0px); transform: translateY(0px);
-moz-transform: translateY(0px); -moz-transform: translateY(0px);
-ms-transform: translateY(0px); -ms-transform: translateY(0px);
-o-transform: translateY(0px); -o-transform: translateY(0px);
@ -414,7 +414,7 @@
} }
10% { 10% {
-webkit-transform: translateY(6px); transform: translateY(6px);
-moz-transform: translateY(6px); -moz-transform: translateY(6px);
-ms-transform: translateY(6px); -ms-transform: translateY(6px);
-o-transform: translateY(6px); -o-transform: translateY(6px);
@ -422,7 +422,7 @@
} }
30% { 30% {
-webkit-transform: translateY(-4px); transform: translateY(-4px);
-moz-transform: translateY(-4px); -moz-transform: translateY(-4px);
-ms-transform: translateY(-4px); -ms-transform: translateY(-4px);
-o-transform: translateY(-4px); -o-transform: translateY(-4px);
@ -430,7 +430,7 @@
} }
70% { 70% {
-webkit-transform: translateY(3px); transform: translateY(3px);
-moz-transform: translateY(3px); -moz-transform: translateY(3px);
-ms-transform: translateY(3px); -ms-transform: translateY(3px);
-o-transform: translateY(3px); -o-transform: translateY(3px);
@ -438,7 +438,7 @@
} }
90% { 90% {
-webkit-transform: translateY(-2px); transform: translateY(-2px);
-moz-transform: translateY(-2px); -moz-transform: translateY(-2px);
-ms-transform: translateY(-2px); -ms-transform: translateY(-2px);
-o-transform: translateY(-2px); -o-transform: translateY(-2px);

View File

@ -255,10 +255,17 @@
} }
}; };
} else { } else {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
if (this.courseModel.pmsList.length) { if (this.courseModel.pmsList.length) {
this.jump(); this.jump();
} else { } else {
if (this.tryTime <= 1) { if (this.tryTime <= 1) {
this.loading.close();
this.$confirm('您没有权限,请前往购买产品', '提示', { this.$confirm('您没有权限,请前往购买产品', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -355,4 +362,4 @@
.el-tabs--border-card>.el-tabs__header .el-tabs__item { .el-tabs--border-card>.el-tabs__header .el-tabs__item {
font-weight: bold !important; font-weight: bold !important;
} }
</style> </style>

View File

@ -15,7 +15,7 @@
</div> </div>
<div class="brief-box">城市轨道交通仿真系统以各地铁信号系统为基础针对培训部分进行改造旨在构建一套用于行车演示的专业仿真模拟系统 <div class="brief-box">城市轨道交通仿真系统以各地铁信号系统为基础针对培训部分进行改造旨在构建一套用于行车演示的专业仿真模拟系统
该系统具有高灵活性以便于将来的扩展升级同时仿真系统具备正常操作及故障操作两种模式除了正常的功能操作以外还可以进行设备的故障模拟</div> 该系统具有高灵活性以便于将来的扩展升级同时仿真系统具备正常操作及故障操作两种模式除了正常的功能操作以外还可以进行设备的故障模拟</div>
{{ $t('hello') }} {{ $t('lesson.content') }}
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-card> </el-card>

View File

@ -79,7 +79,8 @@ import { runDiagramQuit, loadQuest, getSimulationInfo } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic'; import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
// import { isFullscreen } from '@/utils/screen'; // import { isFullscreen } from '@/utils/screen';
import { loadMapData } from '@/utils/loaddata'; import { loadMapData,loadMapDataById } from '@/utils/loaddata';
import { getPublishMapInfo } from '@/api/jmap/map';
// import { handleToken } from '@/utils/auth'; // import { handleToken } from '@/utils/auth';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import Vue from 'vue'; import Vue from 'vue';
@ -196,6 +197,13 @@ export default {
}, },
async created() { async created() {
this.group = this.$route.query.group || ''; this.group = this.$route.query.group || '';
const loading = this.$loading({
lock: true ,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
loading.close();
}, },
async mounted() { async mounted() {
this.mode = this.$route.params.mode; this.mode = this.$route.params.mode;
@ -415,10 +423,9 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.switchMode('01'); this.switchMode('01');
const skinStyle = this.$route.query.skinStyle; const mapId = this.$route.query.mapId;
if (parseInt(skinStyle)) { if (parseInt(mapId)) {
await this.loadMapData(skinStyle); await this.loadMapDataById(mapId);
} else { } else {
this.endViewLoading(); this.endViewLoading();
} }
@ -474,6 +481,19 @@ export default {
this.endViewLoading(); this.endViewLoading();
} }
}, },
// id
async loadMapDataById(mapId)
{
try {
await loadMapDataById(mapId);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
// 仿 // 仿
async quit() { async quit() {
await runDiagramQuit(this.group); await runDiagramQuit(this.group);

View File

@ -265,7 +265,7 @@
font-size: 15px; font-size: 15px;
} }
.actionInfo{ .actionInfo{
margin-top: 30px; margin-top:20px;
margin-left: 5px; margin-left: 5px;
font-size: 15px; font-size: 15px;
width:98%; width:98%;

View File

@ -7,7 +7,7 @@
</el-form> </el-form>
<el-table <el-table
:data="ConditionVOList" border style="margin-top:10px;margin-left:10px;width:901px"> :data="ConditionVOList" border style="margin-top:10px;margin-left:10px;width:901px">
<el-table-column label="设备类型" width="150"> <el-table-column :label="$t('scriptRecord.deviceType')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.deviceType}}</div> <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-select v-else v-model="scope.row.deviceType" placeholder="请选择" @change="changeDeviceType($event,scope.row)">
@ -15,7 +15,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备编号" width="150"> <el-table-column :label="$t('scriptRecord.deviceCode')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.code}}</div> <div v-if="scope.row.isAdded">{{scope.row.code}}</div>
<el-select v-else v-model="scope.row.code" placeholder="请选择"> <el-select v-else v-model="scope.row.code" placeholder="请选择">
@ -23,7 +23,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备条件" width="150"> <el-table-column :label="$t('scriptRecord.deviceCondition')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.condition}}</div> <div v-if="scope.row.isAdded">{{scope.row.condition}}</div>
<el-select v-else v-model="scope.row.condition" placeholder="请选择"> <el-select v-else v-model="scope.row.condition" placeholder="请选择">
@ -31,7 +31,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="参数设备类型" width="150"> <el-table-column :label="$t('scriptRecord.paramDeviceType')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.paramDeviceType}}</div> <div v-if="scope.row.isAdded">{{scope.row.paramDeviceType}}</div>
<el-select v-else v-model="scope.row.paramDeviceType" placeholder="请选择" @change="changeParamDeviceType"> <el-select v-else v-model="scope.row.paramDeviceType" placeholder="请选择" @change="changeParamDeviceType">
@ -39,7 +39,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="参数设备编号" width="150"> <el-table-column :label="$t('scriptRecord.paramDeviceCode')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.isAdded">{{scope.row.paramCode}}</div> <div v-if="scope.row.isAdded">{{scope.row.paramCode}}</div>
<el-select v-else v-model="scope.row.paramCode" placeholder="请选择"> <el-select v-else v-model="scope.row.paramCode" placeholder="请选择">
@ -47,7 +47,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150"> <el-table-column :label="$t('scriptRecord.operation')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-row v-if="scope.row.isAdded"> <el-row v-if="scope.row.isAdded">
<el-button type="primary" size="mini" @click="deleteOperate(scope.$index)">删除</el-button> <el-button type="primary" size="mini" @click="deleteOperate(scope.$index)">删除</el-button>

View File

@ -1,30 +1,32 @@
<template> <template>
<div class="tab-pane-big"> <div>
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<div class="actionList"> <div class="actionList">
<i class="el-icon-back" @click="backToMember"></i> <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> <span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
</div> </div>
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action> <div class="tab-pane-big">
<el-table <el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
v-loading="loading" <add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
:data="actionList" border class="actionListTable"> <el-table
<el-table-column prop="reply" label="回复消息" width="200"> v-loading="loading"
</el-table-column> :data="actionList" border class="actionListTable">
<el-table-column prop="time" label="完成时间" width="200"> <el-table-column prop="reply" label="回复消息" width="200">
</el-table-column> </el-table-column>
<el-table-column prop="type" label="动作类型" width="200"> <el-table-column prop="time" label="完成时间" width="200">
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200"> <el-table-column prop="type" label="动作类型" width="200">
<template slot-scope="scope"> </el-table-column>
<el-row> <el-table-column label="操作" width="200">
<el-button type="primary" size="mini" @click="modifyAction(scope.row)">修改</el-button> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="deleteAction(scope.row)">删除</el-button> <el-row>
</el-row> <el-button type="primary" size="mini" @click="modifyAction(scope.row)">修改</el-button>
</template> <el-button type="primary" size="mini" @click="deleteAction(scope.row)">删除</el-button>
</el-table-column> </el-row>
</el-table> </template>
</el-scrollbar> </el-table-column>
</el-table>
</el-scrollbar>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -120,11 +122,15 @@
width:802px; width:802px;
} }
.actionList{ .actionList{
margin-top: 20px; margin-top: 10px;
margin-left: 5px; margin-left: 5px;
font-size: 15px; font-size: 15px;
margin-bottom:10px;
} }
.titleStyle{ .titleStyle{
margin-left:10px; margin-left:10px;
} }
.tab-pane-big{
height:380px;
}
</style> </style>

View File

@ -1,46 +1,48 @@
<template> <template>
<div class="tab-pane-big"> <div>
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar"> <div class="behaviorList">
<div class="behaviorList"> <i class="el-icon-back" @click="backToMember" style="cursor:pointer;"></i>
<i class="el-icon-back" @click="backToMember" style="cursor:pointer;"></i> <span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">行为信息</span></span>
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">行为信息</span></span> </div>
</div> <div class="tab-pane-big">
<add-behavior ref="addBehavior" :title="title" :group="group" :memberId="memberId" @create="handleCreate" :operateType="operateType" :buttonName="buttonName" @modifyButtonName="modifyButtonName"></add-behavior> <el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar">
<div class="behaviorList">行为列表</div> <add-behavior ref="addBehavior" :title="title" :group="group" :memberId="memberId" @create="handleCreate" :operateType="operateType" :buttonName="buttonName" @modifyButtonName="modifyButtonName"></add-behavior>
<el-table <div class="behaviorList">行为列表</div>
v-loading="loading" <el-table
:data="behaviorList" border class="behaviorListTable"> v-loading="loading"
<el-table-column label="是否主动触发" width="150"> :data="behaviorList" border class="behaviorListTable">
<template slot-scope="scope"> <el-table-column label="是否主动触发" width="150">
<div>{{scope.row.auto?"是":"否"}}</div> <template slot-scope="scope">
</template> <div>{{scope.row.auto?"是":"否"}}</div>
</el-table-column> </template>
<el-table-column label="目标角色" width="200"> </el-table-column>
<template slot-scope="scope"> <el-table-column label="目标角色" width="200">
<div>{{scope.row.targetMemberId}}</div> <template slot-scope="scope">
</template> <div>{{scope.row.targetMemberId}}</div>
</el-table-column> </template>
<el-table-column label="描述" width="200"> </el-table-column>
<template slot-scope="scope"> <el-table-column label="描述" width="200">
<div>{{scope.row.description}}</div> <template slot-scope="scope">
</template> <div>{{scope.row.description}}</div>
</el-table-column> </template>
<el-table-column label="触发条件" width="150"> </el-table-column>
<template slot-scope="scope"> <el-table-column label="触发条件" width="150">
<div>{{scope.row.conditionVO.triggerType==null?"无":scope.row.conditionVO.triggerType}}</div> <template slot-scope="scope">
</template> <div>{{scope.row.conditionVO.triggerType==null?"无":scope.row.conditionVO.triggerType}}</div>
</el-table-column> </template>
<el-table-column label="操作" width="200"> </el-table-column>
<template slot-scope="scope"> <el-table-column label="操作" width="200">
<el-row> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="modifyActions(scope.row)">修改</el-button> <el-row>
<el-button type="primary" size="mini" @click="deleteBehavior(scope.row)">删除</el-button> <el-button type="primary" size="mini" @click="modifyActions(scope.row)">修改</el-button>
</el-row> <el-button type="primary" size="mini" @click="deleteBehavior(scope.row)">删除</el-button>
<el-row style="margin-top:10px"><el-button type="primary" size="mini" @click="getActions(scope.row)">动作操作</el-button></el-row> </el-row>
</template> <el-row style="margin-top:10px"><el-button type="primary" size="mini" @click="getActions(scope.row)">动作操作</el-button></el-row>
</el-table-column> </template>
</el-table> </el-table-column>
</el-scrollbar> </el-table>
</el-scrollbar>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -131,7 +133,7 @@
width:901px; width:901px;
} }
.behaviorList{ .behaviorList{
margin-top: 20px; margin-top: 10px;
margin-left: 5px; margin-left: 5px;
font-size: 15px; font-size: 15px;
margin-bottom:20px; margin-bottom:20px;
@ -140,6 +142,6 @@
margin-left:10px; margin-left:10px;
} }
.tab-pane-big{ .tab-pane-big{
height:420px; height:370px;
} }
</style> </style>

View File

@ -1,20 +1,20 @@
<template> <template>
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="角色管理" name="first"> <el-tab-pane :label="$t('scriptRecord.roleManage')" name="first">
<div class="tab-pane"> <div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper"> <el-scrollbar wrapClass="scrollbar-wrapper">
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section> <role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="任务目标" name="second"> <el-tab-pane :label="$t('scriptRecord.targetCondition')" name="second">
<div class="tab-pane"> <div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper"> <el-scrollbar wrapClass="scrollbar-wrapper">
<target-condition ref="targetCondition" :group="group"></target-condition> <target-condition ref="targetCondition" :group="group"></target-condition>
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="任务剧本" name="third"> <el-tab-pane :label="$t('scriptRecord.taskScript')" name="third">
<div class="tab-pane"> <div class="tab-pane">
<el-scrollbar wrapClass="scrollbar-wrapper"> <el-scrollbar wrapClass="scrollbar-wrapper">
<task-script ref="taskScript" :group="group"></task-script> <task-script ref="taskScript" :group="group"></task-script>
@ -60,7 +60,6 @@
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList); this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList); this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
this.$store.dispatch('scriptRecord/updateScript', response.data.script); this.$store.dispatch('scriptRecord/updateScript', response.data.script);
debugger;
if(response.data.mapLocation) if(response.data.mapLocation)
{ {
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale}; let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};

View File

@ -1,35 +1,34 @@
<template> <template>
<div> <div>
<el-form :model="memberVO" ref="memberVO" :rules="rules" label-width="80px" class="roleAction" label-position="left"> <el-form :model="memberVO" ref="memberVO" :rules="rules" label-width="100px" class="roleAction" label-position="right">
<el-form-item label="角色名称" class="conditionVO" prop="name"> <el-form-item :label="$t('scriptRecord.roleName')" class="conditionVO" prop="name">
<el-input v-model="memberVO.name" class="inputStyle"></el-input> <el-input v-model="memberVO.name" class="inputStyle"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="角色类型" class="conditionVO" prop="role"> <el-form-item :label="$t('scriptRecord.roleType')" class="conditionVO" prop="role">
<el-select v-model="memberVO.role" placeholder="请选择角色类型" @change="changeRoleType"> <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-option v-for="rolerType in roleTypeList" :key="rolerType.label" :label="rolerType.label" :value="rolerType.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备编码" class="conditionVO"> <el-form-item :label="$t('scriptRecord.deviceCode')" class="conditionVO">
<el-select v-model="memberVO.deviceCode" clearable placeholder="请选择设备编码"> <el-select v-model="memberVO.deviceCode" clearable placeholder="请选择设备编码">
<!-- groupNumber -->
<el-option v-for="deviceCode in deviceCodeList" :key="deviceCode.code" :label="deviceCode.name" :value="deviceCode.code"></el-option> <el-option v-for="deviceCode in deviceCodeList" :key="deviceCode.code" :label="deviceCode.name" :value="deviceCode.code"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="addQuestMember('memberVO')">添加</el-button> <el-button type="primary" @click="addQuestMember('memberVO')">{{$t('scriptRecord.roleAdd')}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="roleList">角色列表</div> <div class="roleList">{{$t('scriptRecord.roleList')}}</div>
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="memberList" border class="memberList"> :data="memberList" border class="memberList">
<el-table-column prop="name" label="角色名称" width="350"> <el-table-column prop="name" :label="$t('scriptRecord.roleName')" width="350">
</el-table-column> </el-table-column>
<el-table-column label="操作" width="350"> <el-table-column :label="$t('scriptRecord.operation')" width="350">
<template slot-scope="scope"> <template slot-scope="scope">
<el-row> <el-row>
<el-button type="primary" size="mini" @click="getMembers(scope.row)">行为操作</el-button> <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)">删除</el-button> <el-button type="primary" size="mini" @click="deleteMember(scope.$index,scope.row)">{{$t('scriptRecord.delete')}}</el-button>
</el-row> </el-row>
</template> </template>
</el-table-column> </el-table-column>
@ -88,7 +87,6 @@
let group=this.group; let group=this.group;
postQuestMember(group,data).then(resp => { postQuestMember(group,data).then(resp => {
this.reloadTable(); this.reloadTable();
// this.dialogFormVisible=false;
this.memberVO.role="Admin"; this.memberVO.role="Admin";
this.memberVO.deviceCode=""; this.memberVO.deviceCode="";
this.memberVO.name=""; this.memberVO.name="";
@ -119,6 +117,7 @@
let group=this.group; let group=this.group;
getQuestRecord(group).then(response=>{ getQuestRecord(group).then(response=>{
this.memberList=response.data.memberVOList; this.memberList=response.data.memberVOList;
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList); this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
}); });
}, },

View File

@ -40,7 +40,7 @@
data(){ data(){
return{ return{
deviceConditionList:[], deviceConditionList:[],
conditionTitle:"目标条件", conditionTitle:this.$t("scriptRecord.conditionTitle"),
isAdding:false, isAdding:false,
// fieldS:"", // fieldS:"",
} }

View File

@ -66,6 +66,8 @@
}, },
watch: { watch: {
'$store.state.scriptRecord.memberList': function (val, old){ '$store.state.scriptRecord.memberList': function (val, old){
this.taskScript.memberId="";
this.taskScript.behavior="";
this.taskScriptList=val; this.taskScriptList=val;
}, },
'$store.state.scriptRecord.script': function (val, old){ '$store.state.scriptRecord.script': function (val, old){

View File

@ -20,9 +20,9 @@
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action> <get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action>
</template> </template>
<el-button-group class="button-group"> <el-button-group class="button-group">
<el-button type="primary" @click="saveMaplocation">更新定位</el-button> <el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button>
<el-button type="primary" @click="saveScenesStage">保存背景</el-button> <el-button type="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
<el-button type="success" @click="saveScenesData">保存数据</el-button> <el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button>
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> --> <!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
</el-button-group> </el-button-group>
</div> </div>
@ -35,7 +35,7 @@
import GetBehavior from './scriptRecord/getBehavior'; import GetBehavior from './scriptRecord/getBehavior';
import GetAction from './scriptRecord/getAction'; import GetAction from './scriptRecord/getAction';
import RoleConditionScript from './scriptRecord/roleConditionScript'; import RoleConditionScript from './scriptRecord/roleConditionScript';
import { launchFullscreen, exitFullscreen } from '@/utils/screen'; import { launchFullscreen, exitFullscreen } from '@/utils/screen';
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation'; import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
import {updateMapLocation} from '@/api/quest'; import {updateMapLocation} from '@/api/quest';
@ -55,7 +55,7 @@
}, },
data() { data() {
return { return {
title: '任务录制', title: this.$t('scriptRecord.scriptTitle'),
isShrink: false, isShrink: false,
memberId:null, memberId:null,
behaviorId:null, behaviorId:null,

View File

@ -181,6 +181,7 @@
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration); await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
await this.$store.dispatch('trainingList/setTrainingList', list); await this.$store.dispatch('trainingList/setTrainingList', list);
} catch (error) { } catch (error) {
this.loading.close();
// //
if (error.code === 500004) { if (error.code === 500004) {
this.$confirm('无此课程的考试权限,请前往购买!', '提示', { this.$confirm('无此课程的考试权限,请前往购买!', '提示', {
@ -195,11 +196,16 @@
this.$messageBox('不在考试范围之内'); this.$messageBox('不在考试范围之内');
} else { } else {
this.$messageBox(`${error.message}`); this.$messageBox(`${error.message}`);
} }
} }
}, },
exmaStart() { exmaStart() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.examDetail(); this.examDetail();
if (this.examList.length) { if (this.examList.length) {
examNotify({ examId: this.$route.params.examId }).then(resp => { examNotify({ examId: this.$route.params.examId }).then(resp => {
@ -208,12 +214,12 @@
trainingId: this.examList[0].trainingId, trainingId: this.examList[0].trainingId,
userExamId: this.userExam.id, userExamId: this.userExam.id,
examQuestionId: this.examList[0].id examQuestionId: this.examList[0].id
} };
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query }); this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`); this.$messageBox(`创建仿真失败: ${error.message}`);
this.loading.close();
}) })
} }
} }
@ -291,4 +297,4 @@
justify-content: center; justify-content: center;
transform: translateY(-20px); transform: translateY(-20px);
} }
</style> </style>

View File

@ -1,974 +0,0 @@
/* eslint-disable no-unused-vars */
import Vue from 'vue';
import Router from 'vue-router';
// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
Vue.use(Router);
/* Dashboard */
import Dashboard from '@/views/dashboard/index.vue';
/* Layout */
import Layout from '@/views/layout/Layout';
import Login from '@/views/login/index';
import LoginNew from '@/views/login/loginNew';
import Page404 from '@/views/404';
import LoginScreen from '@/views/login/loginScreen';
import LoginNewScreen from '@/views/login/loginNewScreen';
import LoginPlan from '@/views/login/loginPlan';
import LoginNewPlan from '@/views/login/loginNewPlan';
//地图绘制
import MapManage from '@/views/map/mapdraft/index';
import MapEdit from '@/views/map/mapdraft/mapedit/index';
import SkinStyle from '@/views/map/skinStyle/index';
import SkinStyleDraft from '@/views/map/skinStyle/draft';
//列车运行表
import ListPlan from '@/views/map/runplan/index';
//运行图视图
import ViewPlan from '@/views/map/runplan/chart';
//实训管理和编辑
import TrainingManage from '@/views/lesson/trainingrecord/index';
import TrainingEdit from '@/views/lesson/trainingrecord/manage/index';
//产品管理
import TrainingCategory from '@/views/lesson/trainingcategory/index';
import ProductList from '@/views/map/product/list';
import ProductDraft from '@/views/map/product/draft';
//课程管理
import LessonCategory from '@/views/lesson/lessoncategory/index';
//自动生成实训
import TrainingGeneration from '@/views/lesson/trainingmanage/index';
import TrainingRule from '@/views/lesson/trainingRule/list';
import TrainingRuleDetail from '@/views/lesson/trainingRule/detail/index';
//购买页面
import PayPage from '@/views/components/pay/index';
//教学系统
import Teach from '@/views/teach/index';
import TeachHome from '@/views/teach/home';
import TeachDetail from '@/views/teach/detail/index';
import TeachPracticalDetail from '@/views/teach/practical/index';
import TaskManageList from '@/views/lesson/taskmanage/list';
import ScriptManage from '@/views/lesson/scriptmanage/list';
//考试系统
import Exam from '@/views/exam/index';
import ExamHome from '@/views/exam/home';
import ExamDetail from '@/views/exam/detail/examDetail';
import ExamCourseDetail from '@/views/exam/detail/courseDetail';
import ExamQuestionDetail from '@/views/exam/detail/questionDetail';
import ExamResult from '@/views/exam/result';
//考试规则
import ExamRuleList from '@/views/publish/examRule/index';
import ExamRuleDraft from '@/views/publish/examRule/draft/index';
//仿真系统
import Demonstration from '@/views/demonstration/index';
import DemonstrationHome from '@/views/demonstration/home';
import DemonstrationDetail from '@/views/demonstration/detail/index';
//大屏系统
import ScreenMonitor from '@/views/screenMonitor/index';
import ScreenMonitorHome from '@/views/screenMonitor/home';
import ScreenMonitorDetail from '@/views/screenMonitor/detail/index';
//琏计划系统
import PlanMonitor from '@/views/planMonitor/index';
import PlanMonitorHome from '@/views/planMonitor/home';
import PlanMonitorDetail from '@/views/planMonitor/detail';
import PlanEditTool from '@/views/planMonitor/editTool/index';
//回放管理
import replay from '@/views/replay/index';
//权限管理
import PermissionList from '@/views/package/index';
import PermissionDraft from '@/views/package/draft/ruleForm';
// 产品状态管理
import ProductStatus from '@/views/publish/productStatus/index';
// 发布地图管理
import PublishMap from '@/views/publish/publishMap/index';
import PublishMapDraft from '@/views/publish/publishMap/draft';
// 发布课程管理
import PublishLesson from '@/views/publish/publishLesson/index';
// 仿真脚本管理
import SimulationScript from '@/views/publish/simulationScript/index';
// 运行图模板管理
import PlanTemplate from '@/views/publish/runPlanTemplate/index';
import PlanCommon from '@/views/publish/runPlanCommon/index';
import PlanCommonDraft from '@/views/publish/runPlanCommon/draft';
// 运行图每日加载管理
import PlanEveryDay from '@/views/publish/runPlanEveryDay/index';
// 系统字典管理
import Dictionary from '@/views/management/dictionary/index';
import DictionaryDetail from '@/views/management/dictionaryDetail/index';
// 用户考试管理
import UserExam from '@/views/management/userExam/index';
// 用户仿真管理
import UserSimulation from '@/views/management/userSimulation/index';
// 存在仿真管理
import ExistingSimulation from '@/views/management/existingSimulation/index';
// 用户实训管理
import UserTraining from '@/views/management/userTraining/index';
// 用户管理
import UserControl from '@/views/management/userControl/index';
// 商品管理
import commodityList from '@/views/orderauthor/commodity/index';
import CommodityDraft from '@/views/orderauthor/commodity/draft';
//课程权限管理
import LessonPermission from '@/views/orderauthor/author/index';
import LessonPermissionDraft from '@/views/orderauthor/author/draft';
//订单操作
import OrderList from '@/views/orderauthor/order/list';
import OrderDraft from '@/views/orderauthor/order/draft';
import runPlan from '../store/modules/runplan';
//打包管理
import PackageMange from '@/views/orderauthor/permission/index';
import PackageDetail from '@/views/orderauthor/permission/detail';
import PackageDraft from '@/views/orderauthor/permission/draft/ruleForm';
//综合演练
import trainRoom from '@/views/trainRoom/index';
import JointTrainingDraft from '@/views/jointTraining/index';
import ThreeTest from '@/views/jlmap3d/index';//test
import ThreeDrawTest from '@/views/jlmap3d/jlmap3dedit';//test
import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
export const UrlConfig = {
display: '/display',
examRuleDraft: '/examRule/draft',
examRuleManage: '/examRule/manage',
map: {
prefix: '/map',
draft: '/map/draw',
skinStyle: '/map/skinStyle',
skinStyleDraft: '/map/skinStyle/draft',
runPlan: '/map/runPlan',
runPlanView: '/map/runPlan/view',
product: '/map/product',
productDraft: '/map/product/draft',
},
lesson: {
prefix: '/lesson',
record: '/lesson/record/training',
manage: '/lesson/manage/training'
},
teach: {
prefix: '/teach',
detail: '/teach/detail',
practical: '/teach/practical',
pay: '/teach/pay',
},
exam: {
prefix: '/exam',
detail: '/exam/detail',
course: '/exam/course',
examRuleManage: '/exam/examRule/manage',
pay: '/exam/pay'
},
demonstration: {
prefix: '/demonstration',
detail: '/demonstration/detail',
pay: '/demonstration/pay'
},
dp: {
prefix: '/dp',
detail: '/dp/detail',
pay: '/dp/pay'
},
plan: {
prefix: '/plan',
tool: '/plan/tool',
detail: '/plan/detail',
pay: '/plan/pay'
},
replay: {
prefix: '/replay'
},
permission: {
prefix: '/permission',
permissionList: '/permission/manage',
permissionDraft: '/permission/draft',
permission: '/permission/restore'
},
publish: {
prefix: '/publish',
map: '/publish/map',
mapDraft: '/publish/map/draft',
runPlanEveryDay: '/publish/runPlan/everyDay',
runPlanTemplate: '/publish/runPlan/template',
runPlanCommon: '/publish/runPlan/common',
runPlanView: '/publish/runPlan/view',
},
orderauthor: {
prefix: '/orderauthor',
commodityManage: '/orderauthor/commodity/manage',
commodityDraft: '/orderauthor/commodity/draft',
orderManage: '/orderauthor/order/manage',
orderDraft: '/orderauthor/order/draft',
authorMange: '/orderauthor/author/manage',
authorDraft: '/orderauthor/author/draft',
transferDetail: '/orderauthor/transfer/detail',
trainferPackage: '/orderauthor/transfer/package'
}
};
export const constantRouterMap = [
{ path: '/dp/login', component: resolve => require(['@/views/login/loginNewScreen'], resolve), hidden: true }, //扫码登录
{ path: '/dp/login1', component: resolve => require(['@/views/login/loginScreen'], resolve), hidden: true }, //密码登录
{ path: '/plan/login', component: resolve => require(['@/views/login/loginNewPlan'], resolve), hidden: true }, //扫码登录
{ path: '/plan/login1', component: resolve => require(['@/views/login/loginPlan'], resolve), hidden: true }, //密码登录
{ path: '/login', component: resolve => require(['@/views/login/loginNew'], resolve), hidden: true }, //扫码登录
{ path: '/login1', component: resolve => require(['@/views/login/index'], resolve), hidden: true }, //密码登录
{ path: '/jlmap3d/edit', component: resolve => require(['@/views/jlmap3d/jlmap3dedit'], resolve), hidden: true },
{ path: '/404', component: resolve => require(['@/views/404'], resolve), hidden: true },
{ path: '*', redirect: '/404', hidden: true }
];
export default new Router({
mode: 'history', //后端支持可开
scrollBehavior: () => ({ y: 0 }),
routes: constantRouterMap
});
export const user = '01'; // 普通用户
export const mapCreater = '02'; // 地图创建权限
export const lessonCreater = '03'; // 课程创建权限
export const admin = '04'; // 管理员
export const superAdmin = '05'; // 超级管理员
export const userExam = '011'; // 考试系统
export const userLesson = '012'; // 教学系统
export const userSimulation = '013'; // 仿真系统
export const userScreen = '014'; // 大屏系统
export const userPlan = '015'; // 计划系统
export const asyncRouterMap = [
{
path: '/',
component: resolve => require(['@/views/layout/Layout'], resolve),
redirect: '/dashboard',
name: 'Dashboard',
hidden: true,
children: [
{
path: 'dashboard',
component: resolve => require(['@/views/dashboard/index.vue'], resolve)
},
]
},
{
path: '/display/:mode',
component: resolve => require(['@/views/display/index'], resolve),
meta: {
title: '实训视图'
},
hidden: true
},
{
path: '/trainroom',
component: resolve => require(['@/views/trainRoom/index'], resolve),
meta: {
title: '综合演练房间'
},
hidden: true,
},
{
path: '/jointTraining',
name: '联合演练试图',
component: resolve => require(['@/views/jointTraining/index'], resolve),
hidden: true
},
{
path: '/jlmap3d',
name: '三维test',
component: resolve => require(['@/views/jlmap3d/index'], resolve),
meta: {
title: '三维test'
},
hidden: true
},
{
path: '/map',
name: '地图管理',
meta: {
title: '地图管理',
roles: [admin, mapCreater],
},
component: resolve => require(['@/views/layout/Layout'], resolve),
children: [
{
path: 'skinStyle',
name: '皮肤管理',
component: resolve => require(['@/views/map/skinStyle/index'], resolve),
meta: {
title: '皮肤管理',
},
},
{
path: 'skinStyle/draft/:mode/:skinStyleId',
name: '操作权限',
hidden: true,
component: resolve => require(['@/views/map/skinStyle/draft'], resolve),
meta: {
title: '操作权限'
}
},
{
path: 'draw',
redirect: '/map/draw/0/draft',
component: resolve => require(['@/views/map/mapdraft/index'], resolve),
meta: {
title: '地图绘制',
},
children: [
{
path: ':mapId/:view',
component: resolve => require(['@/views/map/mapdraft/mapedit/index'], resolve),
meta: {
title: '地图绘制',
},
hidden: true
}
]
},
{
path: 'runPlan',
redirect: '/map/runPlan/view/draft',
name: '运行图管理',
component: resolve => require(['@/views/map/runplan/index'], resolve),
meta: {
title: '运行图管理'
},
children: [{
path: 'view/:mode',
component: resolve => require(['@/views/map/runplan/chart'], resolve),
hidden: true
}],
},
{
path: 'product',
name: '产品编辑',
component: resolve => require(['@/views/lesson/trainingcategory/index'], resolve),
meta: {
title: '产品编辑',
}
}
]
},
{
path: '/lesson',
component: resolve => require(['@/views/layout/Layout'], resolve),
name: '课程管理',
meta: {
title: '课程管理',
roles: [admin, lessonCreater],
},
children: [
{
path: 'record',
redirect: '/lesson/record/training/0/null',
component: resolve => require(['@/views/lesson/trainingrecord/index'], resolve),
meta: {
title: '实训录制',
},
children: [
{
path: 'training/:trainingId/:trainingName',
component: resolve => require(['@/views/lesson/trainingrecord/manage/index'], resolve),
meta: {
title: '实训录制',
},
hidden: true
},
]
},
{
path: 'manage/taskmanage',
name: '任务管理',
component: resolve => require(['@/views/lesson/taskmanage/list'], resolve),
meta: {
title: '任务管理'
}
},
{
path: 'manage/trainingRule',
name: '操作定义',
component: resolve => require(['@/views/lesson/trainingRule/list'], resolve),
meta: {
title: '操作定义'
},
},
{
path: 'manage/trainingRule/detail',
name: '操作定义明细',
hidden: true,
component: resolve => require(['@/views/lesson/trainingRule/detail/index'], resolve),
meta: {
title: '操作定义明细'
}
},
{
path: 'manage/training',
name: '实训管理',
component: resolve => require(['@/views/lesson/trainingmanage/index'], resolve),
meta: {
title: '实训管理'
}
},
{
path: 'edit',
name: '课程编辑',
component: resolve => require(['@/views/lesson/lessoncategory/index'], resolve),
meta: {
title: '课程编辑',
}
},
{
path: 'manage/scriptmanage',
name: '剧本管理',
component: resolve => require(['@/views/lesson/scriptmanage/list'], resolve),
meta: {
title: '剧本管理'
}
}
]
},
{
path: '/teach',
redirect: '/teach/home',
name: '教学系统',
component: resolve => require(['@/views/teach/index'], resolve),
meta: {
roles: [admin, userLesson, user],
},
children: [
{
path: 'home',
component: resolve => require(['@/views/teach/home'], resolve),
meta: {
title: '教学系统'
},
},
{
path: 'detail/:lessonId',
name: '课程详情',
component: resolve => require(['@/views/teach/detail/index'], resolve),
meta: {
title: '课程详情'
},
hidden: true
},
{
path: 'practical/:trainingId/:lessonId',
name: '实训详情',
component: resolve => require(['@/views/teach/practical/index'], resolve),
meta: {
title: '实训详情'
},
hidden: true
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/exam',
redirect: '/exam/home',
component: resolve => require(['@/views/exam/index'], resolve),
name: '考试系统',
meta: {
roles: [admin, userExam, user],
},
children: [
{
path: 'home',
component: resolve => require(['@/views/exam/home'], resolve),
meta: {
title: '考试系统'
},
},
{
path: 'detail/:examId',
name: '试卷详情',
component: resolve => require(['@/views/exam/detail/examDetail'], resolve),
meta: {
title: '试卷详情'
},
hidden: true,
},
{
path: 'course/:lessonId',
component: resolve => require(['@/views/exam/detail/courseDetail'], resolve),
meta: {
},
hidden: true,
},
{
path: 'examRule/manage',
name: '试题设置',
component: resolve => require(['@/views/publish/examRule/index'], resolve),
meta: {
title: '试题设置'
},
hidden: true,
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true,
component: resolve => require(['@/views/publish/examRule/draft/index'], resolve),
meta: {
title: '添加订单'
}
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
},
{
path: 'questionDetail/:examQuestionId',
name: '开始考试',
component: resolve => require(['@/views/exam/detail/questionDetail'], resolve),
meta: {
title: '开始考试',
},
hidden: true,
},
{
path: 'result/:userExamId',
name: '考试结果',
component: resolve => require(['@/views/exam/result'], resolve),
meta: {
title: '考试结果',
},
hidden: true
},
]
},
{
path: '/demonstration',
redirect: '/demonstration/home',
component: resolve => require(['@/views/demonstration/index'], resolve),
name: '仿真系统',
meta: {
roles: [admin, userSimulation, user],
},
children: [
{
path: 'home',
component: resolve => require(['@/views/demonstration/home'], resolve),
meta: {
title: '仿真系统'
},
},
{
path: 'detail/:mapId',
name: '地图详情',
component: resolve => require(['@/views/demonstration/detail/index'], resolve),
meta: {
title: '地图详情'
},
hidden: true
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/dp',
redirect: '/dp/home',
component: resolve => require(['@/views/screenMonitor/index'], resolve),
name: '大屏系统',
meta: {
roles: [admin, userScreen],
},
children: [
{
path: 'home',
component: resolve => require(['@/views/screenMonitor/home'], resolve),
meta: {
title: '大屏系统'
},
target: true
},
{
path: 'detail/:lessonId',
component: resolve => require(['@/views/screenMonitor/detail/index'], resolve),
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/plan/tool',
component: resolve => require(['@/views/planMonitor/editTool/index'], resolve),
meta: {
},
hidden: true
},
{
path: '/plan',
redirect: '/plan/home',
component: resolve => require(['@/views/planMonitor/index'], resolve),
name: '琏计划',
meta: {
roles: [admin, user],
},
children: [
{
path: 'home',
component: resolve => require(['@/views/planMonitor/home'], resolve),
meta: {
title: '琏计划'
},
target: true
},
{
path: 'detail/:lessonId',
component: resolve => require(['@/views/planMonitor/detail'], resolve),
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/replay',
component: resolve => require(['@/views/layout/Layout'], resolve),
meta: {
roles: [admin],
},
children: [
{
path: 'manage',
component: resolve => require(['@/views/replay/index'], resolve),
meta: {
title: '回放管理'
},
}
]
},
{
path: '/permission',
component: resolve => require(['@/views/layout/Layout'], resolve),
meta: {
roles: [admin, user],
},
children: [
{
path: 'manage',
component: resolve => require(['@/views/package/index'], resolve),
meta: {
title: '权限管理'
},
},
{
path: 'draft',
component: resolve => require(['@/views/package/draft/ruleForm'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/publish',
name: '发布内容管理',
component: resolve => require(['@/views/layout/Layout'], resolve),
meta: {
title: '发布内容管理',
roles: [admin],
},
children: [
{
path: 'map',
name: '发布地图管理',
component: resolve => require(['@/views/publish/publishMap/index'], resolve),
meta: {
title: '发布地图管理',
}
},
{
path: 'product',
name: '产品状态管理',
component: resolve => require(['@/views/publish/productStatus/index'], resolve),
meta: {
title: '产品状态管理',
}
},
{
path: 'lesson',
name: '发布课程管理',
component: resolve => require(['@/views/publish/publishLesson/index'], resolve),
meta: {
title: '发布课程管理',
}
},
// {
// path: 'script',
// name: '仿真脚本管理',
// component: resolve => require(['@/views/publish/simulationScript/index'], resolve),
// meta: {
// title: '仿真脚本管理',
// }
// },
{
path: 'runPlan/template',
component: resolve => require(['@/views/publish/runPlanTemplate/index'], resolve),
meta: {
title: '运行图模板管理'
}
},
{
path: 'runPlan/common',
component: resolve => require(['@/views/publish/runPlanCommon/index'], resolve),
meta: {
title: '运行图通用管理'
}
},
{
path: 'runPlan/everyDay',
component: resolve => require(['@/views/publish/runPlanEveryDay/index'], resolve),
meta: {
title: '运行图每日管理'
}
},
{
path: 'examRule/manage',
name: '试题管理',
component: resolve => require(['@/views/publish/examRule/index'], resolve),
meta: {
title: '试题管理'
}
},
{
path: 'map/draft/:mode/:mapId',
component: resolve => require(['@/views/publish/publishMap/draft'], resolve),
meta: {
},
hidden: true
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true,
component: resolve => require(['@/views/publish/examRule/draft/index'], resolve),
meta: {
}
},
{
path: 'runPlan/common/:mode',
component: resolve => require(['@/views/publish/runPlanCommon/draft'], resolve),
meta: {
},
hidden: true
},
{
path: 'runPlan/view/:mode',
component: resolve => require(['@/views/map/runplan/chart'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/orderauthor',
component: resolve => require(['@/views/layout/Layout'], resolve),
name: '订单权限管理',
meta: {
title: '订单权限管理',
roles: [admin]
},
children: [
{
path: 'commodity/manage',
name: '商品管理',
component: resolve => require(['@/views/orderauthor/commodity/index'], resolve),
meta: {
title: '商品管理'
}
},
{
path: 'order/manage',
name: '订单管理',
component: resolve => require(['@/views/orderauthor/order/list'], resolve),
meta: {
title: '订单管理'
}
},
{
path: 'author/manage',
name: '权限管理',
component: resolve => require(['@/views/orderauthor/author/index'], resolve),
meta: {
title: '权限管理'
}
},
{
path: 'transfer/manage',
name: '权限分发管理',
component: resolve => require(['@/views/orderauthor/permission/index'], resolve),
meta: {
title: '权限分发管理'
}
},
{
path: 'commodity/draft/:mode/:commodityId',
name: '添加商品',
hidden: true,
component: resolve => require(['@/views/orderauthor/commodity/draft'], resolve),
meta: {
title: '添加商品'
}
},
{
path: 'order/draft/:mode/:orderId',
name: '添加订单',
hidden: true,
component: resolve => require(['@/views/orderauthor/order/draft'], resolve),
meta: {
title: '添加订单'
}
},
{
path: 'author/draft/:mode/:userId',
name: '添加课程权限',
hidden: true,
component: resolve => require(['@/views/orderauthor/author/draft'], resolve),
meta: {
title: '添加课程权限'
}
},
{
path: 'transfer/detail/:permissionId',
component: resolve => require(['@/views/orderauthor/permission/detail'], resolve),
meta: {
},
hidden: true
},
{
path: 'transfer/package',
component: resolve => require(['@/views/orderauthor/permission/draft/ruleForm'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/system',
component: resolve => require(['@/views/layout/Layout'], resolve),
meta: {
title: '系统管理',
roles: [admin],
},
children: [
{
path: 'dictionary',
name: 'Dictionary',
component: resolve => require(['@/views/management/dictionary/index'], resolve),
meta: {
title: '数据字典'
}
},
{
path: 'dictionary/detail',
name: '数据字典明细',
hidden: true,
component: resolve => require(['@/views/management/dictionaryDetail/index'], resolve),
meta: {
title: '数据字典明细'
}
},
{
path: 'userManage',
name: '用户管理',
component: resolve => require(['@/views/management/userControl/index'], resolve),
meta: {
title: '用户管理',
}
},
{
path: 'userTrainingManage',
name: '用户实训管理',
component: resolve => require(['@/views/management/userTraining/index'], resolve),
meta: {
title: '用户实训管理',
}
},
{
path: 'userExamManage',
name: '用户考试管理',
component: resolve => require(['@/views/management/userExam/index'], resolve),
meta: {
title: '用户考试管理',
}
},
{
path: 'userSimulationManage',
name: '用户仿真管理',
component: resolve => require(['@/views/management/userSimulation/index'], resolve),
meta: {
title: '用户仿真管理',
}
},
{
path: 'existingSimulation',
name: '存在仿真管理',
component: resolve => require(['@/views/management/existingSimulation/index'], resolve),
meta: {
title: '存在仿真管理',
}
}
]
},
];

View File

@ -253,7 +253,7 @@ export default {
}, },
// //
setMap(map) { setMap(map) {
this.$jlmap.setMap(map); this.$jlmap.setMap(map, this.$store.state.map.mapDevice);
}, },
// //
refresh(map) { refresh(map) {

View File

@ -9,7 +9,8 @@
</template> </template>
<script> <script>
import { getSkinStyleList } from '@/api/management/mapskin' import { listPublishMap } from '@/api/jmap/map'
import { getQuestById} from '@/api/quest'; import { getQuestById} from '@/api/quest';
export default { export default {
@ -17,12 +18,12 @@
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
skinStyleList: [], mapList: [],
taskStatusList: [], taskStatusList: [],
disabled:null, disabled:null,
formModel: { formModel: {
name: '', name: '',
skinCode: '01', mapId: '',
description:'' description:''
}, },
isShow: false, isShow: false,
@ -38,7 +39,7 @@
labelWidth: '100px', labelWidth: '100px',
items: [ items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true}, { prop: 'name', label: '剧本名称', type: 'text', required: true},
{ prop: 'skinCode', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList,disabled:this.disabled}, { prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true}, { prop: 'description', label: '剧本描述', type: 'textarea', required: true},
] ]
} }
@ -49,8 +50,8 @@
name: [ name: [
{ required: true, message: '请输入剧本', trigger: 'blur' }, { required: true, message: '请输入剧本', trigger: 'blur' },
], ],
skinCode: [ mapId: [
{ required: true, message: '请选择皮肤类型', trigger: 'change' }, { required: true, message: '请选择地图', trigger: 'change' },
], ],
description:[ description:[
{ required: true, message: '请输入剧本描述', trigger: 'blur' }, { required: true, message: '请输入剧本描述', trigger: 'blur' },
@ -67,16 +68,16 @@
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinStyleList = []; this.mapList = [];
getSkinStyleList().then(response => { listPublishMap().then(response => {
this.skinStyleList = response.data.map(elem => { return { value: elem.code, label: elem.name } }); this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
}) })
}, },
doShow(questid) { doShow(questid) {
if(questid) if(questid)
{ {
getQuestById(questid).then(resp=>{ getQuestById(questid).then(resp=>{
let data={'name':resp.data.name,'description':resp.data.description,'skinCode':resp.data.skinCode}; let data={'name':resp.data.name,'description':resp.data.description,'mapId':resp.data.mapId};
this.formModel=data; this.formModel=data;
this.formModel.id=questid; this.formModel.id=questid;
this.disabled="disabled"; this.disabled="disabled";

View File

@ -11,8 +11,9 @@
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft'; // import { listPublishMap } from '@/api/jmap/mapdraft';
import { getSkinStyleList } from '@/api/management/mapskin' import { listPublishMap } from '@/api/jmap/map';
// import { getSkinStyleList } from '@/api/management/mapskin'
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest'; import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
@ -27,7 +28,7 @@
}, },
data() { data() {
return { return {
skinCodeList: [], mapList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -36,9 +37,9 @@
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true,
queryObject: { queryObject: {
skinCode: { mapId: {
type: 'select', type: 'select',
label: '皮肤类型', label: '地图',
config: { config: {
data: [] data: []
} }
@ -55,11 +56,11 @@
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '地图',
prop: 'skinCode', prop: 'mapId',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']) return this.$convertField(row.mapId, this.mapList, ['id', 'name'])
}, },
tagType: (row) => { return '' } tagType: (row) => { return '' }
}, },
@ -71,7 +72,7 @@
type: 'button', type: 'button',
title: '操作', title: '操作',
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: '录制', name: '录制',
@ -104,11 +105,12 @@
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.mapList = [];
getSkinStyleList().then(response => { listPublishMap().then(response => {
this.skinCodeList = response.data; this.mapList = response.data;
// this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
}) })
}) })
}, },
@ -141,7 +143,7 @@
// //
handleRecord(index, row) { handleRecord(index, row) {
scriptRecordNotify(row.id).then(resp => { scriptRecordNotify(row.id).then(resp => {
let query = { skinStyle: row.skinCode, group: resp.data, scriptId: row.id }; let query = { mapId: row.mapId, group: resp.data, scriptId: row.id };
this.$router.push({ path: `${UrlConfig.display}/script`, query }); this.$router.push({ path: `${UrlConfig.display}/script`, query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {

View File

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

View File

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

View File

@ -271,14 +271,20 @@ export default {
this.$refs.draftTrain.show({ event: '03', title: '删除自动生成实训' }); this.$refs.draftTrain.show({ event: '03', title: '删除自动生成实训' });
}, },
demoDisplay(index, node) { demoDisplay(index, node) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
trainingNotify({ trainingId: node.id }).then(resp => { trainingNotify({ trainingId: node.id }).then(resp => {
/** 区分演示和正式需要在演示时设置lessonId为0*/ /** 区分演示和正式需要在演示时设置lessonId为0*/
const query = { group: resp.data, trainingId: node.id, lessonId: 0 }; const query = { group: resp.data, trainingId: node.id, lessonId: 0 };
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query }); this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`); this.$messageBox(`创建仿真失败: ${error.message}`);
this.loading.close();
}); });
}, },

View File

@ -2,8 +2,8 @@
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center> <el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave"> </el-button> <el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>

View File

@ -26,15 +26,15 @@ export default {
queryObject: { queryObject: {
code: { code: {
type: 'text', type: 'text',
label: '编码' label: this.$t('system.code')
}, },
name: { name: {
type: 'text', type: 'text',
label: '名称' label: this.$t('system.name')
}, },
status: { status: {
type: 'select', type: 'select',
label: '状态', label: this.$t('system.status'),
config: { config: {
data: this.$ConstSelect.Status data: this.$ConstSelect.Status
} }
@ -48,27 +48,27 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '编码', title: this.$t('system.code'),
prop: 'code' prop: 'code'
}, },
{ {
title: '名称', title: this.$t('system.name'),
prop: 'name' prop: 'name'
}, },
{ {
title: '状态', title: this.$t('system.status'),
prop: 'status', prop: 'status',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); }, columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } } tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
}, },
{ {
title: '说明', title: this.$t('system.remarks'),
prop: 'remarks' prop: 'remarks'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: this.$t('global.operate'),
width: '250', width: '250',
buttons: [ buttons: [
{ {
@ -76,11 +76,11 @@ export default {
handleClick: this.handleViewDetail handleClick: this.handleViewDetail
}, },
{ {
name: '编辑', name: this.$t('global.edit'),
handleClick: this.handleEdit handleClick: this.handleEdit
}, },
{ {
name: '删除', name: this.$t('global.delete'),
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
} }
@ -88,7 +88,7 @@ export default {
} }
], ],
actions: [ actions: [
{ text: '新增', handler: this.handleAdd } { text: this.$t('global.add'), handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' } // { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
] ]
}, },
@ -115,8 +115,8 @@ export default {
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除该类型, 是否继续?', '提示', { this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: this.$t('global.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
del(row.id).then(response => { del(row.id).then(response => {
@ -124,7 +124,7 @@ export default {
this.reloadTable(); this.reloadTable();
}).catch(() => { }).catch(() => {
this.reloadTable(); this.reloadTable();
this.$messageBox('删除失败'); this.$messageBox(this.$t('error.deleteFailed'));
}); });
}); });
}, },

View File

@ -7,7 +7,6 @@
<transition> <transition>
<router-view /> <router-view />
</transition> </transition>
<!-- <menu-location ref="menuLocation" /> -->
</div> </div>
</template> </template>
<script> <script>
@ -15,14 +14,12 @@ import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import MapListOperation from './mapmanage/maplist'; import MapListOperation from './mapmanage/maplist';
import localStore from 'storejs'; import localStore from 'storejs';
import DrapLeft from '@/views/components/drapLeft/index'; import DrapLeft from '@/views/components/drapLeft/index';
// import MenuLocation from './menus/menuLocation';
export default { export default {
name: 'MapDraft', name: 'MapDraft',
components: { components: {
MapListOperation, MapListOperation,
DrapLeft DrapLeft
// MenuLocation
}, },
mixins: [ mixins: [
WindowResizeHandler WindowResizeHandler

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog title="自动信号列表" :visible.sync="show" width="85%" :before-do-close="doClose"> <el-dialog :title="$t('map.automaticSignalList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div> <div>
<QueryListPage <QueryListPage
ref="queryListPage" ref="queryListPage"
@ -41,7 +41,7 @@ export default {
queryObject: { queryObject: {
signalCode: { signalCode: {
type: 'select', type: 'select',
label: '信号机', label: this.$t('map.signal'),
config: { config: {
data: [] data: []
} }
@ -55,38 +55,38 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '自动信号编码', title: this.$t('map.automaticSignalCode'),
prop: 'code' prop: 'code'
}, },
{ {
title: '信号机名称', title: this.$t('map.signalCodeName'),
prop: 'signalCode' prop: 'signalCode'
}, },
{ {
title: '信号机code', title: this.$t('map.signalCode'),
prop: 'code' prop: 'code'
}, },
{ {
type: 'button', type: 'button',
title: '区段数据', title: this.$t('map.sectionData'),
buttons: [ buttons: [
{ {
name: '预览', name: this.$t('map.preview'),
handleClick: this.sectionDetail handleClick: this.sectionDetail
} }
] ]
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: this.$t('map.operation'),
width: '200', width: '200',
buttons: [ buttons: [
{ {
name: '编辑', name: this.$t('map.compile'),
handleClick: this.editObj handleClick: this.editObj
}, },
{ {
name: '删除', name: this.$t('map.delete'),
handleClick: this.deleteObj, handleClick: this.deleteObj,
type: 'danger' type: 'danger'
} }
@ -182,10 +182,10 @@ export default {
if (this.mapInfo && this.mapInfo.id && row) { if (this.mapInfo && this.mapInfo.id && row) {
// //
delAutoSignal(row.id).then(response => { delAutoSignal(row.id).then(response => {
this.$message.success('删除成功'); this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable(); this.reloadTable();
}).catch(error => { }).catch(() => {
this.$messageBox('删除失败'); this.$messageBox(this.$t('map.failDelete'));
}); });
} }
}, },
@ -197,12 +197,12 @@ export default {
const fieldList = { const fieldList = {
id: row.id, id: row.id,
mapId: this.$route.params.mapId, mapId: this.$route.params.mapId,
title: '区段列表', title: this.$t('map.sectionList'),
name: row.code, name: row.code,
model: { model: {
field: 'autoSignalClearList', field: 'autoSignalClearList',
items: [ items: [
{ prop: 'sectionCode', label: '区段名称', type: 'select', options: sectionDict } { prop: 'sectionCode', label: this.$t('map.sectionName'), type: 'select', options: sectionDict }
] ]
} }
}; };

View File

@ -4,16 +4,16 @@
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span> <span>
地图名称 {{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b> <b>{{ mapInfo.name }}</b>
</span> </span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">预览 <el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}
</el-button> </el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">新建 <el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.newConstruction') }}
</el-button> </el-button>
</div> </div>
<el-tabs v-model="enabledTab" type="card"> <el-tabs v-model="enabledTab" type="card">
<el-tab-pane label="自动信号" name="Route"> <el-tab-pane :label="$t('map.automaticSignal')" name="Route">
<route-draft <route-draft
ref="routeEdit" ref="routeEdit"
:selected="selected" :selected="selected"

View File

@ -3,7 +3,7 @@
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini"> <el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini">
<div class="definition"> <div class="definition">
<el-form-item label="信号机ID:" prop="signalCode"> <el-form-item :label="$t('map.signalID')" prop="signalCode">
<el-select v-model="addModel.signalCode" clearable :filterable="true"> <el-select v-model="addModel.signalCode" clearable :filterable="true">
<el-option <el-option
v-for="item in signalList" v-for="item in signalList"
@ -12,10 +12,10 @@
:value="item.code" :value="item.code"
/> />
</el-select> </el-select>
<el-button :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">激活 <el-button :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">{{ $t('map.activate') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item label="进路自动触发区段数据:" prop="autoSignalClearList"> <el-form-item :label="$t('map.segmentData')" prop="autoSignalClearList">
<el-select v-model="addModel.autoSignalClearList" multiple clearable :filterable="true"> <el-select v-model="addModel.autoSignalClearList" multiple clearable :filterable="true">
<el-option <el-option
v-for="item in sectionList" v-for="item in sectionList"
@ -27,13 +27,13 @@
<el-button <el-button
:type=" field === 'autoSignalClearList' ? 'danger' : 'primary'" :type=" field === 'autoSignalClearList' ? 'danger' : 'primary'"
@click="hover('autoSignalClearList')" @click="hover('autoSignalClearList')"
>激活</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group> <el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">保存 <el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button> </el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">更新 <el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button> </el-button>
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
@ -82,10 +82,10 @@ export default {
editShow: false, editShow: false,
rules: { rules: {
signalCode: [ signalCode: [
{ required: true, message: '请选择信号机', trigger: 'change' } { required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' }
], ],
autoSignalClearList: [ autoSignalClearList: [
{ required: true, message: '请选择进路自动触发区段数据', trigger: 'change' } { required: true, message: this.$t('map.triggerSegmentData'), trigger: 'change' }
] ]
} }
}; };
@ -149,11 +149,11 @@ export default {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
postAutoSignal(this.buildModel(getUID('autoSingle'))).then(resp => { postAutoSignal(this.buildModel(getUID('autoSingle'))).then(resp => {
this.$message.success('创建自动信号成功!'); this.$message.success(this.$t('map.automaticSignalSuccessful'));
this.loading = false; this.loading = false;
this.clear(); this.clear();
}).catch(() => { }).catch(() => {
this.$messageBox('创建自动信号失败'); this.$messageBox(this.$t('map.failedCreateSignal'));
this.loading = false; this.loading = false;
}); });
} }
@ -164,11 +164,11 @@ export default {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
putAutoSignal(this.buildModel()).then(resp => { putAutoSignal(this.buildModel()).then(resp => {
this.$message.success('更新自动信号成功!'); this.$message.success(this.$t('map.automaticSignalUpdateSucceeded'));
this.loading = false; this.loading = false;
this.clear(); this.clear();
}).catch(() => { }).catch(() => {
this.$messageBox('更新自动信号失败'); this.$messageBox(this.$t('map.automaticSignalUpdateFailed'));
this.loading = false; this.loading = false;
}); });
} }

View File

@ -243,10 +243,10 @@ export default {
x: em.clientX, x: em.clientX,
y: em.clientY y: em.clientY
}; };
if (!em.deviceType) {
var menu = getDeviceMenuByDeviceType('Cancel'); var menu = getDeviceMenuByDeviceType('Cancel');
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); }
}, },
saveMapEvent() { saveMapEvent() {
if (this.$refs.jlmapVisual) { if (this.$refs.jlmapVisual) {

View File

@ -1,21 +1,21 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane class="view-control" label="属性" name="first"> <el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="form" :form="dataForm" :form-model="editModel" :rules="rules" /> <config-list ref="form" :form="dataForm" :form-model="editModel" :rules="rules" />
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second"> <el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="make" :form="makeForm" :form-model="addModel" :rules="createRules" /> <config-list ref="make" :form="makeForm" :form-model="addModel" :rules="createRules" />
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button> <el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -51,11 +51,11 @@ export default {
imageLists: [ imageLists: [
{ {
value: `${process.env.VOICE_API}/oss/2d/bj1.png`, value: `${process.env.VOICE_API}/oss/2d/bj1.png`,
label: '上段' label: this.$t('map.upside')
}, },
{ {
value: `${process.env.VOICE_API}/oss/2d/bj2.png`, value: `${process.env.VOICE_API}/oss/2d/bj2.png`,
label: '下段' label: this.$t('map.hypomere')
} }
], ],
editModel: { editModel: {
@ -85,16 +85,16 @@ export default {
}, },
rules: { rules: {
width: [ width: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterImageWidth'), trigger: 'blur' }
], ],
height: [ height: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterImageHeight'), trigger: 'blur' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
] ]
} }
}; };
@ -107,13 +107,13 @@ export default {
const form = { const form = {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'code', label: '编码:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.resourceList, change: true, deviceChange: this.deviceChange }, { prop: 'code', label: this.$t('map.code'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.resourceList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: '图片名称:', type: 'input' }, { prop: 'name', label: this.$t('map.imageName'), type: 'input' },
{ prop: 'width', label: '图片宽度:', type: 'number', min: 0 }, { prop: 'width', label: this.$t('map.imageWidth'), type: 'number', min: 0 },
{ prop: 'height', label: '图片高度:', type: 'number', min: 0 }, { prop: 'height', label: this.$t('map.imageHeight'), type: 'number', min: 0 },
{ prop: 'zIndex', label: '图片层级:', type: 'number', min: 0 }, { prop: 'zIndex', label: this.$t('map.imageZindex'), type: 'number', min: 0 },
{ prop: 'rotate', label: '旋转角度:', type: 'number', min: 0 }, { prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: 0 },
{ prop: 'position', label: '图片坐标:', type: 'coordinate', width: '140px', children: [ { prop: 'position', label: this.$t('map.imagePoint'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] } ] }
@ -125,10 +125,10 @@ export default {
const form = { const form = {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'width', label: '图片宽度:', type: 'number', min: 0 }, { prop: 'width', label: this.$t('map.imageWidth'), type: 'number', min: 0 },
{ prop: 'height', label: '图片高度:', type: 'number', min: 0 }, { prop: 'height', label: this.$t('map.imageHeight'), type: 'number', min: 0 },
{ prop: 'url', label: '图片选择:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.imageLists }, { prop: 'url', label: this.$t('map.imageSelect'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.imageLists },
{ prop: 'position', label: '图片坐标:', type: 'coordinate', width: '140px', children: [ { prop: 'position', label: this.$t('map.imagePoint'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] } ] }
@ -139,16 +139,16 @@ export default {
createRules: function () { createRules: function () {
return { return {
width: [ width: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterImageWidth'), trigger: 'blur' }
], ],
height: [ height: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterImageHeight'), trigger: 'blur' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' } { required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
] ]
}; };
} }
@ -241,15 +241,15 @@ export default {
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() === 'ImageControl'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'ImageControl'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('map.confirmDeletion'), this.$t('map.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('map.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('map.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('map.cancelledDelete'));
}); });
} }
} }

View File

@ -54,7 +54,7 @@
<el-button <el-button
:type="item.buttonShowType ? 'danger' : 'primary'" :type="item.buttonShowType ? 'danger' : 'primary'"
@click="item.hover(item.buttonType)" @click="item.hover(item.buttonType)"
>激活</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="checkFieldType(item, 'input')"> <template v-if="checkFieldType(item, 'input')">

View File

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane class="view-control" label="属性" name="first"> <el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" :rules="editRules" label-width="120px" size="mini"> <el-form ref="form" :model="editModel" :rules="editRules" label-width="120px" size="mini">
<el-form-item label="计数器编码:" prop="code"> <el-form-item :label="$t('map.counterCoding')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange"> <el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option <el-option
v-for="item in counterList" v-for="item in counterList"
@ -14,10 +14,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计数器名称:" prop="name"> <el-form-item :label="$t('map.counterName')" prop="name">
<el-input v-model="editModel.name" /> <el-input v-model="editModel.name" />
</el-form-item> </el-form-item>
<el-form-item label="所属车站:" prop="stationCode"> <el-form-item :label="$t('map.belongsStation')" prop="stationCode">
<el-select v-model="editModel.stationCode" filterable> <el-select v-model="editModel.stationCode" filterable>
<el-option <el-option
v-for="item in stationList" v-for="item in stationList"
@ -27,8 +27,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计数器类型:" prop="type"> <el-form-item :label="$t('map.counterType')" prop="type">
<el-select v-model="editModel.type" filterable placeholder="请选择类型"> <el-select v-model="editModel.type" filterable :placeholder="$t('map.pleaseSelect')">
<el-option <el-option
v-for="item in typeList" v-for="item in typeList"
:key="item.code" :key="item.code"
@ -37,26 +37,26 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计数器最大值:" prop="max"> <el-form-item :label="$t('map.countMax')" prop="max">
<el-input-number v-model="editModel.max" :min="0" /> <el-input-number v-model="editModel.max" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="坐标 x:" prop="position.x"> <el-form-item :label="$t('map.pointX')" prop="position.x">
<el-input-number v-model="editModel.position.x" />px <el-input-number v-model="editModel.position.x" />px
</el-form-item> </el-form-item>
<el-form-item label="坐标 y:" prop="position.y"> <el-form-item :label="$t('map.pointY')" prop="position.y">
<el-input-number v-model="editModel.position.y" />px <el-input-number v-model="editModel.position.y" />px
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second"> <el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }"> <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 ref="make" label-width="120px" :model="addModel" :rules="createRules" size="mini">
<el-form-item label="车站名称:" prop="stationCode"> <el-form-item :label="$t('map.stationName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable> <el-select v-model="addModel.stationCode" filterable>
<el-option <el-option
v-for="item in stationList" v-for="item in stationList"
@ -66,8 +66,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计数器类型:" prop="type"> <el-form-item :label="$t('map.counterType')" prop="type">
<el-select v-model="addModel.type" filterable placeholder="请选择类型"> <el-select v-model="addModel.type" filterable :placeholder="$t('map.pleaseSelect')">
<el-option <el-option
v-for="item in typeList" v-for="item in typeList"
:key="item.code" :key="item.code"
@ -79,7 +79,7 @@
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button> <el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -110,8 +110,8 @@ export default {
return { return {
activeName: 'first', activeName: 'first',
typeList: [ typeList: [
{ code: '01', name: '区故解' }, { code: '01', name: this.$t('map.areaSolution') },
{ code: '02', name: '总人解' } { code: '02', name: this.$t('map.alwaysSolution') }
], ],
editModel: { editModel: {
code: '', code: '',
@ -140,35 +140,35 @@ export default {
createRules: function () { createRules: function () {
return { return {
type: [ type: [
{ required: true, message: '请选择计数器类型', trigger: 'change' } { required: true, message: this.$t('map.selectCounterType'), trigger: 'change' }
], ],
stationCode: [ stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' } { required: true, message: this.$t('map.selectStation'), trigger: 'change' }
] ]
}; };
}, },
editRules: function () { editRules: function () {
return { return {
code: [ code: [
{ required: true, message: '请重新选择设备', trigger: 'change' } { required: true, message: this.$t('map.pleaseSelectDevice'), trigger: 'change' }
], ],
stationCode: [ stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' } { required: true, message: this.$t('map.selectStation'), trigger: 'change' }
], ],
name: [ name: [
{ required: true, message: '请输入计数器名称', trigger: 'change' } { required: true, message: this.$t('map.pleaseSelectCountName'), trigger: 'change' }
], ],
type: [ type: [
{ required: true, message: '请选择计数器类型', trigger: 'change' } { required: true, message: this.$t('map.selectCounterType'), trigger: 'change' }
], ],
max: [ max: [
{ required: true, message: '请输入计数器最大值', trigger: 'change' } { required: true, message: this.$t('map.pleaseCounterValue'), trigger: 'change' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' } { required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'change' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'change' } { required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'change' }
] ]
}; };
} }
@ -266,15 +266,15 @@ export default {
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() === 'Counter'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('map.confirmDeletion'), this.$t('map.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('map.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('map.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('map.cancelledDelete'));
}); });
} }
} }

View File

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane class="view-control" label="属性" name="first"> <el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" :rules="editRules" label-width="130px" size="mini"> <el-form ref="form" :model="editModel" :rules="editRules" label-width="130px" size="mini">
<el-form-item label="延时解锁编码:" prop="code"> <el-form-item :label="$t('map.delayUnlockingCode')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange"> <el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option <el-option
v-for="item in delayShowList" v-for="item in delayShowList"
@ -14,7 +14,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属车站:" prop="stationCode"> <el-form-item :label="$t('map.belongsStation')" prop="stationCode">
<el-select v-model="editModel.stationCode" filterable> <el-select v-model="editModel.stationCode" filterable>
<el-option <el-option
v-for="item in stationList" v-for="item in stationList"
@ -24,32 +24,32 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="延时时间:" prop="unlockTime" disabled="true"> <el-form-item :label="$t('map.delayTime')" prop="unlockTime" disabled="true">
<el-input-number v-model="editModel.unlockTime" :min="0" :max="1000" />s <el-input-number v-model="editModel.unlockTime" :min="0" :max="1000" />s
</el-form-item> </el-form-item>
<el-form-item label="字体:" prop="fontFamily"> <el-form-item :label="$t('map.font')" prop="fontFamily">
<el-font v-model="editModel.fontFamily" /> <el-font v-model="editModel.fontFamily" />
</el-form-item> </el-form-item>
<el-form-item label="颜色:" prop="textFontColor"> <el-form-item :label="$t('map.color')" prop="textFontColor">
<el-color-picker v-model="editModel.textFontColor" show-alpha :predefine="skins" /> <el-color-picker v-model="editModel.textFontColor" show-alpha :predefine="skins" />
</el-form-item> </el-form-item>
<el-form-item label="坐标 x:" prop="position.x"> <el-form-item :label="$t('map.pointX')" prop="position.x">
<el-input-number v-model="editModel.position.x" />px <el-input-number v-model="editModel.position.x" />px
</el-form-item> </el-form-item>
<el-form-item label="坐标 y:" prop="position.y"> <el-form-item :label="$t('map.pointY')" prop="position.y">
<el-input-number v-model="editModel.position.y" />px <el-input-number v-model="editModel.position.y" />px
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second"> <el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="120px" :rules="createRules" :model="addModel" size="mini"> <el-form ref="make" label-width="120px" :rules="createRules" :model="addModel" size="mini">
<el-form-item label="车站名称:" prop="stationCode"> <el-form-item :label="$t('map.stationName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable> <el-select v-model="addModel.stationCode" filterable>
<el-option <el-option
v-for="item in stationList" v-for="item in stationList"
@ -62,7 +62,7 @@
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button> <el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -120,32 +120,32 @@ export default {
createRules: function () { createRules: function () {
return { return {
stationCode: [ stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' } { required: true, message: this.$t('map.selectStation'), trigger: 'change' }
] ]
}; };
}, },
editRules: function () { editRules: function () {
return { return {
code: [ code: [
{ required: true, message: '请重新选择设备', trigger: 'change' } { required: true, message: this.$t('map.pleaseSelectDevice'), trigger: 'change' }
], ],
stationCode: [ stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' } { required: true, message: this.$t('map.selectStation'), trigger: 'change' }
], ],
unlockTime: [ unlockTime: [
{ required: true, message: '请输入延时时间', trigger: 'change' } { required: true, message: this.$t('map.pleaseEnterDelayTime'), trigger: 'change' }
], ],
textFontColor: [ textFontColor: [
{ required: true, message: '请输入字体颜色', trigger: 'change' } { required: true, message: this.$t('map.pleaseEnterFontColor'), trigger: 'change' }
], ],
fontFamily: [ fontFamily: [
{ required: true, message: '请输入字体格式', trigger: 'change' } { required: true, message: this.$t('map.pleaseEnterFontFormat'), trigger: 'change' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' } { required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'change' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'change' } { required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'change' }
] ]
}; };
} }
@ -241,15 +241,15 @@ export default {
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() === 'DelayUnlock'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('map.confirmDeletion'), this.$t('map.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('map.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('map.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('map.cancelledDelete'));
}); });
} }
} }

View File

@ -4,7 +4,7 @@
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span> <span>
地图名称 {{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b> <b>{{ mapInfo.name }}</b>
</span> </span>
<el-button <el-button
@ -13,20 +13,20 @@
style="float: right; padding: 3px 0" style="float: right; padding: 3px 0"
:disabled="mapSaveing" :disabled="mapSaveing"
@click="saveMapEvent" @click="saveMapEvent"
>保存</el-button> >{{ $t('map.save') }}</el-button>
<el-button <el-button
v-if="isSave" v-if="isSave"
type="text" type="text"
style="float: right; padding: 3px 0; margin-right: 5px;" style="float: right; padding: 3px 0; margin-right: 5px;"
:disabled="mapSaveing" :disabled="mapSaveing"
@click="verifyMapEvent" @click="verifyMapEvent"
>数据校验</el-button> >{{ $t('map.dataVerification') }}</el-button>
</div> </div>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-radio-group v-model="viewSelect" @change="handleSelectView"> <el-radio-group v-model="viewSelect" @change="handleSelectView">
<el-radio-button :label="ViewMode.LOGIC">逻辑视图</el-radio-button> <el-radio-button :label="ViewMode.LOGIC">{{ $t('map.logicalView') }}</el-radio-button>
<el-radio-button :label="ViewMode.PHYSICAL">物理视图</el-radio-button> <el-radio-button :label="ViewMode.PHYSICAL">{{ $t('map.physicalView') }}</el-radio-button>
<el-radio-button :label="ViewMode.MIX">混合视图</el-radio-button> <el-radio-button :label="ViewMode.MIX">{{ $t('map.mixedView') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</el-row> </el-row>
<el-row v-if="ViewMode.LOGIC === viewSelect" class="logical-view" type="flex" justify="center"> <el-row v-if="ViewMode.LOGIC === viewSelect" class="logical-view" type="flex" justify="center">
@ -42,7 +42,7 @@
</el-checkbox-group> </el-checkbox-group>
</el-row> </el-row>
<el-tabs v-model="enabledTab" type="card"> <el-tabs v-model="enabledTab" type="card">
<el-tab-pane label="Link" name="Link"> <el-tab-pane :label="$t('map.link')" name="Link">
<link-draft <link-draft
ref="Link" ref="Link"
:card-height="cardHeights" :card-height="cardHeights"
@ -52,7 +52,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="区段" name="Section"> <el-tab-pane :label="$t('map.section')" name="Section">
<section-draft <section-draft
ref="Section" ref="Section"
:card-height="cardHeights" :card-height="cardHeights"
@ -63,7 +63,7 @@
@fieldSelect="fieldSelect" @fieldSelect="fieldSelect"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="道岔" name="Switch"> <el-tab-pane :label="$t('map.switch')" name="Switch">
<switch-draft <switch-draft
ref="Switch" ref="Switch"
:card-height="cardHeights" :card-height="cardHeights"
@ -73,7 +73,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="信号机" name="Signal"> <el-tab-pane :label="$t('map.signal')" name="Signal">
<signal-draft <signal-draft
ref="Signal" ref="Signal"
:card-height="cardHeights" :card-height="cardHeights"
@ -83,7 +83,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="zc区域控制" name="ZcControl"> <el-tab-pane :label="$t('map.zcZoneControl')" name="ZcControl">
<zc-control-draft <zc-control-draft
ref="ZcControl" ref="ZcControl"
:card-height="cardHeights" :card-height="cardHeights"
@ -93,7 +93,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="全线临时限速" name="LimitControl"> <el-tab-pane :label="$t('map.temporaryLimit')" name="LimitControl">
<limit-control-draft <limit-control-draft
ref="LimitControl" ref="LimitControl"
:card-height="cardHeights" :card-height="cardHeights"
@ -103,7 +103,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Lc控制" name="LcControl"> <el-tab-pane :label="$t('map.lcControl')" name="LcControl">
<lc-control-draft <lc-control-draft
ref="LcControl" ref="LcControl"
:card-height="cardHeights" :card-height="cardHeights"
@ -113,7 +113,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="图片" name="ImageControl"> <el-tab-pane :label="$t('map.image')" name="ImageControl">
<Image-control-draft <Image-control-draft
ref="ImageControl" ref="ImageControl"
:card-height="cardHeights" :card-height="cardHeights"
@ -123,7 +123,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="车站" name="Station"> <el-tab-pane :label="$t('map.station')" name="Station">
<station-draft <station-draft
ref="Station" ref="Station"
:card-height="cardHeights" :card-height="cardHeights"
@ -133,7 +133,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="控制模式" name="StationControl"> <el-tab-pane :label="$t('map.controlMode')" name="StationControl">
<station-control-draft <station-control-draft
ref="StationControl" ref="StationControl"
:card-height="cardHeights" :card-height="cardHeights"
@ -143,7 +143,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="站台" name="StationStand"> <el-tab-pane :label="$t('map.platform')" name="StationStand">
<station-stand-draft <station-stand-draft
ref="StationStand" ref="StationStand"
:card-height="cardHeights" :card-height="cardHeights"
@ -153,7 +153,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="计数器" name="Counter"> <el-tab-pane :label="$t('map.counter')" name="Counter">
<counter-draft <counter-draft
ref="Counter" ref="Counter"
:card-height="cardHeights" :card-height="cardHeights"
@ -163,7 +163,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="延迟解锁" name="DelayUnlock"> <el-tab-pane :label="$t('map.delayUnlock')" name="DelayUnlock">
<delay-unlock-draft <delay-unlock-draft
ref="DelayUnlock" ref="DelayUnlock"
:card-height="cardHeights" :card-height="cardHeights"
@ -173,7 +173,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="列车" name="Train"> <el-tab-pane :label="$t('map.train')" name="Train">
<train-draft <train-draft
ref="Train" ref="Train"
:card-height="cardHeights" :card-height="cardHeights"
@ -183,7 +183,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="车次窗" name="TrainWindow"> <el-tab-pane :label="$t('map.trainWindow')" name="TrainWindow">
<train-window-draft <train-window-draft
ref="TrainWindow" ref="TrainWindow"
:card-height="cardHeights" :card-height="cardHeights"
@ -193,7 +193,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="线条" name="Line"> <el-tab-pane :label="$t('map.line')" name="Line">
<line-draft <line-draft
ref="Line" ref="Line"
:card-height="cardHeights" :card-height="cardHeights"
@ -203,7 +203,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="文字" name="Text"> <el-tab-pane :label="$t('map.text')" name="Text">
<text-draft <text-draft
ref="Text" ref="Text"
:card-height="cardHeights" :card-height="cardHeights"
@ -270,7 +270,7 @@ export default {
}, },
mapInfo: { mapInfo: {
type: Object, type: Object,
default: function() { return {name: '请选择地图'}; } default: function() { return {name: this.$t('map.pleaseSelectMap')}; }
}, },
cardHeight: { cardHeight: {
type: [String, Number], type: [String, Number],
@ -283,12 +283,12 @@ export default {
feild: '', feild: '',
ViewMode: ViewMode, ViewMode: ViewMode,
LogicalViewTypeList: [ LogicalViewTypeList: [
{ code: 'Link', name: 'link' } { code: 'Link', name: this.$t('map.link') }
], ],
PhysicalViewTypeList: [ PhysicalViewTypeList: [
{ code: 'Section', name: '区段' }, { code: 'Section', name: this.$t('map.section') },
{ code: 'Signal', name: '信号机' }, { code: 'Signal', name: this.$t('map.signal') },
{ code: 'Switch', name: '道岔' } { code: 'Switch', name: this.$t('map.switch') }
], ],
logicalLevelsSelect: [], logicalLevelsSelect: [],
physicalLevelsSelect: [], physicalLevelsSelect: [],

Some files were not shown because too many files have changed in this diff Show More