Merge remote-tracking branch 'origin/dev' into test

This commit is contained in:
fan 2019-09-11 13:20:30 +08:00
commit 41b70bc477
85 changed files with 1011 additions and 1680 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 120 KiB

View File

@ -0,0 +1,22 @@
export default {
testStatistics: 'Test statistics',
simulationStatistics: 'simulationStatistics',
comprehensiveExerciseCloudPlatform: 'Comprehensive exercise cloud platform',
driverSimulatedDrivingSystem: 'Driver simulated driving system',
ATSLineAdjustmentWorkstation: 'ATS line adjustment workstation',
ATSLocalWorkstation: 'ATS local workstation',
courseStatistics: 'Course Statistics',
signalTraining: 'Signal Training',
turnoutTraining: 'Turnout Training',
sectionTraining: 'Section Training',
stationTraining: 'Station Training',
permissions: 'Permissions (individual)',
largeScreenSystemPermissions: 'Large screen system permissions',
courseAuthority: 'Course authority',
examinationAuthority: 'Examination authority',
simulationPermission: 'Simulation Permission',
residualPermissionDistributionMap: 'Residual permission distribution map',
totalPermissions: 'total permissions',
noMapLineDataYetAvailable: 'No map line data yet available',
individual: 'individual'
};

View File

@ -62,6 +62,7 @@ export default {
obtainChapterDataFailed: 'Failed to obtain chapter data', obtainChapterDataFailed: 'Failed to obtain chapter data',
obtainCourseDetailsFailed: 'Failed to obtain course details', obtainCourseDetailsFailed: 'Failed to obtain course details',
obtainCourseInformationFailed: 'Failed to obtain course information', obtainCourseInformationFailed: 'Failed to obtain course information',
obtainStepDataFailed: 'Failed to obtain step data' obtainStepDataFailed: 'Failed to obtain step data',
submitExamFailed: 'Automatic submission of test results failed',
getTestInformationFailed: 'Failed to get test information'
}; };

View File

@ -1,16 +1,39 @@
export default { export default {
testSystem: '城市轨道交通考试系统', testSystem: 'Urban rail transit examination system',
testSystemDescription: ' 该系统具有自定义考试规则、自动生成考卷、学员成绩统计、数据曲线分析及题库管理等功能,从实战操作、业务流程、故障模拟及考试规则等多角度出发,力求打造最符合用户需求的城市轨道交通在线交互实操类考试系统', testSystemDescription: 'The system has the functions of self-defined examination rules, automatic generation of examination papers, statistics of students\' scores, data curve analysis and question bank management, etc. From the perspectives of practical operation, business process, fault simulation and examination rules, it strives to build the online interactive practical operation examination system of urban rail transit that best meets users\' needs',
examResultsDetails: '考试结果详情', examResultsDetails: 'Details of examination results',
testQuestionsName: '试题名称', testQuestionsName: 'Item name',
testScores: '考试得分', testScores: 'Test scores',
points: '分', points: 'Point',
whetherThrough: '是否通过', whetherThrough: 'Whether through',
didNotCalculate: '未计算', didNotCalculate: 'Did not calculate',
pass: '通过', pass: 'pass',
notPass: '未通过', notPass: 'Not pass',
examTime: '考试用时', examTime: 'Exam time',
trainingName: '实训名称', trainingName: 'Training name',
trainingScore: '实训得分', trainingScore: 'Training score',
returnToExamList: '返回考试列表' returnToExamList: 'Return to the exam list',
totalScore: 'Total score',
itemList: 'Item list',
courseName: 'Course name',
permissionsDetails: 'Permissions for details',
buy: 'buy',
distributePermission: 'Permission distribution (examination)',
viewCoursePapers: 'View course papers',
examStartTime: 'Exam start time',
theExamIsReadyAnyTime: 'The exam is ready any time',
testExplanation: 'Test Explanation',
examTimeAvailable: 'Exam time available',
fullMarksInTheExam: 'Full marks in the exam',
passMarkTheExam: 'Pass mark the exam',
examinationRules: 'Examination rules',
trainingType: 'Training type',
numberOfQuestions: 'Number of questions',
score: 'Score',
startTheExam: 'Start the exam',
examinationTiming: 'Examination timing',
maximumTimeToCompleteThisQuestion: 'Maximum time to complete this question',
theBestTimeToCompleteTheQuestion: 'The best time to complete the question',
trainingNotes: 'Training notes',
giveUpTheExam: 'Give up the exam'
}; };

View File

@ -104,7 +104,10 @@ export default {
updateTime: 'Update time:', updateTime: 'Update time:',
line: 'Line:', line: 'Line:',
permissionList: 'Permissions list:', permissionList: 'Permissions list:',
remove: 'remove', remove: 'Remove',
append: 'append', append: 'Append',
release: 'release' release: 'Release',
temporarilyNoData: 'Temporarily no data',
second: 'Second',
amount: 'Amount'
}; };

View File

@ -17,6 +17,7 @@ import planMonitor from './planMonitor';
import screenMonitor from './screenMonitor'; import screenMonitor from './screenMonitor';
import demonstration from './demonstration'; import demonstration from './demonstration';
import exam from './exam'; import exam from './exam';
import dashboard from './dashboard';
export default { export default {
...enLocale, ...enLocale,
@ -37,5 +38,6 @@ export default {
planMonitor, planMonitor,
screenMonitor, screenMonitor,
demonstration, demonstration,
exam exam,
dashboard
}; };

View File

@ -84,5 +84,7 @@ export default {
sourcesOfInformation: 'Sources of information', sourcesOfInformation: 'Sources of information',
distributePermission: 'Distribute permission', distributePermission: 'Distribute permission',
orderCreation: 'Order creation', orderCreation: 'Order creation',
chooseGoods: 'Choose goods' chooseGoods: 'Choose goods',
permissionName: 'Permission Name',
receivingPermission: 'Receiving permission'
}; };

View File

@ -26,6 +26,7 @@ export default {
addPermissionPackageRule: 'Add authority packaging rules', addPermissionPackageRule: 'Add authority packaging rules',
editPermissionPackageRule: 'edit authority packaging rule', editPermissionPackageRule: 'edit authority packaging rule',
restPermissionMaxNumber: '(maximum number of remaining permissions: {0})', restPermissionMaxNumber: '(maximum number of remaining permissions: {0})',
pleaseSelectTransferPermission: 'Select transfer permissions' pleaseSelectTransferPermission: 'Select transfer permissions',
permissionName: 'Permission Name'
}; };

View File

@ -53,6 +53,7 @@ export default {
dataDictionary: 'Data dictionary', dataDictionary: 'Data dictionary',
dataDictionaryDetails: 'Data dictionary details', dataDictionaryDetails: 'Data dictionary details',
userManage: 'user management', userManage: 'user management',
cacheManage: 'cache management',
userTrainingManage: 'User training management', userTrainingManage: 'User training management',
userExamManage: 'User examination management', userExamManage: 'User examination management',
userSimulationManage: 'User simulation management', userSimulationManage: 'User simulation management',

View File

@ -238,5 +238,14 @@ export default {
selectTrainingType: 'Please select training type', selectTrainingType: 'Please select training type',
selectOneTrainingType: 'Only one training type can be selected', selectOneTrainingType: 'Only one training type can be selected',
enterProductType: 'Please enter product type', enterProductType: 'Please enter product type',
selectAssociatedStation: 'Please select the associated station' selectAssociatedStation: 'Please select the associated station',
enterScale: 'Please enter the zoom ratio',
enterXOffset: 'Please enter X offset',
enterYOffset: 'Please enter Y offset',
pleaseSelectButtonType: 'Please select the button type',
pleaseSelectButtonContent: 'Please enter the content',
endTimeRules: 'The end time must be greater than the start time.',
selectCourses: 'Please select courses',
selectTheMapRoute: 'Please select the map route.'
}; };

View File

@ -1,22 +1,102 @@
export default { export default {
scriptTitle: 'Task Recording', scriptTitle: 'Task Recording',
saveMaplocation: 'Update Location',
saveBackground: 'Save Background', saveBackground: 'Save Background',
saveData: 'Save Data', saveData: 'Save Data',
roleManage: 'Role Manage', mapList: 'Map List',
targetCondition: 'Task Target', createScript: 'Create Script',
taskScript: 'Task Script', scriptName: 'Script Name',
roleName: 'Role Name', addScript: 'Add Script',
roleType: 'Role Type', map: 'Map',
deviceCode: 'Device Code', scriptDescription: 'Script Description',
roleList: 'Role List', submit: 'submit',
operation: 'Operation', scriptNameRule: 'Please input script name',
roleAdd: 'Add', scriptDescriptionRule: 'Please input script description',
delete: 'Delete', createScriptSuccess: 'Create script success',
behaviorOperate: 'Behavior Operate', createScriptFail: 'Create script failure',
conditionTitle: 'Target condition', scriptDetail: 'Script Detail',
deviceType: 'Device Type', scriptRecord: 'Record',
deviceCondition: 'Device Condition', scriptModify: 'Modify',
paramDeviceType: 'Param DeviceType', scriptDelete: 'Delete',
paramDeviceCode: 'Param DeviceCode' getScriptFail: 'Get script information failure',
createSimulationFail: 'Create simulation failure',
modifyScriptSuccess: 'Modify script success',
modifyScriptFail: 'Modify script failure',
deleteScriptTip: 'This action will delete this script, whether to continue?',
operateTip: 'Prompt',
confirmButtonText: 'Submit',
cancelButtonText: 'Cancle',
deleteScriptSucess: 'delete script sucess',
deleteScriptFail: 'delete script failure',
scriptRecordTitle: 'Script Record',
drivingPause: 'Pause',
recoverAndExecute: 'Recover And Execute',
resetScript: 'Reset Script',
pauseFail: 'Pause failure',
recoverFail: 'Recover failure',
saveBackgroundSuceess: 'Save background suceess',
updateLocationFail: 'update location failure',
saveBackgroundFail: 'Save background failure',
saveDataSucess: 'Save data sucess',
saveDataFail: 'Save data failure',
clearDataTip: 'This action will clear the saved script data, whether to continue?',
resetDataSuccess: 'Reset script success',
resetDataFail: 'Reset script failure',
allRoles: 'All Roles',
actors: 'Actors',
roleSexMale: 'Male',
roleSexFemale: 'Female',
selectScriptActorSuccess: 'Select script actor success',
selectScriptActorFail: 'Select script actor failure',
cancleScriptActorSuccess: 'Cancle script actor success',
cancleScriptActorFail: 'Cancle script actor failure',
modifyScriptActorSexSuccess: 'Modify script actor sex success',
modifyScriptActorSexFail: 'Modify script actor sex failure',
addConversition: 'Add Conversition',
narrator: 'Narrator',
narratorRules: 'Please select narrator',
receiver: 'Receiver',
receiverRules: 'Please select receiver',
conversitionContent: 'Content',
addCommand: 'Add Command',
executor: 'Executor',
executorRules: 'Please select executor',
executeCommand: 'Command',
executeCommandRules: 'Please select execute command',
startStation: 'Start Station',
startStationRules: 'Please select start station ',
endStation: 'End Station',
endStationRules: 'Please select end station',
addCommandButton: 'Add Command',
addConversitionButton: 'Add Conversition',
conversitionContentRules: 'Please input content',
addCommandSucess: 'Add command sucess',
addCommandFail: 'Add command failure',
addConversitionSuccess: 'Add conversition success',
addConversitionFail: 'Add conversition failure',
modifyConversitionSuccess: 'Modify conversition success',
modifyConversitionFail: 'Modify conversition failure',
modifyConversition: 'Modify Conversition',
modifyConversitionButton: 'modify',
drivingByPlan: 'Driving By Plan',
scriptBack: 'Back'
// roleManage: 'Role Manage',
// targetCondition: 'Task Target',
// taskScript: 'Task Script',
// roleName: 'Role Name',
// roleType: 'Role Type',
// deviceCode: 'Device Code',
// roleList: 'Role List',
// operation: 'Operation',
// roleAdd: 'Add',
// delete: 'Delete',
// behaviorOperate: 'Behavior Operate',
// conditionTitle: 'Target condition',
// deviceType: 'Device Type',
// deviceCondition: 'Device Condition',
// paramDeviceType: 'Param DeviceType',
// paramDeviceCode: 'Param DeviceCode'
}; };

View File

@ -125,6 +125,9 @@ export default {
updateTrainingSuccessfully: 'Update training successfully!', updateTrainingSuccessfully: 'Update training successfully!',
updateTrainingFailed: 'Failed to update training', updateTrainingFailed: 'Failed to update training',
savedStepDataSuccessfully: 'Saved step data successfully', savedStepDataSuccessfully: 'Saved step data successfully',
savedStepDataFailed: 'Failed to save step data' savedStepDataFailed: 'Failed to save step data',
noCourseAuthority: 'No examination permission for this course, please go to purchase!',
notWithinTheScopeOfTheExamination: 'Not within the scope of the examination',
giveUpTheExamTip: 'This operation will give up the examination. Will it continue?',
theNumberOfPermissionsAvailableIsZero: 'The number of permissions available is 0'
}; };

View File

@ -0,0 +1,23 @@
export default {
testStatistics: '考试统计',
simulationStatistics: '仿真统计',
comprehensiveExerciseCloudPlatform: '综合演练云平台',
driverSimulatedDrivingSystem: '司机模拟驾驶系统',
ATSLineAdjustmentWorkstation: 'ATS行调工作站',
ATSLocalWorkstation: 'ATS现地工作站',
courseStatistics: '课程统计',
controlRightsTraining: '控制权实训',
signalTraining: '信号机实训',
turnoutTraining: '道岔实训',
sectionTraining: '区段实训',
stationTraining: '车站培训',
permissions: '权限(个)',
largeScreenSystemPermissions: '大屏系统权限',
courseAuthority: '课程权限',
examinationAuthority: '考试权限',
simulationPermission: '仿真权限',
residualPermissionDistributionMap: '剩余权限分布图',
totalPermissions: '权限总计',
noMapLineDataYetAvailable: '暂无地图线路数据',
individual: '个'
};

View File

@ -62,5 +62,7 @@ export default {
obtainChapterDataFailed: '获取章节数据失败', obtainChapterDataFailed: '获取章节数据失败',
obtainCourseDetailsFailed: '获取课程详情失败', obtainCourseDetailsFailed: '获取课程详情失败',
obtainCourseInformationFailed: '获取课程信息失败', obtainCourseInformationFailed: '获取课程信息失败',
obtainStepDataFailed: '获取步骤数据失败' obtainStepDataFailed: '获取步骤数据失败',
submitExamFailed: '自动提交考试结果失败',
getTestInformationFailed: '获取试题息失败'
}; };

View File

@ -12,5 +12,29 @@ export default {
examTime: '考试用时', examTime: '考试用时',
trainingName: '实训名称', trainingName: '实训名称',
trainingScore: '实训得分', trainingScore: '实训得分',
returnToExamList: '返回考试列表' returnToExamList: '返回考试列表',
totalScore: '总分',
itemList: '试题列表',
courseName: '课程名称',
permissionsDetails: '权限详情',
buy: '购买',
distributePermission: '权限分发(考试)',
viewCoursePapers: '查看课程试卷',
nameOfTestPaper: '试卷名称',
examStartTime: '考试时间',
theExamIsReadyAnyTime: '随时都可以考试',
testExplanation: '考试说明',
examTimeAvailable: '考试时长',
fullMarksInTheExam: '考试满分',
passMarkTheExam: '考试及格分',
examinationRules: '考试规则',
trainingType: '实训类型',
numberOfQuestions: '题数',
score: '分值',
startTheExam: '开始考试',
examinationTiming: '考试计时',
maximumTimeToCompleteThisQuestion: '完成本题最大用时',
theBestTimeToCompleteTheQuestion: '完成本题最佳用时',
trainingNotes: '实训说明',
giveUpTheExam: '放弃考试'
}; };

View File

@ -145,5 +145,8 @@ export default {
permissionList: '权限列表:', permissionList: '权限列表:',
remove: '移除', remove: '移除',
append: '添 加', append: '添 加',
release: '发布' release: '发布',
temporarilyNoData: '暂无数据',
second: '秒',
amount: '总数量'
}; };

View File

@ -17,6 +17,7 @@ import planMonitor from './planMonitor';
import screenMonitor from './screenMonitor'; import screenMonitor from './screenMonitor';
import demonstration from './demonstration'; import demonstration from './demonstration';
import exam from './exam'; import exam from './exam';
import dashboard from './dashboard';
export default { export default {
...cnLocale, ...cnLocale,
@ -37,5 +38,6 @@ export default {
planMonitor, planMonitor,
screenMonitor, screenMonitor,
demonstration, demonstration,
exam exam,
dashboard
}; };

View File

@ -84,5 +84,7 @@ export default {
distributePermission: '权限分发', distributePermission: '权限分发',
orderCreation: '订单创建', orderCreation: '订单创建',
select: '选择', select: '选择',
chooseGoods: '选择商品' chooseGoods: '选择商品',
permissionName: '权限名称',
receivingPermission: '领取权限'
}; };

View File

@ -26,6 +26,7 @@ export default {
addPermissionPackageRule: '增加权限打包规则', addPermissionPackageRule: '增加权限打包规则',
editPermissionPackageRule: '编辑权限打包规则', editPermissionPackageRule: '编辑权限打包规则',
restPermissionMaxNumber: '(剩余最大权限个数:{0}', restPermissionMaxNumber: '(剩余最大权限个数:{0}',
pleaseSelectTransferPermission: '选择转赠权限' pleaseSelectTransferPermission: '选择转赠权限',
permissionName: '权限名称'
}; };

View File

@ -249,12 +249,13 @@ export default {
selectOneTrainingType: '只能选择一个实训类型', selectOneTrainingType: '只能选择一个实训类型',
enterProductType: '请输入产品类型', enterProductType: '请输入产品类型',
selectAssociatedStation: '请选择关联的车站', selectAssociatedStation: '请选择关联的车站',
enterScale: '请输入缩放比例', enterScale: '请输入缩放比例',
enterXOffset: '请输入X偏移', enterXOffset: '请输入X偏移',
enterYOffset: '请输入Y偏移', enterYOffset: '请输入Y偏移',
pleaseSelectButtonType: '请选择按钮类型', pleaseSelectButtonType: '请选择按钮类型',
pleaseSelectButtonContent: '请输入内容' pleaseSelectButtonContent: '请输入内容',
endTimeRules: '结束时间必须大于开始时间',
selectCourses: '请选择课程',
selectTheMapRoute: '请选择地图线路'
}; };

View File

@ -1,11 +1,88 @@
export default { export default {
scriptTitle: '剧本录制', scriptTitle: '剧本录制',
// saveMaplocation: '更新定位',
saveBackground: '保存背景', saveBackground: '保存背景',
saveData: '保存数据', saveData: '保存数据',
mapList: '地图列表', mapList: '地图列表',
createScript: '创建剧本', createScript: '创建剧本',
scriptName: '剧本名称', scriptName: '剧本名称',
addScript: '添加剧本',
map: '所属地图',
scriptDescription: '剧本描述',
submit: '确定',
scriptNameRule: '请输入剧本名称',
scriptDescriptionRule: '请输入剧本描述',
createScriptSuccess: '创建剧本成功',
createScriptFail: '创建剧本失败',
scriptDetail: '剧本详情',
scriptRecord: '编制',
scriptModify: '修改',
scriptDelete: '删除',
getScriptFail: '获取剧本信息失败',
createSimulationFail: '创建仿真失败',
modifyScriptSuccess: '修改剧本成功',
modifyScriptFail: '修改剧本失败',
deleteScriptTip: '此操作将删除此剧本, 是否继续?',
operateTip: '提示',
confirmButtonText: '确定',
cancelButtonText: '取消',
deleteScriptSucess: '删除成功',
deleteScriptFail: '删除失败',
scriptRecordTitle: '剧本编制',
drivingPause: '暂停',
recoverAndExecute: '恢复并执行',
resetScript: '重置剧本',
pauseFail: '暂停失败',
recoverFail: '恢复失败',
saveBackgroundSuceess: '保存背景成功',
updateLocationFail: '更新定位失败',
saveBackgroundFail: '保存背景失败',
saveDataSucess: '保存数据成功',
saveDataFail: '保存数据失败',
clearDataTip: '此操作将会清除已保存的编制数据, 是否继续?',
resetDataSuccess: '重置剧本成功',
resetDataFail: '重置剧本失败',
allRoles: '所有角色',
actors: '演员角色',
roleSexMale: '男',
roleSexFemale: '女',
selectScriptActorSuccess: '选择剧本角色成功',
selectScriptActorFail: '选择剧本角色失败',
cancleScriptActorSuccess: '取消剧本角色成功',
cancleScriptActorFail: '取消剧本角色失败',
modifyScriptActorSexSuccess: '修改剧本成员性别成功',
modifyScriptActorSexFail: '修改剧本成员性别失败',
addConversition: '添加对话',
narrator: '讲述者',
narratorRules: '请选择讲述者',
receiver: '接收者',
receiverRules: '请选择接收者',
conversitionContent: '内容',
addCommand: '添加指令',
executor: '执行者',
executorRules: '请选择执行者',
executeCommand: '执行指令',
executeCommandRules: '请选择执行指令',
startStation: '起始站台',
startStationRules: '请选择起始站台',
endStation: '终点站台',
endStationRules: '请选择终点站台',
addCommandButton: '添加指令',
addConversitionButton: '添加对话',
conversitionContentRules: '请输入内容',
addCommandSucess: '添加指令成功',
addCommandFail: '添加指令失败',
addConversitionSuccess: '添加对话成功',
addConversitionFail: '添加对话失败',
modifyConversitionSuccess: '修改对话成功',
modifyConversitionFail: '修改对话失败',
modifyConversition: '修改对话',
modifyConversitionButton: '修改',
drivingByPlan: '按计划行车',
scriptBack: '返回'
// roleManage: '角色管理', // roleManage: '角色管理',
// targetCondition: '任务目标', // targetCondition: '任务目标',

View File

@ -129,5 +129,9 @@ export default {
updateTrainingSuccessfully: '更新实训成功!', updateTrainingSuccessfully: '更新实训成功!',
updateTrainingFailed: '更新实训失败', updateTrainingFailed: '更新实训失败',
savedStepDataSuccessfully: '保存步骤数据成功', savedStepDataSuccessfully: '保存步骤数据成功',
savedStepDataFailed: '保存步骤数据失败' savedStepDataFailed: '保存步骤数据失败',
noCourseAuthority: '无此课程的考试权限,请前往购买!',
notWithinTheScopeOfTheExamination: '不在考试范围之内',
giveUpTheExamTip: '此操作将放弃本次考试, 是否继续?',
theNumberOfPermissionsAvailableIsZero: '可用的权限数量为0'
}; };

View File

@ -30,13 +30,6 @@ deviceRender[deviceType.Arrow] = {
z: 2 z: 2
}; };
/** RotatingButton渲染配置*/
deviceRender[deviceType.RotatingButton] = {
_type: deviceType.RotatingButton,
zlevel: 1,
z: 3
};
/** TipBox渲染配置*/ /** TipBox渲染配置*/
deviceRender[deviceType.TipBox] = { deviceRender[deviceType.TipBox] = {
_type: deviceType.TipBox, _type: deviceType.TipBox,

View File

@ -2,7 +2,6 @@ const deviceType = {
IbpText: 'IbpText', IbpText: 'IbpText',
SquareButton: 'SquareButton', SquareButton: 'SquareButton',
Arrow: 'Arrow', Arrow: 'Arrow',
RotatingButton: 'RotatingButton',
TipBox: 'TipBox', TipBox: 'TipBox',
Background: 'Background', Background: 'Background',
CircularLamp: 'CircularLamp', CircularLamp: 'CircularLamp',

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,6 @@ import localStore from 'storejs';
import Options from './options'; import Options from './options';
import MouseController from './mouseController'; import MouseController from './mouseController';
import Painter from './painter'; import Painter from './painter';
import deviceState from '../jmap/constant/deviceState';
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser'; import {calculateDCenter, createBoundingRect, deviceFactory} from './utils/parser';
import { updateIbpData } from './utils/parser'; import { updateIbpData } from './utils/parser';
@ -17,10 +16,7 @@ class IbpPan {
this.methods = opts.methods; this.methods = opts.methods;
// 鼠标事件 // 鼠标事件
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom'}; this.events = { __Pan: 'pan', Contextmenu: 'contextmenu'};
// 皮肤参数
// this.skinCode = '';
// 设备数据 // 设备数据
this.ibpDevice = {}; this.ibpDevice = {};
@ -28,9 +24,6 @@ class IbpPan {
// 展示的画布大小 // 展示的画布大小
this.canvasSize = {}; this.canvasSize = {};
// 默认状态
this.defaultStateDict = this.loadDefaultState();
this.initIbpPage(opts); this.initIbpPage(opts);
} }
initIbpPage(opts) { initIbpPage(opts) {
@ -38,7 +31,7 @@ class IbpPan {
const height = opts.config.height; const height = opts.config.height;
this.isAllowDragging=false; this.isAllowDragging=false;
this.$ibpZr = zrender.init(opts.dom, Object.assign({ renderer, devicePixelRatio, width, height }, opts.config)); 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.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {})); // 缩放
this.$mouseController = new MouseController(this); this.$mouseController = new MouseController(this);
this.$mouseController.enable(); this.$mouseController.enable();
@ -50,21 +43,8 @@ class IbpPan {
this.optionsHandler = this.setOptions.bind(this); this.optionsHandler = this.setOptions.bind(this);
this.$mouseController.on(this.events.__Pan, this.optionsHandler); 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) { setMap(config, ibpDevice) {
// 保存平移缩放数据 // 保存平移缩放数据
if (config.config) { if (config.config) {
@ -84,7 +64,7 @@ class IbpPan {
height: config.background.height height: config.background.height
}; };
// 解析地图数据 // 地图数据
this.ibpDevice = ibpDevice; this.ibpDevice = ibpDevice;
// 数据加载完成 回调 // 数据加载完成 回调
@ -235,13 +215,6 @@ class IbpPan {
return this.ibpDevice[code]; return this.ibpDevice[code];
} }
getShapeTipPoint(opts) {
const device = this.ibpDevice[opts.code];
if (device) {
return this.$painter.getShapeTipPoint(device.instance, opts);
}
}
resize(opt) { resize(opt) {
this.$ibpZr.resize(opt); this.$ibpZr.resize(opt);
this.$painter.updateZrSize(opt); this.$painter.updateZrSize(opt);

View File

@ -34,14 +34,12 @@ class MouseController extends Eventful {
initHandler(zr) { initHandler(zr) {
if (zr) { if (zr) {
zr.on('click', this.click, this);
zr.on('contextmenu', this.contextmenu, this); zr.on('contextmenu', this.contextmenu, this);
zr.on('mousemove', this.moveEvent, this); zr.on('mousemove', this.moveEvent, this);
this.enable = function (opts) { this.enable = function (opts) {
opts = opts || {}; opts = opts || {};
this._moveOnMouseMove = opts.moveOnMouseMove || true; this._moveOnMouseMove = opts.moveOnMouseMove || true;
this._zoomOnMouseWheel = opts.zoomOnMouseWheel || false;
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true; this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
this.disable(); this.disable();
@ -52,30 +50,20 @@ class MouseController extends Eventful {
zr.on('touchstart', this.mousedown, this); zr.on('touchstart', this.mousedown, this);
zr.on('touchmove', this.mousemove, this); zr.on('touchmove', this.mousemove, this);
zr.on('touchend', this.mouseup, this); zr.on('touchend', this.mouseup, this);
zr.on('mousewheel', this.mousewheel, this);
}; };
this.disable = function () { this.disable = function () {
zr.off('mousedown', this.mousedown); zr.off('mousedown', this.mousedown);
zr.off('mousemove', this.mousemove); zr.off('mousemove', this.mousemove);
zr.off('mouseup', this.mouseup); zr.off('mouseup', this.mouseup);
zr.off('touchstart', this.mousedown); zr.off('touchstart', this.mousedown);
zr.off('touchmove', this.mousemove); zr.off('touchmove', this.mousemove);
zr.off('touchend', this.mouseup); zr.off('touchend', this.mouseup);
zr.off('mousewheel', this.mousewheel);
}; };
this.dispose = function () { this.dispose = function () {
zr.off('click', this.click);
zr.off('contextmenu', this.contextmenu); zr.off('contextmenu', this.contextmenu);
zr.off('mousemove', this.moveEvent); zr.off('mousemove', this.moveEvent);
zr.off('touchstart', this.mousedown);
zr.off('touchmove', this.mousemove);
zr.off('touchend', this.mouseup);
this.disable(); this.disable();
}; };
@ -134,45 +122,20 @@ class MouseController extends Eventful {
} }
mouseup(e) { mouseup(e) {
console.log('-------', this.eventTarget._type===deviceType.Background);
if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) { if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) {
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY); this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
this.eventTarget.dirty(); this.eventTarget.dirty();
this.eventTarget = '';
} }
// debugger;
if (this.eventTarget && this.eventTarget._type === deviceType.Background) { if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
// console.log('111-------');
this.eventTarget.setCursor('default'); this.eventTarget.setCursor('default');
} }
this.eventTarget = '';
this._dragging = false; 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: this.events.__Zoom, scale, originX, originY });
}
}
click(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Selected, em);
}
contextmenu(e) { contextmenu(e) {
var em = this.checkEvent(e); var em = this.checkEvent(e);
this.trigger(this.events.Contextmenu, em); this.trigger(this.events.Contextmenu, em);

View File

@ -117,25 +117,6 @@ class Painter {
} }
/** /**
* 过去坐标提示位置
* @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]
};
}
}
}
/**
* 初始化电子时钟时间 * 初始化电子时钟时间
*/ */
initClockTime(device, initTime) { initClockTime(device, initTime) {

View File

@ -1,6 +1,6 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image'; import Sector from 'zrender/src/graphic/shape/Sector';
import AppendageBoxImage from '@/assets/ibp_images/appendage_box.png'; import Rect from 'zrender/src/graphic/shape/Rect';
export default class AppendageBox extends Group { export default class AppendageBox extends Group {
constructor(device) { constructor(device) {
@ -18,19 +18,108 @@ export default class AppendageBox extends Group {
id: this.model.code, id: this.model.code,
position: [this.model.point.x, this.model.point.y] position: [this.model.point.x, this.model.point.y]
}); });
this.appendageBox = new Image({ const spaceHeight = (this.model.height-this.model.borderWidth*3)/2;
this.rect1 = new Rect({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
draggable: false, shape: {
style: {
image: AppendageBoxImage,
x: 0, x: 0,
y: 0, y: 0,
width: this.model.width, width: this.model.width - this.model.borderWidth,
height: this.model.height height: this.model.borderWidth
},
style: {
fill: '#34383A'
} }
}); });
this.grouper.add(this.appendageBox); this.rect2 = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: this.model.borderWidth + spaceHeight,
width: this.model.width - this.model.borderWidth,
height: this.model.borderWidth
},
style: {
fill: '#34383A'
}
});
this.rect3 = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 2*this.model.borderWidth + 2*spaceHeight,
width: this.model.width - this.model.borderWidth,
height: this.model.borderWidth
},
style: {
fill: '#34383A'
}
});
this.rect4 = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 0,
width: this.model.borderWidth,
height: this.model.height
},
style: {
fill: '#34383A'
}
});
this.sector1 = new Sector({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: this.model.width - this.model.borderWidth,
cy: this.model.borderWidth,
r: this.model.borderWidth,
startAngle: 1.5*Math.PI,
endAngle: 2*Math.PI
},
style: {
fill: '#34383A'
}
});
this.sector2 = new Sector({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: this.model.width - this.model.borderWidth,
cy: 2*this.model.borderWidth + spaceHeight,
r: this.model.borderWidth,
startAngle: 1.5*Math.PI,
endAngle: 2*Math.PI
},
style: {
fill: '#34383A'
}
});
this.sector3 = new Sector({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: this.model.width - this.model.borderWidth,
cy: 3*this.model.borderWidth + 2*spaceHeight,
r: this.model.borderWidth,
startAngle: 1.5*Math.PI,
endAngle: 2*Math.PI
},
style: {
fill: '#34383A'
}
});
this.grouper.add(this.rect1);
this.grouper.add(this.rect2);
this.grouper.add(this.rect3);
this.grouper.add(this.rect4);
this.grouper.add(this.sector1);
this.grouper.add(this.sector2);
this.grouper.add(this.sector3);
this.add(this.grouper); this.add(this.grouper);
} }
setModel(dx, dy) { setModel(dx, dy) {

View File

@ -16,24 +16,27 @@ export default class background extends Group {
create() { create() {
const image = new Image(25, 25); const image = new Image(25, 25);
image.src = ibpBg; image.src = ibpBg;
image.onload = (e) => { image.decode()
const pattern = new Pattern(image, 'repeat'); .then(() => {
this.imageBg = new Rect({ const pattern = new Pattern(image, 'repeat');
zlevel: this.zlevel, this.imageBg = new Rect({
z: this.z, zlevel: this.zlevel,
cursor: 'default', z: this.z,
shape: { cursor: 'default',
x: 0, shape: {
y: 0, x: 0,
width: this.model.width, y: 0,
height: this.model.height width: this.model.width,
}, height: this.model.height
style: { },
fill: pattern style: {
} fill: pattern
}
});
this.add(this.imageBg);
}).catch((encodingError) => {
// Do something with the error.
}); });
this.add(this.imageBg);
};
} }
setModel(dx, dy) { setModel(dx, dy) {
} }

View File

@ -8,7 +8,6 @@ import IbpLine from './ibpLine';
import Button from './button'; import Button from './button';
import TipBox from './ibpTipBox'; import TipBox from './ibpTipBox';
import AppendageBox from './appendageBox'; import AppendageBox from './appendageBox';
import RotatingButton from './rotatingButton';
import Elevator from './elevator'; import Elevator from './elevator';
import Key from './key'; import Key from './key';
import TeleTerminal from './teleTerminal'; import TeleTerminal from './teleTerminal';
@ -25,7 +24,6 @@ ibpShape[deviceType.IbpLine] = IbpLine;
ibpShape[deviceType.SquareButton] = Button; ibpShape[deviceType.SquareButton] = Button;
ibpShape[deviceType.TipBox] = TipBox; ibpShape[deviceType.TipBox] = TipBox;
ibpShape[deviceType.AppendageBox] = AppendageBox; ibpShape[deviceType.AppendageBox] = AppendageBox;
ibpShape[deviceType.RotatingButton] = RotatingButton;
ibpShape[deviceType.Elevator] = Elevator; ibpShape[deviceType.Elevator] = Elevator;
ibpShape[deviceType.Key] = Key; ibpShape[deviceType.Key] = Key;
ibpShape[deviceType.TeleTerminal] = TeleTerminal; ibpShape[deviceType.TeleTerminal] = TeleTerminal;

View File

@ -28,7 +28,9 @@ export default class ibpTipBox extends Group {
height: this.model.height height: this.model.height
}, },
style: { style: {
fill: this.model.fillColor fill: this.model.opacity ? 'rgb(0,0,0,0)':this.model.fillColor,
lineWidth: this.model.lineWidth,
stroke: this.model.stroke
} }
}); });
this.grouper.add(this.tipBox); this.grouper.add(this.tipBox);

View File

@ -1,7 +1,10 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image'; import Image from 'zrender/src/graphic/Image';
import Line from 'zrender/src/graphic/shape/Line';
import Text from 'zrender/src/graphic/Text';
import keyPic from '@/assets/ibp_images/key.png'; import keyPic from '@/assets/ibp_images/key.png';
import keyPicOn from '@/assets/ibp_images/key_on.png'; import keyPicOn from '@/assets/ibp_images/key_on.png';
import Keyhole from '@/assets/ibp_images/keyhole.png';
export default class key extends Group { export default class key extends Group {
@ -20,28 +23,113 @@ export default class key extends Group {
id: model.code, id: model.code,
position: [model.point.x, model.point.y] position: [model.point.x, model.point.y]
}); });
this.keyImage = new Image({ this.keyImage = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: model.z, z: model.z+1,
draggable: false,
style: { style: {
image: this.getRotateColor(), image: this.getRotateColor(),
x: 0, x: 0,
y: 0, y: 0,
width: 314, width: model.width,
height: 932 height: model.width/314*932
} }
}); });
this.rotatingButton = new Image({
zlevel: this.zlevel,
z: model.z,
style: {
image: Keyhole,
x: 0,
y: 0,
width: model.width,
height: model.width/361*336
}
});
this.ibpLine1 = new Line({
zlevel: model.zlevel,
z: model.z,
shape: {
x1: model.width+2,
y1: model.width/361*336/2,
x2: model.width+12,
y2: model.width/361*336/2
},
style: {
lineWidth: 3,
stroke: '#000'
}
});
this.ibpLine2 = new Line({
zlevel: model.zlevel,
z: model.z,
draggable: false,
shape: {
y1: model.width/361*336+2,
x1: model.width/2,
y2: model.width/361*336+12,
x2: model.width/2
},
style: {
lineWidth: 3,
stroke: '#000'
}
});
this.bottomText = new Text({
zlevel: model.zlevel,
z: model.z,
style: {
x: model.width/2,
y: model.width/361*336+12,
fontWeight: 600,
fontSize: 10,
fontFamily: model.fontFamily,
text: model.bottomText,
textStrokeWidth: 0,
textFill: '#000',
textAlign: 'center',
textPosition: model.textPosition || 'inside',
textLineHeight: 10
}
});
this.topText= new Text({
zlevel: model.zlevel,
z: model.z,
style: {
x: model.width+14,
y: model.width/361*336/2-4,
fontWeight: 600,
fontSize: 10,
fontFamily: model.fontFamily,
text: model.topText,
textStrokeWidth: 0,
textFill: '#000',
textAlign: 'left',
textPosition: model.textPosition || 'inside',
textLineHeight: 10
}
});
this.grouper.add(this.bottomText);
this.grouper.add(this.topText);
this.grouper.add(this.ibpLine1);
this.grouper.add(this.ibpLine2);
this.grouper.add(this.rotatingButton);
this.grouper.add(this.keyImage); this.grouper.add(this.keyImage);
this.add(this.grouper); this.add(this.grouper);
this.transformScale(); // this.transformScale();
} }
/** 缩放按钮 */ /** 缩放按钮 */
transformScale() { transformScale() {
this.keyImage.origin = [0, 0]; // this.keyImage.origin = [0, 0];
this.keyImage.scale =[this.model.width/314, this.model.width/314]; // this.rotatingButton.origin = [0, 0];
this.keyImage.dirty(); // this.keyImage.scale =[this.model.width/314, this.model.width/314];
// this.rotatingButton.scale =[this.model.width/361, this.model.width/336];
// this.keyImage.dirty();
// this.rotatingButton.dirty();
} }
getRotateColor() { getRotateColor() {
@ -94,4 +182,5 @@ export default class key extends Group {
this.model.point.x+=dx; this.model.point.x+=dx;
this.model.point.y+=dy; this.model.point.y+=dy;
} }
} }

View File

@ -2,6 +2,7 @@ import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image'; import Image from 'zrender/src/graphic/Image';
import rotateBlack from '@/assets/ibp_images/rotate_black.png'; import rotateBlack from '@/assets/ibp_images/rotate_black.png';
import rotateRed from '@/assets/ibp_images/rotate_red.png'; import rotateRed from '@/assets/ibp_images/rotate_red.png';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class rotateTip extends Group { export default class rotateTip extends Group {
@ -21,7 +22,7 @@ export default class rotateTip extends Group {
id: model.code, id: model.code,
position: [model.point.x, model.point.y] position: [model.point.x, model.point.y]
}); });
this.imageBg = new Image({ this.tip = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
draggable: false, draggable: false,
@ -29,20 +30,28 @@ export default class rotateTip extends Group {
image: this.getRotateColor(), image: this.getRotateColor(),
x: 0, x: 0,
y: 0, y: 0,
width: 68, width: this.model.width,
height: 60 height: this.model.width
} }
}); });
this.grouper.add(this.imageBg); const tipRect = this.tip.getBoundingRect();
this.tipBg = new Rect({
zlevel: model.zlevel,
z: model.z-1,
draggable: false,
shape: {
x: 0,
y: 0,
width: tipRect.width,
height: tipRect.height
},
style: {
fill: '#CE950F'
}
});
this.grouper.add(this.tip);
this.grouper.add(this.tipBg);
this.add(this.grouper); this.add(this.grouper);
this.transformScale();
}
/** 缩放按钮 */
transformScale() {
this.imageBg.origin = [0, 0];
this.imageBg.scale =[this.model.width/68, this.model.width/68];
this.imageBg.dirty();
} }
getRotateColor() { getRotateColor() {

View File

@ -1,41 +0,0 @@
import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image';
import Keyhole from '@/assets/ibp_images/keyhole.png';
export default class RotatingButton extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper=new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
this.rotatingButton = new Image({
zlevel: this.zlevel,
z: this.z,
draggable: false,
style: {
image: Keyhole,
x: 0,
y: 0,
width: model.width,
height: model.width/361*336
}
});
this.grouper.add(this.rotatingButton);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x+=dx;
this.model.point.y+=dy;
}
}

View File

@ -59,10 +59,6 @@ export function parser(data) {
ibpDevice[elem.code] = deviceFactory(deviceType.Arrow, elem); ibpDevice[elem.code] = deviceFactory(deviceType.Arrow, elem);
}, this); }, this);
zrUtil.each(data.rotatingButtonList || [], elem => {
ibpDevice[elem.code] = deviceFactory(deviceType.RotatingButton, elem);
}, this);
zrUtil.each(data.tipBoxList || [], elem => { zrUtil.each(data.tipBoxList || [], elem => {
ibpDevice[elem.code] = deviceFactory(deviceType.TipBox, elem); ibpDevice[elem.code] = deviceFactory(deviceType.TipBox, elem);
}, this); }, this);
@ -104,7 +100,7 @@ function updateIbpListByDevice(ibp, name, device) {
if (list) { if (list) {
const index = list.findIndex(elem => { return elem.code == device.code; }); const index = list.findIndex(elem => { return elem.code == device.code; });
if (index >= 0) { if (index >= 0) {
list[index].dispose ? list.splice(index, 1) : list[index] = device; device._dispose ? list.splice(index, 1) : list[index] = device;
} else { } else {
list.push(device); list.push(device);
} }
@ -130,9 +126,6 @@ export function updateIbpData(device) {
case deviceType.Arrow : case deviceType.Arrow :
updateIbpListByDevice(ibpData, 'arrowList', device); updateIbpListByDevice(ibpData, 'arrowList', device);
break; break;
case deviceType.RotatingButton :
updateIbpListByDevice(ibpData, 'rotatingButtonList', device);
break;
case deviceType.TipBox : case deviceType.TipBox :
updateIbpListByDevice(ibpData, 'tipBoxList', device); updateIbpListByDevice(ibpData, 'tipBoxList', device);
break; break;

View File

@ -263,8 +263,8 @@ export function Jlmap3dSubscribe(jlmap3d) {
trainlisttest.list[code].dispose = false; trainlisttest.list[code].dispose = false;
trainlisttest.list[code].nowcode = data.body[i].sectionCode; trainlisttest.list[code].nowcode = data.body[i].sectionCode;
trainlisttest.list[code].nextcode = data.body[i].nextSectionCode; trainlisttest.list[code].nextcode = data.body[i].nextSectionCode;
const vexlist = []; let vexlist = [];
const endrotation = null; let endrotation = null;
if (data.body[i].directionType == '02') { // 向右 if (data.body[i].directionType == '02') { // 向右
let offset = null; let offset = null;
@ -278,13 +278,15 @@ export function Jlmap3dSubscribe(jlmap3d) {
rotaposx = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x+offset*data.body[i].sectionOffsetPercent; rotaposx = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x+offset*data.body[i].sectionOffsetPercent;
} }
const rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].z; let rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].z;
trainlisttest.list[code].rotation.y = 0; trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].position.x = rotaposx; trainlisttest.list[code].position.x = rotaposx;
trainlisttest.list[code].position.y = 0; trainlisttest.list[code].position.y = 0;
for (let tl=0; tl<6; tl++) { for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = rotaposz; trainlisttest.list[code].children[tl].position.z = rotaposz;
} }
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x>sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) { if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x>sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
vexlist.push(new THREE.Vector3(rotaposx, 0, rotaposz)); vexlist.push(new THREE.Vector3(rotaposx, 0, rotaposz));
for (let m=sectionlist.sections.datalist[data.body[i].sectionCode].rail.length-1; m>=0; m--) { for (let m=sectionlist.sections.datalist[data.body[i].sectionCode].rail.length-1; m>=0; m--) {
@ -319,16 +321,15 @@ export function Jlmap3dSubscribe(jlmap3d) {
offset = sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x-sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x; offset = sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x-sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x;
rotaposx = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x+offset*data.body[i].sectionOffsetPercent; rotaposx = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x+offset*data.body[i].sectionOffsetPercent;
} }
const rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].z; let rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].z;
trainlisttest.list[code].rotation.y = Math.PI; trainlisttest.list[code].rotation.y = Math.PI;
trainlisttest.list[code].position.x = rotaposx; trainlisttest.list[code].position.x = rotaposx;
trainlisttest.list[code].position.y = 0; trainlisttest.list[code].position.y = 0;
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = rotaposz;
}
if (data.body[i].groupNumber == '001') {
}
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = -rotaposz;
}
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x<sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) { if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x<sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
vexlist.push(new THREE.Vector3(rotaposx, 0, rotaposz)); vexlist.push(new THREE.Vector3(rotaposx, 0, rotaposz));
for (let m=sectionlist.sections.datalist[data.body[i].sectionCode].rail.length-1; m>=0; m--) { for (let m=sectionlist.sections.datalist[data.body[i].sectionCode].rail.length-1; m>=0; m--) {
@ -344,17 +345,25 @@ export function Jlmap3dSubscribe(jlmap3d) {
} }
} }
} }
trainlisttest.list[code].status = '03'; trainlisttest.list[code].status = '03';
} }
trainlisttest.list[code].curve = new THREE.CatmullRomCurve3(vexlist); trainlisttest.list[code].curve = new THREE.CatmullRomCurve3(vexlist);
trainlisttest.list[code].isStandTrack = sectionlist.sections.datalist[data.body[i].sectionCode].isStandTrack; trainlisttest.list[code].isStandTrack = sectionlist.sections.datalist[data.body[i].sectionCode].isStandTrack;
trainlisttest.list[code].progress = 0; trainlisttest.list[code].progress = 0;
trainlisttest.list[code].len = sectionlist.sections.datalist[data.body[i].sectionCode].distance; trainlisttest.list[code].len = sectionlist.sections.datalist[data.body[i].sectionCode].distance;
trainlisttest.list[code].speed = data.body[i].speed;
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/20/trainlisttest.list[code].len);
}
if(data.body[i].speed == 0){
trainlisttest.list[code].speeds = data.body[i].speed;
trainlisttest.list[code].speeds = 0;
// trainlisttest.list[code].startmark = 1;
}else{
trainlisttest.list[code].speeds = data.body[i].speed;
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/20/trainlisttest.list[code].len);
}
}
} else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) { } else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) {
trainlisttest.group.remove(trainlisttest.list[code]); trainlisttest.group.remove(trainlisttest.list[code]);
trainlisttest.list[code].progress = null; trainlisttest.list[code].progress = null;

View File

@ -340,33 +340,33 @@ stationcanvas.src = "../../static/texture/msgt.png";
function getTextCanvas(text){ function getTextCanvas(text){
let canvas = document.getElementById('canvastexture'); let canvas = document.getElementById('canvastexture');
canvas.width = 300; canvas.width = 256;
canvas.height = 374; canvas.height = 512;
// canvas.style.width = width; // canvas.style.width = width;
// canvas.style.height = height; // canvas.style.height = height;
let ctx = canvas.getContext('2d'); let ctx = canvas.getContext('2d');
//ctx.fillStyle = '#FFFFFF'; //ctx.fillStyle = '#FFFFFF';
ctx.fillRect(0, 0,300,374); ctx.fillRect(0, 0,256,512);
ctx.fillStyle = '#FFFFFF'; ctx.fillStyle = '#FFFFFF';
// ctx.textAlign = 'center'; // ctx.textAlign = 'center';
// ctx.textBaseline = 'middle'; // ctx.textBaseline = 'middle';
ctx.clearRect(0,0,300,374); ctx.clearRect(0,0,256,512);
ctx.drawImage(stationcanvas,0,0,300,374); ctx.drawImage(stationcanvas,0,0,256,512);
ctx.font = "20px Verdana"; ctx.font = "20px Verdana";
ctx.fillText("车站名称: "+text.runPlanName, 40,58); ctx.fillText("车站名称: "+text.runPlanName, 20,58);
ctx.fillText("漫游", 40,110); ctx.fillText("漫游", 30,100);
ctx.fillText("信息", 124,110); ctx.fillText("信息", 114,100);
ctx.fillText("备忘", 210,110); ctx.fillText("备忘", 190,100);
ctx.fillText("车站序号: "+text.name, 40,155); ctx.fillText("车站序号: "+text.name, 40,155);
ctx.fillText("公里标记:"+text.kmPost,40 ,256*3/4); ctx.fillText("公里标记:"+text.kmPost,40 ,256*3/4);
let data = ctx.getImageData(0, 0,300,374); let data = ctx.getImageData(0, 0,256,512);
return data; return data;
} }

View File

@ -85,10 +85,13 @@ deviceState[deviceType.Signal] = {
status: { status: {
Default: '01', /** 关闭(缺省值)*/ Default: '01', /** 关闭(缺省值)*/
State01: '01', /** 关闭 */ State01: '01', /** 关闭 */
State02: '02', /** 开放 */ State02: '02', /** 开放正向 */
State03: '03', /** 引导 */ State03: '03', /** 开放侧向 */
State04: '04', /** 封锁 */ State04: '04', /** 引导 */
State05: '05' /** 故障 */ State05: '05', /** 封锁 */
State06: '06', /** 故障 */
State07: '07', /** 功能封锁 */
State08: '08' /** 信号保护区段监视 */
}, },
/** 信号机状态类型 */ /** 信号机状态类型 */
lightType: { lightType: {

View File

@ -230,9 +230,9 @@ class Signal extends Group {
} }
} }
// 开放 /* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/
open() { openPositive() {
if (this.count == 2 && this.model.lightType == '01' && this.model.switchLocateType == '01') { // 双灯 物理点灯 道岔定位 if (this.count == 2 && this.model.lightType == '01') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
@ -241,7 +241,7 @@ class Signal extends Group {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.backgroundColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 2 && this.model.lightType == '02' && this.model.switchLocateType == '01') { // 双灯 逻辑点灯 道岔定位 } else if (this.count == 2 && this.model.lightType == '02') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
@ -250,7 +250,21 @@ class Signal extends Group {
this.lamps[1].setStop(true); this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.backgroundColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 2 && this.model.lightType == '01' && this.model.switchLocateType == '02') { // 双灯 物理点灯 道岔反位 } else if (this.count == 1 && this.model.lightType == '01') {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
} else if (this.count == 1 && this.model.lightType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
}
}
/* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/
openLateral() {
if (this.count == 2 && this.model.lightType == '01') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.backgroundColor); this.lamps[0].setColor(this.style.backgroundColor);
@ -259,7 +273,7 @@ class Signal extends Group {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
} }
} else if (this.count == 2 && this.model.lightType == '02' && this.model.switchLocateType == '02') { // 双灯 逻辑点灯 道岔反位 } else if (this.count == 2 && this.model.lightType == '02') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.backgroundColor); this.lamps[0].setColor(this.style.backgroundColor);
@ -268,7 +282,7 @@ class Signal extends Group {
this.lamps[1].setStop(true); this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
} }
} else if (this.count == 1 && this.model.lightType == '01' && this.model.switchLocateType == '02') { // 单灯 物理点灯 允许调车 } else if (this.count == 1 && this.model.lightType == '01') {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
// 出站信号机/阻隔信号机 // 出站信号机/阻隔信号机
@ -278,24 +292,13 @@ class Signal extends Group {
this.lamps[0].setColor(this.style.Signal.lamp.whiteColor); this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
} }
} }
} else if (this.count == 1 && this.model.lightType == '01' && this.model.switchLocateType == '01') { } else if (this.count == 1 && this.model.lightType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
} else if (this.count == 1 && this.model.lightType == '02' && this.model.switchLocateType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
} else if (this.count == 1 && this.model.lightType == '02' && this.model.switchLocateType == '01' ) {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
} }
} }
// 列车进路 // 列车进路
trainRoute() { trainRoute() {
if (this.count == 1) { if (this.count == 1) {
@ -437,12 +440,13 @@ class Signal extends Group {
/** 设置状态 (点灯类型)*/ /** 设置状态 (点灯类型)*/
switch (model.status) { switch (model.status) {
case '01': this.close(); break; // 关闭 case '01': this.close(); break; // 关闭
case '02': this.open(); break; // 开放 case '02': this.openPositive(); break; // 开放正向
case '03': this.guid(); break; // 引导 case '03': this.openLateral(); break; // 开放侧向
case '04': this.block(); break; // 封锁 case '04': this.guid(); break; // 引导
case '05': this.fault(); break; // 故障 case '05': this.block(); break; // 封锁
case '06': this.block(); break; // 功能封锁 case '06': this.fault(); break; // 故障
case '07': this.signalCheck(); break; // 信号保护区段检测 case '07': this.block(); break; // 功能封锁
case '08': this.signalCheck(); break; // 信号保护区段检测
} }
/** 进路性质类型*/ /** 进路性质类型*/

View File

@ -84,7 +84,6 @@ import RunPlanEveryDay from '@/views/publish/runPlanEveryDay/index';
import ProductStatus from '@/views/publish/productStatus/index'; import ProductStatus from '@/views/publish/productStatus/index';
import PublishLesson from '@/views/publish/publishLesson/index'; import PublishLesson from '@/views/publish/publishLesson/index';
// import SimulationScript from '@/views/publish/simulationScript/index'; // import SimulationScript from '@/views/publish/simulationScript/index';
// import IbpDraft from '@/views/ibp/ibpDraft/index';
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index'; import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
import Commodity from '@/views/orderauthor/commodity/index'; import Commodity from '@/views/orderauthor/commodity/index';

View File

@ -126,7 +126,7 @@ export default {
getTotalRemains(model).then(response => { getTotalRemains(model).then(response => {
this.maxTotal = response.data; this.maxTotal = response.data;
if (this.maxTotal == 0) { if (this.maxTotal == 0) {
this.numberMessage = '可用权限数量为0'; this.numberMessage = this.$t('tip.theNumberOfPermissionsAvailableIsZero');
} else { } else {
this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`; this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`;
} }
@ -134,7 +134,7 @@ export default {
this.$messageBox(this.$t('error.obtainMaxNumberFailed')); this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
}); });
} else { } else {
this.numberMessage = '结束时间必须大于开始时间'; this.numberMessage = this.$t('tip.endTimeRules');
} }
} else { } else {
this.numberMessage = ''; this.numberMessage = '';

View File

@ -23,7 +23,7 @@ export default {
backgroundColor: '#F0F2F5', backgroundColor: '#F0F2F5',
title: { title: {
top: 20, top: 20,
text: '仿真统计', text: this.$t('dashboard.simulationStatistics'),
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
fontSize: 18, fontSize: 18,
@ -139,7 +139,8 @@ export default {
this.option.series = []; this.option.series = [];
this.option.legend.data = []; this.option.legend.data = [];
this.option.xAxis[0].data = ['综合演练云平台', '司机模拟驾驶系统', 'ATS行调工作站', 'ATS现地工作站']; this.option.xAxis[0].data = [this.$t('dashboard.comprehensiveExerciseCloudPlatform'),
this.$t('dashboard.driverSimulatedDrivingSystem'), this.$t('dashboard.ATSLineAdjustmentWorkstation'), this.$t('dashboard.ATSLocalWorkstation')];
data.forEach(elem => { data.forEach(elem => {
this.option.legend.data.push(elem.name); this.option.legend.data.push(elem.name);
this.option.series.push({ this.option.series.push({

View File

@ -2,7 +2,7 @@
<div> <div>
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" /> <div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
<div class="lesson-select"> <div class="lesson-select">
<el-select v-model="lessonId" placeholder="请选择课程"> <el-select v-model="lessonId" :placeholder="this.$t('rules.selectCourses')">
<el-option v-for="item in lessonList" :key="item.statsProjectId" :label="item.statsProjectName" :value="item.statsProjectId" /> <el-option v-for="item in lessonList" :key="item.statsProjectId" :label="item.statsProjectName" :value="item.statsProjectId" />
</el-select> </el-select>
</div> </div>
@ -32,7 +32,7 @@ export default {
backgroundColor: '#F0F2F5', backgroundColor: '#F0F2F5',
title: { title: {
top: 20, top: 20,
text: '考试统计', text: this.$t('dashboard.testStatistics'),
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
fontSize: 18, fontSize: 18,

View File

@ -23,7 +23,7 @@ export default {
backgroundColor: '#F0F2F5', backgroundColor: '#F0F2F5',
title: { title: {
top: 20, top: 20,
text: '课程统计', text: this.$t('dashboard.courseStatistics'),
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
fontSize: 18, fontSize: 18,
@ -139,7 +139,8 @@ export default {
this.option.series = []; this.option.series = [];
this.option.legend.data = []; this.option.legend.data = [];
this.option.xAxis[0].data = ['控制权实训', ' 信号机实训', ' 道岔实训', '区段实训', '站台实训']; this.option.xAxis[0].data = [this.$t('dashboard.controlRightsTraining'),
this.$t('dashboard.signalTraining'),this.$t('dashboard.turnoutTraining'), this.$t('dashboard.sectionTraining'), this.$t('dashboard.stationTraining')];
data.forEach(elem => { data.forEach(elem => {
this.option.legend.data.push(elem.statsProjectName); this.option.legend.data.push(elem.statsProjectName);
this.option.series.push({ this.option.series.push({

View File

@ -2,7 +2,7 @@
<div> <div>
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" /> <div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
<div class="lesson-select"> <div class="lesson-select">
<el-select v-model="mapName" placeholder="请选择地图线路" size="mini" style="width: 300px"> <el-select v-model="mapName" :placeholder="this.$t('dashboard.selectTheMapRoute')" size="mini" style="width: 300px">
<el-option v-for="name in mapNameList" :key="name" :label="name" :value="name" /> <el-option v-for="name in mapNameList" :key="name" :label="name" :value="name" />
</el-select> </el-select>
</div> </div>
@ -62,7 +62,7 @@ export default {
type: 'value', type: 'value',
show: false, show: false,
minInterval: 1, minInterval: 1,
name: '权限(个)' name: this.$t('dashboard.permissions')
}, },
series: [{ series: [{
type: 'bar', type: 'bar',
@ -145,7 +145,6 @@ export default {
(permissionList ||[]).forEach(elem => { (permissionList ||[]).forEach(elem => {
permissionDict[elem.code] = elem.name; permissionDict[elem.code] = elem.name;
}); });
var permissionMap = { var permissionMap = {
'ATS现地工作站-课程权限': 0, 'ATS现地工作站-课程权限': 0,
'ATS行调工作站-课程权限': 0, 'ATS行调工作站-课程权限': 0,
@ -170,8 +169,8 @@ export default {
const values = Object.values(permissionMap); const values = Object.values(permissionMap);
const sum = values.reduce((total, num) => { return total + num; }); const sum = values.reduce((total, num) => { return total + num; });
this.option.title.text = `剩余权限分布图 —— ${mapName}`; this.option.title.text = this.$t('dashboard.residualPermissionDistributionMap') + ` —— ${mapName}`;
this.option.title.subtext = `权限总计${sum}`; this.option.title.subtext = this.$t('dashboard.totalPermissions') + `${sum}` + this.$t('dashboard.individual');
this.option.xAxis.show = true; this.option.xAxis.show = true;
this.option.yAxis.show = true; this.option.yAxis.show = true;
@ -181,8 +180,8 @@ export default {
this.option.series[0].data = values; this.option.series[0].data = values;
this.option.series[1].data = keys.filter(name => { return permissionMap[name]; } ).map(name => { return {name, value: permissionMap[name]}; }); this.option.series[1].data = keys.filter(name => { return permissionMap[name]; } ).map(name => { return {name, value: permissionMap[name]}; });
} else { } else {
this.option.title.text = `剩余权限分布图(暂无地图线路数据`; this.option.title.text =this.$t('dashboard.residualPermissionDistributionMap') + ``+ this.$t('dashboard.noMapLineDataYetAvailable') +``;
this.option.title.subtext = `权限总计0`; this.option.title.subtext = this.$t('dashboard.totalPermissions') + `0` + this.$t('dashboard.individual');
this.option.xAxis.show = false; this.option.xAxis.show = false;
this.option.yAxis.show = false; this.option.yAxis.show = false;
this.option.xAxis.data = []; this.option.xAxis.data = [];

View File

@ -7,9 +7,9 @@
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button> <el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
</el-button-group> --> </el-button-group> -->
<el-button-group> <el-button-group>
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">按计划行车</el-button> <el-button type="success" :disabled="isDisable" @click="selectBeginTime">{{$t('scriptRecord.drivingByPlan')}}</el-button>
<!-- <el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button> --> <!-- <el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button> -->
<el-button type="primary" @click="back">返回</el-button> <el-button type="primary" @click="back">{{$t('scriptRecord.scriptBack')}}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" /> <set-time ref="setTime" @ConfirmSelectBeginTime="start" />

View File

@ -1,7 +1,7 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<b>课程名称 {{ courseModel.name }}</b> <b>{{ $t('exam.courseName') + ': '+ courseModel.name }}</b>
</div> </div>
<div style=" margin:50px" :style="{ height: height - 150 +'px' }"> <div style=" margin:50px" :style="{ height: height - 150 +'px' }">
<!-- <p style="font-size: 14px; margin-bottom: 20px"> 课程说明: <!-- <p style="font-size: 14px; margin-bottom: 20px"> 课程说明:
@ -10,7 +10,7 @@
</span> </span>
</p> --> </p> -->
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="试题列表" name="first"> <el-tab-pane :label="this.$t('exam.itemList')" name="first">
<div v-if="courseModel.detail.length != 0" :style="{ height: height - 230 +'px' }"> <div v-if="courseModel.detail.length != 0" :style="{ height: height - 230 +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<template v-for="item in courseModel.detail"> <template v-for="item in courseModel.detail">
@ -21,10 +21,10 @@
</el-scrollbar> </el-scrollbar>
</div> </div>
<div v-else class="noList"> <div v-else class="noList">
暂无数据 {{ $t('global.temporarilyNoData') }}
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="权限详情" name="second"> <el-tab-pane :label="this.$t('exam.permissionsDetails')" name="second">
<div :style="{ height: height - 230 +'px' }"> <div :style="{ height: height - 230 +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<limit-list ref="limitList" :course-model="courseModel" @initLoadPage="loadInitPage" /> <limit-list ref="limitList" :course-model="courseModel" @initLoadPage="loadInitPage" />
@ -34,10 +34,10 @@
</el-tabs> </el-tabs>
</div> </div>
<div class="btn-buy"> <div class="btn-buy">
<el-button type="success" @click="buy">购买</el-button> <el-button type="success" @click="buy">{{ $t('exam.buy') }}</el-button>
<el-button v-if="hasPermssion" type="primary" @click="distribute">权限分发(考试)</el-button> <el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('exam.distributePermission') }}</el-button>
<el-button v-if="hasPermssion" type="primary" @click="transfer">权限转赠</el-button> <el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button>
<el-button v-if="isAddRule" type="primary" @click="checkCourse">查看课程试卷</el-button> <el-button v-if="isAddRule" type="primary" @click="checkCourse">{{ $t('exam.viewCoursePapers') }}</el-button>
</div> </div>
</el-card> </el-card>
</template> </template>
@ -57,7 +57,7 @@ export default {
loading: false, loading: false,
courseModel: { courseModel: {
id: '', id: '',
name: '请选择课程', name: this.$t('rules.lessonInput'),
price: 0, price: 0,
remarks: '', remarks: '',
detail: [], detail: [],

View File

@ -1,41 +1,41 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<b>试卷名称 {{ examDetails.name }}</b> <b>{{ $t('exam.nameOfTestPaper') +': ' + examDetails.name }}</b>
</div> </div>
<div style="margin:50px; overflow-y: auto;"> <div style="margin:50px; overflow-y: auto;">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height - 190 +'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height - 190 +'px' }">
<p class="list-item"> <p class="list-item">
<span class="list-label">考试时间</span> <span class="list-label">{{ $t('exam.examStartTime') +':'}}</span>
<span v-if="examDetails.startTime" class="list-elem"> <span v-if="examDetails.startTime" class="list-elem">
{{ examDetails.startTime }} - {{ examDetails.endTime }}</span> {{ examDetails.startTime }} - {{ examDetails.endTime }}</span>
<span v-else class="list-elem">随时都可以考试</span> <span v-else class="list-elem">{{ $t('exam.theExamIsReadyAnyTime') }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">考试说明</span> <span class="list-label">{{ $t('exam.testExplanation') + ':' }}</span>
<span class="list-elem">{{ examDetails.remarks }}</span> <span class="list-elem">{{ examDetails.remarks }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">考试时长</span> <span class="list-label">{{ $t('exam.examTimeAvailable') + ':' }}</span>
<span class="list-elem">{{ parseInt(examDetails.duration) / 60 }}分钟</span> <span class="list-elem">{{ parseInt(examDetails.duration) / 60 + $t('global.minutes') }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">考试满分</span> <span class="list-label">{{ $t('exam.fullMarksInTheExam') + ':' }}</span>
<span class="list-elem">{{ examDetails.fullPoint }}</span> <span class="list-elem">{{ examDetails.fullPoint + $t('exam.points') }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">考试及格分</span> <span class="list-label">{{ $t('exam.passMarkTheExam') + ':' }}</span>
<span class="list-elem">{{ examDetails.passingPoint }}</span> <span class="list-elem">{{ examDetails.passingPoint + $t('exam.points') }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">考试规则</span> <span class="list-label">{{ $t('exam.examinationRules') + ':' }}</span>
<span class="list-elem"> <span class="list-elem">
<p class="list-table"> <p class="list-table">
<el-table :data="examDetails.examDefinitionRulesVOList" border show-summary> <el-table :data="examDetails.examDefinitionRulesVOList" border show-summary>
<el-table-column prop="name" label="实训类型" width="180" /> <el-table-column prop="name" :label="this.$t('exam.trainingType')" width="180" />
<el-table-column prop="num" label="题数" /> <el-table-column prop="num" :label="this.$t('exam.numberOfQuestions')" />
<el-table-column prop="point" label="分值" /> <el-table-column prop="point" :label="this.$t('exam.score')" />
<el-table-column prop="chapterIdLong" label="总分" /> <el-table-column prop="chapterIdLong" :label="this.$t('exam.totalScore')" />
</el-table> </el-table>
</p> </p>
</span> </span>
@ -43,7 +43,7 @@
</el-scrollbar> </el-scrollbar>
</div> </div>
<div class="btn-start"> <div class="btn-start">
<el-button :loading="loading" type="primary" @click="exmaStart">开始考试</el-button> <el-button :loading="loading" type="primary" @click="exmaStart">{{ $t('exam.startTheExam') }}</el-button>
</div> </div>
</el-card> </el-card>
</template> </template>
@ -157,7 +157,7 @@ export default {
query: { permissionType: PermissionType.EXAM, prdCode: res.data.prdCode, mapId: res.data.mapId } query: { permissionType: PermissionType.EXAM, prdCode: res.data.prdCode, mapId: res.data.mapId }
}); });
}).catch(() => { }).catch(() => {
this.$messageBox('获取课程详情失败'); this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
this.loading = false; this.loading = false;
}); });
@ -175,16 +175,16 @@ export default {
} catch (error) { } catch (error) {
// //
if (error.code === 500004) { if (error.code === 500004) {
this.$confirm('无此课程的考试权限,请前往购买!', '提示', { this.$confirm( this.$t('tip.noCourseAuthority'), this.$t('tip.hint'), {
cancelButtonText: '取消', cancelButtonText: this.$t('global.cancel'),
confirmButtonText: '确定', confirmButtonText: this.$t('global.confirm'),
type: 'warning', type: 'warning',
center: true center: true
}).then(() => { }).then(() => {
this.buy(); this.buy();
}).catch(() => { }); }).catch(() => { });
} else if (error.code === 500005) { } else if (error.code === 500005) {
this.$messageBox('不在考试范围之内'); this.$messageBox(this.$t('tip.notWithinTheScopeOfTheExamination'));
} else { } else {
this.$messageBox(`${error.message}`); this.$messageBox(`${error.message}`);
} }
@ -205,7 +205,7 @@ export default {
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.loading = false; this.loading = false;
this.$messageBox(`创建仿真失败: ${error.message}`); this.$messageBox( this.$t('error.createSimulationFailed') +`: ${error.message}`);
}); });
} else { } else {
this.loading = false; this.loading = false;

View File

@ -1,29 +1,29 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<span class="title">实训名称 {{ courseModel.name }}</span> <span class="title">{{this.$t('exam.trainingName')}} {{ courseModel.name }}</span>
</div> </div>
<div style="margin:50px" :style="{ height: height - 150 +'px' }"> <div style="margin:50px" :style="{ height: height - 150 +'px' }">
<p class="time-item"> <p class="time-item">
<span class="time-label">考试计时</span> <span class="time-label">{{this.$t('exam.examinationTiming')}}</span>
<span class="time-elem">{{ formatExamUsedTime }}</span> <span class="time-elem">{{ formatExamUsedTime }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">完成本题最大用时</span> <span class="list-label">{{this.$t('exam.maximumTimeToCompleteThisQuestion')}}</span>
<span class="list-elem">{{ courseModel.maxDuration | setTime }} </span> <span class="list-elem">{{ courseModel.maxDuration | setTime }}{{this.$t('global.second')}} </span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">完成本题最佳用时</span> <span class="list-label">{{this.$t('exam.theBestTimeToCompleteTheQuestion')}}</span>
<span class="list-elem">{{ courseModel.minDuration | setTime }} </span> <span class="list-elem">{{ courseModel.minDuration | setTime }}{{this.$t('global.second')}}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label"> 实训说明</span> <span class="list-label"> {{this.$t('exam.trainingNotes')}}</span>
<span class="list-elem">{{ courseModel.remarks }}</span> <span class="list-elem">{{ courseModel.remarks }}</span>
</p> </p>
<p> <p>
<span class="list-label" /> <span class="list-label" />
<el-button :loading="loading" type="primary" @click="start">开始考试</el-button> <el-button :loading="loading" type="primary" @click="start">{{this.$t('exam.startTheExam')}}</el-button>
<el-button :loading="loading" type="danger" @click="back">放弃考试</el-button> <el-button :loading="loading" type="danger" @click="back">{{this.$t('exam.giveUpTheExam')}}</el-button>
</p> </p>
</div> </div>
</el-card> </el-card>
@ -86,7 +86,7 @@ export default {
updateTime: res.data.updateTime updateTime: res.data.updateTime
}; };
}).catch(error => { }).catch(error => {
this.$message.error('获取试题息失败:' + error.message); this.$message.error( this.$t('error.getTestInformationFailed') + ':' + error.message);
}); });
} }
}, },
@ -98,9 +98,9 @@ export default {
}, },
back() { back() {
this.loading = true; this.loading = true;
this.$confirm('此操作将放弃本次考试, 是否继续?', '提示', { this.$confirm( this.$t('tip.giveUpTheExamTip'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('global.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// //

View File

@ -1,7 +1,7 @@
<template> <template>
<el-card v-loading="loading" class="map-list-main"> <el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>试题列表</span> <span>{{ $t('exam.itemList') }}</span>
</div> </div>
<filter-city <filter-city
ref="filerCity" ref="filerCity"
@ -10,7 +10,7 @@
:query-function="queryFunction" :query-function="queryFunction"
@filterSelectChange="refresh" @filterSelectChange="refresh"
/> />
<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-175) +'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-175) +'px' }">
<el-tree <el-tree
ref="tree" ref="tree"

View File

@ -2,24 +2,24 @@
<div v-loading="loading"> <div v-loading="loading">
<el-card class="paper" :style="{height: height - 10 + 'px'}"> <el-card class="paper" :style="{height: height - 10 + 'px'}">
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<span style="font-weight:bold ">考试结果详情</span> <span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div> </div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height - 150 + 'px'}"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height - 150 + 'px'}">
<div class="context"> <div class="context">
<el-form ref="form" :model="resultModel" size="mini"> <el-form ref="form" :model="resultModel" size="mini">
<el-form-item label="试题名称:" prop="name"> <el-form-item :label="this.$t('exam.testQuestionsName')+':'" prop="name">
<span>{{ resultModel.examName }}</span> <span>{{ resultModel.examName }}</span>
</el-form-item> </el-form-item>
<el-form-item label="考试得分:" prop="score"> <el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
<span>{{ resultModel.score + ' 分' }}</span> <span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
</el-form-item> </el-form-item>
<el-form-item label="是否通过:" prop="detail"> <el-form-item :label="this.$t('exam.whetherThrough')+':'" prop="detail">
<span v-if="resultModel.result === '01'" style="color:darkgray">未计算</span> <span v-if="resultModel.result === '01'" style="color:darkgray">{{ $t('exam.didNotCalculate') }}</span>
<span v-else-if="resultModel.result === '02'" style="color:green">通过</span> <span v-else-if="resultModel.result === '02'" style="color:green">{{ $t('exam.pass') }}</span>
<span v-else-if="resultModel.result === '03'" style="color:red">未通过</span> <span v-else-if="resultModel.result === '03'" style="color:red">{{ $t('exam.notPass') }}</span>
</el-form-item> </el-form-item>
<el-form-item label="考试用时:" prop="detail"> <el-form-item :label="this.$t('exam.examTime')+':'" prop="detail">
<span>{{ Math.ceil(resultModel.usedTime/60) + ' 分钟' }}</span> <span>{{ Math.ceil(resultModel.usedTime/60) + ' '+ $t('global.minutes') }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -29,13 +29,13 @@
:summary-method="getSummaries" :summary-method="getSummaries"
show-summary show-summary
> >
<el-table-column prop="trainingName" label="实训名称" /> <el-table-column prop="trainingName" :label="this.$t('exam.trainingName')" />
<el-table-column prop="score" label="实训得分" /> <el-table-column prop="score" :label="this.$('exam.trainingScore')" />
</el-table> </el-table>
</div> </div>
</el-scrollbar> </el-scrollbar>
<div style="position: relative; float: right; right: 60px; bottom: -30px;"> <div style="position: relative; float: right; right: 60px; bottom: -30px;">
<el-button type="primary " @click="back">返回考试列表</el-button> <el-button type="primary " @click="back">{{ $t('exam.returnToExamList') }}</el-button>
</div> </div>
</el-card> </el-card>
</div> </div>
@ -75,7 +75,7 @@ export default {
const sums = []; const sums = [];
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (index === 0) { if (index === 0) {
sums[index] = '总分'; sums[index] = this.$t('exam.totalScore');
return; return;
} }
const values = data.map(item => Number(item[column.property])); const values = data.map(item => Number(item[column.property]));
@ -88,7 +88,7 @@ export default {
return prev; return prev;
} }
}, 0); }, 0);
sums[index] += ' 分'; sums[index] += this.$('exam.points');
} else { } else {
sums[index] = 'N/A'; sums[index] = 'N/A';
} }
@ -110,7 +110,7 @@ export default {
this.loading = false; this.loading = false;
clearInterval(interval); clearInterval(interval);
interval = null; interval = null;
this.$messageBox('自动提交考试结果失败'); this.$messageBox(this.$t('error.submitExamFailed'));
} }
}); });
}, 1000); }, 1000);

View File

@ -7,10 +7,13 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="扶梯框宽度" prop="appendageBoxWidth"> <el-form-item label="扶梯框宽度" prop="appendageBoxWidth">
<el-input-number v-model="form.appendageBoxWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.appendageBoxWidth" controls-position="right" :min="50"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="扶梯框高度" prop="appendageBoxHeight"> <el-form-item label="扶梯框高度" prop="appendageBoxHeight">
<el-input-number v-model="form.appendageBoxHeight" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.appendageBoxHeight" controls-position="right" :min="75"></el-input-number>
</el-form-item>
<el-form-item label="边框宽度" prop="borderWidth">
<el-input-number v-model="form.borderWidth" controls-position="right" :min="1"></el-input-number><span>&nbsp&nbsp(建议尺寸25)</span>
</el-form-item> </el-form-item>
<el-form-item label="X轴坐标"> <el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
@ -42,7 +45,8 @@
appendageBoxWidth: '', appendageBoxWidth: '',
appendageBoxHeight: '', appendageBoxHeight: '',
x: 10, x: 10,
y: 10 y: 10,
borderWidth: 25
}, },
rules: { rules: {
code: [ code: [
@ -53,6 +57,9 @@
], ],
appendageBoxHeight: [ appendageBoxHeight: [
{ required: true, message: '请输入扶梯框高度', trigger: 'blur' }, { required: true, message: '请输入扶梯框高度', trigger: 'blur' },
],
borderWidth: [
{ required: true, message: '请输入边框宽度', trigger: 'blur'},
] ]
} }
}; };
@ -72,6 +79,7 @@
this.form.appendageBoxHeight = model.height; this.form.appendageBoxHeight = model.height;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.borderWidth = model.borderWidth
} }
} }
}, },
@ -89,7 +97,8 @@
_type: 'AppendageBox', _type: 'AppendageBox',
code: this.form.code, code: this.form.code,
width: this.form .appendageBoxWidth, width: this.form .appendageBoxWidth,
height: this.form.appendageBoxHeight height: this.form.appendageBoxHeight,
borderWidth: this.form.borderWidth
}; };
this.$emit('createAppendageBox', appendageBoxModel); this.$emit('createAppendageBox', appendageBoxModel);
this.initPage(); this.initPage();
@ -107,7 +116,8 @@
_type: 'AppendageBox', _type: 'AppendageBox',
code: this.form.code, code: this.form.code,
width: this.form .appendageBoxWidth, width: this.form .appendageBoxWidth,
height: this.form.appendageBoxHeight height: this.form.appendageBoxHeight,
borderWidth: this.form.borderWidth
}; };
this.$emit('deleteDataModel',appendageBoxModel ); this.$emit('deleteDataModel',appendageBoxModel );
this.initPage(); this.initPage();
@ -120,6 +130,7 @@
code: '', code: '',
appendageBoxWidth: '', appendageBoxWidth: '',
appendageBoxHeight: '', appendageBoxHeight: '',
borderWidth: 25,
x: 10, x: 10,
y: 10 y: 10
}; };

View File

@ -21,7 +21,7 @@
<el-input-number v-model="form.arrowWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.arrowWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="箭头颜色" prop="fillColor"> <el-form-item label="箭头颜色" prop="fillColor">
<el-input v-model="form.fillColor"></el-input> <el-color-picker v-model="form.fillColor"></el-color-picker>
</el-form-item> </el-form-item>
<el-form-item label="顶点X轴坐标"> <el-form-item label="顶点X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
@ -50,7 +50,7 @@
showDeleteButton: false, showDeleteButton: false,
form: { form: {
code: '', code: '',
orientation: '', orientation: 'left',
arrowWidth: '', arrowWidth: '',
arrowLength: '', arrowLength: '',
fillColor: '', fillColor: '',
@ -144,7 +144,7 @@
this.showDeleteButton = false; this.showDeleteButton = false;
this.form = { this.form = {
code: '', code: '',
orientation: '', orientation: 'left',
arrowWidth: '', arrowWidth: '',
arrowLength: '', arrowLength: '',
fillColor: '', fillColor: '',

View File

@ -24,9 +24,10 @@
data() { data() {
return { return {
form: { form: {
bgWidth: '', bgWidth: this.$store.state.ibp.ibpBgDevice.model?this.$store.state.ibp.ibpBgDevice.model.width:1,
bgHeight: '' bgHeight: this.$store.state.ibp.ibpBgDevice.model?this.$store.state.ibp.ibpBgDevice.model.height:1,
}, },
code: this.$store.state.ibp.ibpBgDevice.model?this.$store.state.ibp.ibpBgDevice.model.code:'',
rules: { rules: {
bgWidth: [ bgWidth: [
{ required: true, message: '请输入背景板宽度', trigger: 'blur' }, { required: true, message: '请输入背景板宽度', trigger: 'blur' },
@ -57,12 +58,16 @@
x: 0, x: 0,
y: 0, y: 0,
_type: 'Background', _type: 'Background',
code: this.code,
width: this.form .bgWidth, width: this.form .bgWidth,
height: this.form.bgHeight height: this.form.bgHeight
}; };
this.$emit('createBg', bgModel) this.$emit('updateBg', bgModel)
}, },
initPage(){ initPage(){
this.form.bgWidth = this.$store.state.ibp.ibpBgDevice.model?this.$store.state.ibp.ibpBgDevice.model.width:1;
this.form.bgHeight = this.$store.state.ibp.ibpBgDevice.model?this.$store.state.ibp.ibpBgDevice.model.height:1;
this.code = this.$store.state.ibp.ibpBgDevice.model?this.$store.state.ibp.ibpBgDevice.model.code:'';
} }
} }
}; };

View File

@ -45,8 +45,8 @@
showDeleteButton: false, showDeleteButton: false,
form: { form: {
code: '', code: '',
buttonColor: '', buttonColor: 'red',
buttonWidth: '', buttonWidth: 25,
x: 10, x: 10,
y: 10 y: 10
}, },
@ -126,8 +126,8 @@
this.showDeleteButton = false; this.showDeleteButton = false;
this.form = { this.form = {
code: '', code: '',
buttonColor: '', buttonColor: 'red',
buttonWidth: '', buttonWidth: 25,
x: 10, x: 10,
y: 10 y: 10
}; };

View File

@ -6,12 +6,9 @@
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="钥匙宽度" prop="keyWidth"> <el-form-item label="钥匙宽度" prop="keyWidth">
<el-input-number v-model="form.keyWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.keyWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="钥匙高度" prop="keyHeight">
<el-input-number v-model="form.keyHeight" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="钥匙朝向" prop="status"> <el-form-item label="钥匙朝向" prop="status">
<el-select v-model="form.status" placeholder="请选择钥匙朝向"> <el-select v-model="form.status" placeholder="请选择钥匙朝向">
<el-option label="水平" value="on"></el-option> <el-option label="水平" value="on"></el-option>
@ -24,6 +21,12 @@
<el-form-item label="Y轴坐标"> <el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="上侧文字" prop="topText">
<el-input v-model="form.topText"></el-input>
</el-form-item>
<el-form-item label="下侧文字" prop="bottomText">
<el-input v-model="form.bottomText"></el-input>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button> <el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
@ -46,10 +49,11 @@
form: { form: {
code: '', code: '',
keyWidth: '', keyWidth: '',
keyHeight: '', status:'on',
status:'',
x: 10, x: 10,
y: 10 y: 10,
topText:'',
bottomText:''
}, },
rules: { rules: {
code: [ code: [
@ -58,12 +62,15 @@
keyWidth: [ keyWidth: [
{ required: true, message: '请输入钥匙孔宽度', trigger: 'blur' }, { required: true, message: '请输入钥匙孔宽度', trigger: 'blur' },
], ],
keyHeight: [
{ required: true, message: '请输入钥匙孔高度', trigger: 'blur' },
],
status: [ status: [
{ required: true, message: '请选择钥匙朝向', trigger: 'change' }, { required: true, message: '请选择钥匙朝向', trigger: 'change' },
], ],
topText: [
{ required: true, message: '请输入上侧文字', trigger: 'blur' },
],
bottomText: [
{ required: true, message: '请输入下侧文字', trigger: 'blur' },
],
} }
}; };
}, },
@ -79,10 +86,11 @@
this.isUpdate = true; this.isUpdate = true;
this.form.code = model.code; this.form.code = model.code;
this.form.keyWidth = model.width; this.form.keyWidth = model.width;
this.form.keyHeight = model.height;
this.form.status = model.status; this.form.status = model.status;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.topText = model.topText;
this.form.bottomText = model.bottomText;
} }
} }
}, },
@ -101,8 +109,9 @@
_type: 'Key', _type: 'Key',
code: this.form.code, code: this.form.code,
width: this.form.keyWidth, width: this.form.keyWidth,
height: this.form.keyHeight, status:this.form.status,
status:this.form.status topText:this.form.topText,
bottomText:this.form.bottomText,
}; };
this.$emit('createKey', keyModel); this.$emit('createKey', keyModel);
this.initPage(); this.initPage();
@ -122,8 +131,9 @@
_type: 'Key', _type: 'Key',
code: this.form.code, code: this.form.code,
width: this.form .keyWidth, width: this.form .keyWidth,
height: this.form.keyHeight, status:this.form.status,
status:this.form.status topText:this.form.topText,
bottomText:this.form.bottomText,
}; };
this.$emit('deleteDataModel',keyModel); this.$emit('deleteDataModel',keyModel);
this.initPage(); this.initPage();
@ -135,10 +145,11 @@
this.form = { this.form = {
code: '', code: '',
keyWidth: '', keyWidth: '',
keyHeight: '', status:'on',
status:'',
x: 10, x: 10,
y: 10 y: 10,
topText:'',
bottomText:'',
}; };
}, },
generateCode() { generateCode() {

View File

@ -10,7 +10,7 @@
<el-input-number v-model="form.lineWidth" controls-position="right" :min="1" :max="50"></el-input-number> <el-input-number v-model="form.lineWidth" controls-position="right" :min="1" :max="50"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="线段颜色" prop="fillColor"> <el-form-item label="线段颜色" prop="fillColor">
<el-input v-model="form.fillColor"></el-input> <el-color-picker v-model="form.fillColor"></el-color-picker>
</el-form-item> </el-form-item>
<el-form-item label="起始X轴坐标"> <el-form-item label="起始X轴坐标">
<el-input-number v-model="form.x1" controls-position="right" :min="0"></el-input-number> <el-input-number v-model="form.x1" controls-position="right" :min="0"></el-input-number>
@ -46,7 +46,7 @@
form: { form: {
code: '', code: '',
lineWidth: '', lineWidth: '',
fillColor: '', fillColor: '#000000',
x1: 10, x1: 10,
y1: 10, y1: 10,
x2: 20, x2: 20,

View File

@ -16,7 +16,7 @@
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="提示颜色" prop="rotateTipColor"> <el-form-item label="提示颜色" prop="rotateTipColor">
<el-select v-model="form.rotateTipColor" placeholder="请选择按钮颜色"> <el-select v-model="form.rotateTipColor" placeholder="请选择提示颜色">
<el-option label="红色" value="red"></el-option> <el-option label="红色" value="red"></el-option>
<el-option label="黑色" value="black"></el-option> <el-option label="黑色" value="black"></el-option>
</el-select> </el-select>

View File

@ -1,128 +0,0 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="钥匙孔编号" prop="code">
<el-input :disabled="true" v-model="form.code" >
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input>
</el-form-item>
<el-form-item label="钥匙孔宽度" prop="rotatingButtonWidth">
<el-input-number v-model="form.rotatingButtonWidth" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'RotatingButtonDraft',
components: {
},
data() {
return {
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false,
form: {
code: '',
rotatingButtonWidth: '',
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message: '请输入钥匙孔编号', trigger: 'blur' },
],
rotatingButtonWidth: [
{ required: true, message: '请输入钥匙孔宽度', trigger: 'blur' },
]
}
};
},
computed: {
},
watch: {
'$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'RotatingButton' ){
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.rotatingButtonWidth = model.width;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const rotatingButtonModel = {
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'RotatingButton',
code: this.form.code,
width: this.form .rotatingButtonWidth,
};
this.$emit('createRotatingButton', rotatingButtonModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const rotatingButtonModel = {
point: {
x: this.form.x,
y: this.form.y
},
draggable: true,
_type: 'RotatingButton',
code: this.form.code,
width: this.form .rotatingButtonWidth,
};
this.$emit('deleteDataModel',rotatingButtonModel );
this.initPage();
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
rotatingButtonWidth: '',
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.form.code = "rButton_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -2,7 +2,7 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px"> <el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="端子编号" prop="code"> <el-form-item label="端子编号" prop="code">
<el-input :disabled="true" v-model="form.code" style="width:300px"> <el-input :disabled="true" v-model="form.code">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>

View File

@ -1,19 +1,28 @@
<template> <template>
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> <el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item label="提示框编号" prop="code"> <el-form-item label="矩形编号" prop="code">
<el-input :disabled="true" v-model="form.code" > <el-input :disabled="true" v-model="form.code" >
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="提示框宽度" prop="tipBoxWidth"> <el-form-item label="矩形宽度" prop="tipBoxWidth">
<el-input-number v-model="form.tipBoxWidth" controls-position="right" :min="1" ></el-input-number> <el-input-number v-model="form.tipBoxWidth" controls-position="right" :min="1" ></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="提示框高度" prop="tipBoxHeight"> <el-form-item label="矩形高度" prop="tipBoxHeight">
<el-input-number v-model="form.tipBoxHeight" controls-position="right" :min="1" ></el-input-number> <el-input-number v-model="form.tipBoxHeight" controls-position="right" :min="1" ></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="提示框颜色" prop="fillColor"> <el-form-item label="填充颜色" prop="fillColor">
<el-input v-model="form.fillColor"></el-input> <el-color-picker v-model="form.fillColor"></el-color-picker>
</el-form-item>
<el-form-item label="填充透明颜色">
<el-switch v-model="opacity"></el-switch>
</el-form-item>
<el-form-item label="边框线宽" prop="lineWidth">
<el-input-number v-model="form.lineWidth" controls-position="right" :min="0" ></el-input-number>
</el-form-item>
<el-form-item label="边线颜色" prop="stroke">
<el-color-picker v-model="form.stroke"></el-color-picker>
</el-form-item> </el-form-item>
<el-form-item label="X轴坐标"> <el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
@ -41,13 +50,16 @@
isUpdate: false, isUpdate: false,
buttonText: '立即创建', buttonText: '立即创建',
showDeleteButton: false, showDeleteButton: false,
opacity: false,
form: { form: {
code: '', code: '',
tipBoxWidth: '', tipBoxWidth: '',
tipBoxHeight: '', tipBoxHeight: '',
fillColor: '', fillColor: '#CE950F',
x: 10, x: 10,
y: 10 y: 10,
lineWidth: 0,
stroke: ''
}, },
rules: { rules: {
code: [ code: [
@ -81,6 +93,9 @@
this.form.fillColor = model.fillColor; this.form.fillColor = model.fillColor;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.opacity = model.opacity;
this.form.lineWidth = model.lineWidth;
this.form.stroke = model.stroke;
} }
} }
}, },
@ -99,7 +114,10 @@
_type: 'TipBox', _type: 'TipBox',
width: this.form.tipBoxWidth, width: this.form.tipBoxWidth,
height: this.form.tipBoxHeight, height: this.form.tipBoxHeight,
fillColor: this.form.fillColor fillColor: this.form.fillColor,
opacity: this.opacity,
lineWidth: this.form.lineWidth,
stroke: this.form.stroke
}; };
this.$emit('createTipBox', tipBoxModel); this.$emit('createTipBox', tipBoxModel);
this.initPage(); this.initPage();
@ -119,7 +137,10 @@
_type: 'TipBox', _type: 'TipBox',
width: this.form.tipBoxWidth, width: this.form.tipBoxWidth,
height: this.form.tipBoxHeight, height: this.form.tipBoxHeight,
fillColor: this.form.fillColor fillColor: this.form.fillColor,
opacity: this.opacity,
lineWidth: this.form.lineWidth,
stroke: this.form.stroke
}; };
this.$emit('deleteDataModel',tipBoxModel); this.$emit('deleteDataModel',tipBoxModel);
this.initPage(); this.initPage();
@ -134,7 +155,10 @@
tipBoxHeight: '', tipBoxHeight: '',
fillColor: '', fillColor: '',
x: 10, x: 10,
y: 10 y: 10,
opacity: false,
lineWidth: 0,
stroke: ''
}; };
}, },
generateCode() { generateCode() {

View File

@ -3,7 +3,7 @@
<div class="map-control"> <div class="map-control">
<el-card type="border-card"> <el-card type="border-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>车站名称</span> <span>车站名称</span>
<el-select v-model="stationCode" @change="changeStationCode" placeholder="请选择车站"> <el-select v-model="stationCode" @change="changeStationCode" placeholder="请选择车站">
<el-option <el-option
v-for="item in stationOptions" v-for="item in stationOptions"
@ -20,90 +20,88 @@
</div> </div>
<el-tabs v-model="enabledTab" class="mapEdit" type="card" @tab-click="handleTabClick"> <el-tabs v-model="enabledTab" class="mapEdit" type="card" @tab-click="handleTabClick">
<el-tab-pane label="背景板" name="Background"> <el-tab-pane label="背景板" name="Background">
<ibp-bg <ibp-bg ref="background"
@createBg="createDataModel" @updateBg="createDataModel" style="width:90%"
></ibp-bg> ></ibp-bg>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="线条" name="IbpLine"> <el-tab-pane label="线条" name="IbpLine">
<ibp-line ref="ibpline" <ibp-line ref="ibpline"
@createLine="createDataModel" @deleteDataModel="deleteDataModel" @createLine="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-line> </ibp-line>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="文字" name="IbpText"> <el-tab-pane label="文字" name="IbpText">
<ibp-text ref="ibptext" <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
@createText="createDataModel" @deleteDataModel="deleteDataModel" <ibp-text ref="ibptext"
> @createText="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
</ibp-text> >
</ibp-text>
</el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="提示框" name="TipBox"> <el-tab-pane label="矩形" name="TipBox">
<ibp-tip-box ref="tipbox" <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
@createTipBox="createDataModel" @deleteDataModel="deleteDataModel" <ibp-tip-box ref="tipbox"
></ibp-tip-box> @createTipBox="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
></ibp-tip-box>
</el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="按钮" name="SquareButton"> <el-tab-pane label="按钮" name="SquareButton">
<ibp-button ref="squarebutton" <ibp-button ref="squarebutton"
@createButton="createDataModel" @deleteDataModel="deleteDataModel" @createButton="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-button> </ibp-button>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="圆形指示灯" name="CircularLamp"> <el-tab-pane label="圆形指示灯" name="CircularLamp">
<ibp-lamp ref="circularlamp" <ibp-lamp ref="circularlamp"
@createLamp="createDataModel" @deleteDataModel="deleteDataModel" @createLamp="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-lamp> </ibp-lamp>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="箭头" name="Arrow"> <el-tab-pane label="箭头" name="Arrow">
<ibp-arrow ref="arrow" <ibp-arrow ref="arrow"
@createArrow="createDataModel" @deleteDataModel="deleteDataModel" @createArrow="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-arrow> </ibp-arrow>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="扶梯框" name="AppendageBox"> <el-tab-pane label="扶梯框" name="AppendageBox">
<ibp-appendage-box ref="appendagebox" <ibp-appendage-box ref="appendagebox"
@createAppendageBox="createDataModel" @deleteDataModel="deleteDataModel" @createAppendageBox="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-appendage-box> </ibp-appendage-box>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="报警器" name="Alarm"> <el-tab-pane label="报警器" name="Alarm">
<ibp-alarm ref="alarm" <ibp-alarm ref="alarm"
@createAlarm="createDataModel" @deleteDataModel="deleteDataModel" @createAlarm="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-alarm> </ibp-alarm>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="钥匙孔" name="RotatingButton">
<ibp-rotating-button ref="rotatingbutton"
@createRotatingButton="createDataModel" @deleteDataModel="deleteDataModel"
>
</ibp-rotating-button>
</el-tab-pane>
<el-tab-pane label="电话端子" name="TeleTerminal"> <el-tab-pane label="电话端子" name="TeleTerminal">
<ibp-telephone-terminal ref="teleTerminal" <ibp-telephone-terminal ref="teleTerminal"
@createTeleTerminal="createDataModel" @deleteDataModel="deleteDataModel" @createTeleTerminal="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-telephone-terminal> </ibp-telephone-terminal>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="电梯" name="Elevator"> <el-tab-pane label="电梯" name="Elevator">
<ibp-elevator ref="elevator" <ibp-elevator ref="elevator"
@createElevator="createDataModel" @deleteDataModel="deleteDataModel" @createElevator="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-elevator> </ibp-elevator>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="钥匙" name="Key"> <el-tab-pane label="钥匙" name="Key">
<ibp-key ref="key" <ibp-key ref="key"
@createKey="createDataModel" @deleteDataModel="deleteDataModel" @createKey="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-key> </ibp-key>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="电子表" name="Clock"> <el-tab-pane label="电子表" name="Clock">
<ibp-clock ref="clock" <ibp-clock ref="clock"
@createClock="createDataModel" @deleteDataModel="deleteDataModel" @createClock="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-clock> </ibp-clock>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="旋转提示" name="RotateTip"> <el-tab-pane label="旋转提示" name="RotateTip">
<ibp-rotate-tip ref="rotateTip" <ibp-rotate-tip ref="rotateTip"
@createRotateTip="createDataModel" @deleteDataModel="deleteDataModel" @createRotateTip="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
> >
</ibp-rotate-tip> </ibp-rotate-tip>
</el-tab-pane> </el-tab-pane>
@ -125,7 +123,6 @@
import IbpAppendageBox from './ibpAppendageBox'; import IbpAppendageBox from './ibpAppendageBox';
import IbpArrow from './ibpArrow'; import IbpArrow from './ibpArrow';
import IbpLamp from './ibpLamp'; import IbpLamp from './ibpLamp';
import IbpRotatingButton from './ibpRotatingButton';
import IbpLine from './ibpLine'; import IbpLine from './ibpLine';
import IbpTelephoneTerminal from './ibpTelephoneTerminal'; import IbpTelephoneTerminal from './ibpTelephoneTerminal';
import IbpElevator from './ibpElevator'; import IbpElevator from './ibpElevator';
@ -144,7 +141,6 @@
IbpAppendageBox, IbpAppendageBox,
IbpArrow, IbpArrow,
IbpLamp, IbpLamp,
IbpRotatingButton,
IbpLine, IbpLine,
IbpTelephoneTerminal, IbpTelephoneTerminal,
IbpElevator, IbpElevator,
@ -157,7 +153,7 @@
], ],
data() { data() {
return { return {
enabledTab: 'BgImage', enabledTab: 'Background',
data: '', data: '',
stationOptions:[ stationOptions:[
{ {
@ -173,7 +169,8 @@
label: '枣园站' label: '枣园站'
} }
], ],
stationCode: '' stationCode: '',
height: this.$store.state.app.height - 190
}; };
}, },
watch: { watch: {
@ -190,12 +187,7 @@
}, },
methods: { methods: {
createDataModel(model) { createDataModel(model) {
if(model._type === deviceType.Background) {
const bgDevice = this.$store.getters['ibp/ibpBgDevice'];
model.code = bgDevice.model.code;
}
const newModel = deviceFactory(model._type, model); const newModel = deviceFactory(model._type, model);
this.$store.dispatch('ibp/updateIbpDevices', newModel.model); this.$store.dispatch('ibp/updateIbpDevices', newModel.model);
}, },
deleteDataModel(model) { deleteDataModel(model) {
@ -207,6 +199,7 @@
}, },
changeStationCode(e) { changeStationCode(e) {
this.$emit('ibpChange',e); this.$emit('ibpChange',e);
this.handleTabClick();
}, },
handleTabClick() { handleTabClick() {
this.$refs.ibpline.initPage(); this.$refs.ibpline.initPage();
@ -217,13 +210,20 @@
this.$refs.arrow.initPage(); this.$refs.arrow.initPage();
this.$refs.appendagebox.initPage(); this.$refs.appendagebox.initPage();
this.$refs.alarm.initPage(); this.$refs.alarm.initPage();
this.$refs.rotatingbutton.initPage();
this.$refs.elevator.initPage(); this.$refs.elevator.initPage();
this.$refs.key.initPage(); this.$refs.key.initPage();
this.$refs.teleTerminal.initPage(); this.$refs.teleTerminal.initPage();
this.$refs.clock.initPage(); this.$refs.clock.initPage();
this.$refs.rotateTip.initPage(); this.$refs.rotateTip.initPage();
this.$refs.background.initPage();
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.map-control {
float: right;
width: 100%;
}
</style>

View File

@ -22,23 +22,20 @@ export default {
}, },
data() { data() {
return { return {
mapSaveing: false,
viewDraft: 'draft',
autoSaveTask: null,
selected: null,
mapInfo: { name: '' },
timeDemon: null,
size: { size: {
width: this.$store.state.app.width-521, width: this.$store.state.app.width-521,
height: this.$store.state.app.height-60 height: this.$store.state.app.height - 60
}, }
}; };
}, },
watch: { watch: {
'$store.state.app.windowSizeCount': function() { '$store.state.app.windowSizeCount': function() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height }); this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
} }
}, },
created() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
},
mounted() { mounted() {
this.$refs.ibpPlate.show(); this.$refs.ibpPlate.show();
this.$refs.ibpPlate.drawIbpInit(); this.$refs.ibpPlate.drawIbpInit();
@ -47,12 +44,6 @@ export default {
}, },
methods: { methods: {
endViewLoading(isSuccess) {
},
selectViewDraft(data) {
this.viewDraft = data;
},
ibpChange(stationCode) { ibpChange(stationCode) {
this.$refs.ibpPlate.show(stationCode); this.$refs.ibpPlate.show(stationCode);
this.$refs.ibpPlate.drawIbpInit(); this.$refs.ibpPlate.drawIbpInit();
@ -75,7 +66,10 @@ export default {
float: left; float: left;
width: 60%; width: 60%;
} }
.mapPaint{
height: 100%;
overflow: hidden;
}
.map-draft { .map-draft {
float: right; float: right;
width: 520px; width: 520px;
@ -85,16 +79,4 @@ export default {
// height: calc(100% - 40px); // height: calc(100% - 40px);
// } // }
} }
.physical-view {
line-height: 25px;
height: 60px;
padding-left: 12px;
.el-checkbox {
width: 70px;
margin: 0;
margin-right: 12px;
}
}
</style> </style>

View File

@ -1,61 +0,0 @@
<template>
<div id="mapMain" class="ibpDraft">
<div class="map-list" :style="{width: widthLeft+'px'}">
<span>车站列表</span>
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view />
</transition>
</div>
</template>
<script>
import localStore from 'storejs';
import DrapLeft from '@/views/components/drapLeft/index';
export default {
name: 'IbpDraft',
components: {
DrapLeft
},
data() {
return {
widthLeft: 320
};
},
watch: {
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
}
},
methods: {
drapWidth(width) {
this.widthLeft = Number(width);
},
setMapResize(LeftWidth) {
const widths =this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.ibpDraft {
overflow: hidden;
.map-list {
float: left;
height: 100%;
}
}
</style>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div :id="ibpId" :style="{ width: '100%', height: '100%',background:'#000' }" class="ibp-canvas" /> <div :id="ibpId" :style="{ width: this.canvasWidth +'px', height: this.canvasHeight +'px',background:'#000' }" class="ibp-canvas" v-loading="loading" />
<el-button v-if="showBackButton" class="ibp-button" type="primary" @click="back">返回</el-button> <el-button v-if="showBackButton" class="ibp-button" type="primary" @click="back">返回</el-button>
</div> </div>
</template> </template>
@ -40,7 +40,8 @@ export default {
}, },
showBackButton: true, showBackButton: true,
initTime: '', initTime: '',
started: false started: false,
loading: false
}; };
}, },
computed: { computed: {
@ -87,6 +88,7 @@ export default {
return false; return false;
}; };
this.ibpDestroy(); this.ibpDestroy();
this.loading = true;
const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight}); const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight});
this.$ibp = new IbpPan({ this.$ibp = new IbpPan({
dom: document.getElementById(this.ibpId), dom: document.getElementById(this.ibpId),
@ -101,9 +103,7 @@ export default {
offsetY: 0 offsetY: 0
}, },
methods: { methods: {
dataLoaded: this.handleDataLoaded,
viewLoaded: this.handleViewLoaded, viewLoaded: this.handleViewLoaded,
stateLoaded: this.handleStateLoaded
} }
}); });
Vue.prototype.$ibp = this.$ibp; Vue.prototype.$ibp = this.$ibp;
@ -148,7 +148,7 @@ export default {
setWindowSize() { setWindowSize() {
this.$nextTick(() => { this.$nextTick(() => {
const width = this.size ? this.size.width : this.$store.state.app.width; const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height :this.$store.state.app.height; const height = this.size ? this.size.height : this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height }); this.$store.dispatch('config/resize', { width: width, height: height });
}); });
}, },
@ -161,6 +161,9 @@ export default {
this.$ibp = ''; this.$ibp = '';
Vue.prototype.$ibp = ''; Vue.prototype.$ibp = '';
} }
},
handleViewLoaded() {
this.loading = false;
} }
} }
}; };

View File

@ -74,7 +74,7 @@ export default {
prop: 'organizationName' prop: 'organizationName'
}, },
{ {
title: '权限名称', title: this.$t('orderAuthor.permissionName'),
prop: 'permissionName' prop: 'permissionName'
}, },
{ {

View File

@ -16,7 +16,7 @@
style="width: 100%" style="width: 100%"
:height="height-300" :height="height-300"
> >
<el-table-column prop="permissionName" label="权限名称" /> <el-table-column prop="permissionName" :label="this.$t('orderAuthor.permissionName')" />
<!-- <el-table-column prop="mapProductName" :label="this.$t('orderAuthor.mapProductName')" width="120" /> <!-- <el-table-column prop="mapProductName" :label="this.$t('orderAuthor.mapProductName')" width="120" />
<el-table-column prop="lessonName" :label="this.$t('orderAuthor.courseName')" width="100" /> <el-table-column prop="lessonName" :label="this.$t('orderAuthor.courseName')" width="100" />
<el-table-column prop="permissionType" :label="this.$t('orderAuthor.permissionType')" width="100"> --> <el-table-column prop="permissionType" :label="this.$t('orderAuthor.permissionType')" width="100"> -->

View File

@ -48,7 +48,7 @@ export default {
// }, // },
'status': { 'status': {
type: 'select', type: 'select',
label: '状态', label: this.$t('global.status'),
value: '1', value: '1',
config: { config: {
data: [] data: []
@ -66,7 +66,7 @@ export default {
prop: 'organizationName' prop: 'organizationName'
}, },
{ {
title: '权限名称', title: this.$t('orderAuthor.permissionName'),
prop: 'permissionName' prop: 'permissionName'
}, },
{ {
@ -121,11 +121,11 @@ export default {
} }
}, },
{ {
title: '总数量', title: this.$t('global.amount'),
prop: 'amount' prop: 'amount'
}, },
{ {
title: '剩余数量', title: this.$t('global.remains'),
prop: 'remains' prop: 'remains'
}, },
{ {
@ -142,7 +142,7 @@ export default {
formatter: this.formatterDate formatter: this.formatterDate
}, },
{ {
title: '状态', title: this.$t('global.status'),
prop: 'status', prop: 'status',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
@ -175,20 +175,14 @@ export default {
name: this.$t('orderAuthor.recovery'), name: this.$t('orderAuthor.recovery'),
handleClick: this.handleRestore, handleClick: this.handleRestore,
type: 'danger', type: 'danger',
showControl: (row) => { return row.status == '1' && row.source == '04'; } showControl: (row) => { return row.status == '1' && row.source == '03' || row.source == '04' || row.source =='05'; }
},
{
name: this.$t('orderAuthor.unpacking'),
handleClick: this.handleUnPackage,
type: 'danger',
showControl: (row) => { return row.status == '1' && row.source == '02'; }
} }
] ]
} }
], ],
actions: [ actions: [
{ text: this.$t('orderAuthor.privilegePackaging'), btnCode: 'employee_insert', handler: this.handlePackage }, { text: this.$t('orderAuthor.privilegePackaging'), btnCode: 'employee_insert', handler: this.handlePackage },
{ text: '领取权限', handler: this.handlerPermission, show: process.env.NODE_ENV == 'development' } { text: this.$t('orderAuthor.receivingPermission'), handler: this.handlerPermission, show: process.env.NODE_ENV == 'development' }
] ]
} }
}; };
@ -255,20 +249,6 @@ export default {
}); });
}).catch(() => { }); }).catch(() => { });
}, },
handleUnPackage(index, row) {
this.$confirm(this.$t('tip.unpackingTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
permissionDistributeUnPackage(row.id).then(resp => {
this.reloadTable();
this.$message.success(this.$t('tip.unpackingSuccessful'));
}).catch(() => {
this.$messageBox(this.$t('tip.unpackingFailed'));
});
}).catch(() => { });
},
handlePackage() { handlePackage() {
this.$router.push({ path: `${UrlConfig.orderauthor.trainferPackage}` }); this.$router.push({ path: `${UrlConfig.orderauthor.trainferPackage}` });
}, },

View File

@ -60,7 +60,7 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '权限名称', title: this.$t('permission.permissionName'),
width: '210', width: '210',
prop: 'permissionName' prop: 'permissionName'
}, },

View File

@ -1,8 +1,8 @@
<template> <template>
<el-card v-loading="loading" class="map-list-main"> <el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="mapListTitle">地图列表</span> <span class="mapListTitle">{{ $t('scriptRecord.mapList') }}</span>
<el-button type="primary" size="small" @click="addScript" class="addScript">添加剧本</el-button> <el-button type="primary" size="small" @click="addScript" class="addScript">{{ $t('scriptRecord.addScript') }}</el-button>
</div> </div>
<el-select v-model="mapSelect" size="medium" class="mapSelect" @change="mapSelectChange"> <el-select v-model="mapSelect" size="medium" class="mapSelect" @change="mapSelectChange">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />

View File

@ -2,15 +2,15 @@
<el-card :style="{height: height+'px'}"> <el-card :style="{height: height+'px'}">
<div class="home-box"> <div class="home-box">
<el-card class="box-card"> <el-card class="box-card">
<div id="scriptTitle">剧本详情</div> <div id="scriptTitle">{{$t('scriptRecord.scriptDetail')}}</div>
<div id="sciptForm"> <div id="sciptForm">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div> </div>
<div id="btnList"> <div id="btnList">
<span slot="footer" class="btn-footer"> <span slot="footer" class="btn-footer">
<el-button type="success" @click="drawUp">编制</el-button> <el-button type="success" @click="drawUp">{{$t('scriptRecord.scriptRecord')}}</el-button>
<el-button type="primary" @click="modifyScript">修改</el-button> <el-button type="primary" @click="modifyScript">{{$t('scriptRecord.scriptModify')}}</el-button>
<el-button type="danger" @click="deleteScript">删除</el-button> <el-button type="danger" @click="deleteScript">{{$t('scriptRecord.scriptDelete')}}</el-button>
</span> </span>
</div> </div>
</el-card> </el-card>
@ -18,6 +18,10 @@
</el-card> </el-card>
</template> </template>
<script> <script>
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import {listPublishMap} from '@/api/jmap/map'; import {listPublishMap} from '@/api/jmap/map';
@ -43,11 +47,11 @@ export default {
computed: { computed: {
form() { form() {
const form = { const form = {
labelWidth: '100px', labelWidth: '150px',
items: [ items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true}, { prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList, disabled: this.disabled}, { prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled: this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true} { prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
] ]
}; };
return form; return form;
@ -55,13 +59,15 @@ export default {
rules() { rules() {
const crules = { const crules = {
name: [ name: [
{ required: true, message: '请输入剧本', trigger: 'blur' } { required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'change' }
], ],
mapId: [ mapId: [
{ required: true, message: '请选择地图', trigger: 'change' } { required: true, message: '请选择地图', trigger: 'change' }
], ],
description: [ description: [
{ required: true, message: '请输入剧本描述', trigger: 'blur' } { required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'change' }
] ]
}; };
return crules; return crules;
@ -90,7 +96,7 @@ export default {
this.formModel=data; this.formModel=data;
this.formModel.id=scriptId; this.formModel.id=scriptId;
}).catch(error => { }).catch(error => {
this.$message.error('获取剧本信息失败:' + error.message); this.$message.error(this.$t('scriptRecord.getScriptFail')+':' + error.message);
}); });
} }
}, },
@ -101,31 +107,31 @@ export default {
this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query }); this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
}); });
}, },
modifyScript() { modifyScript() {
const data=this.formModel; const data=this.formModel;
updateQuest(data.id, data).then(resp => { updateQuest(data.id, data).then(resp => {
this.$emit('refresh'); this.$emit('refresh');
this.$message.success('修改剧本成功'); this.$message.success(this.$t('scriptRecord.modifyScriptSuccess'));
}).catch(error => { }).catch(error => {
this.$messageBox(`修改剧本失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyScriptFail')}: ${error.message}`);
}); });
}, },
deleteScript() { deleteScript() {
const data=this.formModel; const data=this.formModel;
this.$confirm('此操作将删除此剧本, 是否继续?', '提示', { this.$confirm(this.$t('scriptRecord.deleteScriptTip'), this.$t('scriptRecord.operateTip'), {
confirmButtonText: '确定', confirmButtonText: this.$t('scriptRecord.confirmButtonText'),
cancelButtonText: '取消', cancelButtonText: this.$t('scriptRecord.cancelButtonText'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteQuest(data.id).then(response => { deleteQuest(data.id).then(response => {
this.$message.success('删除成功'); this.$message.success(this.$t('scriptRecord.deleteScriptSucess'));
this.$emit('refresh'); this.$emit('refresh');
this.$router.push({ path: `${UrlConfig.script.prefix}` }); this.$router.push({ path: `${UrlConfig.script.prefix}` });
}).catch(() => { }).catch(() => {
this.$messageBox('删除失败'); this.$messageBox(this.$t('scriptRecord.deleteScriptFail'));
}); });
}).catch(() => { }); }).catch(() => { });
} }

View File

@ -4,7 +4,7 @@
<el-container class="actionPane"> <el-container class="actionPane">
<el-header style="height:50px;"> <el-header style="height:50px;">
<el-row class="actionList"> <el-row class="actionList">
<span class="titleStyle">剧本编制</span> <span class="titleStyle">{{ $t('scriptRecord.scriptRecordTitle') }}</span>
</el-row> </el-row>
</el-header> </el-header>
<el-main style="padding-top:10px;padding-bottom:10px;"> <el-main style="padding-top:10px;padding-bottom:10px;">
@ -14,9 +14,9 @@
</el-main> </el-main>
<el-footer> <el-footer>
<el-button-group class="button-group"> <el-button-group class="button-group">
<el-button v-if="isPause" type="primary" :disabled="executeDisabled" @click="pauseScript">暂停</el-button> <el-button v-if="isPause" type="primary" :disabled="executeDisabled" @click="pauseScript">{{ $t('scriptRecord.drivingPause') }}</el-button>
<el-button v-else type="primary" :disabled="executeDisabled" @click="executePlayScript">恢复并执行</el-button> <el-button v-else type="primary" :disabled="executeDisabled" @click="executePlayScript">{{ $t('scriptRecord.recoverAndExecute') }}</el-button>
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button> <el-button type="danger" @click="dumpScenesData">{{ $t('scriptRecord.resetScript') }}</el-button>
<el-button type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button> <el-button type="primary" :disabled="backDisabled" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
<el-button type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button> <el-button type="success" :loading="isSavingScript" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
<!-- 暂停 --> <!-- 暂停 -->
@ -24,6 +24,10 @@
</el-footer> </el-footer>
</el-container> </el-container>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
@ -48,7 +52,7 @@ export default {
}, },
data() { data() {
return { return {
title: '剧本编制', title: this.$t('scriptRecord.scriptRecordTitle'),
isShrink: false, isShrink: false,
mapLocation: {}, mapLocation: {},
autoSaveScript: null, autoSaveScript: null,
@ -99,14 +103,14 @@ export default {
scriptPause(this.group).then(resp => { scriptPause(this.group).then(resp => {
this.$store.dispatch('scriptRecord/updateSimulationPause', true); this.$store.dispatch('scriptRecord/updateSimulationPause', true);
}).catch(() => { }).catch(() => {
this.$messageBox('暂停失败!'); this.$messageBox(this.$t('scriptRecord.pauseFail'));
}); });
}, },
executePlayScript() { executePlayScript() {
executeScript(this.group).then(resp => { executeScript(this.group).then(resp => {
this.$store.dispatch('scriptRecord/updateSimulationPause', false); this.$store.dispatch('scriptRecord/updateSimulationPause', false);
}).catch(() => { }).catch(() => {
this.$messageBox('恢复失败!'); this.$messageBox(this.$t('scriptRecord.recoverFail'));
}); });
}, },
saveScenesStage() { saveScenesStage() {
@ -116,23 +120,23 @@ export default {
saveScriptScenes(this.group).then(resp => { saveScriptScenes(this.group).then(resp => {
updateMapLocation(group, dataZoom).then(response=>{ updateMapLocation(group, dataZoom).then(response=>{
this.$store.dispatch('scriptRecord/updateBgSet', true); this.$store.dispatch('scriptRecord/updateBgSet', true);
this.$message.success('保存背景成功'); this.$message.success(this.$t('scriptRecord.saveBackgroundSuceess'));
}).catch(error => { }).catch(error => {
this.$messageBox(`更新定位失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.updateLocationFail')}: ${error.message}`);
}); });
}).catch(() => { }).catch(() => {
this.$messageBox('保存背景失败!'); this.$messageBox(this.$t('scriptRecord.saveBackgroundFail'));
}); });
}, },
saveScenesData() { saveScenesData() {
this.isSavingScript=true; this.isSavingScript=true;
saveScriptData(this.group).then(resp => { saveScriptData(this.group).then(resp => {
this.$message.success('保存数据成功'); this.$message.success(this.$t('scriptRecord.saveDataSucess'));
this.isSavingScript=false; this.isSavingScript=false;
this.initAutoSaveScript(); this.initAutoSaveScript();
}).catch(error => { }).catch(error => {
this.$messageBox(`保存数据失败!: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.saveDataFail')}: ${error.message}`);
this.isSavingScript=false; this.isSavingScript=false;
if (error.code === 40004 || error.code === 40005 || error.code === 40003) { if (error.code === 40004 || error.code === 40005 || error.code === 40003) {
this.clearAutoSave(); this.clearAutoSave();
@ -144,9 +148,9 @@ export default {
dumpScenesData() { dumpScenesData() {
this.clearAutoSave(); this.clearAutoSave();
const group=this.group; const group=this.group;
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', { this.$confirm(this.$t('scriptRecord.clearDataTip'), this.$t('scriptRecord.operateTip'), {
confirmButtonText: '确定', confirmButtonText: this.$t('scriptRecord.confirmButtonText'),
cancelButtonText: '取消', cancelButtonText: this.$t('scriptRecord.cancelButtonText'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
dumpScriptData(group).then(resp => { dumpScriptData(group).then(resp => {
@ -157,9 +161,9 @@ export default {
this.$refs['addAction'].initData(); this.$refs['addAction'].initData();
this.initAutoSaveScript(); this.initAutoSaveScript();
this.$store.dispatch('scriptRecord/updateBgSet', false); this.$store.dispatch('scriptRecord/updateBgSet', false);
this.$message.success('重置数据成功'); this.$message.success(this.$t('scriptRecord.resetDataSuccess'));
}).catch(() => { }).catch(() => {
this.$messageBox('重置数据失败!'); this.$messageBox(this.$t('scriptRecord.resetDataFail'));
}); });
}).catch(() => { }).catch(() => {
this.initAutoSaveScript(); this.initAutoSaveScript();

View File

@ -2,13 +2,13 @@
<el-card :style="{height: height+'px'}"> <el-card :style="{height: height+'px'}">
<div class="home-box"> <div class="home-box">
<el-card class="box-card"> <el-card class="box-card">
<div id="scriptTitle">创建剧本</div> <div id="scriptTitle">{{ $t('scriptRecord.createScript') }}</div>
<div id="sciptForm"> <div id="sciptForm">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div> </div>
<div id="btnList"> <div id="btnList">
<span slot="footer" class="btn-footer"> <span slot="footer" class="btn-footer">
<el-button type="primary" :loading="loading" @click="doCreate"> </el-button> <el-button type="primary" :loading="loading" @click="doCreate">{{$t('scriptRecord.submit')}}</el-button>
</span> </span>
</div> </div>
</el-card> </el-card>
@ -40,11 +40,11 @@ export default {
computed: { computed: {
form() { form() {
const form = { const form = {
labelWidth: '100px', labelWidth: '150px',
items: [ items: [
{ prop: 'name', label: '剧本名称', type: 'text', required: true}, { prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
{ prop: 'mapId', label: '所属地图', type: 'select', required: true, options: this.mapList, disabled: this.disabled}, { prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled: this.disabled},
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true} { prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
] ]
}; };
return form; return form;
@ -52,15 +52,17 @@ export default {
rules() { rules() {
const crules = { const crules = {
name: [ name: [
{ required: true, message: '请输入剧本名称', trigger: 'blur' }, { required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'blur' },
{ required: true, message: '请输入剧本名称', trigger: 'change' } { required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'change' }
], ],
mapId: [ mapId: [
{ required: true, message: '请选择所属地图', trigger: 'change' } { required: true, message: '请选择所属地图', trigger: 'change' }
], ],
description: [ description: [
{ required: true, message: '请输入剧本描述', trigger: 'blur' }, { required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'blur' },
{ required: true, message: '请输入剧本描述', trigger: 'change' } { required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'change' }
] ]
}; };
return crules; return crules;
@ -94,13 +96,15 @@ export default {
createQuest(data).then(resp => { createQuest(data).then(resp => {
const data={mapId: self.formModel.mapId, scriptId: resp.data}; const data={mapId: self.formModel.mapId, scriptId: resp.data};
this.$emit('refresh', data); this.$emit('refresh', data);
this.$message.success('创建剧本成功'); this.$message.success(this.$t('scriptRecord.createScriptSuccess'));
this.formModel={}; this.formModel={};
this.loading=false; this.loading=false;
this.$router.push({ path: `${UrlConfig.script.detail}/${resp.data}` }); this.$router.push({ path: `${UrlConfig.script.detail}/${resp.data}` });
}).catch(error => { }).catch(error => {
this.loading=false; this.loading=false;
this.$messageBox(`创建剧本失败: ${error.message}`); this.$messageBox(`${$t('scriptRecord.createScriptFail')}${error.message}`);
}); });
}); });
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<el-scrollbar class="addScript" :style="{width:size.width+'px',height:size.height+'px'}" ref="elActionScrollbar" wrapClass="scrollbar-wrapper"> <el-scrollbar class="addScript" :style="{width:size.width+'px',height:size.height+'px'}" ref="elActionScrollbar" wrapClass="scrollbar-wrapper">
<el-card class="conversitionCard"> <el-card class="conversitionCard">
<div class="addConversition">添加对话</div> <div class="addConversition">{{$t('scriptRecord.addConversition')}}</div>
<el-form size="mini" :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="conversitionInfo" label-position="right"> <el-form size="mini" :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="conversitionInfo" label-position="right">
<!-- <el-form-item label="动作类型" class="conditionVO" prop="actionVO.type" > <!-- <el-form-item label="动作类型" class="conditionVO" prop="actionVO.type" >
<el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType" :disabled="deviceTypeReadOnly||isPause"> <el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType" :disabled="deviceTypeReadOnly||isPause">
@ -10,13 +10,13 @@
</el-form-item> --> </el-form-item> -->
<div> <div>
<div class="itemGroup"> <div class="itemGroup">
<el-form-item label="讲述者" class="conditionVO" prop="actionVO.memberId"> <el-form-item :label="$t('scriptRecord.narrator')" class="conditionVO" prop="actionVO.memberId">
<el-select v-model="modalData.actionVO.memberId" placeholder="请选择讲述者" :disabled="isPause&&isNotModify"> <el-select v-model="modalData.actionVO.memberId" :placeholder="$t('scriptRecord.narratorRules')" :disabled="isPause&&isNotModify">
<el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option> <el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="接收者" class="conditionVO" prop="actionVO.targetId"> <el-form-item :label="$t('scriptRecord.receiver')" class="conditionVO" prop="actionVO.targetId">
<el-select v-model="modalData.actionVO.targetId" placeholder="请选择接收者" :disabled="isPause&&isNotModify"> <el-select v-model="modalData.actionVO.targetId" :placeholder="$t('scriptRecord.receiverRules')" :disabled="isPause&&isNotModify">
<el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option> <el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -27,8 +27,7 @@
<div class="changeBottom"></div> <div class="changeBottom"></div>
</div> </div>
</div> </div>
<el-form-item :label="$t('scriptRecord.conversitionContent')" class="conditionVO" prop="actionVO.reply">
<el-form-item label="内容" class="conditionVO" prop="actionVO.reply">
<el-input v-model="modalData.actionVO.reply" type="textarea" class="textareaStyle" rows="3" :disabled="isPause&&isNotModify"></el-input> <el-input v-model="modalData.actionVO.reply" type="textarea" class="textareaStyle" rows="3" :disabled="isPause&&isNotModify"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -37,30 +36,30 @@
</el-form> </el-form>
</el-card> </el-card>
<el-card class="commandCard"> <el-card class="commandCard">
<div class="addCommand">添加指令</div> <div class="addCommand">{{$t('scriptRecord.addCommand')}}</div>
<el-form size="mini" :model="commandData" ref="commandData" :rules="commandRules" label-width="100px" class="actionInfo" label-position="right"> <el-form size="mini" :model="commandData" ref="commandData" :rules="commandRules" label-width="120px" class="actionInfo" label-position="right">
<el-form-item label="执行者" class="conditionVO" prop="action.memberId"> <el-form-item :label="$t('scriptRecord.executor')" class="conditionVO" prop="action.memberId">
<el-select v-model="commandData.action.memberId" placeholder="请选择执行者" :disabled="isPause" @change="changeRole"> <el-select v-model="commandData.action.memberId" :placeholder="$t('scriptRecord.executorRules')" :disabled="isPause" @change="changeRole">
<el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option> <el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="执行指令" class="conditionVO" prop="action.deviceCommand"> <el-form-item :label="$t('scriptRecord.executeCommand')" class="conditionVO" prop="action.deviceCommand">
<el-select v-model="commandData.action.deviceCommand " placeholder="请选择执行指令" @change="changeCommand" class="inputStyle" :disabled="isPause"> <el-select v-model="commandData.action.deviceCommand " :placeholder="$t('scriptRecord.executeCommandRules')" @change="changeCommand" class="inputStyle" :disabled="isPause">
<el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option> <el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="起始站台" class="conditionVO" v-if="isJinLu" prop="param.startStation"> <el-form-item :label="$t('scriptRecord.startStation')" class="conditionVO" v-if="isJinLu" prop="param.startStation">
<el-select v-model="commandData.param.startStation " placeholder="请选择起始站台" class="inputStyle" :disabled="isPause"> <el-select v-model="commandData.param.startStation " :placeholder="$t('scriptRecord.startStationRules')" class="inputStyle" :disabled="isPause">
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option> <el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="终点站台" class="conditionVO" v-if="isJinLu" prop="param.endStation"> <el-form-item :label="$t('scriptRecord.endStation')" class="conditionVO" v-if="isJinLu" prop="param.endStation">
<el-select v-model="commandData.param.endStation " placeholder="请选择终点站台" class="inputStyle" :disabled="isPause"> <el-select v-model="commandData.param.endStation " :placeholder="$t('scriptRecord.endStationRules')" class="inputStyle" :disabled="isPause">
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option> <el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="addCommandAction('commandData')" :disabled="isPause" :loading="adding">添加指令</el-button> <el-button type="primary" @click="addCommandAction('commandData')" :disabled="isPause" :loading="adding">{{$t('scriptRecord.addCommandButton')}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -104,7 +103,7 @@
}, },
data() { data() {
return { return {
buttonName:"添加对话", buttonName:this.$t('scriptRecord.addConversitionButton'),
operateType:"add", operateType:"add",
modalData:{ modalData:{
actionVO:{ actionVO:{
@ -139,31 +138,31 @@
rules:{ rules:{
actionVO:{ actionVO:{
memberId:[ memberId:[
{ required: true, message: '请选择主体角色', trigger: 'change' } { required: true, message: this.$t('scriptRecord.narratorRules'), trigger: 'change' }
], ],
reply:[ reply:[
{ required: true, message: '请输入内容', trigger: 'blur' } { required: true, message: this.$t('scriptRecord.conversitionContentRules'), trigger: 'blur' }
], ],
targetId:[ targetId:[
{ required: true, message: '请选择目标角色', trigger: 'change' } { required: true, message: this.$t('scriptRecord.receiverRules'), trigger: 'change' }
] ]
}, },
}, },
commandRules:{ commandRules:{
action:{ action:{
memberId:[ memberId:[
{ required: true, message: '请选择主体角色', trigger: 'change' } { required: true, message: this.$t('scriptRecord.executorRules'), trigger: 'change' }
], ],
deviceCommand:[ deviceCommand:[
{ required: true, message: '请选择执行指令', trigger: 'change' } { required: true, message: this.$t('scriptRecord.executeCommandRules'), trigger: 'change' }
] ]
}, },
param:{ param:{
startStation:[ startStation:[
{ required: true, message: '请选择起始站台', trigger: 'change' } { required: true, message: this.$t('scriptRecord.startStationRules'), trigger: 'change' }
], ],
endStation:[ endStation:[
{ required: true, message: '请选择终点站台', trigger: 'change' } { required: true, message: this.$t('scriptRecord.endStationRules'), trigger: 'change' }
] ]
} }
} }
@ -174,7 +173,7 @@
}, },
methods:{ methods:{
initData(){ initData(){
this.buttonName="添加对话"; this.buttonName=this.$t('scriptRecord.addConversitionButton');
this.operateType="add"; this.operateType="add";
getScriptPlayMember(this.group).then(resp => { getScriptPlayMember(this.group).then(resp => {
let roleTypeList=ConstConfig.ConstSelect.roleType; let roleTypeList=ConstConfig.ConstSelect.roleType;
@ -224,14 +223,14 @@
this.adding=true; this.adding=true;
addScriptAction(group,data).then(response=>{ addScriptAction(group,data).then(response=>{
this.adding=false; this.adding=false;
this.$message.success('添加指令成功'); this.$message.success(this.$t('scriptRecord.addCommandSucess'));
this.$emit('create'); this.$emit('create');
// this.$emit('create',[this.commandData.action.memberId]); // this.$emit('create',[this.commandData.action.memberId]);
// this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]); // this.$parent.$parent.$refs['addRole'].resetData([this.commandData.action.memberId]);
// this.initCommandActionData(); // this.initCommandActionData();
}).catch(error => { }).catch(error => {
this.adding=false; this.adding=false;
this.$messageBox(`添加指令失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.addCommandFail')}: ${error.message}`);
}); });
} }
else { else {
@ -252,14 +251,14 @@
{ {
addScriptAction(group,data).then(response=>{ addScriptAction(group,data).then(response=>{
this.modifying=false; this.modifying=false;
this.$message.success('添加对话成功'); this.$message.success(this.$t('scriptRecord.addConversitionSuccess'));
this.$emit('create'); this.$emit('create');
// [this.modalData.actionVO.memberId] // [this.modalData.actionVO.memberId]
// this.initActionData(); // this.initActionData();
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.actionVO.memberId,this.modalData.actionVO.targetId]); // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.actionVO.memberId,this.modalData.actionVO.targetId]);
}).catch(error => { }).catch(error => {
this.modifying=false; this.modifying=false;
this.$messageBox(`添加对话失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.addConversitionFail')}: ${error.message}`);
}); });
} }
else else
@ -269,15 +268,15 @@
this.modifying=false; this.modifying=false;
this.isNotModify=true; this.isNotModify=true;
this.$emit("setDisabled",this.isNotModify); this.$emit("setDisabled",this.isNotModify);
this.buttonName="添加对话"; this.buttonName=this.$t('scriptRecord.addConversitionButton');
this.operateType="add"; this.operateType="add";
this.$message.success('修改对话成功'); this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess'));
this.$emit('create'); this.$emit('create');
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]);
this.initActionData(); this.initActionData();
}).catch(error => { }).catch(error => {
this.modifying=false; this.modifying=false;
this.$messageBox(`修改对话失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
}); });
} }
} }
@ -344,7 +343,7 @@
doShow(data){ doShow(data){
if(data) if(data)
{ {
this.buttonName="修改对话"; this.buttonName=this.$t('scriptRecord.modifyConversition');
this.operateType="modify"; this.operateType="modify";
this.clearValidate(); this.clearValidate();
this.isNotModify=false; this.isNotModify=false;

View File

@ -1,11 +1,11 @@
<template> <template>
<el-card class="scriptTop"> <el-card class="scriptTop">
<el-transfer v-model="selectRoleData" :data="allRoleData" class="script-player-choose" :titles="['所有角色', '演员角色']" @change="handleChange"> <el-transfer v-model="selectRoleData" :data="allRoleData" class="script-player-choose" :titles="[$t('scriptRecord.allRoles'), $t('scriptRecord.actors')]" @change="handleChange">
<span slot-scope="{option}"> <span slot-scope="{option}">
<span>{{option.role+(option.name==undefined?'':option.name)}}</span> <span>{{option.role+(option.name==undefined?'':option.name)}}</span>
<el-radio-group v-model="option.gender" size="mini" class="sexGroup" @change="changeSex($event,option.key)"> <el-radio-group v-model="option.gender" size="mini" class="sexGroup" @change="changeSex($event,option.key)">
<el-radio-button label="Male"></el-radio-button> <el-radio-button label="Male">{{$t('scriptRecord.roleSexMale')}}</el-radio-button>
<el-radio-button label="Female"></el-radio-button> <el-radio-button label="Female">{{$t('scriptRecord.roleSexFemale')}}</el-radio-button>
</el-radio-group> </el-radio-group>
</span> </span>
</el-transfer> </el-transfer>
@ -27,7 +27,7 @@
return { return {
allRoleData:[], allRoleData:[],
selectRoleData:[], selectRoleData:[],
sexGroup:"男", sexGroup:this.$t('scriptRecord.roleSexMale'),
} }
}, },
mounted(){ mounted(){
@ -75,11 +75,11 @@
let group=this.$props.group; let group=this.$props.group;
let data=movedKeys; let data=movedKeys;
selectScriptMembers(group,data).then(response=>{ selectScriptMembers(group,data).then(response=>{
this.$message.success('选择剧本角色成功'); this.$message.success(this.$t('scriptRecord.selectScriptActorSuccess'));
this.$emit("refresh"); this.$emit("refresh");
}) })
.catch(error => { .catch(error => {
this.$messageBox(`选择剧本角色失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.selectScriptActorFail')}: ${error.message}`);
return false; return false;
}); });
break; break;
@ -89,10 +89,10 @@
let data=movedKeys; let data=movedKeys;
cancleScriptMembers(group,data).then(response=>{ cancleScriptMembers(group,data).then(response=>{
this.$emit("refresh"); this.$emit("refresh");
this.$message.success('取消剧本角色成功'); this.$message.success(this.$t('scriptRecord.cancleScriptActorSuccess'));
}) })
.catch(error => { .catch(error => {
this.$messageBox(`取消剧本角色失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.cancleScriptActorFail')}: ${error.message}`);
this.initData(); this.initData();
}); });
} }
@ -117,10 +117,10 @@
let group=this.$props.group; let group=this.$props.group;
let data={"gender":event}; let data={"gender":event};
modifyScriptMemberSex(group,id,data).then(response=>{ modifyScriptMemberSex(group,id,data).then(response=>{
this.$message.success('修改剧本成员性别成功'); this.$message.success(this.$t('scriptRecord.modifyScriptActorSexSuccess'));
}) })
.catch(error => { .catch(error => {
this.$messageBox(`修改剧本成员性别失败: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyScriptActorSexFail')}: ${error.message}`);
}); });
} }
} }

View File

@ -21,7 +21,7 @@
</span> </span>
</div> </div>
<div class="btnGroup"> <div class="btnGroup">
<el-button type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)" v-if="actionInfo.visible">修改</el-button> <el-button type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)" v-if="actionInfo.visible">{{$t('scriptRecord.modifyConversitionButton')}}</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> --> <!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div> </div>
</el-card> </el-card>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
static/texture/msgfo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 16 KiB

BIN
static/texture/msgto.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB