Merge branch 'dev' of git.cloud.tencent.com:joylink/jl-nclient into dev

This commit is contained in:
sunzhenyu 2019-08-27 17:07:30 +08:00
commit 7239983b84
219 changed files with 6592 additions and 3950 deletions

View File

@ -113,3 +113,12 @@ export function updatePublishMapName(data) {
data: data
});
}
/** 修改发布地图名称*/
export function getPublishMapDetailList(params, code) {
return request({
url: `/api/map/${code}/versions`,
method: 'get',
params: params
});
}

View File

@ -209,6 +209,40 @@ export function getScriptMemberData(group) {
});
}
/** 获取剧本出演成员角色 */
export function getScriptPlayMember(group) {
return request({
url: `/api/simulation/${group}/scriptWrite/players`,
method: 'get'
});
}
/** 取消剧本演出成员角色 */
export function cancleScriptMembers(group, data) {
return request({
url: `/api/simulation/${group}/scriptWrite/removePlayers`,
method: 'put',
data
});
}
/** 选择剧本演出成员角色 */
export function selectScriptMembers(group, data) {
return request({
url: `/api/simulation/${group}/scriptWrite/choosePlayers`,
method: 'put',
data
});
}
/** 修改剧本演出成员性别 */
export function modifyScriptMemberSex(group, playerId, data) {
return request({
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
method: 'put',
});
}
/** 清除仿真剧本数据*/
export function dumpScriptData(group) {
return request({

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1,10 @@
export default {
simulationSystem: 'Urban rail transit simulation system',
simulationSystemDescription: 'Based on the subway signal system, the urban rail transit simulation system is reformed for the training part, aiming to build a set of professional simulation system for driving demonstration. The system has high flexibility for future expansion and upgrading. Meanwhile, the simulation system has two modes of normal operation and fault operation. Besides normal functional operation, it can also conduct fault simulation of equipment.',
simulationName: 'Simulation name:',
noSimulationProducts: 'No simulation products',
productDescription: 'Product description:',
startSimulation: 'Start the simulation',
createRoom: 'Create a room',
enterRoom: 'Enter the room'
};

View File

@ -51,5 +51,17 @@ export default {
templateHasBeUse: 'The template has been used by the load plan and cannot be deleted',
setFailed: 'Setup failed',
deleteException: 'To remove exceptions, contact your administrator',
paperHasUseNotDel: 'The paper has been used and cannot be deleted'
paperHasUseNotDel: 'The paper has been used and cannot be deleted',
batchCreateFailed: 'Batch build operation definition failed',
createOperateRuleFailed: 'Failed to create operation definition',
createOperateStepFailed: 'The create action step failed',
updateOperateStepFailed: 'The update action step failed',
packagePermissionFailed: 'Packaging authority failed',
acquisitionTimeFailed: 'Acquisition Time Failed',
getProductListFailed: 'Failed to get product list',
obtainChapterDataFailed: 'Failed to obtain chapter data',
obtainCourseDetailsFailed: 'Failed to obtain course details',
obtainCourseInformationFailed: 'Failed to obtain course information',
obtainStepDataFailed: 'Failed to obtain step data'
};

16
src/i18n/langs/en/exam.js Normal file
View File

@ -0,0 +1,16 @@
export default {
testSystem: '城市轨道交通考试系统',
testSystemDescription: ' 该系统具有自定义考试规则、自动生成考卷、学员成绩统计、数据曲线分析及题库管理等功能,从实战操作、业务流程、故障模拟及考试规则等多角度出发,力求打造最符合用户需求的城市轨道交通在线交互实操类考试系统',
examResultsDetails: '考试结果详情',
testQuestionsName: '试题名称',
testScores: '考试得分',
points: '分',
whetherThrough: '是否通过',
didNotCalculate: '未计算',
pass: '通过',
notPass: '未通过',
examTime: '考试用时',
trainingName: '实训名称',
trainingScore: '实训得分',
returnToExamList: '返回考试列表'
};

View File

@ -91,5 +91,20 @@ export default {
notBeUse: 'This function is not enabled for the time being',
fastCreate: 'Quickly Create',
duration: 'duration',
isTry: 'Try'
isTry: 'Try',
buy: 'Buy',
distributePermission: 'Distribute permission',
transferQRCode: 'Transfer QRCode',
minutes: 'minutes',
minute: 'minute',
totoal: 'Totoal',
publishPermission: 'The public authority',
specialPermission: 'Special permission',
mapList: 'Map list',
updateTime: 'Update time:',
line: 'Line:',
permissionList: 'Permissions list:',
remove: 'remove',
append: 'append',
release: 'release'
};

View File

@ -9,10 +9,14 @@ import scriptRecord from './scriptRecord';
import tip from './tip';
import system from './system';
import orderAuthor from './orderAuthor';
import teach from './teach';
import publish from './publish';
import permission from './permission';
import replay from './replay';
import planMonitor from './planMonitor';
import screenMonitor from './screenMonitor';
import demonstration from './demonstration';
import exam from './exam';
export default {
...enLocale,
@ -20,6 +24,7 @@ export default {
global,
router,
lesson,
teach,
error,
rules,
scriptRecord,
@ -29,5 +34,8 @@ export default {
publish,
permission,
replay,
planMonitor
planMonitor,
screenMonitor,
demonstration,
exam
};

View File

@ -7,6 +7,7 @@ export default {
hasCalcelDelete: 'Canceled deletion',
isConfirmDelete: 'Whether to confirm deletion?',
trainingName: 'Training Name',
trainingType: 'Training Type',
stationList: 'Station List',
stepInfo: 'Step Information',
selectMap: 'Please select the map',
@ -21,5 +22,70 @@ export default {
startRecording: 'Start Recording',
endRecording: 'End Recording',
nextStep: 'Next Step',
selectMode: 'Mode'
selectMode: 'Mode',
deleteSuccess: 'Delete successfully',
wellDelTrainingRule: 'This action will delete the training rule. Do you want to continue?',
stepDetail: 'Detail',
generation: 'Generation',
skinType: 'Skin Type',
minDuration: 'The Best Available',
maxDuration: 'The Largest Available',
trainingRemark: 'Explain',
createOperateRule: 'Create Action Rules',
editOperateRule: 'Edit Action Rules',
tipNamePlaceholderInfo: "Select the placeholder '{}' not to be deleted, otherwise the name will display incorrectly!",
tipExplainPlaceholderInfo: "Select placeholder '{}' not to be deleted, otherwise the display will be problematic!",
generationOperation: 'Automatic Generation Operation',
wellClearOperate: 'This operation clears all operation definitions under the skin. Do you want to continue?',
batchCreateSuccess: 'Batch build operation definition successful',
createOperateSuccess: 'The operation definition was created successfully',
updateOperateSuccess: 'The update steps were successful',
wellDelOperate: 'This action will delete the training step. Do you want to continue?',
operateCode: 'Opcode',
stepReturn: 'Return Value',
stepTips: 'Tips',
createStepInfo: 'Create Step Information',
eidtStepInfo: 'Edit Step Information',
product: 'Product',
remarks: 'Remarks',
operateSuccess: 'Operation successfully',
createChapter: 'Create chapter',
contentSorting: 'Content sorting',
courseList: 'Course list',
createNewCoursesFromRelease: 'Create new courses from release',
courseName: 'Course name',
parentChapter: 'Parent chapter',
chapterName: 'Chapter name',
chapterInstructions: 'Chapter instructions',
associatedTraining: 'Associated training',
updateChapter: 'Update chapter',
automaticOrManual: 'Auto/Manual',
automatic: 'Automatic',
manual: 'Manual',
publishCourseName: 'Publish course name',
draftCourseName: 'Draft course name',
associatedSkin: 'Associated skin',
associatedProducts: 'Associated products',
courseDescription: 'Course description',
editCourse: 'Edit course',
createCourse: 'Create course',
courseRelease: 'Course release',
releaseAssociatedCity: 'Release associated city',
releaseAssociatedMap: 'Release associated map',
trainingSequence: 'Training sequence',
creationTime: 'Creation time',
finishTime: 'Finish time',
createResults: 'Create results',
start: 'start',
toPerform: 'To perform',
productType: 'Product type:',
minTime: 'Minimum time:',
maxTime: 'Largest time:',
trainingDescription: 'Training description:',
generateTraining: 'Generate training',
updateTraining: 'Update training',
deleteTraining: 'Delete training',
automaticGenerationOfTraining: 'Automatic generation of training',
modifyTrainingByCategory: 'Modify training by category',
deleteAutoGeneratedTraining: 'Delete auto-generated training'
};

View File

@ -23,6 +23,7 @@ export default {
layerDisplay: 'The layer display',
viewShows: 'View shows',
contentShows: 'content show',
createBatch: 'Create a batch',
save: 'save',
updata: 'update',
@ -299,6 +300,7 @@ export default {
zzkContent: 'Station control content:',
stationControlZok: 'central',
skinStyleColon: 'Skin type:',
skinDesignation: 'SkinName',
skinCoding: 'SkinCoding',
coordinatesOrigin: 'CoordinatesOrigin',
@ -341,9 +343,13 @@ export default {
productType: 'ProductType',
productCode: 'ProductCode',
productName: 'ProductName',
createProductCategories: 'Create product categories',
productDescription: 'ProductDescription',
associateTrainingTypes: 'AssociateTrainingTypes',
createTrainingCategories: 'CreateTrainingCategories',
editTraining: 'Edit product categories',
productCategories: 'The product category',
selectOperation: 'Please select operation',
editTrainingCategories: 'EditTrainingCategories',
linkWidth: 'LinkWidth',
maxLinkWidth: '(Link width is at most 20)',
@ -380,6 +386,7 @@ export default {
trainCode: 'Train number:',
groupNumber: 'The number of:',
groupNumberInterval: 'Group number interval:',
modelCode: 'Car type:',
trainmodelCreate: 'New car type',
@ -488,6 +495,8 @@ export default {
switchBCode: 'Switch number 2',
switchACodeNum: 'Switch ID 1:',
switchBCodeNum: 'Switch ID 2:'
switchBCodeNum: 'Switch ID 2:',
wellDelTrianModel: 'Deleting the train model will delete the associated class cars together, please confirm whether to continue?',
clear: 'Clear'
};

View File

@ -2,5 +2,30 @@ export default {
permissionPack: 'Package',
setSuccess: 'Set successfully',
isSureSetBelonger: 'Are you sure to set {name} to be the owner of the permission?',
belonger: 'Set Owner'
setBelonger: 'Set Owner',
lessonName: 'Lesson Name',
mapName: 'Map Name',
mapProductName: 'Product Name',
permissionType: 'Permission Type',
permissionStatus: 'Permission Status',
permissionUseType: 'Public/Private',
permissionTotal: 'Total',
permissionRemains: 'Remains',
isForever: 'Permanent',
startTime: 'Start Time',
endTime: 'End Time',
belonger: 'Owner',
userList: 'User List',
customPackageRules: 'Custom packaging rules',
addRules: 'Add rules',
package: 'Pack',
getQrcode: 'Get qr code',
hasExitRule: 'This type rule already exists',
pleaseAddRule: 'Please add rules',
selectDate: 'Select time',
addPermissionPackageRule: 'Add authority packaging rules',
editPermissionPackageRule: 'edit authority packaging rule',
restPermissionMaxNumber: '(maximum number of remaining permissions: {0})',
pleaseSelectTransferPermission: 'Select transfer permissions'
};

View File

@ -1,3 +1,6 @@
export default {
buy: 'Buy',
offlineMappingSoftware: 'Offline mapping software',
lianPlanSystem: 'Urban rail transit lian planning system',
lianPlanDescription: 'Lian plan is a map compiling test system, can be real simulation to achieve the simulation of running test of new operation diagram, the system can realize editing operation diagram, import operation diagram and according to the standard of operation diagram simulation real driving environment, solve the problem that can not be updated for operation diagram test. It can find out the unreasonable places in the new diagram in time and make real-time adjustment on the diagram, so as to avoid the problem of finding problems in the operation of the new diagram and requiring manual intervention of dispatchers, and minimize the impact of the fault on the normal operation of subway.',
};

View File

@ -1,5 +1,5 @@
export default {
replay: 'playback',
replay: 'Play',
mapName: 'Map Name',
creatorId: 'Creator of ID',
createTime: 'Create Time',

View File

@ -32,6 +32,7 @@ export default {
pointY: 'Coordinates y:',
direct: 'The direction of:',
basisLink: 'Based on the Link:',
sectionRelSwitchCode: 'sectionRelSwitchCode',
pleaseSelectSectionName: 'Select the section name',
pleaseFillOffset: 'Please fill in the offset',
@ -213,5 +214,29 @@ export default {
sectionWidthInputPrompt: 'Please enter a valid segment width',
selectShowWatermark: 'Select whether or not to watermark',
pleaseInputMapName: 'Please enter a new name for the map',
inputTemplateRunPlan: 'Please select the template run diagram'
inputTemplateRunPlan: 'Please select the template run diagram',
inputSkinType: 'Please select skin type',
inputOperateCode: 'Please enter the step code',
inputStepNo: 'Please enter the step number',
inputStepTips: 'Please enter step number. Please enter step prompt',
selectMapName: 'Please select a map name',
selectMapProductName: 'Please select map product name',
inputTime: 'Please enter time',
inputPermissionNumber: 'Please enter the number of permissions',
permissionNumberGreater0: 'The number of permissions must be greater than 0',
enterChapterName: 'Please enter chapter name',
enterChapterInstructions: 'Please enter chapter instructions',
selectCourseName: 'Please select the course name',
enterCourseName: 'Please enter the course name',
selectAssociatedProduct: 'Please select the associated product',
enterCourseDescription: 'Please enter the course description',
courseIdIsEmpty: 'Course Id is empty',
selectCity: 'Please select city',
enterStandardTime: 'Please enter standard time',
enterNumericValue: 'Please enter a numeric value',
greaterThanMinTime: 'Must be greater than the minimum time',
selectTrainingType: 'Please select training type',
selectOneTrainingType: 'Only one training type can be selected',
enterProductType: 'Please enter product type',
selectAssociatedStation: 'Please select the associated station'
};

View File

@ -0,0 +1,6 @@
export default {
screenSystem: 'Large screen system of urban rail transit',
screenSystemDescription: 'Based on the subway signal system and real subway line data, the big screen system of urban rail transit aims to build a professional simulation system of driving demonstration. The system has high flexibility to switch line data freely.',
productTrialDuration: 'product Trial Duration',
aTSScreenSimulation: 'ATS line tuning center screen simulation'
};

View File

@ -0,0 +1,19 @@
export default {
title: 'Urban rail transit teaching system',
describe: 'This system is equipped with real business logic and software architecture based on the business and process-driven mode of metro employees and training sites. From the perspective of business process, standard operation, training mode and open principle, it strives to build a practical training and teaching system that best meets user needs and responds to changes quickly.',
trainingName: 'Training name:',
trainingTime: 'Best time to complete the training:',
trainingMaximum: 'Maximum time to complete the training:',
trainingInstructions: 'Training instructions:',
startTraining: 'Began to practice',
courseName: 'Course name',
courseDescription: 'Course description',
courseDetails: 'Course details',
free: 'free',
permissionsDetails: 'Permissions for details',
buy: 'buy',
permissionDistribute: 'Permission distribution (class)',
authorityTransferred: 'Authority transferred',
courseList: 'Course list'
};

View File

@ -5,9 +5,11 @@ export default {
creatingFailed: 'Create a failure',
confirmDeletion: 'Confirm deletion?',
confirmBatchGeneration: 'Is batch generation confirmed?',
hint: 'hint',
confirmBatchDelete: 'Is batch deletion confirmed?',
hint: 'Tips',
cancelledDelete: 'Cancelled delete',
cancelGeneration: 'Batch generation has been cancelled',
refreshFailure: 'Refresh failure',
updateSuccessfully: 'The update is successful',
saveSuccessfully: 'Save success',
@ -25,6 +27,8 @@ export default {
selectedSectionEmpty: 'The selected section is empty',
selectedStationEmpty: 'The selected station is empty',
enterKeywordsFiltering: 'Enter keywords for filtering',
selectMap: 'Please select the map first',
selectTrainType: 'Please select the train model to view',
@ -59,6 +63,9 @@ export default {
deleteProductSuccessfully: 'Product deleted successfully',
deleteProductFailed: 'Product deletion failed',
cannotDeleteProduct: 'The product has been used and cannot be deleted',
productCodeExists: 'The product Code already exists',
narrowScope: 'You cannot narrow down the training list you created last time',
pathCreationSuccessful: 'Create road successfully!',
createRoutingFailed: 'Failed to create junction',
pathUpdataSuccessful: 'Road update successful!',
@ -89,5 +96,35 @@ export default {
skinDeleteConfirmation: 'This will permanently remove the skin. Do you want to continue?',
skinCodingExist: 'Map skin codes already exist',
underImport: 'UnderImport...',
deleteTypeHint: 'This action deletes the type. Do you want to continue?'
deleteTypeHint: 'This action deletes the type. Do you want to continue?',
selectValidInterval: 'Please select a valid interval',
failedCourse: 'Failed to obtain course information',
createSimulationFaild: 'Failed to create simulation',
accessCourseNo: 'No access to this course, please go and buy it!',
failedSubmitOrder: 'Failed to submit order',
permissionsNumber: 'Please enter the number of valid permissions',
purchaseMonth: 'Please enter a valid purchase month',
createRoomFailedHint: 'Each user can only create one comprehensive drill room. Do you want to enter the room?',
noPermissionHint: 'You do not have permission, please go to purchase products',
trainModelNameRepeat: 'Train model data duplication',
coursePublishSuccessful: 'Successful course release',
coursePublishFailed: 'Course launch failed',
startOperationHint: 'This operation will start the task. Do you want to continue?',
cancelsTaskHint: 'This action cancels the task. Do you want to continue?',
automaticGenerationTrainingSuccess: 'Automatic generation of training success',
automaticGenerationTrainingFailure: 'Automatic generation of training failure',
updateAutomaticGenerationTrainingSuccess: 'Update automatically generated training successfully',
updateAutomaticGenerationTrainingFailure: 'Update automatically generated training failure',
deleteAutomaticGenerationTrainingSuccess: 'Delete automatic generation training successfully',
deleteAutomaticGenerationTrainingFailure: 'Delete automatic generation training failure',
addTrainingSuccessfully: 'Add training successfully!',
addTrainingFailed: 'Failed to add training',
updateTrainingSuccessfully: 'Update training successfully!',
updateTrainingFailed: 'Failed to update training',
savedStepDataSuccessfully: 'Saved step data successfully',
savedStepDataFailed: 'Failed to save step data'
};

View File

@ -0,0 +1,10 @@
export default {
simulationSystem: '城市轨道交通仿真系统',
simulationSystemDescription: '城市轨道交通仿真系统以各地铁信号系统为基础,针对培训部分进行改造,旨在构建一套用于行车演示的专业仿真模拟系统。该系统具有高灵活性以便于将来的扩展升级,同时,仿真系统具备正常操作及故障操作两种模式,除了正常的功能操作以外还可以进行设备的故障模拟。',
simulationName: '仿真名称:',
noSimulationProducts: '无仿真产品',
productDescription: '产品说明:',
startSimulation: '开始仿真',
createRoom: '创建房间',
enterRoom: '进入房间'
};

View File

@ -51,6 +51,16 @@ export default {
templateHasBeUse: '该模板已被加载计划使用,无法删除',
setFailed: '设置失败',
deleteException: '删除异常,请联系管理员',
paperHasUseNotDel: '该试卷已被使用,不能删除'
paperHasUseNotDel: '该试卷已被使用,不能删除',
batchCreateFailed: '批量生成操作定义失败',
createOperateRuleFailed: '创建操作定义失败',
createOperateStepFailed: '创建操作步骤失败',
updateOperateStepFailed: '更新操作步骤失败',
packagePermissionFailed: '打包权限失败',
acquisitionTimeFailed: '获取时间失败',
getProductListFailed: '获取产品列表失败',
obtainChapterDataFailed: '获取章节数据失败',
obtainCourseDetailsFailed: '获取课程详情失败',
obtainCourseInformationFailed: '获取课程信息失败',
obtainStepDataFailed: '获取步骤数据失败'
};

16
src/i18n/langs/zh/exam.js Normal file
View File

@ -0,0 +1,16 @@
export default {
testSystem: '城市轨道交通考试系统',
testSystemDescription: ' 该系统具有自定义考试规则、自动生成考卷、学员成绩统计、数据曲线分析及题库管理等功能,从实战操作、业务流程、故障模拟及考试规则等多角度出发,力求打造最符合用户需求的城市轨道交通在线交互实操类考试系统',
examResultsDetails: '考试结果详情',
testQuestionsName: '试题名称',
testScores: '考试得分',
points: '分',
whetherThrough: '是否通过',
didNotCalculate: '未计算',
pass: '通过',
notPass: '未通过',
examTime: '考试用时',
trainingName: '实训名称',
trainingScore: '实训得分',
returnToExamList: '返回考试列表'
};

View File

@ -85,6 +85,44 @@ export default {
inputRoomNumber: '请输入房间号',
chooseRoom: '选择房间',
month: '月',
permissions: '权限',
yuanMonth: '元/月',
permissionType: '权限类型:',
purchaseDuration: '购买时长:',
custom: '自定义',
permissionNum: '权限数量:',
orderCode: '订单编码:',
creationTime: '创建时间:',
amountPayable: '应付金额:',
indexA: '个',
purchasePrice: '购买总价:',
submitOrders: '提交订单',
completePayment: '完成支付',
weChatPay: '微信支付',
alipayPayment: '支付宝支付',
clickRefresh: '请点击刷新',
buyProject: '你将购买的商品为虚拟内容服务,购买后不支持退货、转让、退换,请斟酌确认。',
relatedServices: '购买后可在“权限详情”区查看和使用相关服务。',
paymentSuccessful: '支付成功,点击返回',
cancelSuccessfully: '取消成功,点击返回',
paymentFailed: '支付失败,点击返回',
checkstand: '收银台',
january: '一月',
march: '三月',
year: '一年',
twoYears: '两年',
fiveYears: '五年',
tenYears: '十年',
courseName: '课程名称',
screenName: '大屏名称',
productName: '产品名称',
coursePrice: '课程单价',
testPrice: '考试单价',
simulationPrice: '仿真单价',
timeUnitPrice: '大屏单价',
putaway: '上 架',
soldOut: '下 架',
exportMap: '导出地图',
@ -92,6 +130,20 @@ export default {
notBeUse: '该功能暂时未开启',
fastCreate: '快速创建',
duration: '时长',
isTry: '是否试用'
isTry: '是否试用',
buy: '购 买',
distributePermission: '权限分发',
transferQRCode: '权限转赠',
minutes: '分钟',
minute: '分钟',
totoal: '总数',
publishPermission: '公用权限',
specialPermission: '专用权限',
mapList: '地图列表',
updateTime: '更新时间:',
line: '线路:',
permissionList: '权限列表:',
remove: '移除',
append: '添加',
release: '发布'
};

View File

@ -9,10 +9,14 @@ import scriptRecord from './scriptRecord';
import tip from './tip';
import system from './system';
import orderAuthor from './orderAuthor';
import teach from './teach';
import publish from './publish';
import permission from './permission';
import replay from './replay';
import planMonitor from './planMonitor';
import screenMonitor from './screenMonitor';
import demonstration from './demonstration';
import exam from './exam';
export default {
...cnLocale,
@ -21,6 +25,7 @@ export default {
router,
lesson,
error,
teach,
rules,
scriptRecord,
tip,
@ -29,5 +34,8 @@ export default {
publish,
permission,
replay,
planMonitor
planMonitor,
screenMonitor,
demonstration,
exam
};

View File

@ -7,6 +7,7 @@ export default {
hasCalcelDelete: '已取消删除',
isConfirmDelete: '是否确认删除?',
trainingName: '实训名称',
trainingType: '实训类型',
stationList: '车站列表',
stepInfo: '步骤信息',
selectMap: '请选择地图',
@ -21,5 +22,71 @@ export default {
startRecording: '开始录制',
endRecording: '结束录制',
nextStep: '下一步',
selectMode: '模式选择'
selectMode: '模式选择',
deleteSuccess: '删除成功',
wellDelTrainingRule: '此操作将删除此实训规则, 是否继续?',
stepDetail: '步骤明细',
generation: '自动生成',
skinType: '皮肤类型',
minDuration: '最佳用时',
maxDuration: '最大用时',
trainingRemark: '实训说明',
createOperateRule: '创建操作规则',
editOperateRule: '编辑操作规则',
tipNamePlaceholderInfo: '选择占位符 {} 不可删除,否则名称显示会有问题!',
tipExplainPlaceholderInfo: '选择占位符 {} 不可删除,否则说明显示会有问题!',
generationOperation: '自动生成操作',
wellClearOperate: '此操作将清空改皮肤下所有操作定义, 是否继续?',
batchCreateSuccess: '批量生成操作定义成功',
createOperateSuccess: '创建操作定义成功',
updateOperateSuccess: '更新操作步骤成功',
wellDelOperate: '此操作将删除此实训步骤, 是否继续?',
operateCode: '操作码',
stepReturn: '步骤返回值',
stepTips: '步骤提示信息',
createStepInfo: '创建步骤信息',
editStepInfo: '编辑步骤信息',
product: '产品',
remarks: '描述',
operateSuccess: '操作成功',
createChapter: '创建章节',
contentSorting: '内容排序',
courseList: '课程列表',
createNewCoursesFromRelease: '从发布课程新建',
courseName: '课程名称:',
parentChapter: '父级章节:',
chapterName: '章节名称:',
chapterInstructions: '章节说明:',
associatedTraining: '关联实训:',
updateChapter: '更新章节',
automaticOrManual: '自动/人工',
automatic: '自动',
manual: '人工',
publishCourseName: '发布课程名称:',
draftCourseName: '草稿课程名称:',
associatedSkin: '关联皮肤:',
associatedProducts: '关联产品:',
courseDescription: '课程说明:',
editCourse: '编辑课程',
createCourse: '创建课程',
courseRelease: '课程发布',
releaseAssociatedCity: '发布关联城市:',
releaseAssociatedMap: '发布关联地图:',
trainingSequence: '实训排序',
creationTime: '创建时间',
finishTime: '完成时间',
createResults: '创建结果',
start: '开始',
toPerform: '重新执行',
productType: '产品类型:',
minTime: '最小用时:',
maxTime: '最大用时:',
trainingDescription: '实训描述:',
generateTraining: '生成实训',
updateTraining: '修改实训',
deleteTraining: '删除实训',
automaticGenerationOfTraining: '自动生成实训',
modifyTrainingByCategory: '按类别修改实训',
deleteAutoGeneratedTraining: '删除自动生成实训'
};

View File

@ -2,9 +2,11 @@ export default {
drawData: '绘图数据',
mapData: '地图数据',
pleaseSelect: '请选择',
pleaseEnter: '请输入',
sketchMap: '草稿地图列表',
newConstruction: '新建',
importMap: '导入地图',
bothCreate: '批量生成',
importMap: '导入',
createNewMap: '新建地图',
normalCreate: '正常创建',
saveMapAs: '地图另存为',
@ -19,10 +21,12 @@ export default {
deny: '否',
drawMap: '绘图',
advanced: '高级',
viewLayer: '视图图层',
layerDisplay: '图层显示',
viewLayer: '显示',
layerDisplay: '显示',
viewShows: '视图显示',
contentShows: '内容显示',
contentShows: '设备显示',
createBatch: '批量创建',
deleteBoth: '批量删除',
save: '保存',
updata: '更新',
@ -30,6 +34,7 @@ export default {
updateObjAxis: '更新坐标',
saveAs: '另存为',
publish: '发布',
publishMap: '发布地图',
deleteObj: '删除',
remove: '移除',
lastStep: '上一步',
@ -55,7 +60,7 @@ export default {
text: '文字',
mapName: '地图名称:',
skinName: '皮肤风格:',
skinName: '皮肤:',
selectCity: '所属城市:',
offsetXColon: 'X偏移:',
offsetYColon: 'Y偏移:',
@ -109,7 +114,7 @@ export default {
automaticSignalCode: '自动信号编码',
signalCodeName: '信号机名称',
signalCode: '信号机code',
sectionData: '区段数据',
sectionData: '区段列表',
preview: '预览',
operation: '操作',
compile: '编辑',
@ -119,11 +124,11 @@ export default {
sectionList: '区段列表',
automaticSignal: '自动信号',
signalID: '信号机ID:',
signalID: '信号机:',
activate: '激活',
pleaseSelectSignal: '请选择信号机',
triggerSegmentData: '请选择进路自动触发区段数据',
triggerSegmentData: '请选择进路自动触发区段',
automaticSignalSuccessful: '创建自动信号成功!',
failedCreateSignal: '创建自动信号失败',
automaticSignalUpdateSucceeded: '更新自动信号成功!',
@ -207,7 +212,7 @@ export default {
sectionLogicalNumber: '逻辑区段数量',
sectionLsectioncode: '左侧区段名称:',
sectionRsectioncode: '右侧区段名称:',
associatedSection: '关联物理区段:',
associatedSection: '所属物理/道岔区段:',
blockCoding: '区段编码:',
sectionType: '区段类型:',
sectionNameColon: '区段名称:',
@ -234,12 +239,12 @@ export default {
destinationCodeShow: '是否显示目的地码:',
leftStopPointOffset: '左向停车点偏移量:',
rightStopPointOffset: '右向停车点偏移量:',
isSwitchSection: '是否道岔区段:',
relSwitchCode: '关联道岔Code:',
isSwitchSection: '是否关联道岔:',
relSwitchCode: '关联道岔:',
logicSectionNameSort: '逻辑区段排序:',
fromSmallToLarge: '从小到大',
fromLargeToSmall: '从大到小',
relevanceLinkCode: '关联的Link:',
relevanceLinkCode: '所在Link:',
sepTypeLeft: '左侧分隔符类型:',
sectionOffsetLeft: '左侧Link偏移量:',
sepTypeRight: '右侧分隔符类型:',
@ -249,7 +254,7 @@ export default {
isCurve: '是否曲线:',
physicalSegmentName: '物理区段名称:',
directionType: '形式方向:',
directionType: '行驶方向:',
leftOrRight: '左右位置:',
positionType: '上下位置:',
@ -264,21 +269,26 @@ export default {
potLampType: '点灯类型:',
signalDirectionType: '方向类型:',
signalPositionType: '信号机位置类型:',
signalOffset: '偏移量:',
signalOffset: '所属link偏移量:',
signalLinkCode: '所属link',
signalPositionX: '信号机x:',
signalPositionY: '信号机y:',
signalPosition: '信号机坐标:',
signalNamePositionX: '信号机名字偏移量 x:',
signalNamePositionY: '信号机名字偏移量 y:',
signalNamePosition: '信号机名字偏移量:',
signalButtonShow: '是否显示按钮:',
signalButtonPositionX: '按钮x:',
signalButtonPositionY: '按钮y:',
signalButtonPosition: '按钮:',
signalGuideShow: '是否显示引导信号灯:',
signalGuidePositionX: '引导信号x:',
signalGuidePositionY: '引导信号y:',
signalGuidePosition: '引导信号:',
concentrateStationCode: '所属联锁站编码:',
concentrateStationCode: '所属联锁站:',
stationCode: '车站编码:',
zcCode: '所属zc区域编码:',
zcCode: '所属zc区域:',
centralized: '是否集中站:',
stationRunPlanName: '真实名称:',
stationVisible: '是否显示:',
@ -291,7 +301,9 @@ export default {
stationKmPostFontColor: '公里标字体颜色:',
stationPositionX: 'x坐标:',
stationPositionY: 'y坐标:',
stationPosition: '车站坐标:',
stationControlPosition: '控制模式坐标:',
stationControlCode: '控制模式编码:',
stationControlName: '控制模式名称:',
zokContent: '中控内容:',
@ -300,7 +312,7 @@ export default {
zzkContent: '站中控内容:',
stationControlZok: '中控',
stationstandName: '选择车站名称:',
stationstandName: '所属车站:',
stationstandDirection: '站台方向:',
stationstandHasDoor: '是否显示屏蔽门:',
stationstandNameColon: '站台名称:',
@ -308,6 +320,7 @@ export default {
stationstandShowName: '是否显示名称:',
stationstandWidth: '宽度 w:',
stationstandHeight: '高度 h:',
stationstandPosition: '车站坐标:',
switchCode: '道岔编码:',
switchName: '道岔名称:',
@ -315,6 +328,7 @@ export default {
switchShowName: '是否显示道岔名称:',
switchPositionX: '道岔名称x偏移量:',
switchPositionY: '道岔名称y偏移量:',
switchPosition: '道岔名称偏移量:',
turnTime: '道岔转换时间:',
timeoutShow: '是否显示道岔倒计时时间:',
sectionACode: '关联的A Section Code:',
@ -322,6 +336,11 @@ export default {
sectionCCode: '关联的C Section Code:',
switchTpX: '时间x坐标偏移量:',
switchTpY: '时间y坐标偏移量:',
switchTp: '时间坐标偏移量:',
counterPosition: '计数器坐标:',
delayUnlockPosition: '延迟解锁坐标:',
trainWindowPoints: '车次窗坐标:',
textPoints: '坐标:',
textCode: '文字编码:',
textContent: '文本内容:',
@ -330,6 +349,7 @@ export default {
trainCode: '列车编号:',
groupNumber: '车组号:',
groupNumberInterval: '车组号区间:',
trainNumber: '车组号',
modelCode: '车类型:',
@ -364,7 +384,7 @@ export default {
startingSignalName: '始端信号机名称',
endingSignalName: '终端信号机名称',
routeID: '进路ID',
routeID: '进路',
routeName: '进路名称:',
routeStationName: '所属车站名称',
@ -375,16 +395,16 @@ export default {
accessType: '进路性质类型',
automaticRouteType: '自动进路类型',
nearSectionCode: '接近区段名称',
continueProtectSwitchData: '延续保护道岔数据',
accessSideTurnoutData: '进路侧防道岔数据',
continueProtectSwitchData: '延续保护道岔',
accessSideTurnoutData: '进路侧防道岔',
turnBackRailName: '折返轨名称',
routeSegmentData: '进路自动触发区段数据',
routeProtectsData: '进路延续保护区段数据',
accessPhysical: '进路物理区段数据',
routeRouteScreenData: '进路屏蔽门数据',
routeRouteTurnoutData: '进路道岔数据',
hostileApproachData: '敌对进路数据',
routeSegmentData: '进路自动触发区段',
routeProtectsData: '进路延续保护区段',
accessPhysical: '进路物理区段',
routeRouteScreenData: '进路屏蔽门',
routeRouteTurnoutData: '进路道岔',
hostileApproachData: '敌对进路',
relation: '关系',
associatedRoute: '关联进路:',
@ -395,25 +415,26 @@ export default {
accessTypeColon: '进路性质类型:',
automaticRouteTypeColon: '自动进路类型:',
startSignalId: '始端信号机ID:',
endSignalId: '终端信号机ID:',
startSignalId: '始端信号机:',
endSignalId: '终端信号机:',
switchType: '道岔类型',
switchId: '道岔ID',
accessSwitchList: '进路道岔数据:',
accessStandList: '进路屏蔽门数据:',
accessSectionList: '进路物理区段数据:',
turnBackSectionCode: '折返轨ID:',
routeFlankProtectionList: '侧防道岔数据:',
routeOverlapSwitchList: '延续保护道岔数据:',
routeOverlapSectionList: '进路延续保护区段数据:',
routeTriggerSectionList: '进路自动触发区段数据:',
nearSectionCodeColon: '接近区段ID:',
switchId: '道岔',
accessSwitchList: '进路道岔:',
accessStandList: '进路屏蔽门:',
accessSectionList: '进路物理区段:',
turnBackSectionCode: '折返轨:',
routeFlankProtectionList: '侧防道岔:',
routeOverlapSwitchList: '延续保护道岔:',
routeOverlapSectionList: '进路延续保护区段:',
routeTriggerSectionList: '进路自动触发区段:',
nearSectionCodeColon: '接近区段:',
thenList: '交路列表',
startStation: '起始站',
endStation: '终到站',
skinStyleColon: '皮肤类型:',
skinDesignation: '皮肤名称',
skinCoding: '皮肤编码',
coordinatesOrigin: '坐标原点',
@ -456,9 +477,13 @@ export default {
productType: '产品类型',
productCode: '产品编码',
productName: '产品名称',
createProductCategories: '创建产品类目',
productDescription: '产品说明',
associateTrainingTypes: '关联实训类型',
createTrainingCategories: '创建实训类目',
editTraining: '编辑产品类目',
productCategories: '产品类目',
selectOperation: '请选择操作',
editTrainingCategories: '编辑实训类目',
linkWidth: 'link宽度',
maxLinkWidth: '(Link宽度最大为20)',
@ -474,7 +499,7 @@ export default {
routingDirection: '方向',
remarks: '描述',
remarksColon: '描述:',
trafficSegmentData: '交路区段数据:',
trafficSegmentData: '交路区段:',
startSectionColon: '起始区段:',
endStationColon: '终到站:',
endSectionColon: '终到区段:',
@ -490,6 +515,9 @@ export default {
switchBCode: '道岔2编号',
switchACodeNum: '道岔ID 1:',
switchBCodeNum: '道岔ID 2:'
switchBCodeNum: '道岔ID 2:',
wellDelTrianModel: '删除车模型会将关联的类车一起删除,请确认是否继续?',
clear: '清空'
};

View File

@ -2,5 +2,30 @@ export default {
permissionPack: '权限打包',
setSuccess: '设置成功',
isSureSetBelonger: '是否确定设置{name}为权限所属人?',
belonger: '设置归属人'
setBelonger: '设置归属人',
lessonName: '课程名称',
mapName: '地图名称',
mapProductName: '产品名称',
permissionType: '权限类型',
permissionStatus: '权限状态',
permissionUseType: '公用/专用',
permissionTotal: '权限总数',
permissionRemains: '生于权限',
isForever: '是否永久',
startTime: '开始时间',
endTime: '结束时间',
belonger: '归属人',
userList: '用户列表',
customPackageRules: '定制打包规则',
addRules: '添加规则',
package: '打包',
getQrcode: '获取二维码',
hasExitRule: '已存在此类型规则',
pleaseAddRule: '请添加规则',
selectDate: '选择时间',
addPermissionPackageRule: '增加权限打包规则',
editPermissionPackageRule: '编辑权限打包规则',
restPermissionMaxNumber: '(剩余最大权限个数:{0}',
pleaseSelectTransferPermission: '选择转赠权限'
};

View File

@ -1,3 +1,6 @@
export default {
buy: '购买',
offlineMappingSoftware: '离线编图软件',
lianPlanSystem: '城市轨道交通琏计划系统',
lianPlanDescription: '琏计划是一款编图测试系统,能够真实模拟实现对新运行图的仿真运行测试,该系统能够实现编辑运行图、导入运行图并按照运行图标准模拟真实行车环境,解决了无法针对运行图更新进行测试的问题。能够及时找出新图中不合理的地方并且在图上实时作出调整,避免了新运行图在运营过程中发现问题需要调度员人工进行干预的情况,最大程度降低故障对地铁正常运营的影响。'
};

View File

@ -54,5 +54,7 @@ export default {
userTrainingManage: '用户实训管理',
userExamManage: '用户考试管理',
userSimulationManage: '用户仿真管理',
existingSimulation: '存在仿真管理'
existingSimulation: '存在仿真管理',
ibpDraw: 'Ibp盘绘制'
};

View File

@ -184,6 +184,7 @@ export default {
chooseUser: '请选择用户',
pleaseInputLessonName: '请输入课程名称',
pleaseSelectTraining: '请选择实训',
sectionRelSwitchCode: '请选择关联道岔',
maxScaling: '(缩放比例最大为8级)',
skinCodingInput: '请输入皮肤编码',
@ -212,6 +213,45 @@ export default {
sectionWidthInputPrompt: '请输入有效区段宽度',
selectShowWatermark: '请选择是否水印',
courseNameEmpty: '课程名称不能为空',
purchaseMonth: '请输入购买月数',
accessNumber: '请输入权限数量',
pleaseInputMapName: '请输入地图新名称',
inputTemplateRunPlan: '请选择模板运行图'
inputTemplateRunPlan: '请选择模板运行图',
inputSkinType: '请选择皮肤类型',
inputTrainingName: '请输入实训名称',
inputTrainingType: '请输入实训类型',
inputOperationType: '请输入操作类型',
inputMinDuration: '请输入最佳用时',
inputMaxDuration: '请输入最大用时',
inputTrainingRemark: '请输入实训说明',
inputOperateCode: '请输入步骤操作码',
inputStepNo: '请输入步骤序号',
inputStepTips: '请输入步骤提示信息',
selectMapName: '请选择地图名称',
selectMapProductName: '请选择地图产品名称',
inputTime: '请输入时间',
inputPermissionNumber: '请输入权限个数',
permissionNumberGreater0: '权限个数必须大于0',
enterChapterName: '请输入章节名称',
enterChapterInstructions: '请输入章节说明',
selectCourseName: '请选择课程名称',
enterCourseName: '请输入课程名称',
selectAssociatedProduct: '请选择关联产品',
enterCourseDescription: '请输入课程说明',
courseIdIsEmpty: '课程Id为空',
selectCity: '请选择城市',
enterStandardTime: '请输入标准用时',
enterNumericValue: '请输入数字值',
greaterThanMinTime: '必须大于最小时间',
selectTrainingType: '请选择实训类型',
selectOneTrainingType: '只能选择一个实训类型',
enterProductType: '请输入产品类型',
selectAssociatedStation: '请选择关联的车站',
enterScale: '请输入缩放比例',
enterXOffset: '请输入X偏移',
enterYOffset: '请输入Y偏移'
};

View File

@ -0,0 +1,6 @@
export default {
screenSystem: '城市轨道交通大屏系统',
screenSystemDescription: '城市轨道交通大屏系统以各地铁信号系统及真实地铁线路数据为基础,旨在构建一套行车演示的专业模拟系统。 该系统具有高灵活性可自由切换线路数据。',
productTrialDuration: '产品试用时长:',
aTSScreenSimulation: 'ATS行调中心大屏仿真'
};

View File

@ -0,0 +1,19 @@
export default {
title: '城市轨道交通教学系统',
describe: '该系统具备真实的业务逻辑,以地铁员工和培训点为要素的业务和流程驱动方式进行软件架构,从业务流程、标准作业、培训方式及开放原则等角度出发,力求打造最符合用户需求及快速响应变化的实训教学系统。',
trainingName: '实训名称:',
trainingTime: '完成实训最佳用时:',
trainingMaximum: '完成实训最大用时:',
trainingInstructions: '实训说明:',
startTraining: '开始实训',
courseName: '课程名称',
courseDescription: '课程说明',
courseDetails: '课程详情',
free: '免费',
permissionsDetails: '权限详情',
buy: '购买',
permissionDistribute: '权限分发(上课)',
authorityTransferred: '权限转赠',
courseList: '课程列表'
};

View File

@ -5,9 +5,11 @@ export default {
creatingFailed: '创建失败',
confirmDeletion: '是否确认删除?',
confirmBatchGeneration: '是否确认批量生成?',
confirmBatchDelete: '是否确认批量删除?',
hint: '提示',
cancelledDelete: '已取消删除',
cancelGeneration: '已取消批量生成',
refreshFailure: '刷新失败',
updateSuccessfully: '更新成功',
saveSuccessfully: '保存成功',
@ -25,6 +27,8 @@ export default {
selectedSectionEmpty: '选择的区段为空',
selectedStationEmpty: '选择的车站为空',
enterKeywordsFiltering: '输入关键字进行过滤',
selectMap: '请先选择地图',
selectTrainType: '请选择查看的列车模型',
@ -59,6 +63,9 @@ export default {
deleteProductSuccessfully: '删除产品成功',
deleteProductFailed: '删除产品失败',
cannotDeleteProduct: '产品已被使用无法删除',
productCodeExists: '产品Code已存在',
narrowScope: '不能缩小上次创建的实训列表的范围',
pathCreationSuccessful: '创建交路成功!',
createRoutingFailed: '创建交路失败',
pathUpdataSuccessful: '更新交路成功!',
@ -89,6 +96,38 @@ export default {
skinDeleteConfirmation: '此操作将永久删除该皮肤, 是否继续?',
skinCodingExist: '地图皮肤编码已存在',
underImport: '正在导入中...',
deleteTypeHint: '此操作将删除该类型, 是否继续?'
deleteTypeHint: '此操作将删除该类型, 是否继续?',
selectValidInterval: '请选择有效的区间',
failedCourse: '获取课程信息失败',
createSimulationFaild: '创建仿真失败',
accessCourseNo: '无此课程权限, 请前往购买!',
failedSubmitOrder: '提交订单失败',
permissionsNumber: '请输入有效的权限个数',
purchaseMonth: '请输入有效的购买月数',
totalAmount: '获取总金额失败',
wxCodePayFailde: '获取微信支付二维码失败',
aliCodePayFailde: '获取支付宝支付二维码失败',
cancelOrderFailed: '取消订单失败',
createRoomFailedHint: '每个用户只能创建一个综合演练房间, 是否进入房间?',
noPermissionHint: '您没有权限,请前往购买产品',
trainModelNameRepeat: '列车模型数据重复',
coursePublishSuccessful: '课程发布成功',
coursePublishFailed: '课程发布失败',
startOperationHint: '此操作将开始任务, 是否继续?',
cancelsTaskHint: '此操作将取消任务, 是否继续?',
automaticGenerationTrainingSuccess: '自动生成实训成功',
automaticGenerationTrainingFailure: '自动生成实训失败',
updateAutomaticGenerationTrainingSuccess: '更新自动生成实训成功',
updateAutomaticGenerationTrainingFailure: '更新自动生成实训失败',
deleteAutomaticGenerationTrainingSuccess: '删除自动生成实训成功',
deleteAutomaticGenerationTrainingFailure: '删除自动生成实训失败',
addTrainingSuccessfully: '添加实训成功!',
addTrainingFailed: '添加实训失败',
updateTrainingSuccessfully: '更新实训成功!',
updateTrainingFailed: '更新实训失败',
savedStepDataSuccessfully: '保存步骤数据成功',
savedStepDataFailed: '保存步骤数据失败'
};

View File

@ -0,0 +1,44 @@
import deviceType from './deviceType';
const deviceRender = {};
/** IbpText渲染配置*/
deviceRender[deviceType.IbpText] = {
zlevel: 1
};
/** SquareButton渲染配置*/
deviceRender[deviceType.SquareButton] = {
zlevel: 1
};
/** WarnButton渲染配置*/
deviceRender[deviceType.WarnButton] = {
zlevel: 1
};
/** Arrow渲染配置*/
deviceRender[deviceType.Arrow] = {
zlevel: 1
};
/** RotatingButton渲染配置*/
deviceRender[deviceType.RotatingButton] = {
zlevel: 1
};
/** Tip渲染配置*/
deviceRender[deviceType.Tip] = {
zlevel: 1
};
/** BackGround渲染配置*/
deviceRender[deviceType.Background] = {
zlevel: 0
};
/** CircularLamp渲染配置 */
deviceRender[deviceType.CircularLamp] = {
zlevel: 1
};
export default deviceRender;

View File

@ -0,0 +1,12 @@
const deviceType = {
IbpText: 'IbpText',
SquareButton: 'SquareButton',
WarnButton: 'WarnButton',
Arrow: 'Arrow',
RotatingButton: 'RotatingButton',
Tip: 'Tip',
Background: 'Background',
CircularLamp: 'CircularLamp'
};
export default deviceType;

View File

@ -0,0 +1,51 @@
const ibpData = {
background: {
type: 'Background',
code: 'bg_0000'
},
arrowList: [
{
type: 'Arrow',
code: '1111_arrow',
point: {
x: 510,
y: 400
},
length: 488,
stroke: '#0000CD',
fill: '#0000CD',
lineWidth: 1,
direction: '上行',
stationstandDirection: '三桥方向'
},
{
type: 'Arrow',
code: '1222_arrow',
point: {
x: 510,
y: 200
},
length: 488,
stroke: '#0000CD',
fill: '#0000CD',
lineWidth: 1,
direction: '下行',
stationstandDirection: '车辆段方向'
}
],
circularLampList: [
{
type: 'CircularLamp',
code: '1333_lamp',
point: {
x: 600,
y: 600
},
r: 40,
fillColor: '#332C22'
}
]
};
export default ibpData;

283
src/ibp/ibpPan.js Normal file
View File

@ -0,0 +1,283 @@
import zrender from 'zrender';
import * as zrUtil from 'zrender/src/core/util';
import localStore from 'storejs';
import Options from './options';
import MouseController from './mouseController';
import Painter from './painter';
import deviceState from '../jmap/constant/deviceState';
import deviceType from './constant/deviceType';
import {calculateDCenter, createBoundingRect, modelFactory} from './utils/parser';
const renderer = 'canvas';
const devicePixelRatio = 1;
class IbpPan {
constructor(opts) {
this.methods = opts.methods;
// 鼠标事件
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom'};
// 皮肤参数
// this.skinCode = '';
// 设备数据
this.ibpDevice = {};
// 默认状态
this.defaultStateDict = this.loadDefaultState();
this.initIbpPage(opts);
}
initIbpPage(opts) {
const width = opts.config.width;
const height = opts.config.height;
this.$ibpZr = zrender.init(opts.dom, Object.assign({ renderer, devicePixelRatio, width, height }, opts.config));
this.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
this.$mouseController = new MouseController(this);
this.$mouseController.enable();
this.$painter = new Painter(this);
this.$painter.updateZrSize({width: this.$ibpZr.getWidth(), height: this.$ibpZr.getHeight()});
this.$painter.updateTransform(this.$options);
this.optionsHandler = this.setOptions.bind(this);
this.$mouseController.on(this.events.__Pan, this.optionsHandler);
this.$mouseController.on(this.events.__Zoom, this.optionsHandler);
}
loadDefaultState() {
const defaultStateDict = {};
zrUtil.each(Object.keys(deviceState), (type) => {
defaultStateDict[type] = {};
zrUtil.each(Object.keys(deviceState[type] || {}), (state) => {
defaultStateDict[type][state] = deviceState[type][state].Default;
}, this);
}, this);
return defaultStateDict;
}
setMap(config, ibpDevice) {
// 保存皮肤类型
if (config.config) {
this.$options.scaleRate = config.scaling;
this.$options.offsetX = config.origin.x;
this.$options.offsetY = config.origin.y;
this.$painter.updateTransform({ scaleRate: config.scaling, offsetX: config.origin.x, offsetY: config.origin.y });
}
// 保存原始数据
this.data = config;
// 解析地图数据
this.ibpDevice = ibpDevice;
// 加载对应皮肤
// this.style = this.loadStyle(this.skinCode);
// 数据加载完成 回调
if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.ibpDevice); }
// 初次渲染视图
this.$painter.repaint(this.ibpDevice);
// 视图加载完成 回调
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.ibpDevice); }
}
setDefaultState() {
const list = [];
this.update(list);
if (this.methods.stateLoaded instanceof Function) { this.methods.stateLoaded(list); }
}
setOptions(opts) {
const options = this.pullBack(opts);
this.$options.update(options);
this.$painter.updateTransform(this.$options);
if (this.$options.disabled == true) {
this.$mouseController.disable();
} else {
this.$mouseController.enable(opts);
}
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); }
}
setCenter(deviceCode) {
const device = this.ibpDevice[deviceCode];
if (device && device.instance) {
var rect = createBoundingRect(device.instance);
var dcenter = calculateDCenter(rect, { width: this.$ibpZr.getWidth(), height: this.$ibpZr.getHeight() });
this.setOptions(dcenter);
}
}
setLevelVisible(list) {
this.$painter.setLevelVisible(list);
}
render(list) {
console.log('-*-*-*-*-', list);
(list || []).forEach(elem => {
const code = elem.code;
const type = elem._type;
const oDevice = this.ibpDevice[code] || {instance: null, event: null, model: modelFactory(type, elem)};
const nDevice = Object.assign(oDevice.model || {}, elem);
this.$painter.delete(oDevice);
if (!elem._dispose) {
this.ibpDevice[code] = nDevice;
this.$painter.add(nDevice);
}
});
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
}
// 中间处理
hookHandle(model, elem) {
const code = elem.code;
const type = elem._type;
// 如果是延时计时,需要保存计数值到全局
if (type === deviceType.StationCounter) {
let val = '' + elem.val;
if (val === '0' || !elem.val) {
val = elem.val = localStore.get(code) || '0';
}
localStore(code, val);
}
for (var prop in elem) {
if (elem[prop] != model[prop]) {
Object.assign(model, elem);
return true;
}
}
return false;
}
update(list) {
(list || []).forEach(elem => {
const code = elem.code;
const oDevice = this.ibpDevice[code];
if (elem.dispose) {
this.$painter.delete(oDevice);
} else {
if (this.hookHandle(oDevice.model, elem)) {
this.$painter.update(oDevice);
}
}
});
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }
}
drawIbpInit() {
(Object.keys(this.ibpDevice) || []).forEach(elem => {
this.$painter.drawIbp(this.ibpDevice[elem]);
});
}
pullBack(payload) {
if (payload.type === 'zoom') {
const zrWidth = this.$ibpZr.getWidth();
const zrHeight = this.$ibpZr.getHeight();
const originX = payload.originX || zrWidth / 2;
const originY = payload.originY || zrHeight / 2;
const x = (this.$options.offsetX + originX) / this.$options.scaleRate;
const y = (this.$options.offsetY + originY) / this.$options.scaleRate;
const newScaleRate = this.$options.getScaleRate(payload.scale);
const dx = originX - (x * newScaleRate - this.$options.offsetX);
const dy = originY - (y * newScaleRate - this.$options.offsetY);
payload.dx = dx;
payload.dy = dy;
}
return payload || {};
}
getZr() {
return this.$ibpZr;
}
getEvents() {
return this.events;
}
getDeviceByCode(code) {
return this.ibpDevice[code];
}
getShapeTipPoint(opts) {
const device = this.ibpDevice[opts.code];
if (device) {
return this.$painter.getShapeTipPoint(device.instance, opts);
}
}
resize(opt) {
this.$ibpZr.resize(opt);
this.$painter.updateZrSize(opt);
}
refresh() {
this.$painter.refresh();
}
clear() {
this.skinCode = '';
this.style = {};
this.ibpDevice = {};
this.$painter.clear();
}
dispose() {
this.off(this.events.Pan, this.optionsHandler);
this.off(this.events.Zoom, this.optionsHandler);
this.clear();
this.$mouseController.dispose();
this.$ibpZr && zrender.dispose(this.$ibpZr);
this.$painter.dispose();
}
on(eventname, cb, context) {
const idx = Object.values(this.events).indexOf(eventname);
if (idx >= 0) {
switch (eventname) {
case this.events.Selected:
this.$mouseController.on(this.events.Selected, cb, context);
break;
case this.events.Contextmenu:
this.$mouseController.on(this.events.Contextmenu, cb, context);
break;
case this.events.DataZoom:
this.$mouseController.on(this.events.DataZoom, cb, context);
break;
}
}
}
off(eventname, cb) {
const idx = Object.values(this.events).indexOf(eventname);
if (idx >= 0) {
switch (eventname) {
case this.events.Selected:
this.$mouseController.off(this.events.Selected, cb);
break;
case this.events.Contextmenu:
this.$mouseController.off(this.events.Contextmenu, cb);
break;
case this.events.DataZoom:
this.$mouseController.off(this.events.DataZoom, cb);
break;
}
}
}
}
export default IbpPan;

201
src/ibp/mouseController.js Normal file
View File

@ -0,0 +1,201 @@
import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event';
import store from '@/store';
class EventModel {
constructor(e) {
this.clientX = e.event.clientX;
this.clientY = e.event.clientY;
let view = e.target;
while (view) {
if (Object.values(deviceType).includes(view._type)) {
this.deviceCode = view._code;
this.deviceType = view._type;
break;
}
if (view._subType) {
this.subType = view._subType;
}
if (view._val) {
this.val = view._val;
}
view = view.parent;
}
}
}
class MouseController extends Eventful {
constructor(ibp) {
super();
this.$ibp = ibp;
this.$zr = ibp.getZr();
this.events = ibp.getEvents();
this.initHandler(this.$zr);
}
initHandler(zr) {
if (zr) {
zr.on('click', this.click, this);
zr.on('contextmenu', this.contextmenu, this);
zr.on('mousemove', this.moveEvent, this);
this.enable = function (opts) {
opts = opts || {};
this._moveOnMouseMove = opts.moveOnMouseMove || true;
this._zoomOnMouseWheel = opts.zoomOnMouseWheel || false;
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
this.disable();
zr.on('mousedown', this.mousedown, this);
zr.on('mousemove', this.mousemove, this);
zr.on('mouseup', this.mouseup, this);
zr.on('mousewheel', this.mousewheel, this);
};
this.disable = function () {
zr.off('mousedown', this.mousedown);
zr.off('mousemove', this.mousemove);
zr.off('mouseup', this.mouseup);
zr.off('mousewheel', this.mousewheel);
};
this.dispose = function () {
zr.off('click', this.click);
zr.off('contextmenu', this.contextmenu);
zr.off('mousemove', this.moveEvent);
this.disable();
};
this.isDragging = function () { return this._dragging; };
}
}
mousedown(e) {
if (eventTool.notLeftMouse(e)) {
return;
}
var x = e.offsetX;
var y = e.offsetY;
this._x = x;
this._y = y;
this._dragging = true;
}
mousemove(e) {
if (eventTool.notLeftMouse(e) ||
!this._moveOnMouseMove ||
!this._dragging
) {
return;
}
const oldX = this._x;
const oldY = this._y;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
this._x = e.offsetX;
this._y = e.offsetY;
this._preventDefaultMouseMove && eventTool.stop(e.event);
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
}
mouseup(e) {
if (!eventTool.notLeftMouse(e)) {
this._dragging = false;
}
}
mousewheel(e) {
const shouldZoom = this._zoomOnMouseWheel;
const wheelDelta = e.wheelDelta;
const originX = e.offsetX;
const originY = e.offsetY;
if (wheelDelta === 0 || !shouldZoom) {
return;
}
if (shouldZoom) {
eventTool.stop(e.event);
let scale = 1;
if (wheelDelta > 0) {
scale = 1;
} else if (wheelDelta < 0) {
scale = -1;
}
this.trigger(this.events.__Zoom, {type: 'zoom', scale, originX, originY });
}
}
click(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Selected, em);
}
contextmenu(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Contextmenu, em);
}
moveEvent(e) {
const newEm = new EventModel(e);
const trainDetails = store.state.map.trainDetails;
if (trainDetails) {
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
var instance = (this.$ibp.getDeviceByCode(trainDetails.code) || {} ).instance;
instance && instance.removeTrainDetail && instance.removeTrainDetail();
}
}
}
checkEvent(e) {
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
var newEm = new EventModel(e);
if ([1, 3].includes(e.which)) {
// 查找之前和当前鼠标选中的实例
var oldDevice = this.$ibp.getDeviceByCode(oldEm.deviceCode) || {};
var newDevice = this.$ibp.getDeviceByCode(newEm.deviceCode) || {};
var oldInstance = (this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
var newInstance = (this.$ibp.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
// 如果之前和当前选中的实例不一致
if (oldInstance != newInstance) {
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行
oldDevice['down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
newDevice['down'] = true;
newInstance.mouseEvent['mouseover'](e);
}
}
// 保存当前实例到全局
this.$zr.curEvent = e;
}
return newEm;
}
updateDatazoom(zoom) {
this.trigger(this.events.Datazoom, zoom);
}
}
export default MouseController;

100
src/ibp/options.js Normal file
View File

@ -0,0 +1,100 @@
class Options {
constructor(opts, trigger) {
this.scaleIndex = 0;
this.scaleList = [
0.5, 0.6, 0.7, 0.8, 0.9,
1, 1.2, 1.4, 1.6, 1.8,
2, 2.2, 2.4, 2.6, 2.8,
3, 3.2, 3.4, 3.6, 3.8,
4, 4.2, 4.4, 4.6, 4.8,
5, 5.2, 5.4, 5.6, 5.8,
6, 6.2, 6.4, 6.6, 6.8,
7, 7.2, 7.4, 7.6, 7.8,
8, 8.2, 8.4, 8.6, 8.8
];
if (Number.isFinite(opts.scaleRate)) {
const idx = this.scaleList.indexOf(opts.scaleRate);
if (idx >= 0) {
this.scaleIndex = idx;
}
}
this.scaleRate = opts.scaleRate || this.scaleList[this.scaleIndex]; // 缩放比例
this.offsetX = opts.offsetX || 0; // x偏移
this.offsetY = opts.offsetY || 0; // y偏移
this.throttle = opts.throttle || 100; // 刷新频率
this.disabled = false;
this.moveOnMouseMove = true;
this.zoomOnMouseWheel = false;
this.preventDefaultMouseMove = true;
this.trigger = trigger;
}
update(payload) {
if (Number.isFinite(payload.dx)) {
this.offsetX -= payload.dx;
}
if (Number.isFinite(payload.dy)) {
this.offsetY -= payload.dy;
}
if (Number.isFinite(payload.offsetX)) {
this.offsetX = payload.offsetX;
}
if (Number.isFinite(payload.offsetY)) {
this.offsetY = payload.offsetY;
}
if (Number.isFinite(payload.scale)) {
if (Number.isFinite(payload.scale)) {
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
this.scaleIndex = this.scaleIndex + payload.scale;
}
}
this.scaleRate = this.scaleList[this.scaleIndex];
}
if (Number.isFinite(payload.scaleRate)) {
const idx = this.scaleList.indexOf(payload.scaleRate);
if (idx < 0) {
return;
}
this.scaleIndex = idx;
this.scaleRate = payload.scaleRate;
}
if (payload.disabled === true || payload.disabled === false) {
this.disabled = payload.disabled;
}
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
this.moveOnMouseMove = payload.moveOnMouseMove;
}
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
}
if (this.trigger instanceof Function) { this.trigger(this); }
}
getScaleRate(scale) {
if (Number.isFinite(scale)) {
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
return this.scaleList[this.scaleIndex + scale];
}
}
return this.scaleList[this.scaleIndex];
}
}
export default Options;

207
src/ibp/painter.js Normal file
View File

@ -0,0 +1,207 @@
import * as zrUtil from 'zrender/src/core/util';
import * as vector from 'zrender/src/core/vector';
import Group from 'zrender/src/container/Group';
import deviceType from './constant/deviceType';
import shapefactory from './shape/factory';
import TransformHandle from './transformHandle';
class Painter {
constructor(ibp) {
// 父级实例
this.$ibp = ibp;
this.$ibpZr = ibp.getZr();
// 图层数据
this.ibpInstanceLevel = {};
// 初始图层
this.initLevels();
// 视图控制器
this.$transformHandle = new TransformHandle(this);
}
/**
* 初始绘图实例
* @param {*} dom
* @param {*} config
*/
initLevels() {
// 添加父级图层
this.parentLevel = new Group({ name: '__parent__' });
this.$ibpZr.add(this.parentLevel);
// 添加子级图层
zrUtil.each(Object.values(deviceType), (type) => {
const level = new Group({ name: `__${type}__` });
this.ibpInstanceLevel[type] = level;
this.parentLevel.add(level);
});
}
/**
* 重绘视图
* @param {*} ibpDevice
*/
repaint(ibpDevice) {
// 清空视图
this.clear();
// 创建视图
Object.values(ibpDevice).forEach(device => {
this.add(device);
});
}
/**
* 添加视图
* @param {*} device
*/
add(device) {
device = Object.assign(device, { event: this.$ibp.$mouseController });
const instance = shapefactory(device, this.$ibp);
if (instance) {
device.instance = instance;
this.$transformHandle.transformView(instance);
this.ibpInstanceLevel[device.model._type].add(instance);
}
}
/**
* 删除视图
* @param {*} device
*/
delete(device) {
const instance = device.instance;
if (instance) {
this.ibpInstanceLevel[device.model._type].remove(instance);
}
}
/**
* 更新视图
* @param {*} device
*/
update(device) {
if (device) {
if (device.model._dispose) {
this.delete(device);
} else {
const instance = device.instance;
if (instance) {
instance.setState(device);
}
}
}
}
/**
* 绘制ipb时更改draggable 和注册事件
*/
drawIbp(device) {
if (device) {
const instance = device.instance;
if (instance) {
instance.setDraggable();
}
}
}
/**
* 更新transform变化
* @param {*} opt
*/
updateTransform(opt,) {
this.$transformHandle.updateTransform(opt);
}
/**
* 更新zrender尺寸
* @param {*} opt
*/
updateZrSize(opt) {
this.$transformHandle.updateZrSize(opt);
}
/**
* 过去坐标提示位置
* @param {*} opts
*/
getShapeTipPoint(instance, opts) {
if (instance) {
var point = instance.getShapeTipPoint(opts);
if (point) {
// 矩阵变换
var transform = this.$transformHandle.transform;
var transPoint = vector.applyTransform([], [point.x, point.y], transform);
return {
x: transPoint[0],
y: transPoint[1]
};
}
}
}
/**
* 设置图层可见
* @param {*} code
*/
setLevelVisible(list) {
zrUtil.each(Object.values(deviceType), type => {
const level = this.ibpInstanceLevel[type];
if (list.includes(type)) {
level.show();
} else {
level.hide();
}
}, this);
}
/**
* 刷新图层
*/
refresh() {
this.$ibpZr.refresh();
}
/**
* 清除图层
*/
clearLevel(type) {
const level = this.ibpInstanceLevel[type];
if (level) {
level.removeAll();
}
}
/**
* 清除canvas
*/
clear() {
zrUtil.each(Object.values(this.ibpInstanceLevel), (level) => {
level && level.removeAll();
}, this);
this.refresh();
}
/**
* 销毁图层
*/
dispose() {
this.ibpInstanceLevel = {};
this.parentLevel = null;
}
/**
* 父级图层
*/
getParentLevel() {
return this.parentLevel;
}
}
export default Painter;

72
src/ibp/shape/alarm.js Normal file
View File

@ -0,0 +1,72 @@
import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image';
import alarmpic from '@/assets/ibp_images/alarm.png';
export default class alarm extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.create();
}
create() {
const model = this.model;
this.imageBg = new Image({
zlevel: this.zlevel,
draggable: model.draggable || false,
style: {
image: alarmpic,
x: model.point.x,
y: model.point.y,
width: 70,
height: 74
}
});
this.add(this.imageBg);
}
setDraggable() {
this.arrow.attr('draggable', true);
this.createMouseEvent();
}
createMouseEvent() {
this.on('mousedown', this.mousedown, this);
this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this);
}
onmousedown(e) {
if (this.model.allowDrag) {
var x = e.offsetX;
var y = e.offsetY;
this._x = x;
this._y = y;
this._dragginger = true;
}
return true;
}
onmousemove(e) {
if (this._dragginger&&this.model.allowDrag) {
const oldX = this._x;
const oldY = this._y;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
this.model.point.x=this.model.point.x+dx;
this.model.point.y=this.model.point.y+dy;
this.imageBg.setStyle(this.model.point);
}
return true;
}
onmouseup(e) {
if (this.model.allowDrag) {
this._dragginger = false;
// this.model.point.y
// this.model.point.x
}
return true;
}
}

61
src/ibp/shape/arrow.js Normal file
View File

@ -0,0 +1,61 @@
import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group';
import {arrow} from '../../jmap/shape/utils/ShapePoints';
import { updateIbpData } from '@/ibp/utils/parser';
class Arrow extends Group {
constructor(device) {
super();
this.event = device.event;
this.model = device.model;
this.create();
}
create() {
const model = this.model;
const point = arrow(this.model.point.x, this.model.point.y, this.model.length, 10);
this.arrow = new Polygon({
zlevel: model.zlevel,
z: model.z,
draggable: model.draggable || false,
shape: {
points: point
},
style: {
stroke: model.stroke,
lineWidth: model.lineWidth,
fill: model.fill
}
});
this.add(this.arrow);
}
// 箭头颜色
setColor(color) {
this.arrow.setStyle('fill', color);
}
setDraggable() {
this.arrow.attr('draggable', true);
this.createMouseEvent();
}
createMouseEvent() {
this.on('mousedown', this.mousedown, this);
this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this);
}
mousedown() {
this.event.disable();
console.log('鼠标按下');
}
mousemove() {
console.log('鼠标移动');
}
mouseup(e) {
this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX;
this.model.point.y = this.model.point.y + e.offsetY;
console.log('鼠标抬起', this.model);
}
}
export default Arrow;

View File

@ -0,0 +1,52 @@
import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image';
import Rect from 'zrender/src/graphic/shape/Rect';
import ibpBg from '@/assets/ibp_images/ibp_bg.png';
export default class background extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = 1;
this.create();
}
create() {
this.imageBg = new Image({
zlevel: this.zlevel,
z: this.z,
style: {
x: 0,
y: 0,
image: ibpBg,
width: 2048,
height: 1024
}
});
this.tailorRect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 0,
width: this.model.width,
height: this.model.height
}
});
this.tailorBgImage();
}
tailorBgImage() {
// this.imageBg.setClipPath(this.tailorRect);
this.add(this.imageBg);
}
setInitialPosition(opt) {
const x = this.imageBg.style.x;
const y = this.imageBg.style.y;
this.imageBg.setStyle('x', x-opt.offsetX);
this.imageBg.setStyle('y', y-opt.offsetY);
this.tailorRect.setShape('x', x-opt.offsetX);
this.tailorRect.setShape('y', y-opt.offsetY);
}
setDraggable() {
}
}

142
src/ibp/shape/button.js Normal file
View File

@ -0,0 +1,142 @@
import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image';
import redButtonPic from '@/assets/ibp_images/red_button.png';
import redButtonPicOn from '@/assets/ibp_images/red_button_on.png';
import greenButtonPicOn from '@/assets/ibp_images/green_button_on.png';
import greenButtonPic from '@/assets/ibp_images/green_button.png';
import blueButtonPic from '@/assets/ibp_images/blue_button.png';
import blueButtonPicOn from '@/assets/ibp_images/blue_button_on.png';
import yellowButtonPic from '@/assets/ibp_images/yellow_button.png';
import yellowButtonPicOn from '@/assets/ibp_images/yellow_button_on.png';
import grayButtonPic from '@/assets/ibp_images/gray_button.png';
import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png';
export default class button extends Group {
static colors = new Map([
['red_on', [redButtonPicOn]],
['red_off', [redButtonPic]],
['green_on', [greenButtonPicOn]],
['green_off', [greenButtonPic]],
['blue_on', [blueButtonPicOn]],
['blue_off', [blueButtonPic]],
['yellow_on', [yellowButtonPicOn]],
['yellow_off', [yellowButtonPic]],
['gray_on', [grayButtonPicOn]],
['gray_off', [grayButtonPic]]
]);
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.create();
}
create() {
const model = this.model;
this.imageBg = new Image({
zlevel: this.zlevel,
draggable: model.draggable || false,
style: {
image: this.getImagePic(),
x: model.point.x,
y: model.point.y,
width: 70,
height: 80
}
});
this.add(this.imageBg);
}
getImagePic() {
const color = button.colors.get(`${this.model.color}_${this.model.status}`);
return color[0];
}
setDraggable() {
this.arrow.attr('draggable', true);
this.createMouseEvent();
}
createMouseEvent() {
this.on('mousedown', this.mousedown, this);
this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this);
}
// 设置按钮状态
setState(model) {
switch (model.status) {
case 'on': {
// 关闭
this.close();
this.model.status='on';
break;
}
case 'off': {
// 开放
this.open();
this.model.status='off';
break;
}
}
}
onclick() {
if (!this.model.allowDrag) {
switch (this.model.status) {
case 'off': {
this.open();
this.model.status='on';
break;
}
case 'on': {
this.close();
this.model.status='off';
break;
}
}
}
}
onmousedown(e) {
if (this.model.allowDrag) {
var x = e.offsetX;
var y = e.offsetY;
this._x = x;
this._y = y;
this._dragginger = true;
}
return true;
}
onmousemove(e) {
if (this._dragginger&&this.model.allowDrag) {
const oldX = this._x;
const oldY = this._y;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
this.model.point.x=this.model.point.x+dx;
this.model.point.y=this.model.point.y+dy;
this.imageBg.setStyle(this.model.point);
}
return true;
}
onmouseup(e) {
if (this.model.allowDrag) {
this._dragginger = false;
// this.model.point.y
// this.model.point.x
}
return true;
}
// 关闭
close() {
const color = button.colors.get(`${this.model.color}_off`);
this.imageBg.setStyle({image: color[0]});
}
// 开放
open() {
const color = button.colors.get(`${this.model.color}_on`);
this.imageBg.setStyle({image: color[0]});
}
}

View File

@ -0,0 +1,54 @@
import Group from 'zrender/src/container/Group';
import Circle from 'zrender/src/graphic/shape/Circle';
export default class CircularLamp extends Group {
constructor(device) {
super();
this.model = device.model;
this.event = device.event;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
this.lamp = new Circle({
zlevel: this.zlevel,
z: this.z,
draggable: this.model.draggable||false,
shape: {
cx: this.model.point.x,
cy: this.model.point.y,
r: this.model.r
},
style: {
fill: this.model.fillColor
}
});
this.add(this.lamp);
}
setCircularLampColor(color) {
this.lamp.setStyle('fill', color);
}
setDraggable() {
this.lamp.attr('draggable', true);
this.createMouseEvent();
}
createMouseEvent() {
this.on('mousedown', this.mousedown, this);
this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this);
}
mousedown() {
this.event.disable();
console.log('鼠标按下');
}
mousemove() {
console.log('鼠标移动');
}
mouseup() {
this.event.enable();
console.log('鼠标抬起');
}
}

22
src/ibp/shape/factory.js Normal file
View File

@ -0,0 +1,22 @@
import Arrow from './arrow';
import deviceType from '../constant/deviceType';
import Background from './background';
import CircularLamp from './circularLamp';
import IbpText from './ibpText';
const ibpShape = {};
ibpShape[deviceType.Arrow] = Arrow;
ibpShape[deviceType.Background] = Background;
ibpShape[deviceType.CircularLamp] = CircularLamp;
ibpShape[deviceType.IbpText] = IbpText;
function shapefactory(device, ibp) {
const type = device.model._type;
const shape = ibpShape[type];
if (shape instanceof Function) {
// eslint-disable-next-line
return new shape(device, ibp.style);
}
}
export default shapefactory;

60
src/ibp/shape/ibpText.js Normal file
View File

@ -0,0 +1,60 @@
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
import { updateIbpData } from '@/ibp/utils/parser';
export default class button extends Group {
constructor(device) {
super();
this.model = device.model;
this.event = device.event;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.textName = new Text({
zlevel: model.zlevel,
z: model.z,
silent: model.silent || false,
draggable: model.draggable || false,
style: {
x: model.x,
y: model.y,
fontWeight: model.fontWeight,
fontSize: model.fontSize,
fontFamily: model.fontFamily,
text: model.context,
textStrokeWidth: model.textStrokeWidth,
textFill: model.textFill,
textAlign: model.textAlign,
textPosition: model.textPosition || 'inside',
textVerticalAlign: model.textVerticalAlign || null
}
});
this.add(this.textName);
}
setDraggable() {
this.textName.attr('draggable', true);
this.createMouseEvent();
}
createMouseEvent() {
this.on('mousedown', this.mousedown, this);
this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this);
}
mousedown() {
this.event.disable();
console.log('鼠标按下');
}
mousemove() {
console.log('鼠标移动');
}
mouseup(e) {
this.event.enable();
this.model.x = this.model.x + e.offsetX;
this.model.y = this.model.y + e.offsetY;
console.log('鼠标抬起', this.model);
updateIbpData(this.model, 'update');
}
}

View File

@ -0,0 +1,71 @@
import {createTransform, createBoundingRect} from './utils/parser';
class TransformHandle {
constructor(painter) {
this.$painter = painter;
this.parentLevel = painter.getParentLevel();
this.rect = { x: 0, y: 0, width: 0, height: 0 };
this.transform = createTransform({ scaleRate: 1, offsetX: 0, offsetY: 0 });
}
checkVisible(view) {
return createBoundingRect(view).intersect(this.rect);
}
revisibleView(view) {
if (this.checkVisible(view)) {
view.show();
} else {
view.hide();
}
view.dirty();
}
// 视图进行缩放/平移
transformView(view) {
if (view) {
view.transform = this.transform;
view.decomposeTransform();
this.revisibleView(view);
}
// return view;
}
// 处理所有视图缩放/平移
transformAll() {
this.traverse(this.transformView, this);
}
// 重新计算显示图形
revisibleAll() {
this.traverse(this.revisibleView, this);
}
// 更新偏移量
updateTransform(opts) {
this.transform = createTransform(opts);
this.transformAll();
}
// 更新画布尺寸
updateZrSize(opts) {
this.rect = { x: 0, y: 0, width: opts.width, height: opts.height };
this.revisibleAll();
}
// 遍历group执行回调
traverse(cb, context) {
this.parentLevel.eachChild(level => {
level.eachChild((view) => {
cb.call(context, view);
}, context);
}, context);
}
}
export default TransformHandle;

78
src/ibp/utils/parser.js Normal file
View File

@ -0,0 +1,78 @@
import * as zrUtil from 'zrender/src/core/util';
import * as matrix from 'zrender/src/core/matrix';
import deviceType from '../constant/deviceType';
import deviceRender from '../constant/deviceRender';
export function createTransform(opts) {
let transform = matrix.create();
transform = matrix.scale(matrix.create(), transform, [opts.scaleRate, opts.scaleRate]);
transform = matrix.translate(matrix.create(), transform, [-opts.offsetX, -opts.offsetY]);
return transform;
}
export function createBoundingRect(view) {
const rect = view.getBoundingRect();
const scale = view.scale[0];
const offsetX = view.position[0];
const offsetY = view.position[1];
rect.x = rect.x * scale + offsetX;
rect.y = rect.y * scale + offsetY;
rect.width = rect.width * scale;
rect.height = rect.height * scale;
return rect;
}
export function calculateDCenter(viewRect, zrbound) {
var dx = (zrbound.width - viewRect.width) / 2 - viewRect.x;
var dy = 0;
return { dx: dx, dy: dy };
}
export function modelFactory(type, elem) {
return Object.assign(elem, { _type: type }, deviceRender[type]);
}
export function createModel(type, model, propConvert) {
const tempModel = modelFactory(type, model);
return { instance: null, event: null, model: propConvert ? propConvert.initPrivateProps(tempModel) : tempModel };
}
export function parser(data, config) {
var ibpDevice = {};
const propConvert = null;
// var propConvert = skinCode ? Vue.prototype.$theme.loadPropConvert(skinCode): null;
if (data) {
Object.assign(data.background, config);
ibpDevice[data.background.code] = createModel(deviceType.Background, data.background, propConvert);
zrUtil.each(data.textList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.IbpText, elem, propConvert);
}, this);
zrUtil.each(data.squareButtonList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.SquareButton, elem, propConvert);
}, this);
zrUtil.each(data.circularLampList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.CircularLamp, elem, propConvert);
}, this);
zrUtil.each(data.warnButtonList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.WarnButton, elem, propConvert);
}, this);
zrUtil.each(data.arrowList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.Arrow, elem, propConvert);
}, this);
zrUtil.each(data.rotatingButtonList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.RotatingButton, elem, propConvert);
}, this);
zrUtil.each(data.tipList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.Tip, elem, propConvert);
}, this);
}
return ibpDevice;
}

View File

@ -12,7 +12,11 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
text: {
active: {
routeColor: false // 进路触发颜色
},
text: { // 物理区段名称
show: true, // 物理区段名称显示
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
@ -22,7 +26,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
logicText: { // 逻辑区段名称
show: false, // 逻辑区段名称显示
position: -1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
@ -32,7 +37,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
standText: { // 站台轨名称
show: true, // 站台轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
@ -43,7 +49,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
reentryText: { // 折返轨名称
show: true, // 折返轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
@ -54,7 +61,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
transferText: { // 转换轨名称
show: true, // 转换轨名称显示
opposite: true, // 对称相反
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
@ -65,7 +73,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
destinationText: { // 目的码名称
show: true, // 目的码名称显示
position: 1, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 11, // 文字离区段距离
fontSize: 11, // 字体大小
@ -129,6 +138,7 @@ class SkinCode extends defaultStyle {
standardWidth: 1.5 // 灯柱宽度
},
text: {
show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式
@ -258,8 +268,11 @@ class SkinCode extends defaultStyle {
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
yellowColor: '#FFFF00', // 控制模式黄色
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: false // 按图折返显示
},
arrow: {
show: false // 控制模式箭头显隐
@ -291,15 +304,21 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
text: {
show: true // 公里标名称显示
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold' // 文字错细
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: -15, y: -10}, // 道岔名称与区段距离
fontSize: 10, // 字体大小
fontColor: '#C0C0C0', // 道岔名称颜色
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#FFFFFF', // 道岔失去颜色

View File

@ -12,7 +12,11 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
active: {
routeColor: true // 进路触发颜色
},
text: {
show: true, // 物理区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
fontSize: 12, // 字体大小
@ -23,6 +27,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
show: false, // 逻辑区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
fontSize: 11, // 字体大小
@ -33,6 +38,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 24, // 文字离区段距离
fontSize: 11, // 字体大小
@ -43,6 +49,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
show: true, // 折返轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
@ -53,6 +60,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
show: true, // 转换轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
@ -63,6 +71,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
show: true, // 目的码名称显示
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
@ -132,6 +141,7 @@ class SkinCode extends defaultStyle {
standardWidth: 2 // 灯柱宽度
},
text: {
show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式
@ -262,10 +272,14 @@ class SkinCode extends defaultStyle {
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
yellowColor: '#FFFF00', // 控制模式黄色
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: true // 按图折返显示
},
arrow: {
show: true // 控制模式箭头显隐
show: false // 控制模式箭头显隐
}
};
@ -286,14 +300,20 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
text: {
show: true // 公里标名称显示
},
kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向
};
this[deviceType.Switch] = {
text: {
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 5, y: -10}, // 道岔名称与区段距离
show: true, // 道岔名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 5, y: -10}, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontColor: '#fff', // 道岔名称颜色
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#C00808', // 道岔失去颜色
@ -308,13 +328,13 @@ class SkinCode extends defaultStyle {
locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)
inversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色)
rectShow: true, // 道岔单锁 矩形框是否显示
rectWidth: 18, // 矩形框 宽高
rectBorderColor: '#fff' // 矩形边框颜色
rectWidth: 18, // 矩形框 宽高
rectBorderColor: '#fff' // 矩形边框颜色
},
block: { // 道岔封锁配置
nameBorderShow: false, // 道岔名称是否有包围框 显示
contentRectShow: true, // 道岔封锁显示
contentRectColor: 'red' // 道岔封锁边框颜色
block: { // 道岔封锁配置
nameBorderShow: false, // 道岔名称是否有包围框 显示
contentRectShow: true, // 道岔封锁显示
contentRectColor: 'red' // 道岔封锁边框颜色
}
};

View File

@ -12,7 +12,11 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
active: {
routeColor: false // 进路触发颜色
},
text: {
show: true, // 物理区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
fontSize: 12, // 字体大小
@ -22,7 +26,8 @@ class SkinCode extends defaultStyle {
textPosition: 'inside', // 文字位置
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: { // 逻辑区段名称
logicText: { // 逻辑区段名称
show: false, // 逻辑区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
fontSize: 11, // 字体大小
@ -33,6 +38,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: { // 站台
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 24, // 文字离区段距离
fontSize: 11, // 字体大小
@ -43,6 +49,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: { // 折返
show: true, // 折返轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
@ -53,6 +60,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: { // 转换轨
show: true, // 转换轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 36, // 文字离区段距离
fontSize: 11, // 字体大小
@ -63,6 +71,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: { // 目的地
show: true, // 目的码名称显示
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 12, // 文字离区段距离
@ -129,6 +138,7 @@ class SkinCode extends defaultStyle {
standardWidth: 2 // 灯柱宽度
},
text: {
show: true, // 信号机名称显示
distance: 3, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: false, // 信号字体对其方式
@ -259,7 +269,11 @@ class SkinCode extends defaultStyle {
grayColor: '#C0C0C0', // 控制模式灰色
greenColor: 'green', // 控制模式绿色
redColor: 'red', // 控制模式红色
yellowColor: 'yellow' // 控制模式黄色
yellowColor: 'yellow', // 控制模式黄色
emergencyControlShow: true, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: false // 按图折返显示
},
arrow: {
show: false // 控制模式箭头显隐
@ -283,14 +297,20 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
text: {
show: true // 公里标名称显示
},
kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 5, y: -10}, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontColor: '#C0C0C0', // 道岔名称颜色
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: 'lightgreen', // 道岔失去颜色

View File

@ -12,7 +12,11 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Section] = {
active: {
routeColor: false // 进路触发颜色
},
text: {
show: true, // 物理区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 18, // 文字离区段距离
fontSize: 11, // 字体大小
@ -23,6 +27,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
logicText: {
show: true, // 逻辑区段名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 6, // 文字离区段距离
fontSize: 8, // 字体大小
@ -33,6 +38,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
standText: {
show: true, // 站台轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 30, // 文字离区段距离
fontSize: 11, // 字体大小
@ -43,6 +49,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
reentryText: {
show: true, // 折返轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 30, // 文字离区段距离
fontSize: 11, // 字体大小
@ -53,6 +60,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
transferText: {
show: true, // 转换轨名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 28, // 文字离区段距离
fontSize: 11, // 字体大小
@ -63,6 +71,7 @@ class SkinCode extends defaultStyle {
textVerticalAlign: 'middle' // 文字垂直对齐方式
},
destinationText: {
show: true, // 目的码名称显示
opposite: true, // 对称相反
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
distance: 10, // 文字离区段距离
@ -122,6 +131,7 @@ class SkinCode extends defaultStyle {
standardWidth: 2 // 灯珠宽度
},
text: {
show: true, // 信号机名称显示
distance: 0, // 文字和灯杆的距离
isNoRotation: true, // 是否禁止旋转
isAlignCenter: true, // 信号字体对其方式
@ -241,7 +251,11 @@ class SkinCode extends defaultStyle {
grayColor: '#7F7F7F', // 控制模式灰色
greenColor: '#00FF00', // 控制模式绿色
redColor: '#FF0000', // 控制模式红色
yellowColor: '#FFFF00' // 控制模式黄色
yellowColor: '#FFFF00', // 控制模式黄色
emergencyControlShow: false, // 紧急站控显示
centerControlShow: true, // 中控显示
substationControlShow: true, // 站控按钮显示
turnedAroundControlShow: false // 按图折返显示
},
arrow: {
show: true // 控制模式箭头显隐
@ -265,14 +279,20 @@ class SkinCode extends defaultStyle {
};
this[deviceType.Station] = {
kilometerPosition: 'up' // 公里标朝向
text: {
show: true // 公里标名称显示
},
kmPostShow: true, // 公里标显示
kilometerPosition: 'up' // 公里标朝向
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
offset: {x: 0, y: 8}, // 道岔名称与区段距离
fontSize: 11, // 字体大小
fontColor: '#C0C0C0', // 道岔名称颜色
fontWeight: 'normal', // 字体粗细
borderColor: '#FE0000', // 道岔边框颜色
lossColor: '#FFFFFF', // 道岔失去颜色

View File

@ -80,6 +80,10 @@ class Jlmap {
// 保存皮肤类型
if (map.skinVO) {
this.skinCode = map.skinVO.code;
this.$options.scaleRate = map.skinVO.scaling || 1;
this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0;
this.$options.offsetY = map.skinVO.origin ? map.skinVO.origin.y : 0;
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
}
// 保存原始数据
@ -304,8 +308,10 @@ class Jlmap {
} else {
const elem = list[idex];
if (elem) {
Object.keys(elem).forEach(key => {
elem[key] = model[key];
Object.keys(model).forEach(key => {
if (key != 'instance') {
elem[key] = model[key];
}
});
} else {
list.push(Object.assign({}, model));

View File

@ -67,11 +67,15 @@ class Painter {
* @param {*} device
*/
add(device) {
const instance = shapefactory(device, this.$jmap);
if (instance) {
device.instance = instance;
this.$transformHandle.transformView(instance);
this.mapInstanceLevel[device._type].add(instance);
try {
const instance = shapefactory(device, this.$jmap);
if (instance) {
device.instance = instance;
this.$transformHandle.transformView(instance);
this.mapInstanceLevel[device._type].add(instance);
}
} catch (err) {
console.error(err);
}
}
@ -136,15 +140,19 @@ class Painter {
*/
update(device) {
if (device) {
if (device._dispose) {
this.delete(device);
} else if (deviceType.Train == device._type) {
this.updateTrain(device);
} else {
const instance = device.instance;
if (instance) {
instance.setState(device);
try {
if (device._dispose) {
this.delete(device);
} else if (deviceType.Train == device._type) {
this.updateTrain(device);
} else {
const instance = device.instance;
if (instance) {
instance.setState(device);
}
}
} catch (err) {
console.error(err);
}
}
}

View File

@ -228,8 +228,8 @@ export default class Section extends Group {
const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2;
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
const drict = model.trainPosType != '01' ? 1 : -1;
/** 区段名称*/
if (model.nameShow) {
/** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/
if (style.Section.logicText.show || style.Section.text.show) {
let tempx = x;
let tempy = y;
// 创建区段名称
@ -238,23 +238,26 @@ export default class Section extends Group {
const opposite = style.Section.logicText.opposite ? -1: 1;
tempx += traingle.getSin(style.Section.logicText.distance);
tempy += traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y,
fontWeight: style.Section.logicText.fontWeight,
fontSize: style.Section.logicText.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.logicText.fontColor,
textAlign: style.Section.logicText.textAlign,
textPosition: style.Section.logicText.textPosition,
textVerticalAlign: style.Section.logicText.textVerticalAlign
});
} else {
if (style.Section.logicText.show) {
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y,
fontWeight: style.Section.logicText.fontWeight,
fontSize: style.Section.logicText.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.logicText.fontColor,
textAlign: style.Section.logicText.textAlign,
textPosition: style.Section.logicText.textPosition,
textVerticalAlign: style.Section.logicText.textVerticalAlign
});
this.add(this.name);
}
} else if (style.Section.text.show && !model.isSwitchSection) {
const opposite = style.Section.text.opposite ? -1: 1;
tempx += traingle.getSin(style.Section.text.distance);
tempy += traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
@ -274,30 +277,33 @@ export default class Section extends Group {
textPosition: style.Section.text.textPosition,
textVerticalAlign: style.Section.text.textVerticalAlign
});
this.add(this.name);
}
} else {
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y + style.Section.text.distance * drict,
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.text.fontColor,
textAlign: style.Section.text.textAlign,
textPosition: style.Section.text.textPosition,
textVerticalAlign: style.Section.text.textVerticalAlign
});
if (style.Section.text.show) {
this.name = new ETextName({
zlevel: this.zlevel,
z: this.z + 2,
style: this.style,
silent: false,
x: tempx + model.namePosition.x,
y: tempy + model.namePosition.y + style.Section.text.distance * drict,
fontWeight: style.Section.text.fontWeight,
fontSize: style.Section.text.fontSize,
fontFamily: style.fontFamily,
text: model.name,
textFill: style.Section.text.fontColor,
textAlign: style.Section.text.textAlign,
textPosition: style.Section.text.textPosition,
textVerticalAlign: style.Section.text.textVerticalAlign
});
this.add(this.name);
}
}
this.add(this.name);
}
/** 站台轨名称*/
if (model.isStandTrack && model.standTrackNameShow) {
if (model.isStandTrack && model.standTrackNameShow && style.Section.standText.show) {
const opposite = style.Section.standText.opposite ? -1: 1;
const tempx = x + traingle.getSin(style.Section.standText.distance);
const tempy = y + traingle.getCos(style.Section.standText.distance) * (style.Section.standText.position || opposite * drict);
@ -320,7 +326,7 @@ export default class Section extends Group {
}
/** 折返轨名称*/
if (model.isReentryTrack && model.reentryTrackNameShow) {
if (model.isReentryTrack && model.reentryTrackNameShow && style.Section.reentryText.show) {
const opposite = style.Section.reentryText.opposite ? -1: 1;
const tempx = x + traingle.getSin(style.Section.reentryText.distance);
const tempy = y + traingle.getCos(style.Section.reentryText.distance) * (style.Section.reentryText.position || opposite * drict);
@ -343,7 +349,7 @@ export default class Section extends Group {
}
/** 转换轨名称*/
if (model.isTransferTrack && model.transferTrackNameShow) {
if (model.isTransferTrack && model.transferTrackNameShow && style.Section.transferText.show) {
const opposite = style.Section.transferText.opposite ? -1: 1;
const tempx = x + traingle.getSin(style.Section.transferText.distance);
const tempy = y + traingle.getCos(style.Section.transferText.distance) * (style.Section.transferText.position || opposite * drict);
@ -366,7 +372,7 @@ export default class Section extends Group {
}
/** 目的码名称*/
if (model.destinationCode && model.destinationCodeShow) {
if (model.destinationCode && model.destinationCodeShow && style.Section.destinationText.show) {
const opposite = style.Section.destinationText.opposite ? -1: 1;
const tempx = x + traingle.getSin(style.Section.destinationText.distance);
const tempy = y + traingle.getCos(style.Section.destinationText.distance) * (style.Section.destinationText.position || opposite * drict);
@ -731,12 +737,21 @@ export default class Section extends Group {
/** 设置状态*/
setState(model) {
this.recover();
if (model.status == '01' || model.status == '00' || model.status == undefined) {
if (this.name && this.style.Section.active.routeColor) {
this.name.setStyle({textFill: this.style.Section.text.fontColor});
}
} else {
if (this.name && this.style.Section.active.routeColor) {
this.name.setStyle({textFill: 'green'});
}
}
switch (model.status) {
case '00': /** 未定义*/
this.undefine();
break;
case '01': /** 空闲*/
this.spare();
this.spare(); // 空闲状态下 名称白色 其他条件为绿色
break;
case '02': /** 通信车占用*/
this.communicationOccupied();

View File

@ -47,7 +47,7 @@ export default class EMouse extends Group {
this.device.lamps.forEach(elem => {
elem.setBorderColor(this.style.Signal.mouseOverStyle.lampBorderLineColor);
});
this.device.sigName.setColor(this.style.backgroundColor);
this.device.sigName && this.device.sigName.setColor(this.style.backgroundColor);
}
mouseout(e) {

View File

@ -150,7 +150,7 @@ class Signal extends Group {
this.add(this.sigPost);
this.lamps.forEach(lamp => { this.add(lamp); });
this.model.nameShow ? this.add(this.sigName) : null;
this.style.Signal.text.show ? this.add(this.sigName) : null;
this.add(this.sigAuto);
this.add(this.sigRoute);
this.add(this.sigDelay);

View File

@ -21,7 +21,8 @@ export default class Station extends Group {
const model = this.model;
const style = this.style;
if (model.visible) {
if (style.Station.text.show) {
// 公里标名称是否显示
this.stationText = new ETextName({
zlevel: this.zlevel,
z: this.z,
@ -36,6 +37,11 @@ export default class Station extends Group {
textVerticalAlign: 'top',
textFill: model.nameFontColor
});
this.add(this.stationText);
}
if (style.Station.kmPostShow) {
// 公里标是否显示
let direction = 1;
if (this.style.Station.kilometerPosition == 'up') {
direction = -1;
@ -54,19 +60,7 @@ export default class Station extends Group {
textVerticalAlign: 'top',
textFill: model.kmPostFontColor
});
this.add(this.stationText);
this.add(this.mileageText);
this.setShowMileageText(model.kmPostShow);
}
}
/** 设置公里标是否显示*/
setShowMileageText(show) {
if (show) {
this.mileageText.show();
} else {
this.mileageText.hide();
}
}

View File

@ -25,56 +25,70 @@ export default class StationControl extends Group {
create() {
const model = this.model;
this.emergencyControl = new ESingleControl({
_subType: 'emergency',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.jjzkContent,
pop: false
});
this.centerControl = new ESingleControl({
_subType: 'center',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zokContent,
pop: false
});
this.substationControl = new ESingleControl({
_subType: 'substation',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zakContent,
pop: false
});
this.turnedAroundControl = new ESingleControl({
_subType: 'turnedAround',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: '按图折返',
pop: false
});
// 紧急站控
if (this.style.StationControl.lamp.emergencyControlShow) {
this.emergencyControl = new ESingleControl({
_subType: 'emergency',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.jjzkContent,
pop: false
});
this.add(this.emergencyControl);
}
// 中控按钮
if (this.style.StationControl.lamp.centerControlShow) {
this.centerControl = new ESingleControl({
_subType: 'center',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x - this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zokContent,
pop: false
});
this.add(this.centerControl);
}
// 站控按钮
if (this.style.StationControl.lamp.substationControlShow) {
this.substationControl = new ESingleControl({
_subType: 'substation',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: model.zakContent,
pop: false
});
this.add(this.substationControl);
}
// 按图折返
if (this.style.StationControl.lamp.turnedAroundControlShow) {
this.turnedAroundControl = new ESingleControl({
_subType: 'turnedAround',
style: this.style,
zlevel: this.zlevel,
z: this.z,
point: {
x: model.position.x + this.style.StationControl.lamp.distance * 3 / 2 + this.style.StationControl.lamp.offset.x,
y: model.position.y + this.style.StationControl.lamp.offset.y
},
context: '按图折返',
pop: false
});
this.add(this.turnedAroundControl);
}
// 箭头
if (this.style.StationControl.arrow.show) {
const point = arrow(this.model.position.x, this.model.position.y + this.style.StationControl.lamp.radiusR / 2, this.style.StationControl.lamp.distance / 6, this.style.StationControl.lamp.radiusR * 0.8);
@ -93,38 +107,30 @@ export default class StationControl extends Group {
});
this.add(this.arrowsControl);
}
this.add(this.substationControl);
this.add(this.centerControl);
if (this.style.StationControl.lamp.count == 3) {
this.add(this.emergencyControl);
} else if (this.style.StationControl.lamp.count == 4) {
this.add(this.emergencyControl);
this.add(this.turnedAroundControl);
}
}
// 设置状态
setState(model) {
switch (model.status) {
case '00': // 无状态
this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor);
this.substationControl.setColor(this.style.StationControl.lamp.grayColor);
this.centerControl.setColor(this.style.StationControl.lamp.grayColor);
this.emergencyControl && this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.StationControl.lamp.grayColor);
break;
case '01': // 中控
this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor);
this.substationControl.setColor(this.style.StationControl.lamp.grayColor);
this.centerControl.setColor(this.style.StationControl.lamp.greenColor);
this.emergencyControl && this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.StationControl.lamp.greenColor);
break;
case '02': // 站控
this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor);
this.substationControl.setColor(this.style.StationControl.lamp.yellowColor);
this.centerControl.setColor(this.style.StationControl.lamp.grayColor);
this.emergencyControl && this.emergencyControl.setColor(this.style.StationControl.lamp.grayColor);
this.substationControl && this.substationControl.setColor(this.style.StationControl.lamp.yellowColor);
this.centerControl && this.centerControl.setColor(this.style.StationControl.lamp.grayColor);
break;
case '03': // 紧急站控
this.emergencyControl.setColor(this.style.StationControl.lamp.redColor);
this.substationControl.setColor(this.style.StationControl.lamp.grayColor);
this.centerControl.setColor(this.style.StationControl.lamp.grayColor);
this.emergencyControl && this.emergencyControl.setColor(this.style.StationControl.lamp.redColor);
this.substationControl && this.substationControl.setColor(this.style.StationControl.lamp.grayColor);
this.centerControl && this.centerControl.setColor(this.style.StationControl.lamp.grayColor);
break;
}
}

View File

@ -196,7 +196,7 @@ class StationStand extends Group {
/** 空闲*/
spare() {
this.safeStand.setColor(this.style.StationStand.stand.spareColor);
this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.spareColor);
}
/** 列车停站*/

View File

@ -25,7 +25,7 @@ class ESwName extends Group {
text: model.name,
textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
textVerticalAlign: 'middle',
textFill: style.textFontColor
textFill: style.Switch.text.fontColor
}
});

View File

@ -135,7 +135,7 @@ export default class Switch extends Group {
nameTextY: nameTextY,
sectionName: model.sectionName,
name: model.name,
nameShow: model.nameShow,
nameShow: style.Switch.text.show,
triangle: this.triangle
});
@ -188,7 +188,7 @@ export default class Switch extends Group {
/** 设置岔芯颜色*/
setSwitchCoreColor(color) {
this.swCore.setColor(color);
this.swCore && this.swCore.setColor(color);
}
/** 设置道岔文字颜色*/

View File

@ -1,6 +1,6 @@
<template>
<div class="avatar-container" style="right: 80px;">
<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" v-show="!item.hidden" :key="item.name" class="avatar-wrapper" index="" @click="item.handle">
<span style="color: white;">{{ $t(item.name) }}</span>
</el-menu-item>
<deomon-list ref="deomonList" />
@ -27,7 +27,8 @@ export default {
},
{
name: 'global.scan',
handle: this.qcodeEntry
handle: this.qcodeEntry,
hidden: process.env.NODE_ENV != 'development'
}
],
stomp: null,

View File

@ -27,8 +27,8 @@ import SkinCodeDraft from '@/views/map/skinCode/draft';
import Mapdraft from '@/views/map/mapdraft/index';
import Mapedit from '@/views/map/mapdraft/mapedit/index';
import Runplan from '@/views/map/runplan/index';
import MapProduct from '@/views/map/product/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';
@ -76,6 +76,7 @@ import PackageDraft from '@/views/package/draft/ruleForm';
import PublishMap from '@/views/publish/publishMap/index';
import PublishMapDraft from '@/views/publish/publishMap/draft';
import PublishMapDetail from '@/views/publish/publishMap/list';
import RunPlanCommon from '@/views/publish/runPlanCommon/index';
import RunPlanCommonDraft from '@/views/publish/runPlanCommon/draft';
import RunPlanTemplate from '@/views/publish/runPlanTemplate/index';
@ -83,6 +84,8 @@ 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 IbpDraft from '@/views/ibp/ibpDraft/index';
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
import Commodity from '@/views/orderauthor/commodity/index';
import CommodityDraft from '@/views/orderauthor/commodity/draft';
@ -215,6 +218,11 @@ export const UrlConfig = {
prefix: '/script',
detail: '/script/detail',
display: '/script/display'
},
ibp: {
prefix: 'ibp',
draft: '/ibp/draft',
edit: 'ibp/edit'
}
};
@ -374,6 +382,13 @@ export const asyncRouter = [
}
]
},
{
path: 'ibp/edit',
component: IbpEdit,
meta: {
i18n: 'router.ibpDraw'
}
},
{
path: 'runPlan',
redirect: '/map/runPlan/view/draft',
@ -389,7 +404,7 @@ export const asyncRouter = [
},
{
path: 'product',
component: Trainingcategory,
component: MapProduct,
meta: {
i18n: 'router.productEdit'
}
@ -746,6 +761,11 @@ export const asyncRouter = [
i18n: 'router.publishMapManage'
}
},
{
path: 'map/detail',
hidden: true,
component: PublishMapDetail
},
{
path: 'product',
component: ProductStatus,

View File

@ -89,7 +89,7 @@ export default {
{ label: '综合演练', value: 'Joint'},
{ label: '大屏', value: 'BigScreen'},
{ label: '琏计划', value: 'RunPlan'},
{ label: '任务录制', value: 'ScriptRecord'}
{ label: '剧本录制', value: 'ScriptWrite'}
],
skinCode: [

View File

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

View File

@ -230,11 +230,11 @@ export const translate = {
{ key: 'name', tHeader: '区段名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
// { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
{ key: 'axleShow', tHeader: '是否显示计轴器', formatter: (val) => { return val || false; } },
{ key: 'type', tHeader: '类型', formatter: (val) => { return val || ''; } },
{ key: 'linkCode', tHeader: 'link编号', formatter: (val) => { return val || ''; } },
{ key: 'logicSectionNameShow', tHeader: '是否显示逻辑区段名称', formatter: (val) => { return val || false; } },
// { key: 'logicSectionNameShow', tHeader: '是否显示逻辑区段名称', formatter: (val) => { return val || false; } },
{ key: 'logicSectionNameSort', tHeader: '逻辑区段按名称排序方式', formatter: (val) => { return val || false; } },
{ key: 'logicSectionNum', tHeader: '逻辑区段数量', formatter: (val) => { return val ? JSON.parse(val) : [0]; } },
{ key: 'logicSectionShow', tHeader: '是否显示逻辑区段', formatter: (val) => { return val || false; } },
@ -276,7 +276,7 @@ export const translate = {
{ key: 'uniqueName', tHeader: '信号机唯一名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
// { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
{ key: 'buttonPosition', tHeader: '按钮坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'buttonShow', tHeader: '是否显示按钮', formatter: (val) => { return val || false; } },
{ key: 'directionType', tHeader: '方向类型', formatter: (val) => { return val || ''; } },
@ -362,7 +362,7 @@ export const translate = {
{ key: 'name', tHeader: '道岔名称', formatter: (val) => { return val || ''; } },
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
{ key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
{ key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
// { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
{ key: 'sectionACode', tHeader: 'A线物理区段编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionBCode', tHeader: 'B线物理区段编号', formatter: (val) => { return val || ''; } },
{ key: 'sectionCCode', tHeader: 'C线物理区段编号', formatter: (val) => { return val || ''; } },

View File

@ -13,6 +13,7 @@ import exam from './modules/exam';
import runPlan from './modules/runplan';
import socket from './modules/socket';
import scriptRecord from './modules/scriptRecord';
import ibp from './modules/ibp';
import getters from './getters';
@ -32,7 +33,8 @@ const store = new Vuex.Store({
exam,
runPlan,
socket,
scriptRecord
scriptRecord,
ibp
},
getters
});

59
src/store/modules/ibp.js Normal file
View File

@ -0,0 +1,59 @@
import Vue from 'vue';
import { parser } from '@/ibp/utils/parser';
/**
* ibp状态数据
*/
const ibp = {
namespaced: true,
state: {
ibp: null, // 数据
ibpDevice: {}, // 解析后的地图数据
ibpList: {}, // 数据列表
ibpIdList: {} // 数据列表(以id为标识)
},
getters: {
ibpList: (state) => {
return state.ibpList;
},
ibp: (state) => {
return state.ibp;
},
version: (state) => {
if (state.ibp) {
return state.ibp.version;
} else {
return null;
}
}
},
mutations: {
ibpRender: (state, devices) => {
Vue.prototype.$ibp && Vue.prototype.$ibp.render(devices);
},
setIbpData: (state, ibp) => {
state.ibp = ibp;
}
},
actions: {
setIbpData: ({ commit }, map) => {
commit('setIbpData', map);
},
updateIbpDevices: ({ commit }, models) => {
return new Promise((resolve) => {
if (!(models instanceof Array)) {
models = [models];
}
commit('ibpRender', models);
resolve(models);
});
}
}
};
export default ibp;

View File

@ -199,6 +199,7 @@ const map = {
state: {
map: null, // 地图数据
dataZoom: {}, // 缩放位置
mapDevice: {}, // 解析后的地图数据
mapList: {}, // 地图数据列表
mapIdList: {}, // 地图数据列表(以id为标识)
@ -423,6 +424,9 @@ const map = {
state.mapDevice = {};
}
},
setDataZoom: (state, dataZoom) => {
state.dataZoom = dataZoom;
},
mapRender: (state, devices) => {
Vue.prototype.$jlmap && Vue.prototype.$jlmap.render(devices);
},
@ -455,6 +459,15 @@ const map = {
if (index >= 0) {
list.splice(index, 1);
}
const trainList = state.map.trainList;
trainList.forEach(elem => {
if (elem.modelCode == model.code) {
elem['_dispose'] = true;
}
});
Vue.prototype.$jlmap && Vue.prototype.$jlmap.render(trainList);
}
}
},
@ -470,6 +483,11 @@ const map = {
commit('mapClear');
},
// 设置缩放位置
updateZoom: ({ commit }, dataZoom) => {
commit('setDataZoom', dataZoom);
},
setMapData: ({ commit }, map) => {
commit('setMapData', map);
},

View File

@ -2,48 +2,57 @@
* 实训状态数据
*/
const scriptRecord = {
namespaced: true,
state: {
mapLocation: {}, //地图定位,
simulationPause: true ,
scriptId:"",
},
getters: {
mapLocation: (state)=>{
return state.mapLocation;
},
simulationPause:(state)=>{
return state.simulationPause;
},
scriptId: (state)=>{
return state.scriptId;
},
},
mutations: {
setMapLocation: (state, mapLocation) => {
namespaced: true,
state: {
mapLocation: {}, // 地图定位,
simulationPause: true,
scriptId: '',
bgSet: false
},
getters: {
mapLocation: (state)=>{
return state.mapLocation;
},
simulationPause: (state)=>{
return state.simulationPause;
},
scriptId: (state)=>{
return state.scriptId;
},
bgSet: (state)=>{
return state.bgSet;
}
},
mutations: {
setMapLocation: (state, mapLocation) => {
state.mapLocation = mapLocation;
},
setSimulationPause: (state, simulationPause) => {
},
setSimulationPause: (state, simulationPause) => {
state.simulationPause = simulationPause;
},
setscriptId: (state, scriptId) => {
},
setscriptId: (state, scriptId) => {
state.scriptId = scriptId;
},
},
actions: {
/**
},
setBgSet: (state, bgSet) => {
state.bgSet = bgSet;
}
},
actions: {
/**
* 设置地图定位
*/
updateMapLocation: ({ commit }, mapLocation) => {
updateMapLocation: ({ commit }, mapLocation) => {
commit('setMapLocation', mapLocation);
},
updateSimulationPause: ({ commit }, simulationPause) => {
},
updateSimulationPause: ({ commit }, simulationPause) => {
commit('setSimulationPause', simulationPause);
},
updateScriptId: ({ commit }, scriptId) => {
},
updateScriptId: ({ commit }, scriptId) => {
commit('setscriptId', scriptId);
},
}
},
updateBgSet: ({ commit }, bgSet) => {
commit('setBgSet', bgSet);
}
}
};
export default scriptRecord;
export default scriptRecord;

View File

@ -88,6 +88,8 @@ function handle(state, data) {
case 'Simulation_Quest_Finish': // 任务结束标志
state.tipOperateCount++;
break;
case 'Simulation_Control_Pause': // 暂停中
store.dispatch('scriptRecord/updateSimulationPause', msg);
}
}

View File

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

View File

@ -1,5 +1,5 @@
<template>
<div>
<div class="font_box">
<el-select v-model="font" :placeholder="$t('global.font')" @input="$emit('input', inputValue)">
<el-option v-for="option in fontList" :key="option.code" :label="option.name" :value="option.code" />
</el-select>
@ -65,9 +65,20 @@ export default {
}
};
</script>
<style>
<style rel="stylesheet/scss" lang="scss" scoped>
.format {
background-color: #C0C4CC;
width: 100%;
display: flex;
padding-left: 15px;
}
.font_box{
/deep/ {
.el-select{
max-width: 50%;
display: block;
float: left;
}
}
}
</style>

View File

@ -12,30 +12,30 @@
<el-form-item :label="nameTitle + ':'" prop="name">
<span style="color: #808080 !important;"> {{ saleModel.name }} </span>
</el-form-item>
<el-form-item label="权限类型: " prop="systemName">
<span style="color: #808080 !important;"> {{ systemName }}权限 </span>
<el-form-item :label="$t('global.permissionType')" prop="systemName">
<span style="color: #808080 !important;"> {{ systemName }}{{ $t('global.permissions') }} </span>
</el-form-item>
<el-form-item :label="priceTitle + ':'" prop="price">
<span style="font-size: 16px;color: #fb7a1b;"> {{ saleModel.price.toFixed(2) }}</span>
<span style="color: #333;">/</span>
<span style="color: #333;">{{ $t('global.yuanMonth') }}</span>
</el-form-item>
<el-form-item label="购买时长: " prop="choose">
<el-form-item :label="$t('global.purchaseDuration')" prop="choose">
<el-radio-group v-model="choose" @change="chooseEvent">
<template v-for="(item,idx) in chooseList">
<el-radio-button :key="idx" :label="item.label" />
</template>
<el-radio-button label="自定义" />
<el-radio-button :label="$t('global.custom')" />
</el-radio-group>
</el-form-item>
<el-form-item v-show="!disabled" prop="months">
<el-input-number v-model="saleModel.months" :min="1" :max="1000" :disabled="disabled " />
<span></span>
<span>{{ $t('global.month') }}</span>
</el-form-item>
<el-form-item label="权限数量: " prop="total">
<el-form-item :label="$t('global.permissionNum')" prop="total">
<el-input-number v-model="saleModel.total" :min="1" :max="200" />
<span></span>
<span>{{ $t('global.indexA') }}</span>
</el-form-item>
<el-form-item label="购买总价: " prop="sumPrice">
<el-form-item :label="$t('global.purchasePrice')" prop="sumPrice">
<span style="font-size: 24px; color: #fb7a1b;"> {{ parseInt(sumPrice) }}</span>
<span style="font-size: 16px;color: #fb7a1b;">. {{ (sumPrice -
parseInt(sumPrice)).toFixed(2).toString().replace('.0', '').replace(' ', '') }}
@ -44,9 +44,9 @@
</el-form>
</el-scrollbar>
</div>
<el-button style="float: right; margin-bottom: 20px; margin-right: 20px;" type="primary " @click="commit">提交订单
<el-button style="float: right; margin-bottom: 20px; margin-right: 20px;" type="primary " @click="commit">{{ $t('global.submitOrders') }}
</el-button>
<el-button style="float: right; margin-bottom: 20px; margin-right: 10px;" @click="back">返回</el-button>
<el-button style="float: right; margin-bottom: 20px; margin-right: 10px;" @click="back">{{ $t('global.back') }}</el-button>
</el-card>
</template>
@ -69,14 +69,14 @@ export default {
data() {
return {
disabled: true,
choose: '一月',
choose: this.$t('global.january'),
chooseList: [
{ label: '一月', value: 1 },
{ label: '三月', value: 3 },
{ label: '一年', value: 12 },
{ label: '两年', value: 24 },
{ label: '五年', value: 60 },
{ label: '十年', value: 120 }
{ label: this.$t('global.january'), value: 1 },
{ label: this.$t('global.march'), value: 3 },
{ label: this.$t('global.year'), value: 12 },
{ label: this.$t('global.twoYears'), value: 24 },
{ label: this.$t('global.fiveYears'), value: 60 },
{ label: this.$t('global.tenYears'), value: 120 }
],
saleModel: {
goodsId: '',
@ -94,48 +94,48 @@ export default {
nameTitle() {
if (this.$route.query.permissionType == PermissionType.EXAM ||
this.$route.query.permissionType == PermissionType.LESSON) {
return '课程名称';
return this.$t('global.courseName');
} else if (this.$route.query.permissionType == PermissionType.SCREEN) {
return '大屏名称';
return this.$t('global.screenName');
} else {
return '产品名称';
return this.$t('global.productName');
}
},
priceTitle() {
switch (this.$route.query.permissionType) {
case PermissionType.LESSON: return '课程单价';
case PermissionType.EXAM: return '考试单价';
case PermissionType.SIMULATION: return '仿真单价';
case PermissionType.SCREEN: return '大屏单价';
case PermissionType.LESSON: return this.$t('global.coursePrice');
case PermissionType.EXAM: return this.$t('global.testPrice');
case PermissionType.SIMULATION: return this.$t('global.simulationPrice');
case PermissionType.SCREEN: return this.$t('global.timeUnitPrice');
}
return '';
},
rules() {
return {
'name': [
{ required: true, message: '课程名称不能为空', trigger: 'blur' }
{ required: true, message: this.$t('rules.courseNameEmpty'), trigger: 'blur' }
],
'months': [
{ required: true, message: '请输入购买月数', trigger: 'blur' },
{ required: true, message: this.$t('rules.purchaseMonth'), trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) >= 0) {
callback();
} else {
callback(new Error('请输入有效的购买月数'));
callback(new Error(this.$t('tip.purchaseMonth')));
}
},
trigger: 'blur'
}
],
'total': [
{ required: true, message: '请输入权限数量', trigger: 'blur' },
{ required: true, message: this.$t('rules.accessNumber'), trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) >= 0) {
callback();
} else {
callback(new Error('请输入有效的权限个数'));
callback(new Error(this.$t('tip.permissionsNumber')));
}
},
trigger: 'blur'
@ -163,7 +163,7 @@ export default {
methods: {
//
chooseEvent(label) {
this.disabled = label !== '自定义';
this.disabled = label !== this.$t('global.custom');
this.chooseList.forEach(elem => {
if (label === elem.label) {
this.saleModel.months = elem.value;
@ -184,7 +184,7 @@ export default {
commitOrder(model).then(response => {
this.$emit('commit', response.data);
}).catch(() => {
this.$messageBox('提交订单失败');
this.$messageBox(this.$t('tip.failedSubmitOrder'));
});
}
});

View File

@ -9,7 +9,7 @@
{{ saleModel.name }}
</span>
</p>
<p style="font-size: 14px;"> 权限类型:
<p style="font-size: 14px;"> {{ $t('global.permissionType') }}
<span style="color: !important;">
{{ systemName }}
</span>
@ -17,37 +17,36 @@
<p style="font-size: 14px;"> {{ priceTitle }}:
<span style=" color: #fb7a1b;">
<em style="font-size: 16px;">{{ saleModel.price.toFixed(2) }} </em>
<span style="color: #333;">/</span>
<span style="color: #333;">{{ $t('global.yuanMonth') }}</span>
</span>
</p>
<p style="font-size: 14px;"> 权限数量:
<p style="font-size: 14px;"> {{ $t('global.permissionNum') }}
<span style="color: !important;">
{{ saleModel.amount }}
{{ saleModel.amount }}{{ $t('global.indexA') }}
</span>
</p>
<p style="font-size: 14px;"> 购买时长:
<p style="font-size: 14px;"> {{ $t('global.purchaseDuration') }}
<span style="color:!important;">
{{ saleModel.monthAmount }}
{{ saleModel.monthAmount }}{{ $t('global.month') }}
</span>
</p>
<p style="font-size: 14px;"> 订单编码:
<p style="font-size: 14px;"> {{ $t('global.orderCode') }}
<span style="color:!important;">
{{ saleModel.orderCode }}
</span>
</p>
<p style="font-size: 14px;"> 创建时间:
<p style="font-size: 14px;"> {{ $t('global.creationTime') }}
<span style="color:!important;">
{{ saleModel.createTime }}
</span>
</p>
</el-col>
<el-col :span="8" style="line-height: 100px;">
<p style="font-size: 16px;"> 应付金额:
<p style="font-size: 16px;"> {{ $t('global.amountPayable') }}
<span style="font-size: 18px; color: #fb7a1b;">
<em style="font-size: 30px;">{{ parseInt(saleModel.sumPrice) }} </em>
<i style="font-size: 18px;">.{{ (saleModel.sumPrice -
parseInt(saleModel.sumPrice)).toFixed(2).toString().replace('0.',
'') }}
parseInt(saleModel.sumPrice)).toFixed(2).toString().replace('0.', '') }}
</i>
</span>
</p>
@ -58,7 +57,7 @@
<el-card shadow="never" style="margin-top: 10px;">
<el-tabs v-model="active" type="card">
<el-tab-pane label="微信支付" :name="payTypeEnum.WePay">
<el-tab-pane :label="$t('global.weChatPay')" :name="payTypeEnum.WePay">
<div style="float: left; width: 200px;">
<img :src="images.img_wepay_logo" width="200" height="40" style="padding-left: 60px;">
</div>
@ -68,10 +67,10 @@
<a style="font-size: 12px;color:gray" @click="loadWePayQtCode"><span
ref="rotateA"
class="el-icon-refresh"
/></a>
/>{{ $t('global.clickRefresh') }}</a>
</div>
</el-tab-pane>
<el-tab-pane label=" 支付宝支付 " :name="payTypeEnum.Alipay">
<el-tab-pane :label="$t('global.alipayPayment')" :name="payTypeEnum.Alipay">
<div style="float: left; width: 200px;">
<img :src="images.img_alipay_logo" width="200" height="40" style="padding-left: 60px;">
</div>
@ -90,12 +89,12 @@
<a style="font-size: 12px;color:gray" @click="loadAliPayQtCode"><span
ref="rotateB"
class="el-icon-refresh"
/></a>
/>{{ $t('global.clickRefresh') }}</a>
</div>
</el-tab-pane>
<ul style="float: left; font-size: 12px; color: darkgrey">
<li>你将购买的商品为虚拟内容服务购买后不支持退货转让退换请斟酌确认</li>
<li>购买后可在权限详情区查看和使用相关服务</li>
<li>{{ $t('global.buyProject') }}</li>
<li>{{ $t('global.relatedServices') }}</li>
</ul>
</el-tabs>
<el-button
@ -103,7 +102,7 @@
style="float: right; margin-bottom: 20px; margin-right: 20px;"
type="primary "
@click="cancal"
>取消</el-button>
>{{ $t('global.cancel') }}</el-button>
</el-card>
</div>
</template>
@ -170,19 +169,19 @@ export default {
nameTitle() {
if (this.$route.query.permissionType == PermissionType.EXAM ||
this.$route.query.permissionType == PermissionType.LESSON) {
return '课程名称';
return this.$t('global.courseName');
} else if (this.$route.query.permissionType == PermissionType.SCREEN) {
return '大屏名称';
return this.$t('global.screenName');
} else {
return '产品名称';
return this.$t('global.productName');
}
},
priceTitle() {
switch (this.$route.query.permissionType) {
case PermissionType.LESSON: return '课程单价';
case PermissionType.EXAM: return '考试单价';
case PermissionType.SIMULATION: return '仿真单价';
case PermissionType.SCREEN: return '大屏单价';
case PermissionType.LESSON: return this.$t('global.coursePrice');
case PermissionType.EXAM: return this.$t('global.testPrice');
case PermissionType.SIMULATION: return this.$t('global.simulationPrice');
case PermissionType.SCREEN: return this.$t('global.timeUnitPrice');
}
return '';
}
@ -205,7 +204,7 @@ export default {
this.saleModel.sumPrice = response.data;
this.loadPayQtCode();
}).catch(() => {
this.$messageBox('获取总金额失败');
this.$messageBox(this.$t('tip.totalAmount'));
});
}
},
@ -260,7 +259,7 @@ export default {
this.WePayUrl = response.data;
this.loadings[0] = false;
}).catch(() => {
this.$messageBox('获取微信支付二维码失败');
this.$messageBox(this.$t('tip.wxCodePayFailde'));
this.loadings[0] = false;
});
},
@ -275,7 +274,7 @@ export default {
this.AlipayForm = response.data;
this.loadings[1] = false;
}).catch(() => {
this.$messageBox('获取支付宝支付二维码失败');
this.$messageBox(this.$t('tip.aliCodePayFailde'));
this.loadings[1] = false;
});
},
@ -291,7 +290,7 @@ export default {
this.$emit('confirm', '03');
}).catch(() => {
this.cancalOk = false;
this.$messageBox('取消订单失败');
this.$messageBox(this.$t('tip.cancelOrderFailed'));
});
}
}
@ -303,6 +302,5 @@ export default {
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
-ms-transform: All 0.4s ease-in-out;
}
</style>

View File

@ -18,9 +18,9 @@
style="border-style: dashed; border-width: 1px; padding: 1px; border-color:darkgray; border-radius:5px;"
@click="finish"
>
<span v-if="finishStatus === '02'" style=" color: green;">支付成功,点击返回</span>
<span v-else-if="finishStatus === '03'" style=" color: green;">取消成功,点击返回</span>
<span v-else style=" color: red;">支付失败,点击返回</span>
<span v-if="finishStatus === '02'" style=" color: green;">{{ $t('global.paymentSuccessful') }}</span>
<span v-else-if="finishStatus === '03'" style=" color: green;">{{ $t('global.cancelSuccessfully') }}</span>
<span v-else style=" color: red;">{{ $t('global.paymentFailed') }}</span>
</a>
</div>
</div>

View File

@ -1,7 +1,7 @@
<template>
<el-card :style="{ height: height +'px' }">
<div style="text-align: center; padding-top: 30px">
<b>收银台</b>
<b>{{ $t('global.checkstand') }}</b>
</div>
<div :style=" { height: height - 60 +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
@ -11,8 +11,8 @@
style="margin-top: 20px; margin-left: auto; margin-right: auto; width: 80%"
center
>
<el-step title="提交订单" />
<el-step title="完成支付" />
<el-step :title="$t('global.submitOrders')" />
<el-step :title="$t('global.completePayment')" />
</el-steps>
<div style="margin-top: 20px; margin-left: auto; margin-right: auto; width: 80%;">
<commit-draft
@ -72,10 +72,10 @@ export default {
computed: {
systemName() {
switch (this.$route.query.permissionType) {
case PermissionType.LESSON: return '教学系统';
case PermissionType.EXAM: return '考试系统';
case PermissionType.SIMULATION: return '仿真系统';
case PermissionType.SCREEN: return '大屏系统';
case PermissionType.LESSON: return this.$t('global.coursePrice');
case PermissionType.EXAM: return this.$t('global.testPrice');
case PermissionType.SIMULATION: return this.$t('global.simulationPrice');
case PermissionType.SCREEN: return this.$t('global.timeUnitPrice');
}
return '';
}
@ -105,7 +105,7 @@ export default {
this.active = 0;
this.orderData = response.data;
}).catch(() => {
this.$messageBox('获取课程信息失败');
this.$messageBox(this.$t('tip.failedCourse'));
});
},
//

View File

@ -1,86 +1,93 @@
<template>
<div class="digit" :style="{width: 11*zoom+'px', height: 20*zoom+'px', top: top+'px'}">
<div class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowOne), top: zoom+'px', left: zoom*2+'px', right: zoom*2+'px', height: zblod+'px'}">
</div>
<div class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowTwo), top: zoom*2+'px', right: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}">
</div>
<div class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowThee), bottom: zoom*2+'px', right: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}">
</div>
<div class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowFour), bottom: zoom+'px', right: zoom*2+'px', height: zblod+'px', left: zoom*2+'px' }">
</div>
<div class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowFive), bottom: zoom*2+'px', left: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}">
</div>
<div class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowSix), top: zoom*2+'px', left: zoom+'px',width: zblod+'px', height: zoom*7.5+'px'}">
</div>
<div class="segment "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowSeven), left: zoom*2+'px', right: zoom*2+'px', height: zblod+'px', bottom: zoom*9.5+'px'}">
</div>
</div>
<div class="digit" :style="{width: 11*zoom+'px', height: 20*zoom+'px', top: top+'px'}">
<div
class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowOne), top: zoom+'px', left: zoom*2+'px', right: zoom*2+'px', height: zblod+'px'}"
/>
<div
class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowTwo), top: zoom*2+'px', right: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}"
/>
<div
class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowThee), bottom: zoom*2+'px', right: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}"
/>
<div
class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowFour), bottom: zoom+'px', right: zoom*2+'px', height: zblod+'px', left: zoom*2+'px' }"
/>
<div
class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowFive), bottom: zoom*2+'px', left: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}"
/>
<div
class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowSix), top: zoom*2+'px', left: zoom+'px',width: zblod+'px', height: zoom*7.5+'px'}"
/>
<div
class="segment "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowSeven), left: zoom*2+'px', right: zoom*2+'px', height: zblod+'px', bottom: zoom*9.5+'px'}"
/>
</div>
</template>
<script>
export default {
name: 'digit',
props: {
top: {
type: Number,
required: true
},
zoom: {
type: Number,
required: true
},
number: {
type: Number,
required: true
},
fine: {
type: Number,
required: true,
},
color: {
type: String,
required: true,
}
},
computed: {
zblod() {
return parseInt(this.fine * this.zoom)
},
isShowOne() {
return [2, 3, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1;
},
isShowTwo() {
return [1, 2, 3, 4, 7, 8, 9, 0].indexOf(this.number) != -1;
},
isShowThee() {
return [1, 3, 4, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1;
},
isShowFour() {
return [2, 3, 5, 6, 8, 9, 0].indexOf(this.number) != -1;
},
isShowFive() {
return [2, 6, 8, 0].indexOf(this.number) != -1;
},
isShowSix() {
return [4, 5, 6, 8, 9, 0].indexOf(this.number) != -1;
},
isShowSeven() {
return [2, 3, 4, 5, 6, 8, 9].indexOf(this.number) != -1;
},
},
methods: {
opacity(show) {
return show ? 1 : 0.2;
}
}
}
export default {
name: 'Digit',
props: {
top: {
type: Number,
required: true
},
zoom: {
type: Number,
required: true
},
number: {
type: Number,
required: true
},
fine: {
type: Number,
required: true
},
color: {
type: String,
required: true
}
},
computed: {
zblod() {
return parseInt(this.fine * this.zoom);
},
isShowOne() {
return [2, 3, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1;
},
isShowTwo() {
return [1, 2, 3, 4, 7, 8, 9, 0].indexOf(this.number) != -1;
},
isShowThee() {
return [1, 3, 4, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1;
},
isShowFour() {
return [2, 3, 5, 6, 8, 9, 0].indexOf(this.number) != -1;
},
isShowFive() {
return [2, 6, 8, 0].indexOf(this.number) != -1;
},
isShowSix() {
return [4, 5, 6, 8, 9, 0].indexOf(this.number) != -1;
},
isShowSeven() {
return [2, 3, 4, 5, 6, 8, 9].indexOf(this.number) != -1;
}
},
methods: {
opacity(show) {
return show ? 1 : 0.2;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@ -109,4 +116,4 @@
}
}
</style>
</style>

View File

@ -1,75 +1,84 @@
<template>
<div class="system-time-box"
:style="{background: background, width: width+'px', height: height+'px', 'line-height': height+'px'}">
<template v-for="(item,index) in time">
<digit v-if="Number.isInteger(parseInt(item))" :number="parseInt(item)" :color="color" :fine="fine"
:zoom="time.length - index > 2? zoom: zoom* 0.6" :top="top"></digit>
<separator v-if="!Number.isInteger(parseInt(item))" :color="color" :zoom="zoom" :fine="fine"></separator>
</template>
</div>
<div
class="system-time-box"
:style="{background: background, width: width+'px', height: height+'px', 'line-height': height+'px'}"
>
<template v-for="(item,index) in time">
<digit
v-if="Number.isInteger(parseInt(item))"
:key="index"
:number="parseInt(item)"
:color="color"
:fine="fine"
:zoom="time.length - index > 2? zoom: zoom* 0.6"
:top="top"
/>
<separator v-if="!Number.isInteger(parseInt(item))" :key="index" :color="color" :zoom="zoom" :fine="fine" />
</template>
</div>
</template>
<script>
import Digit from './digit';
import Separator from './separator';
import Digit from './digit';
import Separator from './separator';
export default {
name: 'SystenTime',
props: {
background: {
type: String,
default() {
return '#000';
}
},
color: {
type: String,
default() {
return '#00FF00'
}
},
time: {
type: String,
default() {
return '12:3456'
}
},
zoom: {
type: Number,
default() {
return 4;
}
},
width: {
type: Number,
default() {
return 280;
}
},
height: {
type: Number,
default() {
return 80;
}
},
fine: {
type: Number,
default() {
return 1;
}
},
top: {
type: Number,
default() {
return 1;
}
}
},
components: {
Digit,
Separator
}
}
export default {
name: 'SystenTime',
components: {
Digit,
Separator
},
props: {
background: {
type: String,
default() {
return '#000';
}
},
color: {
type: String,
default() {
return '#00FF00';
}
},
time: {
type: String,
default() {
return '12:3456';
}
},
zoom: {
type: Number,
default() {
return 4;
}
},
width: {
type: Number,
default() {
return 280;
}
},
height: {
type: Number,
default() {
return 80;
}
},
fine: {
type: Number,
default() {
return 1;
}
},
top: {
type: Number,
default() {
return 1;
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@ -77,4 +86,4 @@
display: inline-block;
text-align: center;
}
</style>
</style>

View File

@ -1,38 +1,39 @@
<template>
<div class="point"
:style="{background: color, width: zblod+'px', height: zblod+'px', top: top+'px', 'border-radius': 0.5*zblod+'px'}">
</div>
<div
class="point"
:style="{background: color, width: zblod+'px', height: zblod+'px', top: top+'px', 'border-radius': 0.5*zblod+'px'}"
/>
</template>
<script>
export default {
name: 'point',
props: {
top: {
type: Number,
required: true,
},
zoom: {
type: Number,
required: true,
},
fine: {
type: Number,
required: true,
},
color: {
type: String,
required: true,
}
},
computed: {
zblod() {
return parseInt(this.fine * this.zoom)
}
},
methods: {
}
}
export default {
name: 'Point',
props: {
top: {
type: Number,
required: true
},
zoom: {
type: Number,
required: true
},
fine: {
type: Number,
required: true
},
color: {
type: String,
required: true
}
},
computed: {
zblod() {
return parseInt(this.fine * this.zoom);
}
},
methods: {
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@ -40,4 +41,4 @@
position: relative;
display: inline-block;
}
</style>
</style>

View File

@ -27,150 +27,79 @@ export default {
data() {
return {
option: {
backgroundColor: '#F0F2F5',
title: [{
backgroundColor: '#f0f0f0',
title: {
text: '',
subtext: '',
subtextStyle: {
color: '#909399'
},
y: 10,
left: 'center',
textAlign: 'center'
}, {
top: '12%',
left: '25%',
text: '',
textStyle: {
fontSize: 14,
fontWeight: 'normal'
}
}, {
top: '35%',
left: '25%',
text: '',
textStyle: {
fontSize: 14,
fontWeight: 'normal'
}
}, {
top: '58%',
left: '25%',
text: '',
textStyle: {
fontSize: 14,
fontWeight: 'normal'
}
}],
left: 'center'
},
tooltip: {
},
grid: [{
top: '15%',
top: '17%',
width: '45%',
bottom: '68%',
left: 10,
containLabel: true
}, {
top: '38%',
width: '45%',
bottom: '45%',
left: 10,
containLabel: true
}, {
top: '62%',
width: '45%',
bottom: '7%',
left: 10,
bottom: '5%',
left: 30,
containLabel: true
}],
xAxis: [{
type: 'value',
show: false,
minInterval: 1,
name: '权限(个)'
}, {
type: 'value',
show: false,
gridIndex: 1,
minInterval: 1,
name: '权限(个)'
}, {
type: 'value',
show: false,
gridIndex: 2,
minInterval: 1,
name: '权限(个)'
}],
yAxis: [{
xAxis: {
type: 'category',
show: false,
axisLabel: {
interval: 0,
rotate: 30
rotate: 60
},
splitLine: {
show: false
},
data: []
}, {
type: 'category',
},
yAxis: {
type: 'value',
show: false,
gridIndex: 1,
axisLabel: {
interval: 0,
rotate: 30
},
splitLine: {
show: false
},
data: []
}, {
type: 'category',
show: false,
gridIndex: 2,
axisLabel: {
interval: 0,
rotate: 30
},
splitLine: {
show: false
},
data: []
}],
minInterval: 1,
name: '权限(个)'
},
series: [{
type: 'bar',
z: 3,
barWidth: 10,
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
barWidth: 25,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#83bff6'},
{offset: 0.5, color: '#188df0'},
{offset: 1, color: '#188df0'}
]
)
},
emphasis: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#2378f7'},
{offset: 0.7, color: '#2378f7'},
{offset: 1, color: '#83bff6'}
]
)
}
},
data: []
}, {
type: 'bar',
z: 3,
xAxisIndex: 1,
yAxisIndex: 1,
barWidth: 10,
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'bar',
z: 3,
xAxisIndex: 2,
yAxisIndex: 2,
barWidth: 10,
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'pie',
radius: [0, '70%'],
center: ['75%', '52%'],
radius: [0, '72%'],
center: ['74%', '55%'],
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.percent}%`; }
formatter: params => { return `${params.marker} ${params.name}: ${params.percent}% ${params.value}个)`; }
},
data: []
}]
@ -211,77 +140,54 @@ export default {
},
async loadExamData(mapName) {
if (mapName) {
var permissionMap = {};
var permissionDict = {};
var permissionList = await this.$Dictionary.permissionType();
(permissionList ||[]).forEach(elem => {
permissionDict[elem.code] = elem.name;
});
if (permissionList) {
(permissionList ||[]).forEach(elem => {
permissionMap[elem.code] = elem.name;
});
}
var lessonMap = {
var permissionMap = {
'ATS现地工作站-课程权限': 0,
'ATS行调工作站-课程权限': 0
};
var examMap = {
'ATS行调工作站-课程权限': 0,
'ATS现地工作站-考试权限': 0,
'ATS行调工作站-考试权限': 0
};
var simulationMap = {
'ATS行调工作站-考试权限': 0,
'ATS现地工作站-仿真权限': 0,
'ATS行调工作站-仿真权限': 0,
'综合演练云平台-仿真权限': 0,
'司机模拟驾驶系统-仿真权限': 0,
'大屏系统权限': 0
};
(this.permissionList.filter(elem => { return elem.mapName == mapName; })|| []).forEach(elem => {
switch (elem.type) {
case '01':
lessonMap[`${elem.mapProductName}-${permissionMap[elem.type]}`] = elem.remains;
break;
case '02':
examMap[`${elem.mapProductName}-${permissionMap[elem.type]}`] = elem.remains;
break;
case '03':
simulationMap[`${elem.mapProductName}-${permissionMap[elem.type]}`] = elem.remains;
break;
if (elem.mapProductName == Object.keys(permissionMap)[Object.keys(permissionMap).length -1]) {
permissionMap[`${elem.mapProductName}`] = elem.remains;
} else {
permissionMap[`${elem.mapProductName}-${permissionDict[elem.type]}`] = elem.remains;
}
});
const keys = [...Object.keys(lessonMap), ...Object.keys(examMap), ...Object.keys(simulationMap)];
const values = [...Object.values(lessonMap), ...Object.values(examMap), ...Object.values(simulationMap)];
const sum = values.reduce((total, num) => total + num);
const keys = Object.keys(permissionMap);
const values = Object.values(permissionMap);
const sum = values.reduce((total, num) => { return total + num; });
this.option.title[0].text = `剩余权限分布图(${mapName}`;
this.option.title[0].subtext = `权限总计${sum}`;
this.option.title[1].text = `课程权限`;
this.option.title[2].text = `考试权限`;
this.option.title[3].text = `仿真权限`;
this.option.title.text = `剩余权限分布图(${mapName}`;
this.option.title.subtext = `权限总计${sum}`;
this.option.xAxis[0].show = this.option.xAxis[1].show = this.option.xAxis[2].show = true;
this.option.yAxis[0].show = this.option.yAxis[1].show = this.option.yAxis[2].show = true;
this.option.xAxis.show = true;
this.option.yAxis.show = true;
this.option.yAxis[0].data = Object.keys(lessonMap);
this.option.series[0].data = Object.values(lessonMap);
this.option.xAxis.data = keys;
this.option.yAxis[1].data = Object.keys(examMap);
this.option.series[1].data = Object.values(examMap);
this.option.yAxis[2].data = Object.keys(simulationMap);
this.option.series[2].data = Object.values(simulationMap);
this.option.series[3].data = keys.map((name, index) => { return {name, value: values[index]}; });
this.option.series[0].data = values;
this.option.series[1].data = keys.map(name => { return {name, value: permissionMap[name]}; });
} else {
this.option.title[0].text = `剩余权限分布图(暂无地图线路数据)`;
this.option.title[0].subtext = `权限总计0个`;
this.option.title[1].text = ``;
this.option.title[2].text = ``;
this.option.title[3].text = ``;
this.option.xAxis[0].show = this.option.xAxis[1].show = this.option.xAxis[2].show = false;
this.option.yAxis[0].show = this.option.yAxis[1].show = this.option.yAxis[2].show = false;
this.option.yAxis[0].data = this.option.yAxis[1].data = this.option.yAxis[2].data = [];
this.option.series[0].data = this.option.series[1].data = this.option.series[2].data = [];
this.option.title.text = `剩余权限分布图(暂无地图线路数据)`;
this.option.title.subtext = `权限总计0个`;
this.option.xAxis.show = false;
this.option.yAxis.show = false;
this.option.xAxis.data = [];
this.option.series[0].data = [];
this.option.series[1].data = [];
}
this.chart.setOption(this.option);

View File

@ -110,7 +110,7 @@ export default {
launchFullscreen();
await putJointTrainingSimulationEntrance(this.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinStyle: rest.data.skinStyle, mapId: this.mapId, group: this.group };
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group };
this.$router.push({ path: `/jointTraining`, query: query });
} else if (this.state == '01') {
const query = { group: this.group };

View File

@ -1,8 +1,8 @@
<template>
<el-card v-loading="loading">
<div slot="header" style="text-align: center;">
<span v-if="hasProduct"><b>仿真名称 {{ courseModel.name }}</b></span>
<span v-else>无仿真产品</span>
<span v-if="hasProduct"><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span>
<span v-else>{{ $t('demonstration.noSimulationProducts') }}</span>
</div>
<el-tabs
type="border-card"
@ -20,22 +20,22 @@
>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height-170 +'px' }">
<p class="list-item">
<span class="list-label">产品说明</span>
<span class="list-label">{{ $t('demonstration.productDescription') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span>
</p>
<p class="list-item">
<span class="list-label">权限列表</span>
<span class="list-label">{{ $t('global.permissionList') }}</span>
</p>
<limit-list :ref="`limit_${item.code}`" :course-model="courseModel" @initLoadPage="initLoadPage" />
</el-scrollbar>
</el-tab-pane>
<div v-if="hasProduct" class="btn-buy">
<el-button :loading="buttonLoading" type="success" @click="buy">购买</el-button>
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="distribute">权限分发</el-button>
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="transfer">权限转赠</el-button>
<el-button v-show="isStartDemon" :loading="buttonLoading" type="primary" @click="start">开始仿真</el-button>
<el-button v-show="isCreateRoom" :loading="buttonLoading" type="primary" @click="start">创建房间</el-button>
<el-button v-show="isInRoom" :loading="buttonLoading" type="primary" @click="joinRoom">进入房间</el-button>
<el-button :loading="buttonLoading" type="success" @click="buy">{{ $t('global.buy') }}</el-button>
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button>
<el-button v-show="isStartDemon" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
<el-button v-show="isCreateRoom" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.createRoom') }}</el-button>
<el-button v-show="isInRoom" :loading="buttonLoading" type="primary" @click="joinRoom">{{ $t('demonstration.enterRoom') }}</el-button>
</div>
</el-tabs>
</el-card>
@ -59,18 +59,6 @@ export default {
components: {
LimitList
},
filters: {
setTime(val) {
if (val <= 1) {
return `0分钟`;
} else if (val > 1 && val <= 60) {
return '1分钟';
} else if (val > 60) {
const time = parseInt(val / 60);
return `${time}分钟`;
}
}
},
mixins: [
WindowResizeHandler
],
@ -160,7 +148,7 @@ export default {
}
this.loading = false;
} catch (e) {
this.$messageBox('获取产品列表失败');
this.$messageBox(this.$t('error.getProductListFailed'));
}
},
resizeHandler: function () {
@ -227,7 +215,7 @@ export default {
}
} catch (error) {
this.loading = false;
this.$messageBox('刷新失败');
this.$messageBox(this.$t('error.refreshFailed'));
}
} else {
this.loading = false;
@ -254,9 +242,9 @@ export default {
} catch (error) {
this.buttonLoading = false;
if (error.code == 20001) {
this.$confirm(`每个用户只能创建一个综合演练房间, 是否进入房间`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('tip.createRoomFailedHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {}).catch(() => {});
}
@ -269,13 +257,13 @@ export default {
this.jump();
} else {
if (this.tryTime <= 1) {
this.$confirm('您没有权限,请前往购买产品', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('tip.noPermissionHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
this.buy();
}).catch(() => {});
}).catch(() => { this.buttonLoading = false; });
} else {
this.jump();
}
@ -290,7 +278,8 @@ export default {
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
this.buttonLoading = false;
});
},
buy() {

View File

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

View File

@ -1,11 +1,11 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>地图列表</span>
<span>{{ $t('global.mapList') }}</span>
<!-- <div v-if="role" class="back-home" @click="backHome">返回首页</div> -->
</div>
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" @filterSelectChange="refresh" @changeFilter="clearMapSelect" />
<el-input v-model="filterText" placeholder="输入关键字进行过滤" clearable />
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
<el-tree
ref="tree"
@ -122,7 +122,7 @@ export default {
});
} catch (error) {
this.loading = false;
this.$messageBox('刷新失败');
this.$messageBox(this.$t('error.refreshFailed'));
}
},
clearMapSelect() {

View File

@ -176,7 +176,11 @@ export default {
}
},
confirm() {
async confirm() {
await this.$store.dispatch('training/over');
await this.$store.dispatch('training/setMapDefaultState');
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
this.$emit('selectQuest', this.row, this.form.role);
this.doClose();
this.roleDoClose();
@ -189,11 +193,11 @@ export default {
checkDisabled(role) {
if (this.$route.query.prdType == '01') {
return role !== 'Attendant';
return role !== 'Attendant' && role !== 'no';
} else if (this.$route.query.prdType == '02') {
return role !== 'Dispatcher';
return role !== 'Dispatcher'&& role !== 'no';
} else if (this.$route.query.prdType == '04') {
return role !== 'Driver';
return role !== 'Driver' && role !== 'no';
}
},

View File

@ -18,6 +18,7 @@
@tryTime="tryTime"
@hidepanel="hidepanel"
@quitQuest="quitQuest"
@showIbp="showIbp"
/>
<menu-screen v-if="isScreen" ref="menuScreen" :offset="offset" :group="group" @tryTime="tryTime" />
@ -26,10 +27,10 @@
<menu-replay v-if="isReplay" ref="menuReplay" :offset="offset" :group="group" />
<menu-script v-if="isTask" ref="menuScript" :offset="offset" :group="group" />
<menu-script v-if="isScript" ref="menuScript" :offset="offset" :group="group" />
<menu-schema
v-if="isDemon || isPlan || isTask "
v-if="isDemon || isPlan || isScript "
ref="menuSchema"
:offset="offset"
:group="group"
@ -40,11 +41,12 @@
@switchMode="switchMode"
/>
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
<menu-system-time ref="menuSystemTime" :offset="offset" :right="right" :group="group" />
</div>
<Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" />
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<ibp-plate v-show="ibpShow" ref="ibpPlate" @hideIbp="hideIbp"/>
<fault-choose ref="faultChoose" :group="group" />
<run-plan-Load ref="runPlanLoad" :group="group" />
@ -85,6 +87,7 @@ import Vue from 'vue';
//
import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import IbpPlate from '@/views/ibp/index'
export default {
name: 'DisplayDraft',
@ -104,7 +107,8 @@ export default {
MenuSchema,
MenuSystemTime,
Jl3dSimulation,
Jl3dDrive
Jl3dDrive,
IbpPlate
},
mixins: [WindowResizeHandler],
props: {
@ -122,6 +126,7 @@ export default {
timeDemonNum: 0,
checkLine: null,
offset: 15,
right: 0,
mouseNum: 1,
ierval: null,
mouseNumTime: 0,
@ -136,7 +141,8 @@ export default {
'01': '01', // =>
'02': '02', // =>
'04': '02' // =>
}
},
ibpShow: false
};
},
computed: {
@ -157,15 +163,15 @@ export default {
trainingId() {
return this.$route.query.trainingId;
},
skinCode() {
return this.$route.query.skinCode;
},
mapId() {
return this.$route.query.mapId;
},
prdType() {
return this.$route.query.prdType;
},
skinCode() {
return this.$route.query.skinCode;
},
isLesson() {
return this.mode === 'teach' || this.mode === 'record' || this.mode === 'manage';
},
@ -181,7 +187,7 @@ export default {
isReplay() {
return this.mode === 'replay';
},
isTask() {
isScript() {
return this.mode === 'script';
},
isPlan() {
@ -246,6 +252,7 @@ export default {
const width = this.size ? this.size.width : this._clientWidth;
const height = this.size ? this.size.height : this._clientHeight;
this.right = width /2 - 55;
this.$store.dispatch('config/resize', { width, height });
this.$nextTick(() => {
@ -340,13 +347,12 @@ export default {
},
//
async initLoadData() {
// const width = document.documentElement.clientWidth;
// const height = document.documentElement.clientHeight + 200;
// this.$store.dispatch('config/resize', { width, height });
this.$store.dispatch('training/reset');
try {
await this.loadSimulationInfo();
if (!this.isReplay) {
await this.loadSimulationInfo();
}
if (this.isReplay) {
await this.initLoadReplayData();
@ -356,7 +362,7 @@ export default {
await this.initLoadScreenData();
} else if (this.isPlan) {
await this.initLoadTestRunData();
} else if (this.isTask) {
} else if (this.isScript) {
await this.initLoadTaskData();
} else {
await this.initLoadLessonOrExamData();
@ -524,7 +530,7 @@ export default {
await this.$refs.menuScreen.back();
} else if (this.isPlan) {
await this.$refs.menuPlan.back();
} else if (this.isTask) {
} else if (this.isScript) {
await this.$refs.menuScript.back();
}
},
@ -552,6 +558,11 @@ export default {
this.$refs.Jl3dSimulation.show(this.skinCode);
}
},
showIbp() {
this.panelShow = false;
this.ibpShow = true;
this.$refs.ibpPlate.show();
},
showpanel() {
this.panelShow = true;
this.simulationShow = false;
@ -560,6 +571,10 @@ export default {
this.panelShow = true;
this.drivingShow = false;
},
hideIbp() {
this.panelShow = true;
this.ibpShow = false;
},
runPlanViewShow() {
this.$refs.runPlanView.doShow();
},

View File

@ -7,6 +7,7 @@
</div>
<div class="display-draft">
<el-button-group>
<el-button @click="jumpIbp">IBP盘</el-button>
<el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<template v-if="questId">
<el-button type="danger" @click="handleQuitQuest">退出剧本</el-button>
@ -185,6 +186,9 @@ export default {
jumpjlmap3d() {
this.$emit('hidepanel');
},
jumpIbp() {
this.$emit('showIbp')
},
setTryTime() {
if (this.try) {
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });

View File

@ -62,7 +62,7 @@ export default {
startLoading: false,
speed: '1X',
level: 1,
isPlay: true,
isPlay: false,
time: '',
timeInterval: null,
progress: 0,
@ -95,6 +95,11 @@ export default {
return this.isPlay ? '暂停' : '播放';
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function() {
this.isPlay = true;
}
},
mounted() {
EventBus.$emit('showChat');
this.time = (+new Date(this.$route.query.destroyTime) - +new Date(this.$route.query.createTime)) / 1000;

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