# Conflicts:
#	src/jmap/theme/chengdu_03/planSchedule/menuBar.vue
This commit is contained in:
zyy 2019-10-30 18:25:50 +08:00
commit 75f9cf8a70
73 changed files with 8888 additions and 9426 deletions

View File

@ -2,111 +2,103 @@ import request from '@/utils/request';
/** 获取课程树*/ /** 获取课程树*/
export function getLessonTree(skinCode) { export function getLessonTree(skinCode) {
return request({ return request({
url: `/api/lessonDraft/${skinCode}/tree`, url: `/api/lessonDraft/${skinCode}/tree`,
method: 'get' method: 'get'
}); });
} }
/** 获取课程详细内容*/ /** 获取课程详细内容*/
export function getLessonDetail(data) { export function getLessonDetail(data) {
return request({ return request({
url: `/api/lessonDraft/${data.id}`, url: `/api/lessonDraft/${data.id}`,
method: 'get' method: 'get'
}); });
} }
/** 创建课程*/ /** 创建课程*/
export function createLesson(data) { export function createLesson(data) {
return request({ return request({
url: '/api/lessonDraft', url: '/api/lessonDraft',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 从发布课程创建*/ /** 从发布课程创建*/
export function createLessonFromPublish(data) { export function createLessonFromPublish(data) {
return request({ return request({
url: '/api/lessonDraft/createForm', url: '/api/lessonDraft/createForm',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 更新课程*/ /** 更新课程*/
export function updateLesson(data) { export function updateLesson(data) {
return request({ return request({
url: `/api/lessonDraft/${data.id}`, url: `/api/lessonDraft/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 删除课程*/ /** 删除课程*/
export function delLesson(data) { export function delLesson(data) {
return request({ return request({
url: `/api/lessonDraft/${data.id}`, url: `/api/lessonDraft/${data.id}`,
method: 'delete', method: 'delete',
data: data data: data
}); });
} }
/** 创建课程章节*/ /** 创建课程章节*/
export function createLessonChapter(data) { export function createLessonChapter(data) {
return request({ return request({
url: `/api/lessonDraft/${data.lessonId}/chapter`, url: `/api/lessonDraft/${data.lessonId}/chapter`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 更新课程章节*/ /** 更新课程章节*/
export function updateLessonChapter(data) { export function updateLessonChapter(data) {
return request({ return request({
url: `/api/lessonDraft/chapter/${data.id}`, url: `/api/lessonDraft/chapter/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 创建课程章节详细内容*/ /** 创建课程章节详细内容*/
export function getLessonChapterDetail(data) { export function getLessonChapterDetail(data) {
return request({ return request({
url: `/api/lessonDraft/chapter/${data.id}`, url: `/api/lessonDraft/chapter/${data.id}`,
method: 'get' method: 'get'
}); });
} }
/** 发布课程*/ /** 发布课程*/
export function publishLesson(data) { export function publishLesson(data) {
return request({ return request({
url: `/api/lessonDraft/${data.id}/publish`, url: `/api/lessonDraft/${data.id}/publish`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 课程章节拖拽排序*/ /** 课程章节拖拽排序*/
export function dragSortLessonChapter(data) { export function dragSortLessonChapter(data) {
return request({ return request({
url: '/api/lessonDraft/dragSort', url: '/api/lessonDraft/dragSort',
method: 'put', method: 'put',
data: data data: data
}); });
}
/** 根据lessonId获取课程名称*/
export function getLessonNameByMapIdAndLessonId(model) {
return request({
url: `/api/lessonDraft/${model.mapId}/${model.lessonId}`,
method: 'get'
});
} }
export function getLessonDrftList(params) { export function getLessonDrftList(params) {
return request({ return request({
url: `/api/lessonDraft`, url: `/api/lessonDraft`,
method: 'get', method: 'get',
params: params params: params
}); });
} }

View File

@ -17,22 +17,6 @@ export function getPublishMapListBySkinCode(skinCode) {
}); });
} }
/** 根据皮肤获取地图版本信息*/
export function getPublishMapVersion(skinCode) {
return request({
url: `/api/map/skin/${skinCode}/version`,
method: 'get'
});
}
/** 根据皮肤获取发布地图详细内容*/
export function getPublishMapDetail(skinCode) {
return request({
url: `/api/map/skin/${skinCode}/details`,
method: 'get'
});
}
/** 根据地图id获取地图版本信息*/ /** 根据地图id获取地图版本信息*/
export function getPublishMapVersionById(id) { export function getPublishMapVersionById(id) {
return request({ return request({
@ -49,14 +33,6 @@ export function getPublishMapDetailById(id) {
}); });
} }
/** 获取发布地图列车列表*/
export function getPublishTrainList(skinCode) {
return request({
url: `/api/map/${skinCode}/train`,
method: 'get'
});
}
/** 获取发布地图列表*/ /** 获取发布地图列表*/
export function listPublishMap(params) { export function listPublishMap(params) {
return request({ return request({

View File

@ -62,9 +62,9 @@ export function deleteTrainingCategory(data) {
/** /**
* 获取地图下的产品列表 * 获取地图下的产品列表
*/ */
export function getCommodityMapProduct(skinCode) { export function getCommodityMapProduct(mapId) {
return request({ return request({
url: `/api/mapPrd/${skinCode}/list`, url: `/api/mapPrd/${mapId}/list`,
method: 'get' method: 'get'
}); });
} }

View File

@ -2,68 +2,68 @@ import request from '@/utils/request';
/** 分页查询皮肤*/ /** 分页查询皮肤*/
export function getSkinCodePageList(params) { export function getSkinCodePageList(params) {
return request({ return request({
url: `/api/mapSkin`, url: `/api/realLine`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 添加皮肤*/ /** 添加皮肤*/
export function addSkinCode(data) { export function addSkinCode(data) {
return request({ return request({
url: `/api/mapSkin`, url: `/api/realLine`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 删除皮肤*/ /** 删除皮肤*/
export function delSkinCode(id) { export function delSkinCode(id) {
return request({ return request({
url: `/api/mapSkin/${id}`, url: `/api/realLine/${id}`,
method: 'delete' method: 'delete'
}); });
} }
/** 查询地图皮肤 */ /** 查询地图皮肤 */
export function querySkinCode(id) { export function querySkinCode(id) {
return request({ return request({
url: `/api/mapSkin/${id}`, url: `/api/realLine/${id}`,
method: 'get' method: 'get'
}); });
} }
/** 修改地图皮肤*/ /** 修改地图皮肤*/
export function updateSkinCode(data) { export function updateSkinCode(data) {
return request({ return request({
url: `/api/mapSkin/${data.id}`, url: `/api/realLine/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 通过皮肤Code更新地图皮肤*/ /** 通过皮肤Code更新地图皮肤*/
export function updateSkinCodeByCode(data) { export function updateSkinCodeByCode(data) {
return request({ return request({
url: `/api/mapSkin/${data.code}/update`, url: `/api/realLine/${data.code}/update`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 查询皮肤是否存在*/ /** 查询皮肤是否存在*/
export function querySkinCodeExistByCode(code) { export function querySkinCodeExistByCode(code) {
return request({ return request({
url: `/api/mapSkin/${code}/exist`, url: `/api/realLine/${code}/exist`,
method: 'get' method: 'get'
}); });
} }
/** 获取皮肤列表*/ /** 获取皮肤列表*/
export function getSkinCodeList() { export function getSkinCodeList() {
return request({ return request({
url: `/api/mapSkin/list`, url: `/api/realLine/list`,
method: 'get' method: 'get'
}); });
} }

View File

@ -5,131 +5,131 @@ import request from '@/utils/request';
* 获取实训规则列表 * 获取实训规则列表
*/ */
export function getTrainingRulesList(params) { export function getTrainingRulesList(params) {
return request({ return request({
url: `/api/operate`, url: `/api/operate`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** /**
* 生成考试定义规则 * 生成考试定义规则
*/ */
export function postTrainingRulesData(data) { export function postTrainingRulesData(data) {
return request({ return request({
url: `/api/operate`, url: `/api/operate`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** /**
* 修改考试定义规则 * 修改考试定义规则
*/ */
export function putTrainingRulesData(data) { export function putTrainingRulesData(data) {
return request({ return request({
url: `/api/operate/${data.id}`, url: `/api/operate/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** /**
* 删除考试定义规则 * 删除考试定义规则
*/ */
export function deleteTrainingRulesData(id) { export function deleteTrainingRulesData(id) {
return request({ return request({
url: `/api/operate/${id}`, url: `/api/operate/${id}`,
method: 'DELETE' method: 'DELETE'
}); });
} }
/** /**
* 获取实训规则步骤详情列表 * 获取实训规则步骤详情列表
*/ */
export function getOperateStepDataList(id, params) { export function getOperateStepDataList(id, params) {
return request({ return request({
url: `/api/operate/${id}/step`, url: `/api/operate/${id}/step`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** /**
* 创建操作步骤 * 创建操作步骤
*/ */
export function postOperateStepData(params) { export function postOperateStepData(params) {
return request({ return request({
url: `/api/operate/${params.definitionId}/step`, url: `/api/operate/${params.definitionId}/step`,
method: 'post', method: 'post',
data: params data: params
}); });
} }
/** /**
* 修改操作步骤 * 修改操作步骤
*/ */
export function putOperateStepData(params) { export function putOperateStepData(params) {
return request({ return request({
url: `/api/operate/step/${params.id}`, url: `/api/operate/step/${params.id}`,
method: 'put', method: 'put',
data: params data: params
}); });
} }
/** /**
* 修改操作步骤 * 修改操作步骤
*/ */
export function deleteOperateStepData(id) { export function deleteOperateStepData(id) {
return request({ return request({
url: `/api/operate/step/${id}`, url: `/api/operate/step/${id}`,
method: 'delete' method: 'delete'
}); });
} }
/** /**
* 批量生成操作列表 * 批量生成操作列表
*/ */
export function addTrainingRulesList(skinCode, data) { export function addTrainingRulesList(skinCode, data) {
return request({ return request({
url: `/api/operate/${skinCode}/generate`, url: `/api/operate/${skinCode}/generate`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** /**
* 获取操作占位列表 * 获取操作占位列表
*/ */
export function getPlaceholderList(data) { export function getPlaceholderList(data) {
return request({ return request({
url: `/api/operate/placeholder`, url: `/api/operate/placeholder`,
method: 'get', method: 'get',
params: { params: {
trainingType: data.trainingType, trainingType: data.trainingType,
skinCode: data.skinCode skinCode: data.skinCode
} }
}); });
} }
/** /**
* 获取产品下实训操作列表 * 获取产品下实训操作列表
*/ */
export function getOperateTrainingList(data) { export function getOperateTrainingList(data) {
return request({ return request({
url: `/api/operate/type`, url: `/api/operate/type`,
method: 'get', method: 'get',
params: { params: {
productType: data.productType, productType: data.productType,
skinCode: data.skinCode mapId: data.mapId
} }
}); });
} }
// 另存为 操作定义 // 另存为 操作定义
export function postOperateSaveAs(skinCode, other) { export function postOperateSaveAs(mapId, other) {
return request({ return request({
url: `/api/operate/${skinCode}/saveAs/${other}`, url: `/api/operate/${mapId}/saveAs/${other}`,
method: 'post' method: 'post'
}); });
} }

View File

@ -1,15 +1,5 @@
import request from '@/utils/request'; import request from '@/utils/request';
/**
* 获取运行图列表
*/
export function getRunPlanList() {
return request({
url: '/api/runPlan/draft/tree',
method: 'get'
});
}
/** /**
* 获取地图速度等级列表 * 获取地图速度等级列表
*/ */
@ -41,16 +31,6 @@ export function getStationList(mapId) {
}); });
} }
/**
* 通过皮肤获取运行图车站列表
*/
export function getStationListBySkinCode(skinCode) {
return request({
url: `/api/runPlan/draft/station/${skinCode}/bySkin`,
method: 'get'
});
}
/** /**
* 创建运行图 * 创建运行图
*/ */
@ -73,9 +53,9 @@ export function queryRunPlan(planId) {
} }
// 根据skinCode查询发布运行图列表 // 根据skinCode查询发布运行图列表
export function queryRunPlanList(skinCode) { export function queryRunPlanList(mapId) {
return request({ return request({
url: `/api/runPlan/template/skin/${skinCode}`, url: `/api/runPlan/template/${mapId}/list`,
method: 'get' method: 'get'
}); });
} }
@ -411,7 +391,7 @@ export function postSchedulingCommonGenerate(mapId) {
// 从加载计划创建每日计划 // 从加载计划创建每日计划
export function postRunPlanTemplate(data) { export function postRunPlanTemplate(data) {
return request({ return request({
url: `/api/runPlan/template/${data.id}/copyAs/${data.skinCode}?name=${data.name}`, url: `/api/runPlan/template/${data.id}/copyAs/${data.mapId}?name=${data.name}`,
method: 'post' method: 'post'
}); });
} }

View File

@ -1,123 +1,124 @@
export default { export default {
trainingList: 'Training list', trainingList: 'Training list',
filterPlaceholder: 'Input key for filtering', filterPlaceholder: 'Input key for filtering',
addTraining: 'Add training', addTraining: 'Add training',
editTraining: 'Edit training', editTraining: 'Edit training',
demonstration: 'Demonstration', demonstration: 'Demonstration',
hasCalcelDelete: 'Canceled deletion', hasCalcelDelete: 'Canceled deletion',
isConfirmDelete: 'Whether to confirm deletion?', isConfirmDelete: 'Whether to confirm deletion?',
trainingName: 'Training Name', trainingName: 'Training Name',
trainingType: 'Training Type', trainingType: 'Training Type',
stationList: 'Station List', stationList: 'Station List',
stepInfo: 'Step Information', stepInfo: 'Step Information',
selectMap: 'Please select the map', selectMap: 'Please select the map',
selectTraining: 'Please select the training', selectTraining: 'Please select the training',
findStationPlaceholder: 'Input keywords to inquire station', findStationPlaceholder: 'Input keywords to inquire station',
stepNo: 'Step No', stepNo: 'Step No',
deviceNumber: 'Device Number', deviceNumber: 'Device Number',
deviceType: 'Device Type', deviceType: 'Device Type',
operationType: 'Operation Type', operationType: 'Operation Type',
returnValue: 'Return Value', returnValue: 'Return Value',
tips: 'Tips', tips: 'Tips',
startRecording: 'Start Recording', startRecording: 'Start Recording',
endRecording: 'End Recording', endRecording: 'End Recording',
nextStep: 'Next Step', nextStep: 'Next Step',
selectMode: 'Mode', selectMode: 'Mode',
deleteSuccess: 'Delete successfully', deleteSuccess: 'Delete successfully',
wellDelTrainingRule: 'This action will delete the training rule. Do you want to continue?', wellDelTrainingRule: 'This action will delete the training rule. Do you want to continue?',
stepDetail: 'Detail', stepDetail: 'Detail',
generation: 'Generation', generation: 'Generation',
skinType: 'Skin Type', skinType: 'Skin Type',
saveAs: 'Save As', saveAs: 'Save As',
skinTypeFrom: 'from', skinTypeFrom: 'from',
skinTypeTo: 'to', skinTypeTo: 'to',
copyLesson: 'Duplicate course definition', copyLesson: 'Duplicate course definition',
minDuration: 'The Best Available', minDuration: 'The Best Available',
maxDuration: 'The Largest Available', maxDuration: 'The Largest Available',
trainingRemark: 'Explain', trainingRemark: 'Explain',
createOperateRule: 'Create Action Rules', createOperateRule: 'Create Action Rules',
editOperateRule: 'Edit Action Rules', editOperateRule: 'Edit Action Rules',
tipNamePlaceholderInfo: "Select the placeholder '{}' not to be deleted, otherwise the name will display incorrectly!", tipNamePlaceholderInfo: "Select the placeholder '{}' not to be deleted, otherwise the name will display incorrectly!",
tipExplainPlaceholderInfo: "Select placeholder '{}' not to be deleted, otherwise the display will be problematic!", tipExplainPlaceholderInfo: "Select placeholder '{}' not to be deleted, otherwise the display will be problematic!",
generationOperation: 'Automatic Generation Operation', generationOperation: 'Automatic Generation Operation',
wellClearOperate: 'This operation clears all operation definitions under the skin. Do you want to continue?', wellClearOperate: 'This operation clears all operation definitions under the skin. Do you want to continue?',
batchCreateSuccess: 'Batch build operation definition successful', batchCreateSuccess: 'Batch build operation definition successful',
createOperateSuccess: 'The operation definition was created successfully', createOperateSuccess: 'The operation definition was created successfully',
updateOperateSuccess: 'The update steps were successful', updateOperateSuccess: 'The update steps were successful',
wellDelOperate: 'This action will delete the training step. Do you want to continue?', wellDelOperate: 'This action will delete the training step. Do you want to continue?',
operateCode: 'Opcode', operateCode: 'Opcode',
stepReturn: 'Return Value', stepReturn: 'Return Value',
stepTips: 'Tips', stepTips: 'Tips',
createStepInfo: 'Create Step Information', createStepInfo: 'Create Step Information',
eidtStepInfo: 'Edit Step Information', eidtStepInfo: 'Edit Step Information',
product: 'Product', product: 'Product',
remarks: 'Remarks', remarks: 'Remarks',
operateSuccess: 'Operation successfully', operateSuccess: 'Operation successfully',
createChapter: 'Create chapter', createChapter: 'Create chapter',
contentSorting: 'Content sorting', contentSorting: 'Content sorting',
courseList: 'Course list', courseList: 'Course list',
countSkinCode: 'Duplicate skin cannot be the same type as the copied skin', countSkinCode: 'Duplicate skin cannot be the same type as the copied skin',
createNewCoursesFromRelease: 'Create new courses from release', createNewCoursesFromRelease: 'Create new courses from release',
courseName: 'Course name', courseName: 'Course name',
parentChapter: 'Parent chapter', parentChapter: 'Parent chapter',
chapterName: 'Chapter name', chapterName: 'Chapter name',
chapterInstructions: 'Chapter instructions', chapterInstructions: 'Chapter instructions',
associatedTraining: 'Associated training', associatedTraining: 'Associated training',
updateChapter: 'Update chapter', updateChapter: 'Update chapter',
automaticOrManual: 'Auto/Manual', automaticOrManual: 'Auto/Manual',
automatic: 'Automatic', automatic: 'Automatic',
manual: 'Manual', manual: 'Manual',
publishCourseName: 'Publish course name', publishCourseName: 'Publish course name',
draftCourseName: 'Draft course name', draftCourseName: 'Draft course name',
associatedSkin: 'Associated skin', associatedSkin: 'Associated skin',
associatedProducts: 'Associated products', associatedProducts: 'Associated products',
courseDescription: 'Course description', courseDescription: 'Course description',
editCourse: 'Edit course', editCourse: 'Edit course',
createCourse: 'Create course', createCourse: 'Create course',
courseRelease: 'Course release', courseRelease: 'Course release',
releaseAssociatedCity: 'Release associated city', releaseAssociatedCity: 'Release associated city',
releaseAssociatedMap: 'Release associated map', releaseAssociatedMap: 'Release associated map',
trainingSequence: 'Training sequence', trainingSequence: 'Training sequence',
creationTime: 'Creation time', creationTime: 'Creation time',
finishTime: 'Finish time', finishTime: 'Finish time',
createResults: 'Create results', createResults: 'Create results',
start: 'start', start: 'start',
toPerform: 'To perform', toPerform: 'To perform',
productType: 'Product type:', productType: 'Product type:',
minTime: 'Minimum time:', minTime: 'Minimum time:',
maxTime: 'Largest time:', maxTime: 'Largest time:',
trainingDescription: 'Training description:', trainingDescription: 'Training description:',
generateTraining: 'Generate training', generateTraining: 'Generate training',
updateTraining: 'Update training', updateTraining: 'Update training',
deleteTraining: 'Delete training', deleteTraining: 'Delete training',
automaticGenerationOfTraining: 'Automatic generation of training', automaticGenerationOfTraining: 'Automatic generation of training',
modifyTrainingByCategory: 'Modify training by category', modifyTrainingByCategory: 'Modify training by category',
deleteAutoGeneratedTraining: 'Delete auto-generated training', deleteAutoGeneratedTraining: 'Delete auto-generated training',
menu: 'Menu', menu: 'Menu',
turnout: 'Turnout', turnout: 'Turnout',
section: 'Section', section: 'Section',
signaler: 'Signaler', signaler: 'Signaler',
controlMode: 'Control mode', controlMode: 'Control mode',
platform: 'Platform', platform: 'Platform',
train: 'Train', train: 'Train',
station: 'Station', station: 'Station',
trainWindow: 'Train window', trainWindow: 'Train window',
editStepInfo: 'Edit step information', editStepInfo: 'Edit step information',
trainingRecord: 'Training recording', trainingRecord: 'Training recording',
lesson: 'Lesson', lesson: 'Lesson',
taskManage: 'Task manage', taskManage: 'Task manage',
trainingRule: 'Training rule', trainingRule: 'Training rule',
trainingManage: 'Training manage', trainingManage: 'Training manage',
newConstruction: 'New', newConstruction: 'New',
applicationForRelease: 'Application for release', applicationForRelease: 'Application for release',
rejectReason: 'Reason for rejection', rejectReason: 'Reason for rejection',
withdraw: 'Withdraw', withdraw: 'Withdraw',
notRelease: 'Not release', notRelease: 'Not release',
pendingReview: 'Pending review', pendingReview: 'Pending review',
published: 'Published', published: 'Published',
rejected: 'Rejected', rejected: 'Rejected',
review: 'Review', review: 'Review',
explanation: 'Explanation', explanation: 'Explanation',
courseDetails: 'Course details', courseDetails: 'Course details',
courseTree: 'Course tree:' courseTree: 'Course tree:',
mapName:'Map Name'
}; };

View File

@ -1,123 +1,124 @@
export default { export default {
trainingList: '实训列表', trainingList: '实训列表',
filterPlaceholder: '输入关键字进行过滤', filterPlaceholder: '输入关键字进行过滤',
addTraining: '添加实训', addTraining: '添加实训',
editTraining: '修改实训', editTraining: '修改实训',
demonstration: '演示', demonstration: '演示',
hasCalcelDelete: '已取消删除', hasCalcelDelete: '已取消删除',
isConfirmDelete: '是否确认删除?', isConfirmDelete: '是否确认删除?',
trainingName: '实训名称', trainingName: '实训名称',
trainingType: '实训类型', trainingType: '实训类型',
stationList: '车站列表', stationList: '车站列表',
stepInfo: '步骤信息', stepInfo: '步骤信息',
selectMap: '请选择地图', selectMap: '请选择地图',
selectTraining: '请选择实训', selectTraining: '请选择实训',
findStationPlaceholder: '输入关键字查询车站', findStationPlaceholder: '输入关键字查询车站',
stepNo: '步骤序号', stepNo: '步骤序号',
deviceNumber: '设备编号', deviceNumber: '设备编号',
deviceType: '设备类型', deviceType: '设备类型',
operationType: '操作类型', operationType: '操作类型',
returnValue: '返回值', returnValue: '返回值',
tips: '提示语', tips: '提示语',
startRecording: '开始录制', startRecording: '开始录制',
endRecording: '结束录制', endRecording: '结束录制',
nextStep: '下一步', nextStep: '下一步',
selectMode: '模式选择', selectMode: '模式选择',
deleteSuccess: '删除成功', deleteSuccess: '删除成功',
wellDelTrainingRule: '此操作将删除此实训规则, 是否继续?', wellDelTrainingRule: '此操作将删除此实训规则, 是否继续?',
stepDetail: '步骤明细', stepDetail: '步骤明细',
generation: '自动生成', generation: '自动生成',
saveAs: '另存为', saveAs: '另存为',
skinTypeFrom: '从', skinTypeFrom: '从',
skinTypeTo: '到', skinTypeTo: '到',
copyLesson: '复制课程定义', copyLesson: '复制课程定义',
skinType: '皮肤类型', skinType: '皮肤类型',
minDuration: '最佳用时', minDuration: '最佳用时',
maxDuration: '最大用时', maxDuration: '最大用时',
trainingRemark: '实训说明', trainingRemark: '实训说明',
createOperateRule: '创建操作规则', createOperateRule: '创建操作规则',
editOperateRule: '编辑操作规则', editOperateRule: '编辑操作规则',
tipNamePlaceholderInfo: '选择占位符 {} 不可删除,否则名称显示会有问题!', tipNamePlaceholderInfo: '选择占位符 {} 不可删除,否则名称显示会有问题!',
tipExplainPlaceholderInfo: '选择占位符 {} 不可删除,否则说明显示会有问题!', tipExplainPlaceholderInfo: '选择占位符 {} 不可删除,否则说明显示会有问题!',
generationOperation: '自动生成操作', generationOperation: '自动生成操作',
wellClearOperate: '此操作将清空改皮肤下所有操作定义, 是否继续?', wellClearOperate: '此操作将清空改皮肤下所有操作定义, 是否继续?',
batchCreateSuccess: '批量生成操作定义成功', batchCreateSuccess: '批量生成操作定义成功',
createOperateSuccess: '创建操作定义成功', createOperateSuccess: '创建操作定义成功',
updateOperateSuccess: '更新操作步骤成功', updateOperateSuccess: '更新操作步骤成功',
wellDelOperate: '此操作将删除此实训步骤, 是否继续?', wellDelOperate: '此操作将删除此实训步骤, 是否继续?',
operateCode: '操作码', operateCode: '操作码',
stepReturn: '步骤返回值', stepReturn: '步骤返回值',
stepTips: '步骤提示信息', stepTips: '步骤提示信息',
createStepInfo: '创建步骤信息', createStepInfo: '创建步骤信息',
editStepInfo: '编辑步骤信息', editStepInfo: '编辑步骤信息',
product: '产品', product: '产品',
remarks: '描述', remarks: '描述',
operateSuccess: '操作成功', operateSuccess: '操作成功',
createChapter: '创建章节', createChapter: '创建章节',
contentSorting: '内容排序', contentSorting: '内容排序',
courseList: '课程列表', courseList: '课程列表',
createNewCoursesFromRelease: '从发布课程新建', createNewCoursesFromRelease: '从发布课程新建',
courseName: '课程名称', courseName: '课程名称',
parentChapter: '父级章节:', parentChapter: '父级章节:',
chapterName: '章节名称:', chapterName: '章节名称:',
chapterInstructions: '章节说明:', chapterInstructions: '章节说明:',
associatedTraining: '关联实训:', associatedTraining: '关联实训:',
updateChapter: '更新章节', updateChapter: '更新章节',
automaticOrManual: '自动/人工', automaticOrManual: '自动/人工',
automatic: '自动', automatic: '自动',
manual: '人工', manual: '人工',
publishCourseName: '发布课程名称:', publishCourseName: '发布课程名称:',
draftCourseName: '草稿课程名称:', draftCourseName: '草稿课程名称:',
associatedSkin: '关联皮肤:', associatedSkin: '关联皮肤:',
associatedProducts: '关联产品:', associatedProducts: '关联产品:',
courseDescription: '课程说明', courseDescription: '课程说明',
editCourse: '编辑课程', editCourse: '编辑课程',
createCourse: '创建课程', createCourse: '创建课程',
courseRelease: '课程发布', courseRelease: '课程发布',
releaseAssociatedCity: '发布关联城市:', releaseAssociatedCity: '发布关联城市:',
releaseAssociatedMap: '发布关联地图:', releaseAssociatedMap: '发布关联地图:',
trainingSequence: '实训排序', trainingSequence: '实训排序',
creationTime: '创建时间', creationTime: '创建时间',
finishTime: '完成时间', finishTime: '完成时间',
createResults: '创建结果', createResults: '创建结果',
start: '开始', start: '开始',
toPerform: '重新执行', toPerform: '重新执行',
productType: '产品类型:', productType: '产品类型:',
minTime: '最小用时:', minTime: '最小用时:',
maxTime: '最大用时:', maxTime: '最大用时:',
trainingDescription: '实训描述:', trainingDescription: '实训描述:',
generateTraining: '生成实训', generateTraining: '生成实训',
updateTraining: '修改实训', updateTraining: '修改实训',
deleteTraining: '删除实训', deleteTraining: '删除实训',
automaticGenerationOfTraining: '自动生成实训', automaticGenerationOfTraining: '自动生成实训',
modifyTrainingByCategory: '按类别修改实训', modifyTrainingByCategory: '按类别修改实训',
deleteAutoGeneratedTraining: '删除自动生成实训', deleteAutoGeneratedTraining: '删除自动生成实训',
menu: '菜单', menu: '菜单',
turnout: '道岔', turnout: '道岔',
section: '区段', section: '区段',
signaler: '信号机', signaler: '信号机',
controlMode: '控制模式', controlMode: '控制模式',
platform: '站台', platform: '站台',
train: '列车', train: '列车',
station: '车站', station: '车站',
trainWindow: '车次窗', trainWindow: '车次窗',
countSkinCode: '复制皮肤与被复制皮肤类型不能一样', countSkinCode: '复制皮肤与被复制皮肤类型不能一样',
trainingRecord: '实训录制', trainingRecord: '实训录制',
lesson: '课程', lesson: '课程',
taskManage: '任务管理', taskManage: '任务管理',
trainingRule: '操作定义', trainingRule: '操作定义',
trainingManage: '实训管理', trainingManage: '实训管理',
newConstruction: '新建', newConstruction: '新建',
applicationForRelease: '申请发布', applicationForRelease: '申请发布',
rejectReason: '驳回原因', rejectReason: '驳回原因',
withdraw: '撤销', withdraw: '撤销',
notRelease: '未发布', notRelease: '未发布',
pendingReview: '待审核', pendingReview: '待审核',
published: '已发布', published: '已发布',
rejected: '已驳回', rejected: '已驳回',
review: '查看', review: '查看',
explanation: '驳回说明', explanation: '驳回说明',
courseDetails: '课程详情', courseDetails: '课程详情',
courseTree: '课程树:' courseTree: '课程树:',
mapName:'地图名称'
}; };

View File

@ -82,383 +82,375 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import ConfirmTrain from './childDialog/confirmTrain'; import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainControl', name: 'TrainControl',
components: { components: {
ConfirmTrain, ConfirmTrain,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainList: [], trainList: [],
formModel: { formModel: {
trainNo: '', trainNo: '',
trainNumber: '', trainNumber: '',
trainType: '01', trainType: '01',
serverNo: '', serverNo: '',
targetCode: '' targetCode: ''
}, },
rules: { rules: {
trainNumber: [ trainNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' } { required: true, message: '请选择车组号', trigger: 'change' }
], ],
trainType: [ trainType: [
{ required: true, message: '请选择一个列车类型', trigger: 'change' } { required: true, message: '请选择一个列车类型', trigger: 'change' }
], ],
serverNo: [ serverNo: [
{ required: true, message: '请输入表号', trigger: 'blur' } { required: true, message: '请输入表号', trigger: 'blur' }
], ],
trainNo: [ trainNo: [
{ required: true, message: '请输入车次号', trigger: 'blur' } { required: true, message: '请输入车次号', trigger: 'blur' }
], ],
targetCode: [ targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur' } { required: true, message: '请输入目的地号', trigger: 'blur' }
] ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false,
direction: 0 direction: 0
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
trainNoIsDisabled() { trainNoIsDisabled() {
return false; return false;
}, },
serverNoIsDisabled() { serverNoIsDisabled() {
return false; return false;
}, },
targetCodeIsDisabled() { targetCodeIsDisabled() {
return false; return false;
}, },
trainNumberIsDisabled() { trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true; return true;
} }
return false; return false;
}, },
trainTypeIsDisabled() { trainTypeIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true; return true;
} }
return false; return false;
}, },
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdTrainNumber() { domIdTrainNumber() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNumberChange.domId; return OperationEvent.Train.addTrainId.trainNumberChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNumberChange.domId; return OperationEvent.Train.editTrainId.trainNumberChange.domId;
} }
} }
return null; return null;
}, },
domIdTrainNo() { domIdTrainNo() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNoChange.domId; return OperationEvent.Train.addTrainId.trainNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId; return OperationEvent.Train.editTrainId.trainNoChange.domId;
} }
} }
return null; return null;
}, },
domIdTrainType() { domIdTrainType() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainTypeChange.domId; return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainTypeChange.domId; return OperationEvent.Train.editTrainId.trainTypeChange.domId;
} }
} }
return null; return null;
}, },
domIdServerNo() { domIdServerNo() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.serverNoChange.domId; return OperationEvent.Train.addTrainId.serverNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.serverNoChange.domId; return OperationEvent.Train.editTrainId.serverNoChange.domId;
} }
} }
return null; return null;
}, },
domIdTargetCode() { domIdTargetCode() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.targetCodeChange.domId; return OperationEvent.Train.addTrainId.targetCodeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.targetCodeChange.domId; return OperationEvent.Train.editTrainId.targetCodeChange.domId;
} }
} }
return null; return null;
}, },
domIdConfirm() { domIdConfirm() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.menu.domId; return OperationEvent.Train.addTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.menu.domId; return OperationEvent.Train.editTrainId.menu.domId;
} }
} }
return null; return null;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
title() { title() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return '添加列车识别号'; return '添加列车识别号';
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
return '修改列车识别号'; return '修改列车识别号';
} }
return ''; return '';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { },
getPublishTrainList(map.skinCode).then(resp => { doShow(operate, selected) {
this.trainList = resp.data; //
}).catch(() => { if (!this.dialogShow) {
this.$messageBox(`获取列车车组号失败`); this.operation = operate.operation;
}); }
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.formModel = { this.formModel = {
trainNumber: selected.trainNumber, trainNumber: selected.trainNumber,
trainNo: selected.trainNo, trainNo: selected.trainNo,
trainType: '01', trainType: '01',
serverNo: selected.serverNo, serverNo: selected.serverNo,
targetCode: selected.targetCode targetCode: selected.targetCode
}; };
/** 加载列车数据*/ /** 加载列车数据*/
this.loadInitData(this.map); this.loadInitData(this.map);
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange(trainNumber) { trainNumberChange(trainNumber) {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainNumber}`, val: `${trainNumber}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
trainTypeChange(trainType) { trainTypeChange(trainType) {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainType}`, val: `${trainType}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
serverNoChange(serverNo) { serverNoChange(serverNo) {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${serverNo}`, val: `${serverNo}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
trainNoChange(trainNo) { trainNoChange(trainNo) {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainNo}`, val: `${trainNo}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
targetCodeChange(targetCode) { targetCodeChange(targetCode) {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${targetCode}`, val: `${targetCode}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation; operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation; operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
commit() { commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/ /** 增加列车识别号*/
this.addTrainId(); this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
this.editTrainId(); this.editTrainId();
} }
}, },
// //
addTrainId() { addTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const model = this.formModel; const model = this.formModel;
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation, operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [`添加列车识别号:成功`], messages: [`添加列车识别号:成功`],
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}` val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
} else { } else {
return false; return false;
} }
}); });
}, },
// //
editTrainId() { editTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation, operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [`修改列车识别号:成功`], messages: [`修改列车识别号:成功`],
val: this.formModel.trainNo val: this.formModel.trainNo
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
}; };
</script> </script>

View File

@ -1,155 +1,160 @@
<template> <template>
<el-dialog class="fuzhou_01 route-create" :title="title" :visible.sync="show" width="580px" label-position="top" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> class="fuzhou_01 route-create"
<div style="padding: 10px 20px; border: 1px solid lightgray;"> v-dialogDrag
<el-form size="small" label-width="100px"> :title="title"
<el-form-item label="列车:" prop="trainCode"> :visible.sync="show"
<el-select v-model="trainCode" filterable placeholder="列车"> width="580px"
<el-option v-for="item in trainList" :key="item.code" :label="item.trainNumber" label-position="top"
:value="item.code"></el-option> :before-close="doClose"
</el-select> :z-index="2000"
</el-form-item> :modal="false"
<!-- <el-form-item label="列车车次:" prop="trainNo"> :close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<el-form size="small" label-width="100px">
<el-form-item label="列车:" prop="trainCode">
<el-select v-model="trainCode" filterable placeholder="列车">
<el-option
v-for="item in trainList"
:key="item.code"
:label="item.trainNumber"
:value="item.code"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="列车车次:" prop="trainNo">
<el-select v-model="trainNo" filterable placeholder="列车车次"> <el-select v-model="trainNo" filterable placeholder="列车车次">
<el-option v-for="no in trainNoList" :key="no" :label="no" :value="no"></el-option> <el-option v-for="no in trainNoList" :key="no" :label="no" :value="no"></el-option>
</el-select> </el-select>
<div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div> <div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div>
</el-form-item> --> </el-form-item> -->
<el-form-item label="列车方向:" prop="direction"> <el-form-item label="列车方向:" prop="direction">
<el-select v-model="direction" filterable placeholder="列车方向"> <el-select v-model="direction" filterable placeholder="列车方向">
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value"> <el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value" />
</el-option> </el-select>
</el-select> <!-- <div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div> -->
<!-- <div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div> --> </el-form-item>
</el-form-item> </el-form>
</el-form> <el-row>
<el-row> <el-col style="text-align: right;">
<el-col style="text-align: right;"> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
<el-button :id="domIdCancel" @click="cancel"> </el-button> </el-col>
</el-col> </el-row>
</el-row> </div>
</div> <notice-info ref="noticeInfo" />
<notice-info ref="noticeInfo"></notice-info> </el-dialog>
</el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
export default { export default {
name: 'RouteCreate', name: 'RouteCreate',
components: { components: {
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
trainList: [], trainList: [],
trainNoList: [], trainNoList: [],
directionList: [ directionList: [
{ {
value: '2', value: '2',
label: '上行' label: '上行'
}, },
{ {
value: '1', value: '1',
label: '下行' label: '下行'
}
],
trainCode: '',
trainNo: '',
direction: '',
selected: null
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (Object.keys(map || {}).length) {
getPublishTrainList(map.skinCode).then(response => {
this.trainList = response.data;
}).catch(error => {
this.$messageBox(`获取列车列表失败`);
})
} }
}, ],
doShow(operate, selected) { trainCode: '',
this.dialogShow = true; trainNo: '',
this.selected = selected; direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
/** 加载列车数据*/ /** 加载列车数据*/
this.loadInitData(this.map); this.loadInitData(this.map);
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, });
commit() { },
let operate = { doClose() {
send: true, this.trainCode = '';
type: MapDeviceType.Section.type, this.direction = '';
operation: OperationEvent.Section.newtrain.menu.operation, this.loading = false;
val: '' + this.direction + '::' + this.trainCode this.dialogShow = false;
} this.$store.dispatch('training/emitTipFresh');
this.loading = true; },
this.$store.dispatch('training/next', operate).then(({ valid }) => { commit() {
this.loading = false; const operate = {
if (valid) { send: true,
this.doClose(); type: MapDeviceType.Section.type,
} operation: OperationEvent.Section.newtrain.menu.operation,
}).catch(error => { val: '' + this.direction + '::' + this.trainCode
this.loading = false; };
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation,
} }
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose(); this.doClose();
}); }
} }).catch(error => {
this.doClose();
});
} }
} }
};
</script> </script>

View File

@ -1,151 +1,155 @@
<template> <template>
<el-dialog class="beijing-01__systerm route-create" :title="title" :visible.sync="show" width="580px" <el-dialog
label-position="top" :before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag
v-dialogDrag> class="beijing-01__systerm route-create"
<div style="padding: 10px 20px; border: 1px solid lightgray;"> :title="title"
<el-form size="small" label-width="100px"> :visible.sync="show"
<el-form-item label="列车:" prop="trainCode"> width="580px"
<el-select v-model="trainCode" filterable placeholder="列车"> label-position="top"
<el-option v-for="item in trainList" :key="item.code" :label="item.groupNumber" :before-close="doClose"
:value="item.code"></el-option> :z-index="2000"
</el-select> :modal="false"
</el-form-item> :close-on-click-modal="false"
<el-form-item label="列车方向:" prop="direction"> >
<el-select v-model="direction" filterable placeholder="列车方向"> <div style="padding: 10px 20px; border: 1px solid lightgray;">
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value"> <el-form size="small" label-width="100px">
</el-option> <el-form-item label="列车:" prop="trainCode">
</el-select> <el-select v-model="trainCode" filterable placeholder="列车">
</el-form-item> <el-option
</el-form> v-for="item in trainList"
<el-row> :key="item.code"
<el-col style="text-align: right;"> :label="item.groupNumber"
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :value="item.code"
<el-button :id="domIdCancel" @click="cancel"> </el-button> />
</el-col> </el-select>
</el-row> </el-form-item>
</div> <el-form-item label="列车方向:" prop="direction">
<notice-info ref="noticeInfo"></notice-info> <el-select v-model="direction" filterable placeholder="列车方向">
</el-dialog> <el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value" />
</el-select>
</el-form-item>
</el-form>
<el-row>
<el-col style="text-align: right;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</div>
<notice-info ref="noticeInfo" />
</el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map'; import { mouseCancelState } from '../utils/menuItemStatus';
import { mouseCancelState } from '../utils/menuItemStatus'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
export default { export default {
name: 'RouteCreate', name: 'RouteCreate',
components: { components: {
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
trainList: [], trainList: [],
trainNoList: [], trainNoList: [],
directionList: [ directionList: [
{ {
value: '2', value: '2',
label: '上行' label: '上行'
}, },
{ {
value: '1', value: '1',
label: '下行' label: '下行'
}
],
trainCode: '',
tripNumber: '',
direction: '',
selected: null
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (Object.keys(map || {}).length) {
getPublishTrainList(map.skinCode).then(response => {
this.trainList = response.data;
}).catch(error => {
this.$messageBox(`获取列车列表失败`);
})
} }
}, ],
doShow(operate, selected) { trainCode: '',
this.dialogShow = true; tripNumber: '',
this.selected = selected; direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
/** 加载列车数据*/ /** 加载列车数据*/
this.loadInitData(this.map); this.loadInitData(this.map);
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected); });
}, },
commit() { doClose() {
let operate = { this.trainCode = '';
send: true, this.direction = '';
type: MapDeviceType.Section.type, this.loading = false;
operation: OperationEvent.Section.newtrain.menu.operation, this.dialogShow = false;
val: '' + this.direction + '::' + this.trainCode this.$store.dispatch('training/emitTipFresh');
} mouseCancelState(this.selected);
this.loading = true; },
this.$store.dispatch('training/next', operate).then(({ valid }) => { commit() {
this.loading = false; const operate = {
if (valid) { send: true,
this.doClose(); type: MapDeviceType.Section.type,
} operation: OperationEvent.Section.newtrain.menu.operation,
}).catch(error => { val: '' + this.direction + '::' + this.trainCode
this.loading = false; };
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation,
} }
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose();
}
}).catch(error => {
this.doClose(); this.doClose();
}); }
} }).catch(error => {
this.doClose();
});
} }
} }
};
</script> </script>

View File

@ -19,127 +19,128 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
name: 'ReloadTodayPlan', name: 'ReloadTodayPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinCodeList: [], skinCodeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '100px', labelWidth: '100px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
}; };
}, },
computed: { computed: {
title() { title() {
return '加载当天计划'; return '加载当天计划';
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.skinCodeList = [];
getSkinCodeList().then(response => { getSkinCodeList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
}); });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/skinCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
// //
handleConfirm() { handleConfirm() {
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();
this.doClose(); this.doClose();
this.$message.success(`生成用户每日运行图成功`); this.$message.success(`生成用户每日运行图成功`);
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`); this.$messageBox(`生成用户每日运行图失败`);
}); });
} else { } else {
this.$messageBox(`请选择需要加载的运行图`); this.$messageBox(`请选择需要加载的运行图`);
} }
} }
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear'); const mapId = this.$route.query.mapId;
if (skinCode) { this.$store.dispatch('runPlan/clear');
getStationListBySkinCode(skinCode).then(response => { if (mapId) {
const stations = response.data; getStationList(mapId).then(response => {
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
getEveryDayRunPlanData(this.$route.query.group).then(resp => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
this.$store.dispatch('runPlan/setPlanData', resp.data); getEveryDayRunPlanData(this.$route.query.group).then(resp => {
}).catch(() => { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$store.dispatch('runPlan/setPlanData', []); }).catch(() => {
this.$messageBox(`获取运行图数据失败`); this.$store.dispatch('runPlan/setPlanData', []);
}); this.$messageBox(`获取运行图数据失败`);
}); });
}).catch(() => { });
this.$messageBox(`获取车站列表失败`); }).catch(() => {
}); this.$messageBox(`获取车站列表失败`);
} });
}, }
reloadTable() { },
this.queryList.reload(); reloadTable() {
} this.queryList.reload();
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -119,240 +119,236 @@
</div> </div>
</template> </template>
<script> <script>
import XLSX from 'xlsx';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
export default { export default {
name: 'PlanMenuBar', name: 'PlanMenuBar',
props: { props: {
skinCode: { skinCode: {
type: String, type: String,
required: true required: true
} }
}, },
data() { data() {
return { return {
classA: -1, classA: -1,
classB: -1, classB: -1,
tempClassA: -1, tempClassA: -1,
tempClassB: -1, tempClassB: -1,
menu: [ menu: [
{ {
title: '文件F', title: '文件F',
children: [ children: [
] ]
}, },
{ {
title: '显示V', title: '显示V',
children: [ children: [
// { // {
// title: '', // title: '',
// }, // },
// { // {
// title: '', // title: '',
// }, // },
// { // {
// title: '' // title: ''
// } // }
] ]
}, },
{ {
title: '编辑E', title: '编辑E',
children: [ children: [
// { // {
// title: '', // title: '',
// click: this.handleEditPlanningTrain // click: this.handleEditPlanningTrain
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleAddTask // click: this.handleAddTask
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleDeleteTask // click: this.handleDeleteTask
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleModifyingPlanId // click: this.handleModifyingPlanId
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleTranslationalMulTrain // click: this.handleTranslationalMulTrain
// } // }
] ]
}, },
{ {
title: '工具T', title: '工具T',
children: [ children: [
{ {
title: '查看计划列表', title: '查看计划列表',
click: this.handleViewPlanSchedule click: this.handleViewPlanSchedule
}, },
{ {
title: '创建一周计划', title: '创建一周计划',
click: this.handleCreateWeekPlan click: this.handleCreateWeekPlan
}, },
{ {
title: '加载当天计划', title: '加载当天计划',
click: this.handleReloadTodayPlan click: this.handleReloadTodayPlan
} }
// { // {
// title: '', // title: '',
// click: this.handleValidityCheck // click: this.handleValidityCheck
// } // }
] ]
}, },
{ {
title: '帮助H', title: '帮助H',
children: [ children: [
] ]
} }
] ]
}; };
}, },
computed: { computed: {
...mapGetters('training', [ ...mapGetters('training', [
'mode' 'mode'
]), ]),
...mapGetters('map', [ ...mapGetters('map', [
'stationList' 'stationList'
]) ])
}, },
watch: { watch: {
tempClassA() { tempClassA() {
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA; this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
}, },
tempClassB() { tempClassB() {
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB; this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
}, },
'$store.state.menuOperation.break': function (val) { '$store.state.menuOperation.break': function (val) {
if (val) { if (val) {
this.classA = this.classB = -1; this.classA = this.classB = -1;
} else { } else {
this.classA = this.tempClassA; this.classA = this.tempClassA;
this.classB = this.tempClassB; this.classB = this.tempClassB;
} }
} }
}, },
mounted() { mounted() {
this.initMenu(); this.initMenu();
}, },
methods: { methods: {
initMenu() { initMenu() {
this.clickEvent(); this.clickEvent();
this.closeMenu(); this.closeMenu();
}, },
clickEvent() { clickEvent() {
const self = this; const self = this;
window.onclick = function (e) { window.onclick = function (e) {
self.closeMenu(false); self.closeMenu(false);
}; };
}, },
noShowingChildren(children) { noShowingChildren(children) {
if (!children || children.length <= 0) { if (!children || children.length <= 0) {
return true; return true;
} }
return false; return false;
}, },
hasShowingChildren(children) { hasShowingChildren(children) {
if (children && children.length > 0) { if (children && children.length > 0) {
return true; return true;
} }
return false; return false;
}, },
closeMenu() { closeMenu() {
this.classA = this.tempClassA = -1; this.classA = this.tempClassA = -1;
this.classB = this.tempClassB = -1; this.classB = this.tempClassB = -1;
}, },
hookClick(item, event) { hookClick(item, event) {
this.closeMenu(); this.closeMenu();
// launchFullscreen(); setTimeout(() => {
setTimeout(() => { if (item && typeof item.click == 'function') {
if (item && typeof item.click == 'function') { item.click();
item.click(); }
} }, 500);
}, 500); },
}, popupMenuA(item, index) {
popupMenuA(item, index) { this.clickEvent();
this.clickEvent(); this.tempClassA = index;
this.tempClassA = index; this.tempClassB = -1;
this.tempClassB = -1; },
}, popupMenuB(item, index) {
popupMenuB(item, index) { this.tempClassB = index;
this.tempClassB = index; },
}, openLoadFile(item) {
openLoadFile(item) { const obj = this.$refs[item.title][0];
const obj = this.$refs[item.title][0]; if (obj.files) {
if (obj.files) { const file = obj.files[0];
const file = obj.files[0]; item.click(file);
item.click(file); obj.value = '';
obj.value = ''; }
} },
}, doClose() {
doClose() { this.$nextTick(() => {
this.$nextTick(() => { EventBus.$emit('closeMenu');
EventBus.$emit('closeMenu'); });
}); },
}, //
// refresh() {
refresh() { this.closeMenu(true);
this.closeMenu(true); EventBus.$emit('refresh');
EventBus.$emit('refresh'); },
}, undeveloped() {
undeveloped() { this.doClose();
this.doClose(); this.$alert('实现中......', '提示', {
this.$alert('实现中......', '提示', { confirmButtonText: '确定',
confirmButtonText: '确定', callback: action => {
callback: action => { }
} });
}); },
}, //
// handleEditPlanningTrain() {
handleEditPlanningTrain() { this.$emit('dispatchDialog', { name: 'modifyingPlan' });
this.$emit('dispatchDialog', { name: 'modifyingPlan' }); },
}, //
// handleAddTask() {
handleAddTask() { const params = this.$store.state.runPlan.selected;
const params = this.$store.state.runPlan.selected; this.$emit('dispatchDialog', { name: 'addTask', params });
this.$emit('dispatchDialog', { name: 'addTask', params }); },
}, //
// handleDeleteTask() {
handleDeleteTask() { const params = this.$store.state.runPlan.selected;
const params = this.$store.state.runPlan.selected; this.$emit('dispatchDialog', { name: 'deleteTask', params });
this.$emit('dispatchDialog', { name: 'deleteTask', params }); },
}, //
// handleModifyingTask() {
handleModifyingTask() { const params = this.$store.state.runPlan.selected;
const params = this.$store.state.runPlan.selected; this.$emit('dispatchDialog', { name: 'modifyingTask', params });
this.$emit('dispatchDialog', { name: 'modifyingTask', params }); },
}, //
// handleModifyingPlanId() {
handleModifyingPlanId() { this.$emit('dispatchDialog', { name: 'modifyingPlanId' });
this.$emit('dispatchDialog', { name: 'modifyingPlanId' }); },
}, //
// handleTranslationalMulTrain() {
handleTranslationalMulTrain() { this.$emit('dispatchDialog', { name: 'translationalMulTrain' });
this.$emit('dispatchDialog', { name: 'translationalMulTrain' }); },
}, //
// handleViewPlanSchedule() {
handleViewPlanSchedule() { this.$emit('dispatchDialog', { name: 'managePlanList' });
this.$emit('dispatchDialog', { name: 'managePlanList' }); },
}, //
// handleCreateWeekPlan() {
handleCreateWeekPlan() { this.$emit('dispatchDialog', { name: 'createWeekPlan' });
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); },
}, //
// handleReloadTodayPlan() {
handleReloadTodayPlan() { this.$emit('dispatchDialog', { name: 'createTodayPlan' });
this.$emit('dispatchDialog', { name: 'createTodayPlan' }); },
}, //
// handleValidityCheck() {
handleValidityCheck() { }
} }
}
}; };
</script> </script>

View File

@ -97,241 +97,233 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmTrain from './childDialog/confirmTrain'; import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainControl', name: 'TrainControl',
components: { components: {
ConfirmTrain, ConfirmTrain,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainList: [], trainList: [],
selected: null, selected: null,
addModel: { addModel: {
stationName: '', stationName: '',
sectionCode: '', sectionCode: '',
trainWindowCode: '', trainWindowCode: '',
groupNumber: '', groupNumber: '',
serviceNumber: '', serviceNumber: '',
targetCode: '', targetCode: '',
trainCode: '', trainCode: '',
runningMode: '' runningMode: ''
}, },
rules: { rules: {
stationName: [ stationName: [
{ required: true, message: '请输入车站', trigger: 'blur'} { required: true, message: '请输入车站', trigger: 'blur'}
], ],
sectionCode: [ sectionCode: [
{ required: true, message: '请输入轨道', trigger: 'blur'} { required: true, message: '请输入轨道', trigger: 'blur'}
], ],
trainWindowCode: [ trainWindowCode: [
{ required: true, message: '请输入车次窗', trigger: 'blur'} { required: true, message: '请输入车次窗', trigger: 'blur'}
], ],
groupNumber: [ groupNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' } { required: true, message: '请选择车组号', trigger: 'change' }
], ],
serviceNumber: [ serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur'} { required: true, message: '请输入服务号', trigger: 'blur'}
], ],
targetCode: [ targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur'} { required: true, message: '请输入目的地号', trigger: 'blur'}
], ],
trainCode: [ trainCode: [
{ required: true, message: '请输入序列号', trigger: 'blur'} { required: true, message: '请输入序列号', trigger: 'blur'}
], ],
runningMode: [ runningMode: [
{ required: true, message: '请选择运行模式', trigger: 'blur'} { required: true, message: '请选择运行模式', trigger: 'blur'}
] ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false,
direction: 0 direction: 0
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.destinationTrainId.menu.operation) { if (this.operation == OperationEvent.Train.destinationTrainId.menu.operation) {
/* 设目的地*/ /* 设目的地*/
return OperationEvent.Train.destinationTrainId.menu.domId; return OperationEvent.Train.destinationTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation) {
/* 设计划车*/ /* 设计划车*/
return OperationEvent.Train.setPlanTrainId.menu.domId; return OperationEvent.Train.setPlanTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation) {
/* 设人工车*/ /* 设人工车*/
return OperationEvent.Train.artificialTrainId.menu.domId; return OperationEvent.Train.artificialTrainId.menu.domId;
} }
return ''; return '';
} }
return ''; return '';
}, },
title() { title() {
if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation) { if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation) {
return '设目的地车'; return '设目的地车';
} else if ( this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) { } else if ( this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) {
return '设计划车'; return '设计划车';
} else if ( this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) { } else if ( this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) {
return '设人工车'; return '设人工车';
} }
return ''; return '';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { },
getPublishTrainList(map.skinCode).then(resp => { doShow(operate, selected) {
this.trainList = resp.data; this.selected = selected;
}).catch(() => { //
this.$messageBox(`获取列车车组号失败`); if (!this.dialogShow) {
}); this.operation = operate.operation;
} }
}, this.addModel = {
doShow(operate, selected) { tripNumber: '',
this.selected = selected; groupNumber: '',
// trainType: '01',
if (!this.dialogShow) { serviceNumber: '',
this.operation = operate.operation; targetCode: ''
} };
this.addModel = { /** 加载列车数据*/
tripNumber: '', this.loadInitData(this.map);
groupNumber: '', this.dialogShow = true;
trainType: '01', this.$nextTick(function () {
serviceNumber: '', this.$store.dispatch('training/emitTipFresh');
targetCode: '' });
}; },
/** 加载列车数据*/ doClose() {
this.loadInitData(this.map); this.loading = false;
this.dialogShow = true; this.dialogShow = false;
this.$nextTick(function () { this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('map/setTrainWindowShow', false);
}); mouseCancelState(this.selected);
}, },
doClose() { commit() {
this.loading = false; if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation ) {
this.dialogShow = false; this.destinationTrainId();
this.$store.dispatch('training/emitTipFresh'); } else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) {
this.$store.dispatch('map/setTrainWindowShow', false); this.setPlanTrainId();
mouseCancelState(this.selected); } else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) {
}, this.artificialTrainId();
commit() { }
if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation ) { },
this.destinationTrainId(); //
} else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) { destinationTrainId() {
this.setPlanTrainId(); this.$refs['form'].validate((valid) => {
} else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) { if (valid) {
this.artificialTrainId(); const operate = {
} type: MapDeviceType.Train.type,
}, operation: OperationEvent.Train.destinationTrainId.menu.operation,
// message: [`设目的地车:成功`],
destinationTrainId() { val: ''
this.$refs['form'].validate((valid) => { };
if (valid) { this.loading = true;
const operate = { this.$store.dispatch('training/next', operate).then(({ valid }) => {
type: MapDeviceType.Train.type, this.doClose();
operation: OperationEvent.Train.destinationTrainId.menu.operation, this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
message: [`设目的地车:成功`], }).catch(() => {
val: '' this.loading = false;
}; this.doClose();
this.loading = true; this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/next', operate).then(({ valid }) => { });
this.doClose(); } else {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); return false;
}).catch(() => { }
this.loading = false; });
this.doClose(); },
this.$refs.noticeInfo.doShow(operate); //
}); setPlanTrainId() {
} else { this.$refs['form'].validate((valid) => {
return false; if (valid) {
} const operate = {
}); type: MapDeviceType.Train.type,
}, operation: OperationEvent.Train.setPlanTrainId.menu.operation,
// message: [`设计划车:成功`],
setPlanTrainId() { val: ''
this.$refs['form'].validate((valid) => { };
if (valid) { this.loading = true;
const operate = { this.$store.dispatch('training/next', operate).then(({ valid }) => {
type: MapDeviceType.Train.type, this.doClose();
operation: OperationEvent.Train.setPlanTrainId.menu.operation, this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
message: [`设计划车:成功`], }).catch(() => {
val: '' this.loading = false;
}; this.doClose();
this.loading = true; this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/next', operate).then(({ valid }) => { });
this.doClose(); } else {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); return false;
}).catch(() => { }
this.loading = false; });
this.doClose(); },
this.$refs.noticeInfo.doShow(operate); //
}); artificialTrainId() {
} else { this.$refs['form'].validate((valid) => {
return false; if (valid) {
} const operate = {
}); type: MapDeviceType.Train.type,
}, operation: OperationEvent.Train.artificialTrainId.menu.operation,
// message: [`设人工车:成功`],
artificialTrainId() { val: ''
this.$refs['form'].validate((valid) => { };
if (valid) { this.loading = true;
const operate = { this.$store.dispatch('training/next', operate).then(({ valid }) => {
type: MapDeviceType.Train.type, this.doClose();
operation: OperationEvent.Train.artificialTrainId.menu.operation, this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
message: [`设人工车:成功`], }).catch(() => {
val: '' this.loading = false;
}; this.doClose();
this.loading = true; this.$refs.noticeInfo.doShow(operate);
this.$store.dispatch('training/next', operate).then(({ valid }) => { });
this.doClose(); } else {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); return false;
}).catch(() => { }
this.loading = false; });
this.doClose(); },
this.$refs.noticeInfo.doShow(operate); cancel() {
}); const operate = {
} else { type: MapDeviceType.Train.type,
return false; operation: OperationEvent.Command.cancel.menu.operation
} };
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>

View File

@ -33,121 +33,113 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'RouteCreate', name: 'RouteCreate',
components: { components: {
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
trainList: [], trainList: [],
trainNoList: [], trainNoList: [],
directionList: [ directionList: [
{ {
value: '2', value: '2',
label: '上行' label: '上行'
}, },
{ {
value: '1', value: '1',
label: '下行' label: '下行'
} }
], ],
trainCode: '', trainCode: '',
tripNumber: '', tripNumber: '',
direction: '', direction: '',
selected: null selected: null
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId; return OperationEvent.Section.newtrain.menu.domId;
}, },
title() { title() {
return '设置列车'; return '设置列车';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (Object.keys(map || {}).length) { },
getPublishTrainList(map.skinCode).then(response => { doShow(operate, selected) {
this.trainList = response.data; this.dialogShow = true;
}).catch(() => { this.selected = selected;
this.$messageBox(`获取列车列表失败`); console.log(this.map);
}); /** 加载列车数据*/
} this.loadInitData(this.map);
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
console.log(this.map);
/** 加载列车数据*/
this.loadInitData(this.map);
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.trainCode = ''; this.trainCode = '';
this.direction = ''; this.direction = '';
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected); mouseCancelState(this.selected);
}, },
commit() { commit() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Section.type, type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation, operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode val: '' + this.direction + '::' + this.trainCode
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Section.type, type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
}; };
</script> </script>

View File

@ -1,169 +1,173 @@
<template> <template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="480px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div class="el-dialog-div"> class="chengdou-03__systerm stand-stop-time"
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form" label-position="left"> :title="title"
<el-row> :visible.sync="show"
<el-col :span="11"> width="480px"
<el-form-item prop="stationName"> :before-close="doClose"
<span slot="label">车站</span> :z-index="2000"
<el-input v-model="addModel.stationName" :disabled="true"></el-input> :modal="false"
</el-form-item> :close-on-click-modal="false"
</el-col> >
<el-col :span="11" :offset="1"> <div class="el-dialog-div">
<el-form-item prop="trainWindowCode"> <el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules" label-position="left">
<span slot="label">车次窗</span> <el-row>
<el-input v-model="addModel.trainWindowCode" :disabled="true"></el-input> <el-col :span="11">
</el-form-item> <el-form-item prop="stationName">
</el-col> <span slot="label">车站</span>
</el-row> <el-input v-model="addModel.stationName" :disabled="true" />
<el-row> </el-form-item>
<el-col :span="11"> </el-col>
<el-form-item label="车 组 号:" prop="groupNumber"> <el-col :span="11" :offset="1">
<el-select v-model="addModel.groupNumber" filterable> <el-form-item prop="trainWindowCode">
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber" <span slot="label">车次窗</span>
:value="train.groupNumber"> <el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-option> </el-form-item>
</el-select> </el-col>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row> </el-row>
</el-dialog> <el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
export default { export default {
name: 'TrainCreateNumber', name: 'TrainCreateNumber',
components: { components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName:'',
trainWindowCode: '',
groupNumber:''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur'}
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
data() { domIdCancel() {
return { return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
trainNoList: [], },
trainList: [], domIdConfirm() {
selected: null, return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
addModel: { },
title() {
return '新建车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel = {
stationName:'', stationName:'',
trainWindowCode: '', trainWindowCode: '',
groupNumber:'', groupNumber:''
}, };
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur'}
],
},
dialogShow: false,
loading: false,
} }
}, this.dialogShow = true;
computed: { this.$nextTick(function () {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '新建车组号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel ={
stationName:'',
trainWindowCode: '',
groupNumber:'',
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); });
mouseCancelState(this.selected); },
}, doClose() {
commit() { this.loading = false;
this.$refs['form'].validate((valid) => { this.dialogShow = false;
if (valid) { this.$store.dispatch('training/emitTipFresh');
let operate = { this.$store.dispatch('map/setTrainWindowShow', false);
send: true, mouseCancelState(this.selected);
type: MapDeviceType.Train.type, },
operation: OperationEvent.Train.createTrainNo.menu.operation, commit() {
} this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.createTrainNo.menu.operation
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose(); this.doClose();
// this.$refs.noticeInfo.doShow(operate); }
}) }).catch(error => {
} else { this.loading = false;
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose(); this.doClose();
} // this.$refs.noticeInfo.doShow(operate);
}).catch(error => { this.doClose(); }); });
} } else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.chengdou-03__systerm .el-dialog .base-label { .chengdou-03__systerm .el-dialog .base-label {

View File

@ -1,164 +1,168 @@
<template> <template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="480px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div class="el-dialog-div"> class="chengdou-03__systerm stand-stop-time"
<el-form size="small" label-width="80px" :model="addModel" ref="form" label-position="left"> :title="title"
<el-row> :visible.sync="show"
<el-col :span="11"> width="480px"
<el-form-item prop="stationName"> :before-close="doClose"
<span slot="label">车站</span> :z-index="2000"
<el-input v-model="addModel.stationName" :disabled="true"></el-input> :modal="false"
</el-form-item> :close-on-click-modal="false"
</el-col> >
<el-col :span="11" :offset="1"> <div class="el-dialog-div">
<el-form-item prop="trainWindowCode"> <el-form ref="form" size="small" label-width="80px" :model="addModel" label-position="left">
<span slot="label">车次窗</span> <el-row>
<el-input v-model="addModel.trainWindowCode" :disabled="true"></el-input> <el-col :span="11">
</el-form-item> <el-form-item prop="stationName">
</el-col> <span slot="label">车站</span>
</el-row> <el-input v-model="addModel.stationName" :disabled="true" />
<el-row> </el-form-item>
<el-col :span="11"> </el-col>
<el-form-item label="车 组 号:" prop="groupNumber"> <el-col :span="11" :offset="1">
<el-select v-model="addModel.groupNumber" filterable disabled> <el-form-item prop="trainWindowCode">
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber" <span slot="label">车次窗</span>
:value="train.groupNumber"> <el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-option> </el-form-item>
</el-select> </el-col>
</el-form-item> </el-row>
</el-col> <el-row>
</el-row> <el-col :span="11">
</el-form> <el-form-item label="车 组 号:" prop="groupNumber">
</div> <el-select v-model="addModel.groupNumber" filterable disabled>
<el-row justify="center" class="button-group"> <el-option
<el-col :span="10" :offset="2"> v-for="train in trainList"
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :key="train.groupNumber"
</el-col> :label="train.groupNumber"
<el-col :span="8" :offset="4"> :value="train.groupNumber"
<el-button :id="domIdCancel" @click="cancel"> </el-button> />
</el-col> </el-select>
</el-row> </el-form-item>
</el-dialog> </el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
export default { export default {
name: 'TrainDeleteNumber', name: 'TrainDeleteNumber',
components: { components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName:'',
trainWindowCode: '',
groupNumber:''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
data() { domIdCancel() {
return { return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
trainNoList: [], },
trainList: [], domIdConfirm() {
selected: null, return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
addModel: { },
title() {
return '删除车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel = {
stationName:'', stationName:'',
trainWindowCode: '', trainWindowCode: '',
groupNumber:'', groupNumber:''
}, };
dialogShow: false,
loading: false,
} }
}, this.dialogShow = true;
computed: { this.$nextTick(function () {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '删除车组号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel ={
stationName:'',
trainWindowCode: '',
groupNumber:'',
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); });
mouseCancelState(this.selected); },
}, doClose() {
commit() { this.loading = false;
this.$refs['form'].validate((valid) => { this.dialogShow = false;
if (valid) { this.$store.dispatch('training/emitTipFresh');
let operate = { this.$store.dispatch('map/setTrainWindowShow', false);
send: true, mouseCancelState(this.selected);
type: MapDeviceType.Train.type, },
operation: OperationEvent.Train.deleteTrainNo.menu.operation, commit() {
}; this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.deleteTrainNo.menu.operation
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose(); this.doClose();
// this.$refs.noticeInfo.doShow(operate); }
}) }).catch(error => {
} else { this.loading = false;
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose(); this.doClose();
} // this.$refs.noticeInfo.doShow(operate);
}).catch(error => { this.doClose(); }); });
} } else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.chengdou-03__systerm .el-dialog .base-label { .chengdou-03__systerm .el-dialog .base-label {

View File

@ -234,7 +234,6 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
export default { export default {
name: 'TrainDetailInfo', name: 'TrainDetailInfo',

View File

@ -49,125 +49,117 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
export default { export default {
name: 'TrainEditNumber', name: 'TrainEditNumber',
components: { components: {
}, },
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
trainList: [], trainList: [],
selected: null, selected: null,
addModel: { addModel: {
stationName: '', stationName: '',
trainWindowCode: '', trainWindowCode: '',
oldGroupNumber: '', oldGroupNumber: '',
newGroupNumber: '' newGroupNumber: ''
}, },
rules: { rules: {
newGroupNumber: [ newGroupNumber: [
{ required: true, message: '请输入新车组号', trigger: 'blur'} { required: true, message: '请输入新车组号', trigger: 'blur'}
] ]
}, },
dialogShow: false, dialogShow: false,
loading: false loading: false
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationStandList' 'stationStandList'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
}, },
title() { title() {
return '修改车组号'; return '修改车组号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { },
getPublishTrainList(map.skinCode).then(resp => { doShow(operate, selected) {
this.trainList = resp.data; this.selected = selected;
}).catch(() => { //
this.$messageBox(`获取列车车组号失败`); if (!this.dialogShow) {
}); this.addModel = {
} stationName: '',
}, trainWindowCode: '',
doShow(operate, selected) { oldGroupNumber: '',
this.selected = selected; newGroupNumber: ''
// };
if (!this.dialogShow) { }
this.addModel ={ this.dialogShow = true;
stationName: '', this.$nextTick(function () {
trainWindowCode: '', this.$store.dispatch('training/emitTipFresh');
oldGroupNumber: '', });
newGroupNumber: '' },
}; doClose() {
} this.loading = false;
this.dialogShow = true; this.dialogShow = false;
this.$nextTick(function () { this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('map/setTrainWindowShow', false);
}); mouseCancelState(this.selected);
}, },
doClose() { commit() {
this.loading = false; this.$refs['form'].validate((valid) => {
this.dialogShow = false; if (valid) {
this.$store.dispatch('training/emitTipFresh'); const operate = {
this.$store.dispatch('map/setTrainWindowShow', false); send: true,
mouseCancelState(this.selected); type: MapDeviceType.Train.type,
}, operation: OperationEvent.Train.editTrainNo.menu.operation
commit() { };
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainNo.menu.operation
};
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
}); });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { this.doClose(); }); }).catch(() => { this.doClose(); });
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>

View File

@ -1,182 +1,186 @@
<template> <template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="480px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div class="el-dialog-div"> class="chengdou-03__systerm stand-stop-time"
<el-form size="small" label-width="90px" :model="addModel" ref="form" label-position="left"> :title="title"
<el-row> :visible.sync="show"
<el-col :span="11"> width="480px"
<el-form-item prop="stationName"> :before-close="doClose"
<span slot="label">车站</span> :z-index="2000"
<el-input v-model="addModel.stationName" :disabled="true"></el-input> :modal="false"
</el-form-item> :close-on-click-modal="false"
</el-col> >
<el-col :span="11" :offset="1"> <div class="el-dialog-div">
<el-form-item prop="trainWindowCode"> <el-form ref="form" size="small" label-width="90px" :model="addModel" label-position="left">
<span slot="label">车次窗</span> <el-row>
<el-input v-model="addModel.trainWindowCode" :disabled="true"></el-input> <el-col :span="11">
</el-form-item> <el-form-item prop="stationName">
</el-col> <span slot="label">车站</span>
</el-row> <el-input v-model="addModel.stationName" :disabled="true" />
<el-row> </el-form-item>
<el-col :span="11"> </el-col>
<el-form-item label="车 组 号:" prop="groupNumber"> <el-col :span="11" :offset="1">
<el-select v-model="addModel.groupNumber" filterable disabled> <el-form-item prop="trainWindowCode">
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber" <span slot="label">车次窗</span>
:value="train.groupNumber"> <el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-option> </el-form-item>
</el-select> </el-col>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="purposeStationName">
<span slot="label">车站</span>
<el-input v-model="addModel.purposeStationName" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="purposeTrainWindowCode" >
<span slot="label">目的车次窗</span>
<el-input v-model="addModel.purposeTrainWindowCode" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row> </el-row>
</el-dialog> <el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable disabled>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="purposeStationName">
<span slot="label">车站</span>
<el-input v-model="addModel.purposeStationName" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="purposeTrainWindowCode">
<span slot="label">目的车次窗</span>
<el-input v-model="addModel.purposeTrainWindowCode" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
export default { export default {
name: 'TrainMoveNumber', name: 'TrainMoveNumber',
components: { components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
groupNumber: '',
purposeStationName: '',
purposeTrainWindowCode: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
data() { domIdCancel() {
return { return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
trainNoList: [], },
trainList: [], domIdConfirm() {
selected: null, return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
addModel: { },
title() {
return '移动车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
console.log('operate', operate, selected);
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel = {
stationName: '', stationName: '',
trainWindowCode: '', trainWindowCode: '',
groupNumber: '', groupNumber: '',
purposeStationName: '', purposeStationName: '',
purposeTrainWindowCode: '', purposeTrainWindowCode: ''
},
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '移动车组号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
console.log('operate',operate,selected);
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel ={
stationName: '',
trainWindowCode: '',
groupNumber: '',
purposeStationName: '',
purposeTrainWindowCode: '',
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainNo.menu.operation,
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
} }
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainNo.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.chengdou-03__systerm .el-dialog .base-label { .chengdou-03__systerm .el-dialog .base-label {

View File

@ -19,128 +19,129 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
name: 'ReloadTodayPlan', name: 'ReloadTodayPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinCodeList: [], skinCodeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '100px', labelWidth: '100px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
}; };
}, },
computed: { computed: {
title() { title() {
return '加载当天计划'; return '加载当天计划';
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.skinCodeList = [];
getSkinCodeList().then(response => { getSkinCodeList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
}); });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/skinCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
// //
handleConfirm() { handleConfirm() {
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();
this.doClose(); this.doClose();
this.$message.success(`生成用户每日运行图成功`); this.$message.success(`生成用户每日运行图成功`);
}).catch((error) => { }).catch((error) => {
console.error(error); console.error(error);
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`); this.$messageBox(`生成用户每日运行图失败`);
}); });
} else { } else {
this.$messageBox(`请选择需要加载的运行图`); this.$messageBox(`请选择需要加载的运行图`);
} }
} }
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear'); const mapId = this.$route.query.mapId;
if (skinCode) { this.$store.dispatch('runPlan/clear');
getStationListBySkinCode(skinCode).then(response => { if (mapId) {
const stations = response.data; getStationList(mapId).then(response => {
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
getEveryDayRunPlanData(this.$route.query.group).then(resp => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
this.$store.dispatch('runPlan/setPlanData', resp.data); getEveryDayRunPlanData(this.$route.query.group).then(resp => {
}).catch(() => { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$store.dispatch('runPlan/setPlanData', []); }).catch(() => {
this.$messageBox(`获取运行图数据失败`); this.$store.dispatch('runPlan/setPlanData', []);
}); this.$messageBox(`获取运行图数据失败`);
}); });
}).catch(() => { });
this.$messageBox(`获取车站列表失败`); }).catch(() => {
}); this.$messageBox(`获取车站列表失败`);
} });
}, }
reloadTable() { },
this.queryList.reload(); reloadTable() {
} this.queryList.reload();
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -119,10 +119,7 @@
</div> </div>
</template> </template>
<script> <script>
import XLSX from 'xlsx';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
export default { export default {
@ -269,7 +266,6 @@ export default {
}, },
hookClick(item, event) { hookClick(item, event) {
this.closeMenu(); this.closeMenu();
// launchFullscreen();
setTimeout(() => { setTimeout(() => {
if (item && typeof item.click == 'function') { if (item && typeof item.click == 'function') {
item.click(); item.click();

View File

@ -19,127 +19,128 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
name: 'ReloadTodayPlan', name: 'ReloadTodayPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinCodeList: [], skinCodeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '100px', labelWidth: '100px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
}; };
}, },
computed: { computed: {
title() { title() {
return '加载当天计划'; return '加载当天计划';
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.skinCodeList = [];
getSkinCodeList().then(response => { getSkinCodeList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
}); });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/skinCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
// //
handleConfirm() { handleConfirm() {
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();
this.doClose(); this.doClose();
this.$message.success(`生成用户每日运行图成功`); this.$message.success(`生成用户每日运行图成功`);
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`); this.$messageBox(`生成用户每日运行图失败`);
}); });
} else { } else {
this.$messageBox(`请选择需要加载的运行图`); this.$messageBox(`请选择需要加载的运行图`);
} }
} }
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear'); const mapId = this.$route.query.mapId;
if (skinCode) { this.$store.dispatch('runPlan/clear');
getStationListBySkinCode(skinCode).then(response => { if (mapId) {
const stations = response.data; getStationList(mapId).then(response => {
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
getEveryDayRunPlanData(this.$route.query.group).then(resp => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
this.$store.dispatch('runPlan/setPlanData', resp.data); getEveryDayRunPlanData(this.$route.query.group).then(resp => {
}).catch(() => { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$store.dispatch('runPlan/setPlanData', []); }).catch(() => {
this.$messageBox(`获取运行图数据失败`); this.$store.dispatch('runPlan/setPlanData', []);
}); this.$messageBox(`获取运行图数据失败`);
}); });
}).catch(() => { });
this.$messageBox(`获取车站列表失败`); }).catch(() => {
}); this.$messageBox(`获取车站列表失败`);
} });
}, }
reloadTable() { },
this.queryList.reload(); reloadTable() {
} this.queryList.reload();
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -119,240 +119,236 @@
</div> </div>
</template> </template>
<script> <script>
import XLSX from 'xlsx';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
export default { export default {
name: 'PlanMenuBar', name: 'PlanMenuBar',
props: { props: {
skinCode: { skinCode: {
type: String, type: String,
required: true required: true
} }
}, },
data() { data() {
return { return {
classA: -1, classA: -1,
classB: -1, classB: -1,
tempClassA: -1, tempClassA: -1,
tempClassB: -1, tempClassB: -1,
menu: [ menu: [
{ {
title: '文件F', title: '文件F',
children: [ children: [
] ]
}, },
{ {
title: '显示V', title: '显示V',
children: [ children: [
// { // {
// title: '', // title: '',
// }, // },
// { // {
// title: '', // title: '',
// }, // },
// { // {
// title: '' // title: ''
// } // }
] ]
}, },
{ {
title: '编辑E', title: '编辑E',
children: [ children: [
// { // {
// title: '', // title: '',
// click: this.handleEditPlanningTrain // click: this.handleEditPlanningTrain
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleAddTask // click: this.handleAddTask
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleDeleteTask // click: this.handleDeleteTask
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleModifyingPlanId // click: this.handleModifyingPlanId
// }, // },
// { // {
// title: '', // title: '',
// click: this.handleTranslationalMulTrain // click: this.handleTranslationalMulTrain
// } // }
] ]
}, },
{ {
title: '工具T', title: '工具T',
children: [ children: [
{ {
title: '查看计划列表', title: '查看计划列表',
click: this.handleViewPlanSchedule click: this.handleViewPlanSchedule
}, },
{ {
title: '创建一周计划', title: '创建一周计划',
click: this.handleCreateWeekPlan click: this.handleCreateWeekPlan
}, },
{ {
title: '加载当天计划', title: '加载当天计划',
click: this.handleReloadTodayPlan click: this.handleReloadTodayPlan
} }
// { // {
// title: '', // title: '',
// click: this.handleValidityCheck // click: this.handleValidityCheck
// } // }
] ]
}, },
{ {
title: '帮助H', title: '帮助H',
children: [ children: [
] ]
} }
] ]
}; };
}, },
computed: { computed: {
...mapGetters('training', [ ...mapGetters('training', [
'mode' 'mode'
]), ]),
...mapGetters('map', [ ...mapGetters('map', [
'stationList' 'stationList'
]) ])
}, },
watch: { watch: {
tempClassA() { tempClassA() {
this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA; this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA;
}, },
tempClassB() { tempClassB() {
this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB; this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB;
}, },
'$store.state.menuOperation.break': function (val) { '$store.state.menuOperation.break': function (val) {
if (val) { if (val) {
this.classA = this.classB = -1; this.classA = this.classB = -1;
} else { } else {
this.classA = this.tempClassA; this.classA = this.tempClassA;
this.classB = this.tempClassB; this.classB = this.tempClassB;
} }
} }
}, },
mounted() { mounted() {
this.initMenu(); this.initMenu();
}, },
methods: { methods: {
initMenu() { initMenu() {
this.clickEvent(); this.clickEvent();
this.closeMenu(); this.closeMenu();
}, },
clickEvent() { clickEvent() {
const self = this; const self = this;
window.onclick = function (e) { window.onclick = function (e) {
self.closeMenu(false); self.closeMenu(false);
}; };
}, },
noShowingChildren(children) { noShowingChildren(children) {
if (!children || children.length <= 0) { if (!children || children.length <= 0) {
return true; return true;
} }
return false; return false;
}, },
hasShowingChildren(children) { hasShowingChildren(children) {
if (children && children.length > 0) { if (children && children.length > 0) {
return true; return true;
} }
return false; return false;
}, },
closeMenu() { closeMenu() {
this.classA = this.tempClassA = -1; this.classA = this.tempClassA = -1;
this.classB = this.tempClassB = -1; this.classB = this.tempClassB = -1;
}, },
hookClick(item, event) { hookClick(item, event) {
this.closeMenu(); this.closeMenu();
// launchFullscreen(); setTimeout(() => {
setTimeout(() => { if (item && typeof item.click == 'function') {
if (item && typeof item.click == 'function') { item.click();
item.click(); }
} }, 500);
}, 500); },
}, popupMenuA(item, index) {
popupMenuA(item, index) { this.clickEvent();
this.clickEvent(); this.tempClassA = index;
this.tempClassA = index; this.tempClassB = -1;
this.tempClassB = -1; },
}, popupMenuB(item, index) {
popupMenuB(item, index) { this.tempClassB = index;
this.tempClassB = index; },
}, openLoadFile(item) {
openLoadFile(item) { const obj = this.$refs[item.title][0];
const obj = this.$refs[item.title][0]; if (obj.files) {
if (obj.files) { const file = obj.files[0];
const file = obj.files[0]; item.click(file);
item.click(file); obj.value = '';
obj.value = ''; }
} },
}, doClose() {
doClose() { this.$nextTick(() => {
this.$nextTick(() => { EventBus.$emit('closeMenu');
EventBus.$emit('closeMenu'); });
}); },
}, //
// refresh() {
refresh() { this.closeMenu(true);
this.closeMenu(true); EventBus.$emit('refresh');
EventBus.$emit('refresh'); },
}, undeveloped() {
undeveloped() { this.doClose();
this.doClose(); this.$alert('实现中......', '提示', {
this.$alert('实现中......', '提示', { confirmButtonText: '确定',
confirmButtonText: '确定', callback: action => {
callback: action => { }
} });
}); },
}, //
// handleEditPlanningTrain() {
handleEditPlanningTrain() { this.$emit('dispatchDialog', { name: 'modifyingPlan' });
this.$emit('dispatchDialog', { name: 'modifyingPlan' }); },
}, //
// handleAddTask() {
handleAddTask() { const params = this.$store.state.runPlan.selected;
const params = this.$store.state.runPlan.selected; this.$emit('dispatchDialog', { name: 'addTask', params });
this.$emit('dispatchDialog', { name: 'addTask', params }); },
}, //
// handleDeleteTask() {
handleDeleteTask() { const params = this.$store.state.runPlan.selected;
const params = this.$store.state.runPlan.selected; this.$emit('dispatchDialog', { name: 'deleteTask', params });
this.$emit('dispatchDialog', { name: 'deleteTask', params }); },
}, //
// handleModifyingTask() {
handleModifyingTask() { const params = this.$store.state.runPlan.selected;
const params = this.$store.state.runPlan.selected; this.$emit('dispatchDialog', { name: 'modifyingTask', params });
this.$emit('dispatchDialog', { name: 'modifyingTask', params }); },
}, //
// handleModifyingPlanId() {
handleModifyingPlanId() { this.$emit('dispatchDialog', { name: 'modifyingPlanId' });
this.$emit('dispatchDialog', { name: 'modifyingPlanId' }); },
}, //
// handleTranslationalMulTrain() {
handleTranslationalMulTrain() { this.$emit('dispatchDialog', { name: 'translationalMulTrain' });
this.$emit('dispatchDialog', { name: 'translationalMulTrain' }); },
}, //
// handleViewPlanSchedule() {
handleViewPlanSchedule() { this.$emit('dispatchDialog', { name: 'managePlanList' });
this.$emit('dispatchDialog', { name: 'managePlanList' }); },
}, //
// handleCreateWeekPlan() {
handleCreateWeekPlan() { this.$emit('dispatchDialog', { name: 'createWeekPlan' });
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); },
}, //
// handleReloadTodayPlan() {
handleReloadTodayPlan() { this.$emit('dispatchDialog', { name: 'createTodayPlan' });
this.$emit('dispatchDialog', { name: 'createTodayPlan' }); },
}, //
// handleValidityCheck() {
handleValidityCheck() { }
} }
}
}; };
</script> </script>

View File

@ -84,393 +84,384 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import ConfirmTrain from './childDialog/confirmTrain'; import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler'; import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
export default { export default {
name: 'TrainControl', name: 'TrainControl',
components: { components: {
ConfirmTrain, ConfirmTrain,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainList: [], trainList: [],
categoryList: [ categoryList: [
{ name: 'MM', value: '01' } { name: 'MM', value: '01' }
], ],
formModel: { formModel: {
tripNumber: '', tripNumber: '',
groupNumber: '', groupNumber: '',
trainType: '01', trainType: '01',
serviceNumber: '', serviceNumber: '',
targetCode: '', targetCode: '',
category: 'MM' category: 'MM'
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' } { required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
], ],
trainType: [ trainType: [
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' } { required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
], ],
serviceNumber: [ serviceNumber: [
{ required: true, message: this.$t('rules.enterTheServiceNumber'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheServiceNumber'), trigger: 'blur' }
], ],
tripNumber: [ tripNumber: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
], ],
targetCode: [ targetCode: [
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
] ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false,
direction: 0 direction: 0
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
trainNoIsDisabled() { trainNoIsDisabled() {
return false; return false;
}, },
serverNoIsDisabled() { serverNoIsDisabled() {
return true; return true;
}, },
targetCodeIsDisabled() { targetCodeIsDisabled() {
return true; return true;
}, },
trainNumberIsDisabled() { trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true; return true;
} }
return ''; return '';
}, },
// trainTypeIsDisabled() { // trainTypeIsDisabled() {
// if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { // if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
// return true; // return true;
// } // }
// return ''; // return '';
// }, // },
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdTrainNumber() { domIdTrainNumber() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNumberChange.domId; return OperationEvent.Train.addTrainId.trainNumberChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNumberChange.domId; return OperationEvent.Train.editTrainId.trainNumberChange.domId;
} }
} }
return ''; return '';
}, },
domIdTrainNo() { domIdTrainNo() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNoChange.domId; return OperationEvent.Train.addTrainId.trainNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId; return OperationEvent.Train.editTrainId.trainNoChange.domId;
} }
} }
return ''; return '';
}, },
domIdTrainType() { domIdTrainType() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainTypeChange.domId; return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainTypeChange.domId; return OperationEvent.Train.editTrainId.trainTypeChange.domId;
} }
} }
return ''; return '';
}, },
domIdServerNo() { domIdServerNo() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.serverNoChange.domId; return OperationEvent.Train.addTrainId.serverNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.serverNoChange.domId; return OperationEvent.Train.editTrainId.serverNoChange.domId;
} }
} }
return ''; return '';
}, },
domIdTargetCode() { domIdTargetCode() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.targetCodeChange.domId; return OperationEvent.Train.addTrainId.targetCodeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.targetCodeChange.domId; return OperationEvent.Train.editTrainId.targetCodeChange.domId;
} }
} }
return ''; return '';
}, },
domIdConfirm() { domIdConfirm() {
if (this.dialogShow) { if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.addTrainId.menu.domId; return OperationEvent.Train.addTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
return OperationEvent.Train.editTrainId.menu.domId; return OperationEvent.Train.editTrainId.menu.domId;
} }
} }
return ''; return '';
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
title() { title() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return this.$t('menu.menuTrain.addTrainId'); return this.$t('menu.menuTrain.addTrainId');
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
return this.$t('menu.menuTrain.editTrainId'); return this.$t('menu.menuTrain.editTrainId');
} }
return ''; return '';
}, },
istargetCode() { istargetCode() {
if (this.formModel.serviceNumber && this.formModel.targetCode) { if (this.formModel.serviceNumber && this.formModel.targetCode) {
return false; return false;
} }
return true; return true;
} }
}, },
watch: { watch: {
'formModel.tripNumber': function(val) { 'formModel.tripNumber': function(val) {
if (val.length == 4) { if (val.length == 4) {
this.trainNoChange(val); this.trainNoChange(val);
} else { } else {
this.formModel = { this.formModel = {
groupNumber: this.formModel.groupNumber, groupNumber: this.formModel.groupNumber,
tripNumber: val, tripNumber: val,
trainType: this.formModel.trainType, trainType: this.formModel.trainType,
serviceNumber: '', serviceNumber: '',
targetCode: '', targetCode: '',
category: 'MM' category: 'MM'
}; };
} }
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {},
if (map.skinCode) { doShow(operate, selected) {
getPublishTrainList(map.skinCode).then(resp => { //
this.trainList = resp.data; if (!this.dialogShow) {
}).catch(() => { this.operation = operate.operation;
this.$messageBox(this.$t('error.obtainTrainGroupNumberFailed')); }
}); const model = this.$store.getters['map/getDeviceByCode'](selected.code);
} this.formModel = {
}, groupNumber: model.groupNumber,
doShow(operate, selected) { tripNumber: `${model.directionCode}${model.tripNumber}`,
// trainType: model.type,
if (!this.dialogShow) { serviceNumber: model.serviceNumber,
this.operation = operate.operation; targetCode: model.targetCode,
} category: 'MM'
const model = this.$store.getters['map/getDeviceByCode'](selected.code); };
this.formModel = {
groupNumber: model.groupNumber,
tripNumber: `${model.directionCode}${model.tripNumber}`,
trainType: model.type,
serviceNumber: model.serviceNumber,
targetCode: model.targetCode,
category: 'MM'
};
/** 加载列车数据*/ /** 加载列车数据*/
this.loadInitData(this.map); this.loadInitData(this.map);
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange(groupNumber) { trainNumberChange(groupNumber) {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${groupNumber}`, val: `${groupNumber}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
trainTypeChange(trainType) { trainTypeChange(trainType) {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainType}`, val: `${trainType}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
trainNoChange(tripNumber) { trainNoChange(tripNumber) {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: tripNumber, val: tripNumber,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
} }
OperateHandler.backStep(1); OperateHandler.backStep(1);
this.$store.dispatch('training/next', operate).then(({ valid, response }) => { this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) { if (valid) {
if (response.data) { if (response.data) {
this.formModel = { this.formModel = {
groupNumber: this.formModel.groupNumber, groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber, tripNumber: tripNumber,
trainType: this.formModel.trainType, trainType: this.formModel.trainType,
serviceNumber: response.data.serviceNumber, serviceNumber: response.data.serviceNumber,
targetCode: response.data.targetCode, targetCode: response.data.targetCode,
category: 'MM' category: 'MM'
}; };
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.formModel = { this.formModel = {
groupNumber: this.formModel.groupNumber, groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber, tripNumber: tripNumber,
trainType: this.formModel.trainType, trainType: this.formModel.trainType,
serviceNumber: '', serviceNumber: '',
targetCode: '', targetCode: '',
category: 'MM' category: 'MM'
}; };
} }
} }
}); });
}, },
commit() { commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/ /** 增加列车识别号*/
this.addTrainId(); this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
this.editTrainId(); this.editTrainId();
} }
}, },
// //
addTrainId() { addTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const model = this.formModel; const model = this.formModel;
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation, operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [this.$t('tip.addTrainIdTip')], messages: [this.$t('tip.addTrainIdTip')],
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}` val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
} else { } else {
return false; return false;
} }
}); });
}, },
// //
editTrainId() { editTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation, operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [this.$t('tip.editTrainIdTip')], messages: [this.$t('tip.editTrainIdTip')],
val: `${this.formModel.trainType}::${this.formModel.tripNumber}` val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
}; };
</script> </script>

View File

@ -39,117 +39,116 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { getPublishTrainList } from '@/api/jmap/map';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'RouteCreate', name: 'RouteCreate',
components: { components: {
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
trainList: [], trainList: [],
trainNoList: [], trainNoList: [],
directionList: [ directionList: [
{ {
value: '2', value: '2',
label: this.$t('menu.up') label: this.$t('menu.up')
}, },
{ {
value: '1', value: '1',
label: this.$t('menu.down') label: this.$t('menu.down')
} }
], ],
trainCode: '', trainCode: '',
tripNumber: '', tripNumber: '',
direction: '', direction: '',
selected: null selected: null
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId; return OperationEvent.Section.newtrain.menu.domId;
}, },
title() { title() {
return this.$t('menu.settingTrain'); return this.$t('menu.settingTrain');
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map.trainList.length) { if (map.trainList.length) {
this.trainList = map.trainList; this.trainList = map.trainList;
} else { } else {
this.$messageBox(this.$t('error.getTrainListFailed')); this.$messageBox(this.$t('error.getTrainListFailed'));
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
this.dialogShow = true; this.dialogShow = true;
this.selected = selected; this.selected = selected;
console.log(this.map, 111); console.log(this.map, 111);
/** 加载列车数据*/ /** 加载列车数据*/
this.loadInitData(this.map); this.loadInitData(this.map);
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.trainCode = ''; this.trainCode = '';
this.direction = ''; this.direction = '';
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { commit() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Section.type, type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation, operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode val: '' + this.direction + '::' + this.trainCode
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Section.type, type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
}; };
</script> </script>

View File

@ -78,118 +78,118 @@ import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default { export default {
name: 'TrainSwitch', name: 'TrainSwitch',
components: { components: {
}, },
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
addModel: { addModel: {
trainNumberSource: '', trainNumberSource: '',
trainSource: '', trainSource: '',
stationStandSource: '', stationStandSource: '',
trainGoal: '', trainGoal: '',
stationStandGoal: '', stationStandGoal: '',
trainNumberGoal: '' trainNumberGoal: ''
}, },
rules: { rules: {
trainNumberSource: [ trainNumberSource: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' } { required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
], ],
trainSource: [ trainSource: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
], ],
stationStandSource: [ stationStandSource: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' } { required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
], ],
trainNumberGoal: [ trainNumberGoal: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' } { required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
], ],
trainGoal: [ trainGoal: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
], ],
stationStandGoal: [ stationStandGoal: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' } { required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
] ]
}, },
dialogShow: false, dialogShow: false,
loading: false loading: false
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationStandList' 'stationStandList'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
}, },
title() { title() {
return this.$t('menu.menuTrain.moveTrainId'); return this.$t('menu.menuTrain.switchTrainId');
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainId.menu.operation operation: OperationEvent.Train.moveTrainId.menu.operation
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
// this.$refs.noticeInfo.doShow(operate); // this.$refs.noticeInfo.doShow(operate);
}); });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { this.doClose(); }); }).catch(() => { this.doClose(); });
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>

View File

@ -19,127 +19,128 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
name: 'ReloadTodayPlan', name: 'ReloadTodayPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinCodeList: [], skinCodeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '120px', labelWidth: '120px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: this.$t('menu.runGraphName') label: this.$t('menu.runGraphName')
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: this.$t('menu.runGraphName'), title: this.$t('menu.runGraphName'),
prop: 'name' prop: 'name'
}, },
{ {
title: this.$t('menu.skinType'), title: this.$t('menu.skinType'),
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
}; };
}, },
computed: { computed: {
title() { title() {
return this.$t('menu.loadTheDayPlan'); return this.$t('menu.loadTheDayPlan');
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.skinCodeList = [];
getSkinCodeList().then(response => { getSkinCodeList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
}); });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/skinCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
// //
handleConfirm() { handleConfirm() {
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();
this.doClose(); this.doClose();
this.$message.success(this.$t('tip.generateUserDailyRunGraphSuccessfully')); this.$message.success(this.$t('tip.generateUserDailyRunGraphSuccessfully'));
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.$messageBox(this.$t('tip.generateUserDailyRunGraphFailed')); this.$messageBox(this.$t('tip.generateUserDailyRunGraphFailed'));
}); });
} else { } else {
this.$messageBox(this.$t('rules.selectTheRunningDiagramToBeLoaded')); this.$messageBox(this.$t('rules.selectTheRunningDiagramToBeLoaded'));
} }
} }
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear'); const mapId = this.$route.query.mapId;
if (skinCode) { this.$store.dispatch('runPlan/clear');
getStationListBySkinCode(skinCode).then(response => { if (mapId) {
const stations = response.data; getStationList(mapId).then(response => {
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
getEveryDayRunPlanData(this.$route.query.group).then(resp => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
this.$store.dispatch('runPlan/setPlanData', resp.data); getEveryDayRunPlanData(this.$route.query.group).then(resp => {
}).catch(() => { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$store.dispatch('runPlan/setPlanData', []); }).catch(() => {
this.$messageBox(this.$t('error.getRunGraphDataFailed')); this.$store.dispatch('runPlan/setPlanData', []);
}); this.$messageBox(this.$t('error.getRunGraphDataFailed'));
}); });
}).catch(() => { });
this.$messageBox(this.$t('error.getStationListFail')); }).catch(() => {
}); this.$messageBox(this.$t('error.getStationListFail'));
} });
}, }
reloadTable() { },
this.queryList.reload(); reloadTable() {
} this.queryList.reload();
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -26,7 +26,6 @@ import MapProduct from '@/views/system/product/index';
// import Mapdraft from '@/views/map/mapdraft/index'; // import Mapdraft from '@/views/map/mapdraft/index';
import Mapedit from '@/views/map/mapdraft/index'; import Mapedit from '@/views/map/mapdraft/index';
// import Runplan from '@/views/map/runplan/index'; // import Runplan from '@/views/map/runplan/index';
import RunplanView from '@/views/map/runplan/chart';
import Trainingrecord from '@/views/lesson/trainingrecord/index'; import Trainingrecord from '@/views/lesson/trainingrecord/index';
import TrainingrecordManage from '@/views/lesson/trainingrecord/manage/index'; import TrainingrecordManage from '@/views/lesson/trainingrecord/manage/index';
@ -42,7 +41,6 @@ import ScriptmanageHome from '@/views/scriptManage/home';
import ScriptDisplay from '@/views/scriptManage/display/index'; import ScriptDisplay from '@/views/scriptManage/display/index';
import TeachDetail from '@/views/teach/detail/index'; import TeachDetail from '@/views/teach/detail/index';
import TeachPractical from '@/views/teach/practical/index';
import TeachHome from '@/views/teach/index'; import TeachHome from '@/views/teach/index';
import Pay from '@/views/components/pay/index'; import Pay from '@/views/components/pay/index';
import ExamDetail from '@/views/exam/detail/examDetail'; import ExamDetail from '@/views/exam/detail/examDetail';
@ -84,6 +82,7 @@ import RunPlanTemplate from '@/views/publish/runPlanTemplate/index';
import RunPlanEveryDay from '@/views/publish/runPlanEveryDay/index'; 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 RunplanView from '@/views/publish/runPlanView/index';
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index'; import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
import TrainingPlatform from '@/views/trainingPlatform/index'; import TrainingPlatform from '@/views/trainingPlatform/index';
@ -603,11 +602,6 @@ export const asyncRouter = [
component: ExamDetail, component: ExamDetail,
hidden: true hidden: true
}, },
{
path: 'practical/:trainingId/:lessonId',
component: TeachPractical,
hidden: true
},
{ {
path: 'pay/:lessonId', path: 'pay/:lessonId',
component: Pay, component: Pay,

File diff suppressed because it is too large Load Diff

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;

View File

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

View File

@ -1,181 +1,178 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<run-plan-operate ref='applyPassed' @reloadTable="reloadTable" @create="handleConfirmPass" :title="$t('approval.passedRunPlan')" type="applyPassed"> <run-plan-operate ref="applyPassed" :title="$t('approval.passedRunPlan')" @reloadTable="reloadTable" type="applyPassed" @create="handleConfirmPass" />
</run-plan-operate> <run-plan-operate ref="applyReject" :title="$t('approval.rejectRunPlan')" @reloadTable="reloadTable" type="applyReject" @create="handleConfirmReject" />
<run-plan-operate ref='applyReject' @reloadTable="reloadTable" @create="handleConfirmReject" :title="$t('approval.rejectRunPlan')" type="applyReject"> </div>
</run-plan-operate>
</div>
</template> </template>
<script> <script>
import RunPlanOperate from './operate'; import RunPlanOperate from './operate';
import { reviewRunPlanList,publishRunPlan,rejectRunPlan,previewRunPlan } from '@/api/designPlatform'; import { reviewRunPlanList, publishRunPlan, rejectRunPlan, previewRunPlan } from '@/api/designPlatform';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
// import { getSkinCodeList } from '@/api/management/mapskin'; // import { getSkinCodeList } from '@/api/management/mapskin';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
name: 'ScriptApproval', name: 'ScriptApproval',
components: { components: {
RunPlanOperate RunPlanOperate
}, },
data() { data() {
return{ return {
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
mapList:[], mapList:[],
queryForm: { queryForm: {
labelWidth: '150px', labelWidth: '150px',
reset: true, reset: true,
queryObject: { queryObject: {
mapId: { mapId: {
type: 'select', type: 'select',
label: this.$t('approval.map'), label: this.$t('approval.map'),
config: { config: {
data: [] data: []
}
},
'name':{
type: 'text',
label: this.$t('approval.runPlanName')
},
'creatorName': {
type: 'text',
label: this.$t('approval.applicant')
} }
},
'name':{
type: 'text',
label: this.$t('approval.runPlanName')
},
'creatorName': {
type: 'text',
label: this.$t('approval.applicant')
} }
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('approval.runPlanName'),
width:250,
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
width:250,
type: 'tag',
columnValue: (row) => {return this.$convertField(row.mapId , this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.applicant'),
prop: 'creatorName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace("T"," ")},
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
buttons: [
{
name: this.$t('approval.applyPassed'),
handleClick: this.applyPassed,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.applyReject,
type: ''
},
{
name: this.$t('approval.runPlanPreview'),
handleClick: this.runPlanPreview,
type: ''
}
]
}
]
} }
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('approval.runPlanName'),
width:250,
prop: 'name'
},
{
title: this.$t('approval.map'),
prop: 'mapId ',
width:250,
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('approval.applicant'),
prop: 'creatorName'
},
{
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return row.uploadTime.replace('T', ' '); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
buttons: [
{
name: this.$t('approval.applyPassed'),
handleClick: this.applyPassed,
type: ''
},
{
name: this.$t('approval.applyReject'),
handleClick: this.applyReject,
type: ''
},
{
name: this.$t('approval.runPlanPreview'),
handleClick: this.runPlanPreview,
type: ''
}
]
}
]
}
};
},
watch: {
},
created() {
},
mounted() {
this.loadInitData();
},
beforeDestroy() {
},
methods: {
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
} }
}, },
created(){ goDetail() {
this.$router.push({path:``});
}, },
mounted(){ async loadInitData() {
this.loadInitData(); try {
//
this.mapList = [];
const res = await listPublishMap();
this.mapList = res.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.queryForm.queryObject.mapId.config.data = this.mapList;
} catch (error) {
console.error(error, '获取发布地图');
}
}, },
beforeDestroy(){ queryFunction(params) {
return reviewRunPlanList(params);
}, },
watch: { applyPassed(index, row) {
this.$refs.applyPassed.doShow(row);
}, },
methods: { applyReject(index, row) {
reloadTable() { this.$refs.applyReject.doShow(row);
if (this.queryList && this.queryList.reload) { },
this.queryList.reload(); runPlanPreview(index, row) {
previewRunPlan(row.id).then(resp => {
const query = {
skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id, from:''
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
});
},
handleConfirmPass(data) {
publishRunPlan(data.id, data).then(resp => {
if (resp.data.length <= 0) {
this.$message.success(this.$t('approval.passedRunPlanSuccess'));
} else {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`);
} }
}, this.reloadTable();
goDetail() { }).catch(error => {
this.$router.push({path:``}); this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
}, });
async loadInitData() { },
try { handleConfirmReject(data) {
// rejectRunPlan(data.id, data).then(resp => {
this.mapList = []; this.reloadTable();
const res = await listPublishMap(); this.$message.success(this.$t('approval.rejectRunPlanSuccess'));
this.mapList = res.data.map(elem => { return { value: elem.id, label: elem.name } }); }).catch(error => {
this.queryForm.queryObject.mapId.config.data=this.mapList; this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
} catch (error) { });
console.error(error, '获取发布地图');
}
},
queryFunction(params) {
return reviewRunPlanList(params);
},
applyPassed(index,row){
this.$refs.applyPassed.doShow(row);
},
applyReject(index,row){
this.$refs.applyReject.doShow(row);
},
runPlanPreview(index,row){
previewRunPlan(row.id).then(resp => {
const query = {
skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id,from:''
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
});
},
handleConfirmPass(data){
publishRunPlan(data.id,data).then(resp => {
if(resp.data.length<=0){
this.$message.success(this.$t('approval.passedRunPlanSuccess'));
}
else{
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`);
}
this.reloadTable();
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
})
},
handleConfirmReject(data){
rejectRunPlan(data.id,data).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.rejectRunPlanSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
})
},
} }
} }
};
</script> </script>

View File

@ -14,61 +14,61 @@ import { publisMapCityList} from '@/api/designPlatform';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'FilterCity', name: 'FilterCity',
props: { props: {
size: { size: {
type: String, type: String,
default() { default() {
return 'medium'; return 'medium';
} }
}, },
filterEmpty: { filterEmpty: {
type: Boolean, type: Boolean,
default() { default() {
return false; return false;
} }
}, },
queryFunction: { queryFunction: {
type: Function, type: Function,
required: true required: true
}, },
localParamName: { localParamName: {
type: String, type: String,
required: true required: true
} }
}, },
data() { data() {
return { return {
filterSelect: ['', ''], filterSelect: ['', ''],
filterOptions: [] filterOptions: []
}; };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
async loadInitData() { async loadInitData() {
// //
this.filterOptions=[]; this.filterOptions = [];
let resp = this.$route.fullPath.includes('design/userlist')?await this.$Dictionary.cityType():await publisMapCityList('city_type'); let resp = this.$route.fullPath.includes('design/userlist') ? await this.$Dictionary.cityType() : await publisMapCityList('city_type');
resp=this.$route.fullPath.includes('design/userlist')?resp:resp.data; resp = this.$route.fullPath.includes('design/userlist') ? resp : resp.data;
const cityList = resp.sort((a, b) => { const cityList = resp.sort((a, b) => {
return a.code.localeCompare(b.code); return a.code.localeCompare(b.code);
}); });
this.filterOptions=cityList; this.filterOptions = cityList;
this.filterSelect = localStore.get(this.localParamName) || cityList[0].code; this.filterSelect = localStore.get(this.localParamName) || cityList[0].code;
this.$emit('filterSelectChange', this.filterSelect); this.$emit('filterSelectChange', this.filterSelect);
}, },
filterSelectChange(filterSelect) { filterSelectChange(filterSelect) {
// //
// localStore.set('_cityCode', filterSelect); // localStore.set('_cityCode', filterSelect);
localStore.set(this.localParamName, filterSelect); localStore.set(this.localParamName, filterSelect);
this.$emit('filterSelectChange', filterSelect); this.$emit('filterSelectChange', filterSelect);
} }
} }
}; };
</script> </script>

View File

@ -19,43 +19,43 @@ import Digit from './digit';
import Separator from './separator'; import Separator from './separator';
export default { export default {
name: 'SystenTime', name: 'SystenTime',
components: { components: {
Digit, Digit,
Separator Separator
}, },
props: { props: {
background: { background: {
type: String, type: String,
default() { default() {
return '#000'; return '#000';
} }
}, },
color: { color: {
type: String, type: String,
default() { default() {
return '#00FF00'; return '#00FF00';
} }
}, },
time: { time: {
type: String, type: String,
default() { default() {
return '12:3456'; return '12:3456';
} }
}, },
zoom: { zoom: {
type: Number, type: Number,
default() { default() {
return 4; return 4;
} }
}, },
fine: { fine: {
type: Number, type: Number,
default() { default() {
return 2; return 2;
} }
} }
} }
}; };
</script> </script>
@ -63,5 +63,6 @@ export default {
.system-time-box { .system-time-box {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
background: #000;
} }
</style> </style>

View File

@ -21,7 +21,7 @@
<span <span
class="el-icon-tickets" class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}" :style="{color: data.valid ? 'green':''}"
></span> />
<span :style="{color: data.valid ? 'green':''}">&nbsp;{{ tnode.label }}</span> <span :style="{color: data.valid ? 'green':''}">&nbsp;{{ tnode.label }}</span>
</span> </span>
</el-tree> </el-tree>
@ -35,94 +35,94 @@ import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/ut
import FilterCity from '@/views/components/filterCity'; import FilterCity from '@/views/components/filterCity';
export default { export default {
name: 'ExamDetailList', name: 'ExamDetailList',
components: { components: {
FilterCity FilterCity
}, },
props: { props: {
height: { height: {
type: Number, type: Number,
required: true required: true
} }
}, },
data() { data() {
return { return {
loading: true, loading: true,
defaultShowKeys: [], defaultShowKeys: [],
queryFunction: getPublishMapTree, queryFunction: getPublishMapTree,
filterText: '', filterText: '',
treeData: [], treeData: [],
treeList: [], treeList: [],
selected: {}, selected: {},
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
node: { node: {
} }
}; };
}, },
computed: { computed: {
role() { role() {
return this.$store.state.user.roles.includes('04') || return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05') || this.$store.state.user.roles.includes('05') ||
this.$store.state.user.roles.includes('01'); this.$store.state.user.roles.includes('01');
} }
}, },
watch: { watch: {
filterText(val) { filterText(val) {
this.treeList = this.treeData.filter((res) => { this.treeList = this.treeData.filter((res) => {
return res.name.includes(val); return res.name.includes(val);
}); });
} }
}, },
beforeDestroy () { beforeDestroy () {
removeSessionStorage('demonList'); removeSessionStorage('demonList');
}, },
methods: { methods: {
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.name.indexOf(value) !== -1; return data.name.indexOf(value) !== -1;
}, },
showContextMenu(e, obj, node, vueElem) { showContextMenu(e, obj, node, vueElem) {
if (obj) { if (obj) {
this.node = node; this.node = node;
this.selected = obj; this.selected = obj;
} }
}, },
clickEvent(obj, data, ele) { clickEvent(obj, data, ele) {
if (obj.type == 'Map') { if (obj.type == 'Map') {
setSessionStorage('demonList', obj.id); setSessionStorage('demonList', obj.id);
this.$router.push({ path: `${UrlConfig.demonstration.detail}/${obj.id}` }); this.$router.push({ path: `${UrlConfig.demonstration.detail}/${obj.id}` });
} }
}, },
async refresh(filterSelect) { async refresh(filterSelect) {
this.loading = true; this.loading = true;
this.treeData = this.treeList = []; this.treeData = this.treeList = [];
try { try {
const res = await getPublishMapTree(filterSelect); const res = await getPublishMapTree(filterSelect);
this.treeData = res.data; this.treeData = res.data;
this.treeList = this.filterText this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); }) ? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data; : res.data;
if (this.treeData.length > 0) { if (this.treeData.length > 0) {
this.treeData.forEach(v => { this.treeData.forEach(v => {
v.children = []; v.children = [];
}); });
} }
this.$nextTick(() => { this.$nextTick(() => {
const mapId = getSessionStorage('demonList') || null; const mapId = getSessionStorage('demonList') || null;
this.$refs.tree.setCurrentKey(mapId); this.$refs.tree.setCurrentKey(mapId);
this.loading = false; this.loading = false;
}); });
} catch (error) { } catch (error) {
this.loading = false; this.loading = false;
this.$messageBox(this.$t('error.refreshFailed')); this.$messageBox(this.$t('error.refreshFailed'));
} }
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -79,10 +79,9 @@ import { getProductDetail } from '@/api/management/mapprd';
import { runDiagramQuit, getSimulationInfo } from '@/api/simulation'; import { runDiagramQuit, getSimulationInfo } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic'; import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { loadMapData, loadMapDataById } from '@/utils/loaddata'; import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import Vue from 'vue'; import Vue from 'vue';
// import { UrlConfig } from '@/router/index';
import {loadDraftScript} from '@/api/designPlatform'; import {loadDraftScript} from '@/api/designPlatform';
// //
@ -401,7 +400,7 @@ export default {
if (rest && rest.code == 200) { if (rest && rest.code == 200) {
const data = rest.data; const data = rest.data;
await this.$store.dispatch('training/setPrdType', data.prdType); await this.$store.dispatch('training/setPrdType', data.prdType);
await this.loadMapData(detail.skinCode); await this.loadMapDataById(this.mapId);
} }
} else { } else {
this.$messageBox(`获取实训步骤数据失败`); this.$messageBox(`获取实训步骤数据失败`);
@ -417,9 +416,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setPrdType', '');
if (parseInt(this.skinCode)) { if (parseInt(this.mapId)) {
await this.loadMapData(this.skinCode); await this.loadMapDataById(this.mapId);
} else { } else {
this.endViewLoading(); this.endViewLoading();
} }
@ -430,9 +428,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]); this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]);
if (parseInt(this.skinCode)) { if (parseInt(this.mapId)) {
await this.loadMapData(this.skinCode); await this.loadMapDataById(this.mapId);
} else { } else {
this.endViewLoading(); this.endViewLoading();
} }
@ -443,9 +440,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setPrdType', '01');
if (parseInt(this.skinCode)) { if (parseInt(this.mapId)) {
await this.loadMapData(this.skinCode); await this.loadMapDataById(this.mapId);
} else { } else {
this.endViewLoading(); this.endViewLoading();
} }
@ -468,9 +464,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setPrdType', '01');
if (parseInt(this.skinCode)) { if (parseInt(this.mapId)) {
await this.loadMapData(this.skinCode); await this.loadMapDataById(this.mapId);
} else { } else {
this.endViewLoading(); this.endViewLoading();
} }
@ -535,16 +530,6 @@ export default {
async quitQuest() { async quitQuest() {
this.questId = 0; this.questId = 0;
}, },
//
async loadMapData(skinCode) {
try {
await loadMapData(skinCode);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
// id // id
async loadMapDataById(mapId) { async loadMapDataById(mapId) {

File diff suppressed because it is too large Load Diff

View File

@ -27,132 +27,132 @@ import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
name: 'MenuExam', name: 'MenuExam',
components: { components: {
TipExamList TipExamList
}, },
props: { props: {
group: { group: {
type: String, type: String,
required: true required: true
}, },
offset: { offset: {
type: Number, type: Number,
required: true required: true
} }
}, },
data() { data() {
return { return {
isDisable: false, isDisable: false,
startLoading: false, startLoading: false,
training: { training: {
id: '', id: '',
name: '', name: '',
remarks: '' remarks: ''
} }
}; };
}, },
computed: { computed: {
formatUsedTime() { formatUsedTime() {
return timeFormat(this.$store.state.training.usedTime); return timeFormat(this.$store.state.training.usedTime);
} }
}, },
watch: { watch: {
'$store.state.map.mapViewLoadedCount': function() { '$store.state.map.mapViewLoadedCount': function() {
this.$store.dispatch('exam/countUsedTime'); this.$store.dispatch('exam/countUsedTime');
} }
}, },
methods: { methods: {
tipInfo(opt) { tipInfo(opt) {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
const h = this.$createElement; const h = this.$createElement;
this.$notify({ this.$notify({
title: this.$t('global.tips'), title: this.$t('global.tips'),
message: h('i', { style: 'color:' + opt.color }, this.$t('display.exam.startTestOperateTip')) message: h('i', { style: 'color:' + opt.color }, this.$t('display.exam.startTestOperateTip'))
}); });
} }
}, },
start() { start() {
this.$store.dispatch('menuOperation/setButtonOperation', null); this.$store.dispatch('menuOperation/setButtonOperation', null);
this.startLoading = true; this.startLoading = true;
if (this.$route.query.trainingId) { if (this.$route.query.trainingId) {
this.isDisable = true; this.isDisable = true;
startTraining({ id: this.$route.query.trainingId }, this.group).then(response => { startTraining({ id: this.$route.query.trainingId }, this.group).then(response => {
this.$store.dispatch('training/examModeStart'); this.$store.dispatch('training/examModeStart');
this.$store.dispatch('map/clearJlmapTrainView').then(() => { this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => { this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}); });
this.startLoading = false; this.startLoading = false;
}).catch(() => { }).catch(() => {
this.isDisable = false; this.isDisable = false;
this.startLoading = false; this.startLoading = false;
}); });
} else { } else {
this.startLoading = true; this.startLoading = true;
this.$messageBox(this.$t('display.exam.selectTest')); this.$messageBox(this.$t('display.exam.selectTest'));
} }
}, },
end() { end() {
if (this.$route.query.trainingId) { if (this.$route.query.trainingId) {
this.isDisable = false; this.isDisable = false;
if (this.$store.state.training.started) { if (this.$store.state.training.started) {
const model = { const model = {
id: this.$route.query.examQuestionId, id: this.$route.query.examQuestionId,
usedTime: this.$store.state.training.usedTime, usedTime: this.$store.state.training.usedTime,
group: this.group group: this.group
}; };
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
finishOneExamQuestion(model).then(response => { finishOneExamQuestion(model).then(response => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.init(); this.init();
}).catch(() => { }).catch(() => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$messageBox(this.$t('display.exam.endTrainingError')); this.$messageBox(this.$t('display.exam.endTrainingError'));
}); });
} else { } else {
this.isDisable = true; this.isDisable = true;
this.$messageBox(this.$t('display.exam.startTestTip')); this.$messageBox(this.$t('display.exam.startTestTip'));
} }
} }
}, },
back() { back() {
this.$confirm(this.$t('display.exam.endTestTip'), this.$t('global.tips'), { this.$confirm(this.$t('display.exam.endTestTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$emit('quit'); this.$emit('quit');
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${this.$route.query.examId}`, query: { subSystem: this.$route.query.subSystem }}); this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${this.$route.query.examId}`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId }});
Notification.closeAll(); Notification.closeAll();
exitFullscreen(); exitFullscreen();
}).catch(() => { }).catch(() => {
}); });
}, },
init() { init() {
launchFullscreen(); launchFullscreen();
// //
refreshExamList(this.$route.query.userExamId).then(response => { refreshExamList(this.$route.query.userExamId).then(response => {
this.$store.dispatch('exam/setUsedTime', response.data.usedTime); this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration); this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { }); this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
}).catch(error => { }).catch(error => {
// 50009y // 50009y
if (error.code === 500009) { if (error.code === 500009) {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: {subSystem: this.$route.query.subSystem} }); this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
} else { } else {
this.$messageBox(this.$t('display.exam.refreshListError')); this.$messageBox(this.$t('display.exam.refreshListError'));
} }
}); });
}, },
refresh() { refresh() {
this.isDisable = false; this.isDisable = false;
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -5,164 +5,164 @@
</el-select> </el-select>
<el-button-group> <el-button-group>
<!-- viewRunQuest --> <!-- viewRunQuest -->
<el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{$t('display.schema.selectRoles')}}</el-button> <el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{ $t('display.schema.selectRoles') }}</el-button>
<el-button v-if="isDemon && !isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{$t('display.schema.loadScript')}}</el-button> <el-button v-if="isDemon && !isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('display.schema.previewRunDiagram')}}</el-button> <el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{$t('display.schema.loadRunDiagram')}}</el-button> <el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('display.schema.faultSetting')}}</el-button> <el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{ $t('display.schema.faultSetting') }}</el-button>
</el-button-group> </el-button-group>
<el-radio-group v-if="!isPlan" v-model="mode" size="small" @change="changeOperateMode(mode)"> <el-radio-group v-if="!isPlan" v-model="mode" size="small" @change="changeOperateMode(mode)">
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{$t('display.schema.normalOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('display.schema.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{$t('display.schema.faultOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('display.schema.faultOperation') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinCode, queryRunPlan } from '@/api/runplan'; import { getStationList, queryRunPlan } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData } from '@/api/simulation';
import {getRpDetailByUserMapId} from '@/api/designPlatform'; import {getRpDetailByUserMapId} from '@/api/designPlatform';
export default { export default {
name: 'MenuSchema', name: 'MenuSchema',
props: { props: {
group: { group: {
type: String, type: String,
required: true required: true
}, },
offset: { offset: {
type: Number, type: Number,
required: true required: true
} }
}, },
data() { data() {
return { return {
mode: OperateMode.NORMAL, mode: OperateMode.NORMAL,
OperateMode: OperateMode, OperateMode: OperateMode,
viewDisabled: true, viewDisabled: true,
runing: false, runing: false,
swch: '02', swch: '02',
swchList: [ swchList: [
{ value: '01', name: '现地' }, { value: '01', name: '现地' },
{ value: '02', name: '行调' } { value: '02', name: '行调' }
] ]
}; };
}, },
computed: { computed: {
...mapGetters('runPlan', [ ...mapGetters('runPlan', [
'stations' 'stations'
]), ]),
notScript() { notScript() {
return this.$route.params.mode !== 'script'; return this.$route.params.mode !== 'script';
}, },
isPlan() { isPlan() {
return this.$route.params.mode === 'plan'; return this.$route.params.mode === 'plan';
}, },
isScript() { isScript() {
// return this.$route.params.mode === 'script'; // return this.$route.params.mode === 'script';
return false; return false;
}, },
isDemon() { isDemon() {
return this.$route.params.mode === 'demon'; return this.$route.params.mode === 'demon';
}, },
isDesignPlatform(){ isDesignPlatform() {
return this.$route.fullPath.includes('design/display/demon'); return this.$route.fullPath.includes('design/display/demon');
} }
}, },
watch: { watch: {
'$store.state.training.started': function (val) { '$store.state.training.started': function (val) {
this.setRuning(val); this.setRuning(val);
}, },
'$store.state.training.switchcount': async function () { '$store.state.training.switchcount': async function () {
if (this.group) { if (this.group) {
const started = this.$store.state.training.started; const started = this.$store.state.training.started;
if (started) { if (started) {
await this.loadRunData(this.$route.query); await this.loadRunData(this.$route.query);
} }
} }
} }
}, },
async mounted() { async mounted() {
await this.loadRunData(this.$route.query); console.log(this.$route.query, '=====');
}, await this.loadRunData(this.$route.query);
methods: { },
loadRunData(opt) { methods: {
this.$store.dispatch('runPlan/clear').then(() => { loadRunData(opt) {
if (opt && opt.skinCode) { this.$store.dispatch('runPlan/clear').then(() => {
this.viewDisabled = true; if (opt && opt.mapId) {
getStationListBySkinCode(opt.skinCode).then(response => { this.viewDisabled = true;
this.$store.dispatch('runPlan/setStations', response.data).then(() => { getStationList(opt.mapId).then(response => {
if (this.$route.params.mode == 'plan') { this.$store.dispatch('runPlan/setStations', response.data).then(() => {
// debugger; if (this.$route.params.mode == 'plan') {
if(this.$route.query.from=="user"){ // debugger;
// if (this.$route.query.from == 'user') {
getRpDetailByUserMapId(this.$route.query.planId).then(resp => { //
this.$store.dispatch('runPlan/setPlanData', resp.data); getRpDetailByUserMapId(this.$route.query.planId).then(resp => {
this.viewDisabled = false; this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => { this.viewDisabled = false;
this.$store.dispatch('runPlan/setPlanData', []); }).catch(() => {
this.$messageBox(this.$t('display.schema.getRunDiagramFail')); this.$store.dispatch('runPlan/setPlanData', []);
}); this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}else{ });
// } else {
queryRunPlan(this.$route.query.planId).then(resp => { //
this.$store.dispatch('runPlan/setPlanData', resp.data); queryRunPlan(this.$route.query.planId).then(resp => {
this.viewDisabled = false; this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => { this.viewDisabled = false;
this.$store.dispatch('runPlan/setPlanData', []); }).catch(() => {
this.$messageBox(this.$t('display.schema.getRunDiagramFail')); this.$store.dispatch('runPlan/setPlanData', []);
}); this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
} });
}
} else {
} else { getEveryDayRunPlanData(this.group).then(resp => {
getEveryDayRunPlanData(this.group).then(resp => { this.$store.dispatch('runPlan/setPlanData', resp.data);
this.$store.dispatch('runPlan/setPlanData', resp.data); this.viewDisabled = false;
this.viewDisabled = false; }).catch(error => {
}).catch(error => { this.$store.dispatch('runPlan/setPlanData', []);
this.$store.dispatch('runPlan/setPlanData', []); if (error.code == 30001) {
if (error.code == 30001) { this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad')); } else {
} else { this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
this.$messageBox(this.$t('display.schema.getRunDiagramFail')); }
} });
}); }
} });
}); }).catch(() => {
}).catch(() => { this.$messageBox(this.$t('display.schema.getStationListFail'));
this.$messageBox(this.$t('display.schema.getStationListFail')); });
}); }
} });
}); },
}, changeOperateMode(handle) {
changeOperateMode(handle) { this.$store.dispatch('training/changeOperateMode', { mode: handle });
this.$store.dispatch('training/changeOperateMode', { mode: handle }); },
}, setRuning(run) {
setRuning(run) { this.runing = run;
this.runing = run; },
}, setFault() {
setFault() { this.$emit('faultChooseShow');
this.$emit('faultChooseShow'); },
}, loadRunPlan() {
loadRunPlan() { this.$emit('runPlanLoadShow');
this.$emit('runPlanLoadShow'); },
}, viewRunPlan() {
viewRunPlan() { this.$emit('runPlanViewShow');
this.$emit('runPlanViewShow'); },
}, viewRunQuest() {
viewRunQuest() { this.$emit('runQuestLoadShow');
this.$emit('runQuestLoadShow'); },
}, viewScriptRoles() {
viewScriptRoles(){ this.$emit('runAddRolesLoadShow');
this.$emit('runAddRolesLoadShow'); },
}, switchMode(swch) {
switchMode(swch) { this.$emit('switchMode', swch);
this.$emit('switchMode', swch); }
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -83,202 +83,203 @@ import { getTrainingDetail } from '@/api/jmap/training';
import { launchFullscreen, exitFullscreen } from '@/utils/screen'; import { launchFullscreen, exitFullscreen } from '@/utils/screen';
export default { export default {
name: 'TipExamList', name: 'TipExamList',
components: { components: {
}, },
data() { data() {
return { return {
training: { training: {
id: '', id: '',
name: '', name: '',
remarks: '' remarks: ''
}, },
isShrink: false, isShrink: false,
examName: '', examName: '',
courseModel: { courseModel: {
id: '', id: '',
name: '', name: '',
maxDuration: '', maxDuration: '',
minDuration: '', minDuration: '',
remarks: '', remarks: '',
updateTime: '' updateTime: ''
}, },
detailShow: false, detailShow: false,
examIndex: 0 examIndex: 0
}; };
}, },
computed: { computed: {
...mapGetters('trainingList', [ ...mapGetters('trainingList', [
'trainingList' 'trainingList'
]), ]),
remainTime() { remainTime() {
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime; return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
}, },
formatRemainTime() { formatRemainTime() {
if (this.remainTime < 0) { if (this.remainTime < 0) {
this.$message.success(this.$t('display.exam.autoSubmit')); this.$message.success(this.$t('display.exam.autoSubmit'));
this.submit(); this.submit();
} }
return timeFormat(this.remainTime); return timeFormat(this.remainTime);
}, },
isFirst() { isFirst() {
return this.examIndex == 0; return this.examIndex == 0;
}, },
isLast() { isLast() {
return this.examIndex == this.trainingList.length - 1; return this.examIndex == this.trainingList.length - 1;
} }
}, },
mounted() { mounted() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
backList() { backList() {
this.detailShow = true; this.detailShow = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value node-key this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value node-key
}); });
}, },
// //
selectedTraining(obj) { selectedTraining(obj) {
this.trainingList.forEach((item, index) => { this.trainingList.forEach((item, index) => {
if (item.id == obj.id) { if (item.id == obj.id) {
this.examIndex = index; this.examIndex = index;
return; return;
} }
}); });
if (obj) { if (obj) {
getTrainingDetail(obj.trainingId ).then(res => { getTrainingDetail(obj.trainingId ).then(res => {
this.courseModel = { this.courseModel = {
id: res.data.id, id: res.data.id,
name: res.data.name, name: res.data.name,
maxDuration: res.data.maxDuration, maxDuration: res.data.maxDuration,
remarks: res.data.remarks, remarks: res.data.remarks,
minDuration: res.data.minDuration, minDuration: res.data.minDuration,
updateTime: res.data.updateTime updateTime: res.data.updateTime
}; };
}).catch(error => { }).catch(error => {
this.$message.error(this.$t('display.exam.getTestInformation')+':' + error.message); this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
}); });
} }
this.jump(obj); this.jump(obj);
}, },
getTrainDetail(obj) { getTrainDetail(obj) {
this.selectedTraining(obj); this.selectedTraining(obj);
this.detailShow = false; this.detailShow = false;
}, },
// //
loadInitData() { loadInitData() {
// //
refreshExamList(this.$route.query.userExamId).then(response => { refreshExamList(this.$route.query.userExamId).then(response => {
this.examName = response.data.examName; this.examName = response.data.examName;
this.$store.dispatch('exam/setUsedTime', response.data.usedTime); this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration); this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { }); this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
const obj = { const obj = {
trainingId: '', trainingId: '',
id: '' id: ''
}; };
if (this.$route.query.examQuestionId && this.$route.query.trainingId) { if (this.$route.query.examQuestionId && this.$route.query.trainingId) {
obj.trainingId = this.$route.query.trainingId; obj.trainingId = this.$route.query.trainingId;
obj.id = this.$route.query.examQuestionId; obj.id = this.$route.query.examQuestionId;
} else { } else {
obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId; obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId;
obj.id = response.data.userExamQuestionsVOs[0].id; obj.id = response.data.userExamQuestionsVOs[0].id;
} }
this.selectedTraining(obj); this.selectedTraining(obj);
}).catch(error => { }).catch(error => {
// 50009y // 50009y
if (error.code === 500009) { if (error.code === 500009) {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem } }); this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem } });
} else { } else {
this.$messageBox(this.$t('display.exam.refreshListError')); this.$messageBox(this.$t('display.exam.refreshListError'));
} }
}); });
this.shrink(); this.shrink();
}, },
nextExam() { nextExam() {
const obj = { const obj = {
trainingId: '', trainingId: '',
id: '' id: ''
}; };
if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) { if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex + 1].trainingId; obj.trainingId = this.trainingList[this.examIndex + 1].trainingId;
obj.id = this.trainingList[this.examIndex + 1].id; obj.id = this.trainingList[this.examIndex + 1].id;
this.examIndex = this.examIndex + 1; this.examIndex = this.examIndex + 1;
} }
if (obj.trainingId && obj.id) { if (obj.trainingId && obj.id) {
this.selectedTraining(obj); this.selectedTraining(obj);
} }
}, },
lastExam() { lastExam() {
const obj = { const obj = {
trainingId: '', trainingId: '',
id: '' id: ''
}; };
if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) { if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex - 1].trainingId; obj.trainingId = this.trainingList[this.examIndex - 1].trainingId;
obj.id = this.trainingList[this.examIndex - 1].id; obj.id = this.trainingList[this.examIndex - 1].id;
this.examIndex = this.examIndex - 1; this.examIndex = this.examIndex - 1;
} }
if (obj.trainingId && obj.id) { if (obj.trainingId && obj.id) {
this.selectedTraining(obj); this.selectedTraining(obj);
} }
}, },
jump(obj) { jump(obj) {
const query = { const query = {
group: this.$route.query.group, group: this.$route.query.group,
userExamId: this.$route.query.userExamId, userExamId: this.$route.query.userExamId,
trainingId: obj.trainingId, trainingId: obj.trainingId,
examQuestionId: obj.id, examQuestionId: obj.id,
subSystem: this.$route.query.subSystem, subSystem: this.$route.query.subSystem,
examId: this.$route.query.examId examId: this.$route.query.examId,
}; mapId: this.$route.query.mapId
this.$router.push({ path: '/display/exam', query: query }); };
this.$emit('refresh'); this.$router.push({ path: '/display/exam', query: query });
launchFullscreen(); this.$emit('refresh');
}, launchFullscreen();
overExam() { },
this.$store.dispatch('exam/isOver').then(isOver => { overExam() {
if (isOver) { this.$store.dispatch('exam/isOver').then(isOver => {
this.submit(); if (isOver) {
} else { this.submit();
this.$confirm(this.$t('display.exam.cancleExam'), this.$t('global.tips'), { } else {
cancelButtonText: this.$t('global.cancel'), this.$confirm(this.$t('display.exam.cancleExam'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), cancelButtonText: this.$t('global.cancel'),
type: 'warning', confirmButtonText: this.$t('global.confirm'),
center: true type: 'warning',
}).then(() => { center: true
this.submit(); }).then(() => {
}).catch(() => { this.submit();
}); }).catch(() => {
} });
}); }
}, });
submit() { },
exitFullscreen(); submit() {
this.$store.dispatch('exam/over').then(() => { exitFullscreen();
this.$store.dispatch('trainingList/clearTrainingList'); this.$store.dispatch('exam/over').then(() => {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} }); this.$store.dispatch('trainingList/clearTrainingList');
}); this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
}, });
shrink() { },
const height = this.$refs.dragBody.offsetHeight + 40; shrink() {
const top = this.$refs.drapBox.style.top; const height = this.$refs.dragBody.offsetHeight + 40;
if (this.isShrink) { const top = this.$refs.drapBox.style.top;
this.$refs.drapBox.style.height = '40px'; if (this.isShrink) {
this.$refs.drapBox.style.top = ''; this.$refs.drapBox.style.height = '40px';
this.isShrink = false; this.$refs.drapBox.style.top = '';
} else { this.isShrink = false;
this.$refs.drapBox.style.height = height + 'px'; } else {
this.$refs.drapBox.style.top = top; this.$refs.drapBox.style.height = height + 'px';
this.isShrink = true; this.$refs.drapBox.style.top = top;
} this.isShrink = true;
} }
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -60,149 +60,149 @@ import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'ExamDetailView', name: 'ExamDetailView',
components: { components: {
LimitList LimitList
}, },
data() { data() {
return { return {
loading: false, loading: false,
courseModel: { courseModel: {
id: '', id: '',
name: this.$t('rules.lessonInput'), name: this.$t('rules.lessonInput'),
price: 0, price: 0,
remarks: '', remarks: '',
detail: [], detail: [],
pmsList: [], pmsList: [],
treeList: [] treeList: []
}, },
EffectiveTypeList: [], EffectiveTypeList: [],
activeName: 'first', activeName: 'first',
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
expandList: [], expandList: [],
valid: false valid: false
}; };
}, },
computed: { computed: {
hasPermssion() { hasPermssion() {
return this.courseModel.pmsList.length > 0; return this.courseModel.pmsList.length > 0;
}, },
isAddRule() { isAddRule() {
let sumRemains = 0; let sumRemains = 0;
if (this.courseModel.pmsList) { if (this.courseModel.pmsList) {
this.courseModel.pmsList.forEach(elem => { this.courseModel.pmsList.forEach(elem => {
sumRemains += elem.remains; sumRemains += elem.remains;
}); });
} }
return sumRemains >= 10; return sumRemains >= 10;
}, },
height() { height() {
return this.$store.state.app.height - 91; return this.$store.state.app.height - 91;
} }
}, },
watch: { watch: {
'$route.params.subSystem': function (val) { '$route.params.subSystem': function (val) {
this.loadInitPage(); this.loadInitPage();
} }
}, },
mounted() { mounted() {
this.$Dictionary.effectiveType().then(list => { this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list; this.EffectiveTypeList = list;
}); });
this.loadInitPage(); this.loadInitPage();
}, },
methods: { methods: {
loadInitPage() { loadInitPage() {
getCourseLessonDetail({lessonId: this.$route.query.lessonId}).then(resp =>{ getCourseLessonDetail({lessonId: this.$route.query.lessonId}).then(resp =>{
if (resp.data) { if (resp.data) {
this.courseModel = { this.courseModel = {
id: resp.data.id, id: resp.data.id,
name: resp.data.name, name: resp.data.name,
pmsList: resp.data.permissionList || [], pmsList: resp.data.permissionList || [],
prdCode: resp.data.prdCode, prdCode: resp.data.prdCode,
mapId: resp.data.mapId, mapId: resp.data.mapId,
PermissionType: PermissionType.EXAM, PermissionType: PermissionType.EXAM,
treeList: resp.data.examDefinitionList treeList: resp.data.examDefinitionList
}; };
} }
if (this.courseModel.pmsList && this.courseModel.pmsList.length >0) { if (this.courseModel.pmsList && this.courseModel.pmsList.length > 0) {
this.valid = true; this.valid = true;
} }
this.getExpandList(this.courseModel.id); this.getExpandList(this.courseModel.id);
}).catch(()=>{ }).catch(()=>{
this.$messageBox('获取考试信息失败!'); this.$messageBox('获取考试信息失败!');
}); });
}, },
buy() { buy() {
this.loading = true; this.loading = true;
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem } query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
}); });
}, },
checkCourse() { checkCourse() {
this.loading = true; this.loading = true;
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.examRuleManage}`, path: `${UrlConfig.trainingPlatform.examRuleManage}`,
query: { lessonId: this.courseModel.id } query: { lessonId: this.courseModel.id }
}); });
}, },
transfer() { // transfer() { //
this.loading = false; this.loading = false;
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel); this.$refs.limitList.transfer(this.courseModel);
} }
}, },
distribute() { // distribute() { //
this.loading = false; this.loading = false;
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel); this.$refs.limitList.distribute(this.courseModel);
} }
}, },
clickEvent(obj, node, data) { clickEvent(obj, node, data) {
if (this.valid || obj.trial) { if (this.valid || obj.trial) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem }}); this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem, mapId: this.courseModel.mapId }});
} else { } else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel') cancelButtonText: this.$t('tip.cancel')
}).then(() => { }).then(() => {
this.buy(); this.buy();
}).catch(() => { }); }).catch(() => { });
} }
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.name.indexOf(value) !== -1; return data.name.indexOf(value) !== -1;
}, },
nodeExpand(obj, node, ele) { nodeExpand(obj, node, ele) {
const key = obj.id; const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key); this.expandList = this.expandList.filter(item => item !== key);
this.expandList.push(key); this.expandList.push(key);
setSessionStorage('trainingExamExpandList'+this.courseModel.id, this.expandList); setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList);
}, },
nodeCollapse(obj, node, ele) { nodeCollapse(obj, node, ele) {
const key = obj.id; const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key); this.expandList = this.expandList.filter(item => item !== key);
setSessionStorage('trainingExamExpandList'+this.courseModel.id, this.expandList); setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList);
}, },
getExpandList(id) { getExpandList(id) {
let expand = getSessionStorage('trainingExamExpandList'+id); let expand = getSessionStorage('trainingExamExpandList' + id);
expand = expand?(expand+'').split(','):''; expand = expand ? (expand + '').split(',') : '';
if (expand instanceof Array) { if (expand instanceof Array) {
this.expandList = expand; this.expandList = expand;
} }
}, },
backLessonList() { backLessonList() {
localStore.remove('examDetail'+this.$route.params.subSystem); localStore.remove('examDetail' + this.$route.params.subSystem);
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${this.$route.params.subSystem}`}); this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${this.$route.params.subSystem}`});
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -60,164 +60,165 @@ import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
name: 'ExamDetailView', name: 'ExamDetailView',
data() { data() {
return { return {
loading: false, loading: false,
examDetails: { examDetails: {
lessonId: '', lessonId: '',
name: '', name: '',
remarks: '', remarks: '',
examDefinitionRulesVOList: [], examDefinitionRulesVOList: [],
startTime: '', startTime: '',
endTime: '', endTime: '',
fullPoint: '', fullPoint: '',
passingPoint: '', passingPoint: '',
duration: '', duration: '',
type: '' type: ''
}, },
typeList: [], typeList: [],
examList: [], examList: [],
trainingOperateTypeMap: {} trainingOperateTypeMap: {}
}; };
}, },
computed: { computed: {
...mapGetters('trainingList', [ ...mapGetters('trainingList', [
'trainingList' 'trainingList'
]), ]),
height() { height() {
return this.$store.state.app.height - 50; return this.$store.state.app.height - 50;
} }
}, },
watch: { watch: {
'$route.params.examId': function (val) { '$route.params.examId': function (val) {
this.loadInitPage(val); this.loadInitPage(val);
} }
}, },
async mounted() { async mounted() {
this.trainingOperateTypeMap = {}; this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => { this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; // this.trainingOperateTypeMap['01'] = list; //
}); });
this.$Dictionary.signalOperation().then(list => { this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; // this.trainingOperateTypeMap['02'] = list; //
}); });
this.$Dictionary.switchOperation().then(list => { this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; // this.trainingOperateTypeMap['03'] = list; //
}); });
this.$Dictionary.sectionOperation().then(list => { this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; // this.trainingOperateTypeMap['04'] = list; //
}); });
this.$Dictionary.stationStandOperation().then(list => { this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; // this.trainingOperateTypeMap['05'] = list; //
}); });
this.$Dictionary.trainPlanOperation().then(list => { this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; // this.trainingOperateTypeMap['06'] = list; //
}); });
this.$Dictionary.trainOperation().then(list => { this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; // this.trainingOperateTypeMap['07'] = list; //
}); });
await this.getList(); await this.getList();
this.loadInitPage(this.$route.params.examId); this.loadInitPage(this.$route.params.examId);
}, },
methods: { methods: {
async getList() { async getList() {
this.typeList = []; this.typeList = [];
await getDetailList('training_type').then(res => { await getDetailList('training_type').then(res => {
this.typeList = res.data; this.typeList = res.data;
}); });
}, },
async loadInitPage(examId) { async loadInitPage(examId) {
if (examId) { if (examId) {
const res = await getExamLessonDetail(examId); const res = await getExamLessonDetail(examId);
this.examDetails = res.data; this.examDetails = res.data;
this.examDetails.examDefinitionRulesVOList.forEach((res, index) => { this.examDetails.examDefinitionRulesVOList.forEach((res, index) => {
res.chapterIdLong = Number(res.num) * Number(res.point); res.chapterIdLong = Number(res.num) * Number(res.point);
this.typeList.forEach(v => { this.typeList.forEach(v => {
if (res.trainingType == v.code) { if (res.trainingType == v.code) {
this.examDetails.examDefinitionRulesVOList[index].name = v.name; this.examDetails.examDefinitionRulesVOList[index].name = v.name;
if (res.operateType) { if (res.operateType) {
this.trainingOperateTypeMap[res.trainingType].forEach(item => { this.trainingOperateTypeMap[res.trainingType].forEach(item => {
if (item.code == res.operateType) { if (item.code == res.operateType) {
this.examDetails.examDefinitionRulesVOList[index].name = `${this.examDetails.examDefinitionRulesVOList[index].name}-${item.name}`; this.examDetails.examDefinitionRulesVOList[index].name = `${this.examDetails.examDefinitionRulesVOList[index].name}-${item.name}`;
return; return;
} }
}); });
} }
} }
}); });
}); });
} }
}, },
buy() { buy() {
this.loading = true; this.loading = true;
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => { getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`, path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdCode: res.data.prdCode, mapId: res.data.mapId } query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdCode: res.data.prdCode, mapId: res.data.mapId }
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.obtainCourseDetailsFailed')); this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
this.loading = false; this.loading = false;
}); });
}, },
async examDetail() { async examDetail() {
const data = this.examDetails; const data = this.examDetails;
try { try {
const response = await generateExamList(data.id); const response = await generateExamList(data.id);
this.examList = response.data.userExamQuestionsVOs; this.examList = response.data.userExamQuestionsVOs;
this.userExam = response.data; this.userExam = response.data;
const list = response.data.userExamQuestionsVOs; const list = response.data.userExamQuestionsVOs;
await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime); await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime);
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration); await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
await this.$store.dispatch('trainingList/setTrainingList', list); await this.$store.dispatch('trainingList/setTrainingList', list);
} catch (error) { } catch (error) {
// //
if (error.code === 500004) { if (error.code === 500004) {
this.$confirm( this.$t('tip.noCourseAuthority'), this.$t('tip.hint'), { this.$confirm( this.$t('tip.noCourseAuthority'), this.$t('tip.hint'), {
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
confirmButtonText: this.$t('global.confirm'), 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.$t('tip.notWithinTheScopeOfTheExamination')); this.$messageBox(this.$t('tip.notWithinTheScopeOfTheExamination'));
} else { } else {
this.$messageBox(`${error.message}`); this.$messageBox(`${error.message}`);
} }
} }
}, },
async exmaStart() { async exmaStart() {
this.loading = true; this.loading = true;
await this.examDetail(); await this.examDetail();
if (this.examList.length) { if (this.examList.length) {
examNotify({ examId: this.$route.params.examId }).then(resp => { examNotify({ examId: this.$route.params.examId }).then(resp => {
const query = { const query = {
group: resp.data, group: resp.data,
trainingId: this.examList[0].trainingId, trainingId: this.examList[0].trainingId,
userExamId: this.userExam.id, userExamId: this.userExam.id,
examQuestionId: this.examList[0].id, examQuestionId: this.examList[0].id,
subSystem: this.$route.query.subSystem, subSystem: this.$route.query.subSystem,
examId: this.$route.params.examId examId: this.$route.params.examId,
}; mapId: this.$route.query.mapId
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query }); };
launchFullscreen(); this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
}).catch(error => { launchFullscreen();
this.loading = false; }).catch(error => {
this.$messageBox( this.$t('error.createSimulationFailed') +`: ${error.message}`); this.loading = false;
}); this.$messageBox( this.$t('error.createSimulationFailed') + `: ${error.message}`);
} else { });
this.loading = false; } else {
} this.loading = false;
}, }
back() { },
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.examDetails.lessonId}}); back() {
} this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.examDetails.lessonId}});
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -35,83 +35,83 @@ import { launchFullscreen } from '@/utils/screen';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
export default { export default {
name: 'ExamDetailList', name: 'ExamDetailList',
filters: { filters: {
setTime(val) { setTime(val) {
return val; return val;
} }
}, },
data() { data() {
return { return {
loading: false, loading: false,
courseModel: { courseModel: {
id: '', id: '',
name: '', name: '',
skinCode: '', skinCode: '',
maxDuration: '', maxDuration: '',
minDuration: '', minDuration: '',
remarks: '', remarks: '',
updateTime: '' updateTime: ''
} }
}; };
}, },
computed: { computed: {
formatExamUsedTime() { formatExamUsedTime() {
return timeFormat(this.$store.state.exam.usedTime); return timeFormat(this.$store.state.exam.usedTime);
}, },
height() { height() {
return this.$store.state.app.height; return this.$store.state.app.height;
} }
}, },
watch: { watch: {
$route(newVal) { $route(newVal) {
this.initLoadPage(); this.initLoadPage();
} }
}, },
mounted() { mounted() {
this.initLoadPage(); this.initLoadPage();
}, },
methods: { methods: {
initLoadPage() { initLoadPage() {
const trainingId = this.$route.query.trainingId; const trainingId = this.$route.query.trainingId;
if (parseInt(trainingId)) { if (parseInt(trainingId)) {
getTrainingDetail(trainingId).then(res => { getTrainingDetail(trainingId).then(res => {
this.courseModel = { this.courseModel = {
id: res.data.id, id: res.data.id,
name: res.data.name, name: res.data.name,
skinCode: res.data.skinCode, skinCode: res.data.skinCode,
maxDuration: res.data.maxDuration, maxDuration: res.data.maxDuration,
remarks: res.data.remarks, remarks: res.data.remarks,
minDuration: res.data.minDuration, minDuration: res.data.minDuration,
updateTime: res.data.updateTime updateTime: res.data.updateTime
}; };
}).catch(error => { }).catch(error => {
this.$message.error( this.$t('error.getTestInformationFailed') + ':' + error.message); this.$message.error( this.$t('error.getTestInformationFailed') + ':' + error.message);
}); });
} }
}, },
start() { start() {
this.loading = true; this.loading = true;
const query = { skinCode: this.$route.query.skinCode, trainingId: this.$route.query.trainingId, userExamId: this.$route.query.userExamId, examQuestionId: this.$route.params.examQuestionId }; const query = { skinCode: this.$route.query.skinCode, trainingId: this.$route.query.trainingId, userExamId: this.$route.query.userExamId, examQuestionId: this.$route.params.examQuestionId };
this.$router.push({ path: '/display/exam', query: query }); this.$router.push({ path: '/display/exam', query: query });
launchFullscreen(); launchFullscreen();
}, },
back() { back() {
this.loading = true; this.loading = true;
this.$confirm( this.$t('tip.giveUpTheExamTip'), this.$t('tip.hint'), { this.$confirm( this.$t('tip.giveUpTheExamTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// //
setExamGive(this.$route.query.userExamId).then(() => { setExamGive(this.$route.query.userExamId).then(() => {
this.$router.back(); this.$router.back();
}); });
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
}); });
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,103 +0,0 @@
<template>
<div :id="id" style="background: #000;" />
</template>
<script>
import Jlmap from '@/jmap/map';
import deviceType from '@/jmap/constant/deviceType';
import { getPublishMapDetail } from '@/api/test.js';
export default {
name: 'Jlmap',
data() {
return {
id: '__jmap__',
jmap: null
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.$nextTick(() => {
this.jmap.resize({width: this.$store.state.app.width, height: this.$store.state.app.height});
});
}
},
mounted() {
document.getElementById(this.id).oncontextmenu = function (e) {
return false;
};
this.jmap = new Jlmap({
dom: document.getElementById(this.id),
config: {
renderer: 'canvas',
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight
},
options: {
scaleRate: 1,
offsetX: 0,
offsetY: 0
},
methods: {
dataLoaded() { console.log('dataLoaded'); },
viewLoaded() { console.log('viewLoaded'); },
stateLoaded() { console.log('stateLoaded'); },
viewUpdate() { console.log('viewUpdate'); },
stateUpdate() { console.log('stateUpdate'); }
// optionsUpdate() { console.log('optionsUpdate'); }
}
});
this.jmap.on('selected', this.selected);
this.jmap.on('contextmenu', this.contextmenu);
// const list = [];
// for (let i = 1; i < 20; i++) {
// for (let j = 1; j < 500; j++) {
// list.push({ code: `${(Array(3).join(0) + i).slice(-3)}${(Array(3).join(0) + j).slice(-3)}`, lp: { x: 50 + i * 120, y: 50 + j * 20 }, rp: { x: 150 + i * 120, y: 50 + j * 20 } });
// }
// }
// this.jmap.load({ skinVO: { code: '02' }, linkList: list });
getPublishMapDetail('02').then(resp => {
this.jmap.setLevelVisible([deviceType.Link], false);
this.jmap.setMap(resp.data);
// this.jmap.setDefaultState();
});
// this.jmap.render([
// {code: '11', type: 'Link', lp: { x: 20 , y: 100}, rp: { x: 120, y: 100 }}
// ]);
// this.jmap.update([
// { code: '11', type: 'Link', status: '02' }
// ]);
// this.jmap.render([
// { code: '11', type: 'Link', lp: { x: 0, y: 0 }, rp: { x: 200, y: 200 } }
// ]);
// this.jmap.update([]);
},
beforeDestroy() {
this.jmap.off('selected', this.selected);
this.jmap.off('contextmenu', this.contextmenu);
this.jmap.dispose();
this.jmap = null;
},
methods: {
selected(e) {
// console.log('selected', e, this.jmap);
},
contextmenu(e) {
// console.log('contextmenu', e);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
</style>

View File

@ -37,7 +37,7 @@ import IbpPlate from '@/views/ibp/index';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic'; import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { loadMapData } from '@/utils/loaddata'; import { loadMapDataById } from '@/utils/loaddata';
import { getUserRoles, deljointTrainRoom } from '@/api/chat'; import { getUserRoles, deljointTrainRoom } from '@/api/chat';
import { runDiagramOver, getSimulationInfo } from '@/api/simulation'; import { runDiagramOver, getSimulationInfo } from '@/api/simulation';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive'; import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
@ -46,345 +46,345 @@ import ibpData from '@/ibp/constant/ibpData';
import { Message } from 'element-ui'; import { Message } from 'element-ui';
export default { export default {
name: 'JointTrainingDraft', name: 'JointTrainingDraft',
components: { components: {
MapSystemDraft, MapSystemDraft,
MenuDemonJoint, MenuDemonJoint,
MenuDemonSchema, MenuDemonSchema,
JoinFaultChoose, JoinFaultChoose,
JoinRunPlanLoad, JoinRunPlanLoad,
JoinRunPlanView, JoinRunPlanView,
menuSystemTime, menuSystemTime,
Jl3dDrive, Jl3dDrive,
IbpPlate IbpPlate
}, },
data() { data() {
return { return {
trainingObj: {}, trainingObj: {},
checkLine: null, checkLine: null,
timeDemonNum: 0, timeDemonNum: 0,
offset: 10, offset: 10,
mouseNum: 1, mouseNum: 1,
ierval: null, ierval: null,
mouseNumTime: 0, mouseNumTime: 0,
mapBox: null, mapBox: null,
mapBoxP: null, mapBoxP: null,
userRole: '', userRole: '',
deviceCode: '', deviceCode: '',
group: '', group: '',
mapId: '', mapId: '',
skinCode: '', skinCode: '',
simulationShow: false, simulationShow: false,
drivingShow: false, drivingShow: false,
ibpShow: false, ibpShow: false,
panelShow: true, panelShow: true,
ibpPart: '' ibpPart: ''
}; };
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'canvasWidth', 'canvasWidth',
'canvasHeight' 'canvasHeight'
]), ]),
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
...mapGetters('training', [ ...mapGetters('training', [
'offsetStationCode' 'offsetStationCode'
]), ]),
...mapGetters('config', [ ...mapGetters('config', [
'canvasId' 'canvasId'
]), ]),
width() { width() {
return this.$store.state.app.width; return this.$store.state.app.width;
}, },
height() { height() {
return this.$store.state.app.height; return this.$store.state.app.height;
}, },
right() { right() {
return this.$store.state.config.width / 2 - 55; return this.$store.state.config.width / 2 - 55;
} }
}, },
watch: { watch: {
'$store.state.config.menuBarLoadedCount': function (val) { '$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition(); this.setPosition();
}, },
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBox = document.getElementsByTagName('canvas'); this.mapBox = document.getElementsByTagName('canvas');
}, },
'$store.state.socket.permissionOver': function () { '$store.state.socket.permissionOver': function () {
this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), { this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
showClose: false, showClose: false,
callback: async (action) => { callback: async (action) => {
await this.$store.dispatch('training/over'); await this.$store.dispatch('training/over');
await runDiagramOver(this.group); await runDiagramOver(this.group);
await deljointTrainRoom(this.group); await deljointTrainRoom(this.group);
await this.$router.push({ path: `/trainingPlatform/detail/${this.subSystem}`, query: {mapId: this.mapId} }); await this.$router.push({ path: `/trainingPlatform/detail/${this.subSystem}`, query: {mapId: this.mapId} });
} }
}); });
}, },
'$store.state.socket.jointRoomInfo': function (val) { // '$store.state.socket.jointRoomInfo': function (val) { //
if (val.creatorId) { if (val.creatorId) {
this.handleRoomInfo(val); this.handleRoomInfo(val);
} }
}, },
'$store.state.socket.chatContentList': function (val) { // '$store.state.socket.chatContentList': function (val) { //
if (val.type === 'userRoomKickOut'&&val.oneself) { if (val.type === 'userRoomKickOut' && val.oneself) {
this.$router.push({ path: `/` }); this.$router.push({ path: `/` });
this.messageInfo(this.$t('tip.beKickedOut'), 'warning'); this.messageInfo(this.$t('tip.beKickedOut'), 'warning');
} }
}, },
'$store.state.app.windowSizeCount': function() { '$store.state.app.windowSizeCount': function() {
this.setWindowSize(); this.setWindowSize();
}, },
$route() { $route() {
this.$nextTick(() => { this.$nextTick(() => {
this.initLoadData(); this.initLoadData();
}); });
} }
}, },
async created() { async created() {
this.group = this.$route.query.group; this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId; this.mapId = this.$route.query.mapId;
this.skinCode = this.$route.query.skinCode; this.skinCode = this.$route.query.skinCode;
this.subSystem = this.$route.query.subSystem; this.subSystem = this.$route.query.subSystem;
Message.closeAll(); Message.closeAll();
}, },
async mounted() { async mounted() {
await this.setWindowSize(); await this.setWindowSize();
await this.initLoadData(); await this.initLoadData();
}, },
async beforeDestroy() { async beforeDestroy() {
await this.clearAllTimer(); await this.clearAllTimer();
await this.$store.dispatch('training/end', null); await this.$store.dispatch('training/end', null);
await this.$store.dispatch('training/reset'); await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear'); await this.$store.dispatch('map/mapClear');
await this.$store.dispatch('training/setGroup', ''); await this.$store.dispatch('training/setGroup', '');
Message.closeAll(); Message.closeAll();
}, },
methods: { methods: {
mousemove(e) { mousemove(e) {
this.mouseNum = 1; this.mouseNum = 1;
}, },
handleRoomInfo(data) { handleRoomInfo(data) {
if (data.state == '03') { // 退 if (data.state == '03') { // 退
this.$router.push({ path: `/` }); this.$router.push({ path: `/` });
// this.clearSubscribe(); // this.clearSubscribe();
} else if (data.state == '01') { // } else if (data.state == '01') { //
const query = { group: this.group }; const query = { group: this.group };
this.$router.push({ path: `/trainroom`, query: query }); this.$router.push({ path: `/trainroom`, query: query });
// this.clearSubscribe(); // this.clearSubscribe();
} }
this.$store.dispatch('socket/setJointRoomInfo'); // this.$store.dispatch('socket/setJointRoomInfo'); //
}, },
// 线 // 线
clearAllTimer() { clearAllTimer() {
if (this.ierval) { if (this.ierval) {
clearTimeout(this.ierval); clearTimeout(this.ierval);
this.ierval = null; this.ierval = null;
} }
if (this.checkLine) { if (this.checkLine) {
clearTimeout(this.checkLine); clearTimeout(this.checkLine);
this.checkLine = null; this.checkLine = null;
} }
}, },
// 线 // 线
checkLoginLineTimer() { checkLoginLineTimer() {
if (this.checkLine) { if (this.checkLine) {
clearTimeout(this.checkLine); clearTimeout(this.checkLine);
} }
this.checkLine = setInterval(() => { this.checkLine = setInterval(() => {
checkLoginLine(); checkLoginLine();
}, 5000 * 60); }, 5000 * 60);
}, },
// //
checkMouseStatusTimer() { checkMouseStatusTimer() {
if (this.ierval) { if (this.ierval) {
clearTimeout(this.ierval); clearTimeout(this.ierval);
} }
this.ierval = setInterval(() => { this.ierval = setInterval(() => {
if (this.mouseNum) { if (this.mouseNum) {
this.mouseNum = 0; this.mouseNum = 0;
this.mouseNumTime = 0; this.mouseNumTime = 0;
} else { } else {
this.mouseNumTime += 1; this.mouseNumTime += 1;
} }
if (this.mapBox) { if (this.mapBox) {
if (this.mouseNumTime >= 15) { if (this.mouseNumTime >= 15) {
for (let i = 0; i < this.mapBox.length; i++) { for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = 'none'; this.mapBox[i].style.cursor = 'none';
} }
} else { } else {
for (let i = 0; i < this.mapBox.length; i++) { for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = ''; this.mapBox[i].style.cursor = '';
} }
} }
} }
}, 1000); }, 1000);
}, },
// //
setPosition() { setPosition() {
this.$nextTick(() => { this.$nextTick(() => {
let offset = 10; let offset = 10;
const menuBar = document.getElementById('menuBar'); const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool'); const menuTool = document.getElementById('menuTool');
if (menuBar) { if (menuBar) {
offset += (menuBar.offsetHeight || 0); offset += (menuBar.offsetHeight || 0);
} }
if (menuTool) { if (menuTool) {
offset += (menuTool.offsetHeight || 0); offset += (menuTool.offsetHeight || 0);
} }
if (this.offset != offset) { if (this.offset != offset) {
this.offset = offset; this.offset = offset;
} }
}); });
}, },
// //
endViewLoading(isSuccess) { endViewLoading(isSuccess) {
if (!isSuccess) { if (!isSuccess) {
this.$store.dispatch('map/mapClear'); this.$store.dispatch('map/mapClear');
} }
this.$nextTick(() => { this.$nextTick(() => {
EventBus.$emit('viewLoading', false); EventBus.$emit('viewLoading', false);
}); });
}, },
// //
initLoadData() { initLoadData() {
const width = document.documentElement.clientWidth; const width = document.documentElement.clientWidth;
const height = document.documentElement.clientHeight + 200; const height = document.documentElement.clientHeight + 200;
this.$store.dispatch('config/resize', { width, height }); this.$store.dispatch('config/resize', { width, height });
try { try {
this.loadSimulationInfo(); this.loadSimulationInfo();
this.initLoadDemonData(); this.initLoadDemonData();
this.checkLoginLineTimer(); this.checkLoginLineTimer();
this.checkMouseStatusTimer(); this.checkMouseStatusTimer();
} catch (error) { } catch (error) {
this.$messageBox( this.$t('error.initializationFailed') + error.message); this.$messageBox( this.$t('error.initializationFailed') + error.message);
this.endViewLoading(); this.endViewLoading();
} }
}, },
async loadSimulationInfo() { async loadSimulationInfo() {
const resp = await getSimulationInfo(this.group); const resp = await getSimulationInfo(this.group);
if (resp && resp.code == 200) { if (resp && resp.code == 200) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
this.questId = Number(resp.data.questId) || 0; this.questId = Number(resp.data.questId) || 0;
} }
}, },
async getUserRole() { async getUserRole() {
const res = await getUserRoles(this.group); const res = await getUserRoles(this.group);
this.userRole = res.data.userRole; this.userRole = res.data.userRole;
this.deviceCode = res.data.deviceCode; this.deviceCode = res.data.deviceCode;
this.ibpPart = res.data.ibpPart; this.ibpPart = res.data.ibpPart;
if (this.userRole === 'IBP') { if (this.userRole === 'IBP') {
this.showIbp(this.deviceCode); this.showIbp(this.deviceCode);
} else { } else {
this.hideIbp(); this.hideIbp();
} }
return res; return res;
}, },
// 仿 // 仿
async initLoadDemonData() { async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL); this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (this.skinCode) { if (this.skinCode) {
// 01 02 '' // 01 02 ''
const resp = await this.getUserRole(); const resp = await this.getUserRole();
if (resp && resp.code == 200) { if (resp && resp.code == 200) {
// Admin Instructor Dispatcher Attendant Audience Driver Repair IBP:IBP // Admin Instructor Dispatcher Attendant Audience Driver Repair IBP:IBP
this.userRole = resp.data.userRole; this.userRole = resp.data.userRole;
switch (this.userRole) { switch (this.userRole) {
case 'Admin': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Admin'); this.hideIbp(); break; case 'Admin': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Admin'); this.hideIbp(); break;
case 'Instructor': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Instructor'); this.hideIbp(); break; case 'Instructor': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Instructor'); this.hideIbp(); break;
case 'Dispatcher': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Dispatcher'); this.hideIbp(); break; case 'Dispatcher': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Dispatcher'); this.hideIbp(); break;
case 'Attendant': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'Attendant'); this.hideIbp(); break; case 'Attendant': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'Attendant'); this.hideIbp(); break;
case 'Audience': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience'); this.hideIbp(); break; case 'Audience': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience'); this.hideIbp(); break;
case 'Driver': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver'); this.hideIbp(); break; case 'Driver': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver'); this.hideIbp(); break;
case 'Repair': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair'); this.hideIbp(); break; case 'Repair': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair'); this.hideIbp(); break;
case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); this.showIbp(resp.data.deviceCode); break; case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); this.showIbp(resp.data.deviceCode); break;
case 'BigScreen': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen'); this.hideIbp(); break; case 'BigScreen': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen'); this.hideIbp(); break;
} }
} }
await this.getTrainDetail(this.skinCode); await this.getTrainDetail();
} else { } else {
this.endViewLoading(); this.endViewLoading();
} }
}, },
async getTrainDetail(skinCode) { async getTrainDetail() {
try { try {
await loadMapData(skinCode); await loadMapDataById(this.mapId);
await this.$store.dispatch('training/setMapDefaultState'); await this.$store.dispatch('training/setMapDefaultState');
} catch (error) { } catch (error) {
this.$messageBox(this.$t('error.getMapDataFailed')); this.$messageBox(this.$t('error.getMapDataFailed'));
this.endViewLoading(); this.endViewLoading();
} }
}, },
back() { back() {
this.$refs.demonMenu.back(); this.$refs.demonMenu.back();
}, },
runPlanViewShow() { runPlanViewShow() {
this.$refs.runPlanView.doShow(); this.$refs.runPlanView.doShow();
}, },
runPlanLoadShow() { runPlanLoadShow() {
this.$refs.runPlanLoad.doShow(); this.$refs.runPlanLoad.doShow();
}, },
faultChooseShow() { faultChooseShow() {
this.$refs.faultChoose.doShow(); this.$refs.faultChoose.doShow();
}, },
showdriving() { showdriving() {
this.panelShow = true; this.panelShow = true;
this.drivingShow = false; this.drivingShow = false;
this.ibpShow =false; this.ibpShow = false;
}, },
showIbp(deviceCode) { showIbp(deviceCode) {
this.drivingShow = false; this.drivingShow = false;
this.panelShow = false; this.panelShow = false;
this.ibpShow = true; this.ibpShow = true;
if (!deviceCode || !ibpData[deviceCode]) { if (!deviceCode || !ibpData[deviceCode]) {
Message.warning({message: this.$t('error.ibpNoDraw'), duration: 0, showClose: true, type: 'error'}); Message.warning({message: this.$t('error.ibpNoDraw'), duration: 0, showClose: true, type: 'error'});
return; return;
} else { } else {
Message.closeAll(); Message.closeAll();
} }
this.$refs.ibpPlate.show(deviceCode, this.ibpPart); this.$refs.ibpPlate.show(deviceCode, this.ibpPart);
}, },
hidepanel() { hidepanel() {
this.panelShow = false; this.panelShow = false;
this.drivingShow = true; this.drivingShow = true;
this.ibpShow = false; this.ibpShow = false;
this.$refs.Jl3dDrive.show(this.skinCode); this.$refs.Jl3dDrive.show(this.skinCode);
}, },
hideIbp() { hideIbp() {
Message.closeAll(); Message.closeAll();
this.drivingShow = false; this.drivingShow = false;
this.panelShow = true; this.panelShow = true;
this.ibpShow = false; this.ibpShow = false;
this.$refs.ibpPlate.ibpDestroy(); this.$refs.ibpPlate.ibpDestroy();
}, },
messageInfo(message, type) { messageInfo(message, type) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: message, message: message,
type: type type: type
}); });
}, },
setWindowSize() { setWindowSize() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('config/resize', { width: this.width, height: this.height }); this.$store.dispatch('config/resize', { width: this.width, height: this.height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode }); this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
}); });
} }
} }
}; };
</script> </script>
<style> <style>

View File

@ -12,14 +12,14 @@
<el-button-group> <el-button-group>
<template> <template>
<el-button v-if="runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('joinTraining.runGraphPreview')}}</el-button> <el-button v-if="runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
</template> </template>
<template v-if="userRole == 'Admin'"> <template v-if="userRole == 'Admin'">
<el-button v-if="!runing" size="small" type="warning" :disabled="viewDisabled" @click="loadRunPlan"> <el-button v-if="!runing" size="small" type="warning" :disabled="viewDisabled" @click="loadRunPlan">
{{$t('joinTraining.runGraphLoading')}}</el-button> {{ $t('joinTraining.runGraphLoading') }}</el-button>
</template> </template>
<template v-if="userRole == 'Instructor' || userRole == 'Admin'"> <template v-if="userRole == 'Instructor' || userRole == 'Admin'">
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('joinTraining.faultSetting')}}</el-button> <el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{ $t('joinTraining.faultSetting') }}</el-button>
</template> </template>
</el-button-group> </el-button-group>
@ -29,121 +29,122 @@
size="small" size="small"
@change="changeOperateMode(mode)" @change="changeOperateMode(mode)"
> >
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{$t('joinTraining.normalOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('joinTraining.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{$t('joinTraining.faultOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('joinTraining.faultOperation') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData } from '@/api/simulation';
export default { export default {
name: 'MenuDemonSchema', name: 'MenuDemonSchema',
props: { props: {
group: { group: {
type: String, type: String,
required: true required: true
}, },
offset: { offset: {
type: Number, type: Number,
required: true required: true
}, },
userRole: { userRole: {
type: String, type: String,
required: true required: true
} }
}, },
data() { data() {
return { return {
mode: OperateMode.NORMAL, mode: OperateMode.NORMAL,
OperateMode: OperateMode, OperateMode: OperateMode,
viewDisabled: true, viewDisabled: true,
realData: {}, realData: {},
series: [], series: [],
kmRangeCoordMap: {}, kmRangeCoordMap: {},
runPlanData: {}, runPlanData: {},
swch: '02', swch: '02',
swchList: [ swchList: [
{ value: '01', name: this.$t('joinTraining.local') }, { value: '01', name: this.$t('joinTraining.local') },
{ value: '02', name: this.$t('joinTraining.lineAdjustment') } { value: '02', name: this.$t('joinTraining.lineAdjustment') }
], ],
runing: false, runing: false,
userId: '' userId: ''
}; };
}, },
computed: { computed: {
...mapGetters('runPlan', [ ...mapGetters('runPlan', [
'stations' 'stations'
]), ]),
isShowMenuBar() { isShowMenuBar() {
return this.$store.state.map.roles == 'Admin'; return this.$store.state.map.roles == 'Admin';
} }
}, },
watch: { watch: {
'$store.state.training.started': function (val) { '$store.state.training.started': function (val) {
this.setRuning(val); this.setRuning(val);
}, },
'$store.state.training.switchcount': async function () { '$store.state.training.switchcount': async function () {
if (this.group) { if (this.group) {
const started = this.$store.state.training.started; const started = this.$store.state.training.started;
if (started) { if (started) {
await this.loadRunData(this.$route.query); await this.loadRunData(this.$route.query);
} }
} }
} }
}, },
async mounted() { async mounted() {
this.userId = this.$store.state.user.id; this.userId = this.$store.state.user.id;
await this.loadRunData(this.$route.query); console.log(this.$route.query);
}, await this.loadRunData(this.$route.query);
methods: { },
loadRunData(opt) { methods: {
this.$store.dispatch('runPlan/clear').then(resp => { loadRunData(opt) {
if (opt && opt.skinCode) { this.$store.dispatch('runPlan/clear').then(resp => {
this.viewDisabled = true; if (opt && opt.mapId) {
getStationListBySkinCode(opt.skinCode).then(response => { this.viewDisabled = true;
const stations = response.data; getStationList(opt.mapId).then(response => {
this.$store.dispatch('runPlan/setStations', stations).then(() => { const stations = response.data;
getEveryDayRunPlanData(this.group).then(resp => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
this.$store.dispatch('runPlan/setPlanData', resp.data); getEveryDayRunPlanData(this.group).then(resp => {
this.viewDisabled = false; this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(error => { this.viewDisabled = false;
this.$store.dispatch('runPlan/setPlanData', []); }).catch(error => {
if (error.code == 30001) { this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('error.runGraphIsNotLoaded')); if (error.code == 30001) {
} else { this.$messageBox(this.$t('error.runGraphIsNotLoaded'));
this.$messageBox(this.$t('error.obtainOperationGraphFailed')); } else {
} this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
}); }
}); });
}).catch(() => { });
this.$messageBox(this.$t('error.obtainStationListFailed')); }).catch(() => {
}); this.$messageBox(this.$t('error.obtainStationListFailed'));
} });
}); }
}, });
switchMode(swch) { },
this.$store.dispatch('training/setPrdType', swch); switchMode(swch) {
}, this.$store.dispatch('training/setPrdType', swch);
changeOperateMode(handle) { },
this.$store.dispatch('training/changeOperateMode', { mode: handle }); changeOperateMode(handle) {
}, this.$store.dispatch('training/changeOperateMode', { mode: handle });
setFault() { },
this.$emit('faultChooseShow'); setFault() {
}, this.$emit('faultChooseShow');
loadRunPlan() { },
this.$emit('runPlanLoadShow'); loadRunPlan() {
}, this.$emit('runPlanLoadShow');
viewRunPlan() { },
this.$emit('runPlanViewShow'); viewRunPlan() {
}, this.$emit('runPlanViewShow');
setRuning(run) { },
this.runing = run; setRuning(run) {
} this.runing = run;
} }
}
}; };
</script> </script>
<style> <style>

View File

@ -119,7 +119,7 @@ export default {
} else { } else {
this.courseModel.skinCode = this.$route.query.skinCode; this.courseModel.skinCode = this.$route.query.skinCode;
} }
getCommodityMapProduct(this.$route.query.skinCode).then(response => { getCommodityMapProduct(this.$route.query.mapId).then(response => {
this.productList = response.data || []; this.productList = response.data || [];
this.productList = this.productList.filter(elem => { return elem.prdType != '03'; }); this.productList = this.productList.filter(elem => { return elem.prdType != '03'; });
}); });

View File

@ -19,7 +19,7 @@ import {
deleteTrainingRulesData, deleteTrainingRulesData,
getPlaceholderList getPlaceholderList
} from '@/api/management/operation'; } from '@/api/management/operation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { listPublishMap } from '@/api/jmap/map';
import TrainingEdit from './addEdit'; import TrainingEdit from './addEdit';
import AddBatch from './addBatch'; import AddBatch from './addBatch';
import SaveAs from './saveAs.vue'; import SaveAs from './saveAs.vue';
@ -37,7 +37,7 @@ export default {
placeholderMap: {}, placeholderMap: {},
trainingOperateTypeMap: {}, trainingOperateTypeMap: {},
trainingTypeList: [], trainingTypeList: [],
skinCodeList: [], mapIdList: [],
totals: '', totals: '',
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
@ -77,12 +77,12 @@ export default {
} }
}, },
{ {
title: this.$t('lesson.skinType'), title: this.$t('lesson.mapName'),
prop: 'skinCode', prop: 'mapId',
type: 'tag', type: 'tag',
columnValue: row => { columnValue: row => {
return this.$convertField(row.skinCode, this.skinCodeList, [ return this.$convertField(row.id, this.mapIdList, [
'code', 'id',
'name' 'name'
]); ]);
}, },
@ -210,10 +210,10 @@ export default {
}); });
}); });
// //
this.skinCodeList = []; this.mapIdList = [];
getSkinCodeList().then(response => { listPublishMap().then(response => {
this.skinCodeList = response.data; this.mapIdList = response.data;
}); });
// //

View File

@ -17,7 +17,7 @@
<script> <script>
import { postOperateSaveAs } from '@/api/management/operation'; import { postOperateSaveAs } from '@/api/management/operation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { listPublishMap } from '@/api/jmap/map';
export default { export default {
name: 'AddBatch', name: 'AddBatch',
@ -29,7 +29,7 @@ export default {
skinCodeFrom: '', skinCodeFrom: '',
skinCodeTo: '' skinCodeTo: ''
}, },
skinCodeList: [] mapIdList: []
}; };
}, },
computed: { computed: {
@ -43,14 +43,14 @@ export default {
label: this.$t('lesson.skinTypeFrom'), label: this.$t('lesson.skinTypeFrom'),
type: 'select', type: 'select',
required: true, required: true,
options: this.skinCodeList options: this.mapIdList
}, },
{ {
prop: 'skinCodeTo', prop: 'skinCodeTo',
label: this.$t('lesson.skinTypeTo'), label: this.$t('lesson.skinTypeTo'),
type: 'select', type: 'select',
required: true, required: true,
options: this.skinCodeList options: this.mapIdList
} }
] ]
}; };
@ -84,13 +84,13 @@ export default {
}, },
methods: { methods: {
init() { init() {
// //
this.skinCodeList = []; this.mapIdList = [];
getSkinCodeList().then(response => { listPublishMap().then(response => {
this.skinCodeList = response.data.map(item => { this.mapIdList = response.data.map(item => {
const params = {}; const params = {};
params.label = item.name; params.label = item.name;
params.value = item.code; params.value = item.id;
return params; return params;
}); });
}); });

View File

@ -4,10 +4,10 @@
<el-form-item v-if="isAdd" :label="this.$t('lesson.trainingName')+':'" prop="name"> <el-form-item v-if="isAdd" :label="this.$t('lesson.trainingName')+':'" prop="name">
<el-input v-model="operateModel.name" style="width: 300px" /> <el-input v-model="operateModel.name" style="width: 300px" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.skinType') + ':'" prop="skinCode"> <el-form-item :label="this.$t('lesson.mapName') + ':'" prop="mapId">
<el-select v-model="operateModel.skinCode" style="width: 300px" :disabled="this.disable" @change="skinCodeChoose"> <el-select v-model="operateModel.skinCode" style="width: 300px" :disabled="this.disable" @change="skinCodeChoose">
<el-option <el-option
v-for="option in skinCodeList" v-for="option in mapIdList"
:key="option.code" :key="option.code"
:label="option.name" :label="option.name"
:value="option.code" :value="option.code"
@ -70,7 +70,7 @@ import { getCommodityMapProduct } from '@/api/management/mapprd';
export default { export default {
name: 'TrainingAdd', name: 'TrainingAdd',
props: { props: {
skinCodeList: { mapIdList: {
type: Array, type: Array,
required: true required: true
}, },
@ -197,7 +197,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.skinCodeChoose(this.$route.params.skinCode); this.mapIdChoose(this.$route.query.mapId);
}, },
methods: { methods: {
show(data) { show(data) {
@ -211,11 +211,11 @@ export default {
this.dialogShow = false; this.dialogShow = false;
this.loading = false; this.loading = false;
}, },
skinCodeChoose(skinCode) { mapIdChoose(mapId) {
this.operateModel.prdCode = ''; this.operateModel.prdCode = '';
this.productList = []; this.productList = [];
if (skinCode) { if (mapId) {
getCommodityMapProduct(skinCode).then((response) => { getCommodityMapProduct(mapId).then((response) => {
this.productList = response.data; this.productList = response.data;
this.productList = this.productList.filter(elem => { return elem.prdType != '03'; }); this.productList = this.productList.filter(elem => { return elem.prdType != '03'; });
}); });
@ -225,9 +225,10 @@ export default {
this.trainingTypeMap = {}; this.trainingTypeMap = {};
this.operateModel.operateType = []; this.operateModel.operateType = [];
const skinCodeObj = this.skinCodeList.find(elem => { return elem.code === this.operateModel.skinCode; }) || {}; debugger;
const skinCodeObj = this.mapIdList.find(elem => { return elem.code === this.operateModel.skinCode; }) || {};
const prdTypeObj = this.productList.find(elem => { return elem.code === prdCode; }) || {}; const prdTypeObj = this.productList.find(elem => { return elem.code === prdCode; }) || {};
const res = await getOperateTrainingList({ skinCode: skinCodeObj.code, productType: prdTypeObj.prdType }); const res = await getOperateTrainingList({ skinCode: skinCodeObj.mapId, productType: prdTypeObj.prdType });
if (res && res.code == 200) { if (res && res.code == 200) {
this.trainingTypeLists = res.data; this.trainingTypeLists = res.data;
this.trainingTypeList.forEach(elem => { this.trainingTypeList.forEach(elem => {

View File

@ -3,7 +3,7 @@
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<training-draft <training-draft
ref="draftTrain" ref="draftTrain"
:skin-code-list="skinCodeList" :map-id-list="mapIdList"
:training-type-list="trainingTypeList" :training-type-list="trainingTypeList"
:training-operate-type-map="trainingOperateTypeMap" :training-operate-type-map="trainingOperateTypeMap"
@refresh="reloadTable" @refresh="reloadTable"
@ -21,7 +21,7 @@ import { pageQueryTraining } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation'; import { trainingNotify } from '@/api/simulation';
import { getCommodityMapProduct, getProductList } from '@/api/management/mapprd'; import { getCommodityMapProduct, getProductList } from '@/api/management/mapprd';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { getSkinCodeList } from '@/api/management/mapskin'; import { listPublishMap } from '@/api/jmap/map';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import TrainingDraft from './draft'; import TrainingDraft from './draft';
import localStore from 'storejs'; import localStore from 'storejs';
@ -33,7 +33,7 @@ export default {
}, },
data() { data() {
return { return {
skinCodeList: [], mapIdList: [],
trainingTypeList: [], trainingTypeList: [],
prdTypeList: [], prdTypeList: [],
trainingOperateTypeMap: {}, trainingOperateTypeMap: {},
@ -93,7 +93,7 @@ export default {
title: this.$t('lesson.skinType'), title: this.$t('lesson.skinType'),
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); }, columnValue: (row) => { return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
@ -167,12 +167,12 @@ export default {
}, },
methods: { methods: {
async loadInitData() { async loadInitData() {
this.skinCodeList = []; this.mapIdList = [];
this.queryForm.queryObject.prdCode.config.data = []; this.queryForm.queryObject.prdCode.config.data = [];
getSkinCodeList().then(response => { listPublishMap().then(response => {
this.skinCodeList = response.data; this.mapIdList = response.data;
}); });
getCommodityMapProduct(this.$route.params.skinCode).then((response) => { getCommodityMapProduct(this.$route.query.mapId).then((response) => {
const productList = response.data; const productList = response.data;
if (productList && productList.length > 0) { if (productList && productList.length > 0) {
productList.forEach(elem => { productList.forEach(elem => {

View File

@ -23,70 +23,70 @@ import localStore from 'storejs';
import drapLeft from '@/views/components/drapLeft/index'; import drapLeft from '@/views/components/drapLeft/index';
export default { export default {
name: 'TrainingDraft', name: 'TrainingDraft',
components: { components: {
TrainingCategory, TrainingCategory,
drapLeft drapLeft
}, },
data() { data() {
return { return {
widthLeft: localStore.get('LeftWidth') ? Number(localStore.get('LeftWidth')) : 320, widthLeft: localStore.get('LeftWidth') ? Number(localStore.get('LeftWidth')) : 320,
trainingObj: null, trainingObj: null,
group: '' group: ''
}; };
}, },
computed: { computed: {
width() { width() {
return this.$store.state.app.width - 481 - this.widthLeft; return this.$store.state.app.width - 481 - this.widthLeft;
}, },
height() { height() {
return this.$store.state.app.height - 90; return this.$store.state.app.height - 90;
} }
}, },
watch: { watch: {
'$store.state.app.windowSizeCount': function() { '$store.state.app.windowSizeCount': function() {
this.resize(); this.resize();
}, },
widthLeft(val) { widthLeft(val) {
this.resize(val); this.resize(val);
}, },
$route() { $route() {
this.resize(); this.resize();
} }
}, },
mounted() { mounted() {
this.group = this.$route.query.group; this.group = this.$route.query.group;
this.resize(); this.resize();
}, },
async beforeDestroy() { async beforeDestroy() {
if (this.group) { if (this.group) {
runDiagramQuit(this.group); runDiagramQuit(this.group);
} }
}, },
methods: { methods: {
selectMapSure(data) { selectMapSure(data) {
trainingNotify({ trainingId: data.id }).then(resp => { trainingNotify({ trainingId: data.id }).then(resp => {
this.group = resp.data; this.group = resp.data;
this.$router.push({ path: `${UrlConfig.lesson.record}/${data.id}/${data.name}`, query: { group: resp.data } }); this.$router.push({ path: `${UrlConfig.lesson.record}/${data.id}/${data.name}`, query: { group: resp.data } });
}).catch(error => { }).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`); this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
}); });
}, },
trainingStart(data) { trainingStart(data) {
/** 区分演示和正式需要在演示时设置lessonId为0*/ /** 区分演示和正式需要在演示时设置lessonId为0*/
trainingNotify({ trainingId: data.id }).then(resp => { trainingNotify({ trainingId: data.id }).then(resp => {
this.$router.push({ path: `${UrlConfig.display}/record`, query: { trainingId: this.$route.params.trainingId, trainingName: this.$route.params.trainingName, group: resp.data, lessonId: 0 } }); this.$router.push({ path: `${UrlConfig.display}/record`, query: { trainingId: this.$route.params.trainingId, trainingName: this.$route.params.trainingName, group: resp.data, lessonId: 0 } });
}).catch(error => { }).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`); this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
}); });
}, },
drapWidth(width) { drapWidth(width) {
this.widthLeft = Number(width); this.widthLeft = Number(width);
}, },
resize() { resize() {
this.$store.dispatch('config/resize', { width: this.width, height: this.height }); this.$store.dispatch('config/resize', { width: this.width, height: this.height });
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -22,96 +22,96 @@ import { loadMapData } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
export default { export default {
name: 'LessonDraft', name: 'LessonDraft',
components: { components: {
MapSystemDraft, MapSystemDraft,
StepManage StepManage
}, },
data() { data() {
return { return {
stationObj: null, stationObj: null,
trainingObj: null, trainingObj: null,
widthLeft: 0 widthLeft: 0
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'mapData' 'mapData'
]), ]),
group() { group() {
return this.$route.query.group; return this.$route.query.group;
}, },
trainingId() { trainingId() {
return this.$route.params.trainingId; return this.$route.params.trainingId;
}, },
width() { width() {
return this.$store.state.app.width - 481 - this.widthLeft; return this.$store.state.app.width - 481 - this.widthLeft;
}, },
height() { height() {
return this.$store.state.app.height - 90; return this.$store.state.app.height - 90;
} }
}, },
watch: { watch: {
$route(newVal) { $route(newVal) {
this.initLoadData(); this.initLoadData();
}, },
'$store.state.map.mapViewLoadedCount': function() { '$store.state.map.mapViewLoadedCount': function() {
if (this.trainingId) { if (this.trainingId) {
getTrainingStepsDetail(this.trainingId, { group: this.group }).then(response => { getTrainingStepsDetail(this.trainingId, { group: this.group }).then(response => {
this.$store.dispatch('training/setTrainingData', response.data); this.$store.dispatch('training/setTrainingData', response.data);
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.getMapStepsFailed')); this.$messageBox(this.$t('error.getMapStepsFailed'));
this.endViewLoading(); this.endViewLoading();
}); });
} }
} }
}, },
mounted() { mounted() {
this.initLoadData(); this.initLoadData();
}, },
beforeDestroy() { beforeDestroy() {
this.$store.dispatch('map/mapClear'); this.$store.dispatch('map/mapClear');
}, },
methods: { methods: {
endViewLoading(isSuccess) { endViewLoading(isSuccess) {
if (!isSuccess) { if (!isSuccess) {
this.$store.dispatch('map/mapClear'); this.$store.dispatch('map/mapClear');
} }
this.$nextTick(() => { this.$nextTick(() => {
EventBus.$emit('viewLoading', false); EventBus.$emit('viewLoading', false);
}); });
}, },
initLoadData() { initLoadData() {
this.$store.dispatch('training/end', TrainingMode.EDIT); this.$store.dispatch('training/end', TrainingMode.EDIT);
this.$store.dispatch('training/reset'); this.$store.dispatch('training/reset');
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (parseInt(this.trainingId)) { if (parseInt(this.trainingId)) {
this.trainingObj = { id: this.trainingId, name: this.$route.params.trainingName }; this.trainingObj = { id: this.trainingId, name: this.$route.params.trainingName };
// //
// //
// //
getTrainingDetail(this.trainingId).then(resp => { getTrainingDetail(this.trainingId).then(resp => {
const detail = resp.data; const detail = resp.data;
getProductDetail(detail.prdCode).then(rest => { getProductDetail(detail.prdCode).then(rest => {
const data = rest.data; const data = rest.data;
loadMapData(detail.skinCode).then(() => { loadMapData(detail.skinCode).then(() => {
this.$store.dispatch('training/setPrdType', data.prdType); this.$store.dispatch('training/setPrdType', data.prdType);
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.loadMapDataFailed')); this.$messageBox(this.$t('error.loadMapDataFailed'));
this.endViewLoading(); this.endViewLoading();
}); });
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.getMapDetailFailed')); this.$messageBox(this.$t('error.getMapDetailFailed'));
this.endViewLoading(); this.endViewLoading();
}); });
} else { } else {
this.endViewLoading(); this.endViewLoading();
} }
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -12,94 +12,97 @@
import { putRoles } from '@/api/management/user'; import { putRoles } from '@/api/management/user';
export default { export default {
name: 'DictionaryEdit', name: 'DictionaryEdit',
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
formModel: { formModel: {
id: '', id: '',
name: '', name: '',
// nickname: '', // nickname: '',
// mobile: '', // mobile: '',
// email: '', // email: '',
roles: [] roles: []
} }
}; };
}, },
computed: { computed: {
form() { form() {
const form = { const form = {
labelWidth: '60px', labelWidth: '100px',
items: [ items: [
{ prop: 'name', label: this.$t('system.name'), type: 'text', disabled: true }, { prop: 'name', label: this.$t('system.name'), type: 'text', disabled: true },
// { prop: 'nickname', label: '', type: 'text' }, // { prop: 'nickname', label: '', type: 'text' },
// { prop: 'mobile', label: '', type: 'number' }, // { prop: 'mobile', label: '', type: 'number' },
// { prop: 'email', label: '', type: 'text' }, // { prop: 'email', label: '', type: 'text' },
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true } { prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }
] ]
}; };
return form; return form;
}, },
rules() { rules() {
const crules = { const crules = {
name: [ name: [
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' }, { required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' } { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
] ],
// nickname: [ roles: [
// { required: true, message: this.$t('rules.pleaseInputNickName'), trigger: 'blur' }, { required: true, message: this.$t('rules.pleaseSelectPermission'), trigger: 'change' }
// { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' } ]
// ], // nickname: [
// mobile: [ // { required: true, message: this.$t('rules.pleaseInputNickName'), trigger: 'blur' },
// { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'blur' } // { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
// ] // ],
}; // mobile: [
return crules; // { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'blur' }
} // ]
}, };
methods: { return crules;
doShow(data) { }
this.dialogVisible = true; },
if (data) { methods: {
this.formModel = { doShow(data) {
id: data.id, this.dialogVisible = true;
name: data.name, if (data) {
// nickname: data.nickname, this.formModel = {
// mobile: data.mobile, id: data.id,
// email: data.email, name: data.name,
roles: data.roles // nickname: data.nickname,
}; // mobile: data.mobile,
} // email: data.email,
}, roles: data.roles
doSave() { };
const self = this; }
this.$refs.dataform.validateForm(() => { },
self.update(); doSave() {
}); const self = this;
}, this.$refs.dataform.validateForm(() => {
update() { self.update();
const self = this; });
putRoles(this.formModel).then(response => { },
self.$message.success(this.$t('system.updateSuccess')); update() {
self.handleClose(); const self = this;
self.$emit('reloadTable'); putRoles(this.formModel).then(response => {
}).catch(error => { self.$message.success(this.$t('system.updateSuccess'));
self.$message.error(`${this.$t('error.updateFailed')}: ${error.message}`); self.handleClose();
}); self.$emit('reloadTable');
}, }).catch(error => {
handleClose(done) { self.$message.error(`${this.$t('error.updateFailed')}: ${error.message}`);
this.formModel = { });
id: '', },
name: '', handleClose(done) {
roles: [] this.formModel = {
}; id: '',
this.$refs.dataform.resetForm(); name: '',
if (done) { roles: []
done(); };
} else { this.$refs.dataform.resetForm();
this.dialogVisible = false; if (done) {
} done();
} } else {
} this.dialogVisible = false;
}
}
}
}; };
</script> </script>

View File

@ -15,176 +15,168 @@ import { getPublishMapList } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd'; import { getCommodityMapProduct } from '@/api/management/mapprd';
export default { export default {
name: 'UsersTrainingAdd', name: 'UsersTrainingAdd',
props: { props: {
type: { type: {
type: String, type: String,
required: true required: true
} }
}, },
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
formModel: { formModel: {
mapId: '', mapId: '',
mapPrdCode: '', mapPrdCode: '',
userId: '', userId: '',
userName: '', userName: '',
duration: '' duration: ''
}, },
LessonList: [], LessonList: [],
mapPrdList: [], mapPrdList: [],
UserList: [], UserList: [],
UserLoading: false UserLoading: false
}; };
}, },
computed: { computed: {
form() { form() {
const form = { const form = {
labelWidth: '120px', labelWidth: '120px',
items: [ items: [
{ prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') }, { prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') },
{ prop: 'mapPrdCode', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') }, { prop: 'mapPrdCode', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') },
{ prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') }, { prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') },
{ prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' } { prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' }
] ]
}; };
return form; return form;
}, },
rules() { rules() {
const crules = { const crules = {
mapId: [ mapId: [
{ required: true, message: this.$t('rules.mapInput'), trigger: 'change' } { required: true, message: this.$t('rules.mapInput'), trigger: 'change' }
], ],
userName: [ userName: [
{ required: true, message: this.$t('rules.chooseUser'), trigger: 'change' } { required: true, message: this.$t('rules.chooseUser'), trigger: 'change' }
], ],
mapPrdCode: [ mapPrdCode: [
{ required: true, message: this.$t('rules.productInput'), trigger: 'change' } { required: true, message: this.$t('rules.productInput'), trigger: 'change' }
], ],
duration: [ duration: [
{ required: true, message: this.$t('rules.timeInput'), trigger: 'blur' } { required: true, message: this.$t('rules.timeInput'), trigger: 'blur' }
] ]
}; };
return crules; return crules;
}, },
title() { title() {
return this.$t('system.createSimulationTitle'); return this.$t('system.createSimulationTitle');
} }
}, },
mounted() { mounted() {
this.initLoadPage(); this.initLoadPage();
}, },
methods: { methods: {
initLoadPage() { initLoadPage() {
// //
this.LessonList.length = 0; this.LessonList.length = 0;
this.UserList.length = 0; this.UserList.length = 0;
const param = { const param = {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}; };
getPublishMapList(param).then(response => { getPublishMapList(param).then(response => {
const data = response.data.list; const data = response.data.list;
if (data && data.length) { if (data && data.length) {
data.forEach(elem => { data.forEach(elem => {
this.LessonList.push({ value: elem.id, label: elem.name, skinCode: elem.skinCode }); this.LessonList.push({ value: elem.id, label: elem.name, skinCode: elem.skinCode });
}); });
} }
}); });
}, },
// input // input
async querySearchAsync(queryString, cb) { async querySearchAsync(queryString, cb) {
// queryString // queryString
const results = []; const results = [];
if (queryString) { if (queryString) {
try { try {
const params = { const params = {
fuzzyParam: queryString fuzzyParam: queryString
}; };
const res = await getDimUserList(params); const res = await getDimUserList(params);
const list = res.data; const list = res.data;
list.forEach(item => { list.forEach(item => {
const value = { const value = {
id: item.id, id: item.id,
value: `${item.nickname}(${item.name})${item.mobile}` value: `${item.nickname}(${item.name})${item.mobile}`
}; };
results.push(value); results.push(value);
}); });
cb(results); cb(results);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
cb(results); cb(results);
} }
} else { } else {
cb(results); cb(results);
} }
}, },
prdSelect(item) { prdSelect(item) {
this.formModel.userId = item.id; this.formModel.userId = item.id;
}, },
async mapChange(val) { async mapChange(val) {
let skinCode = ''; this.mapPrdList = [];
this.mapPrdList = []; this.formModel.mapPrdCode = '';
this.formModel.mapPrdCode = ''; try {
if (this.LessonList.length) { const res = await getCommodityMapProduct(val);
this.LessonList.forEach(item => { const data = res.data;
if (item.value == val) { if (data && data.length) {
skinCode = item.skinCode; data.forEach(elem => {
} this.mapPrdList.push({ value: elem.code, label: elem.name });
}); });
try { }
const res = await getCommodityMapProduct(skinCode); } catch (error) {
const data = res.data; console.error(error);
if (data && data.length) { }
data.forEach(elem => { },
this.mapPrdList.push({ value: elem.code, label: elem.name }); show(data) {
}); this.dialogVisible = true;
} },
} catch (error) { doSave() {
console.error(error); const self = this;
} this.$refs.dataform.validateForm(() => {
} self.save();
}, });
show(data) { },
this.dialogVisible = true; save() {
}, const self = this;
doSave() { const params = {
const self = this; mapId: this.formModel.mapId,
this.$refs.dataform.validateForm(() => { mapPrdCode: this.formModel.mapPrdCode,
self.save(); userId: this.formModel.userId,
}); duration: parseInt(this.formModel.duration)
}, };
save() { if (params.userId) {
const self = this; postSimulationStats(params).then(response => {
const params = { self.$message.success(this.$t('system.addSuccess'));
mapId: this.formModel.mapId, self.handleClose();
mapPrdCode: this.formModel.mapPrdCode, self.$emit('reloadTable');
userId: this.formModel.userId, }).catch(error => {
duration: parseInt(this.formModel.duration) self.$message.error(this.$t('error.addFailed') + error.message);
}; });
if (params.userId) { } else {
postSimulationStats(params).then(response => { this.$message.error(this.$t('rules.chooseUser'));
self.$message.success(this.$t('system.addSuccess')); }
self.handleClose(); },
self.$emit('reloadTable'); handleClose(done) {
}).catch(error => { this.formModel = {
self.$message.error(this.$t('error.addFailed') + error.message); mapId: '',
}); mapPrdCode: '',
} else { userId: '',
this.$message.error(this.$t('rules.chooseUser')); userName: '',
} duration: ''
}, };
handleClose(done) { this.dialogVisible = false;
this.formModel = { }
mapId: '', }
mapPrdCode: '',
userId: '',
userName: '',
duration: ''
};
this.dialogVisible = false;
}
}
}; };
</script> </script>

View File

@ -1,376 +0,0 @@
<template>
<div class="main" style="background-color:floralwhite">
<div :id="runPlanId" />
<div v-if="isShowBack" style="float: right; margin-right: 2%; margin-top: 10px; margin-bottom: 20px">
<el-button-group>
<el-button type="primary" @click="back">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getStationListBySkinCode, queryRunPlan, queryRunPlanTemplate, queryRunPlanDaily } from '@/api/runplan';
import { timeFormat } from '@/utils/date';
import { UrlConfig } from '@/router/index';
export default {
name: 'RunPlan',
data() {
return {
runPlanId: 'main',
myChart: null,
PlanConvert: {},
option: {
title: {
text: '',
left: 'center'
},
grid: {
top: '30px',
left: '120px',
right: '2%',
bottom: '80px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
right: '2%',
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
tooltip: {
axisPointer: {
trigger: 'item',
type: 'cross'
},
formatter: this.axisTooltip,
borderWidth: 1
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
formatter: this.xAxisLableFormat,
textStyle: {
color: '#333'
}
},
axisPointer: {
snap: true,
label: {
formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
min: 0,
max: 0
},
series: [],
dataZoom: [
{
type: 'inside'
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
bottom: '25px'
}
]
},
kmRangeCoordMap: {}
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
isShowBack() {
if (this.$route.params.mode !== 'draft') {
return true;
}
return false;
},
mode() {
return this.$route.params.mode;
},
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
}
},
watch: {
'$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
},
'$store.state.app.windowSizeCount': function() {
this.setPlanSize();
},
$route() {
this.$nextTick(() => {
this.loadChartPage(this.$route.query);
});
}
},
mounted() {
this.setPlanSize();
this.loadChartPage(this.$route.query);
},
beforeDestroy() {
this.destroy();
},
methods: {
loadChartPage(opt) {
this.PlanConvert = this.$theme.loadPlanConvert(opt.skinCode);
this.$store.dispatch('runPlan/clear').then(resp => {
this.loadInitChart().then(() => {
if (opt.skinCode && opt.planId) {
this.myChart && this.myChart.showLoading();
getStationListBySkinCode(opt.skinCode).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
let queryFunc = null;
const params = opt.planId;
switch (this.mode) {
case 'common': queryFunc = queryRunPlanTemplate; break;
case 'template': queryFunc = queryRunPlanTemplate; break;
case 'everyDay': queryFunc = queryRunPlanDaily; break;
default: queryFunc = queryRunPlan; break;
}
queryFunc(params).then(resp => {
this.loadChartData(resp.data);
this.myChart && this.myChart.hideLoading();
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainStationListFailed'));
});
}
});
});
},
async loadChartData(data) {
try {
this.option.title.text = data.planName;
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(this.stations);
this.option.series = [];
this.pushModels(this.option.series, [this.PlanConvert.initializeYaxis(this.stations)]);
this.pushModels(this.option.series, this.PlanConvert.convertDataToModels(data, this.stations, this.kmRangeCoordMap, { width: 1 }));
this.loadInitData();
} catch (error) {
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
}
},
async loadInitData() {
await this.xAxisInit();
await this.yAxisInit();
await this.loadInitChart();
},
xAxisPointFormat(params) {
return timeFormat(params.value);
},
yAxisPointFormat(params) {
return this.PlanConvert.computedFormatYAxis(this.stations, params);
},
xAxisLableFormat(value, index) {
if (value % 60 === 0) {
return timeFormat(parseInt(value));
}
},
yAxisLableFormat(value, index) {
return '';
},
xAxisInit() {
const list = [];
for (var time = this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
list.push(time);
}
this.option.xAxis[0].data = list;
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = 3600 * 6 - 600 + this.PlanConvert.TranslationTime;
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = 3600 * 8 + 600 + this.PlanConvert.TranslationTime;
},
yAxisInit() {
if (Object.keys(this.PlanConvert).length) {
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
}
},
pushModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
if (elem) {
series.push(elem);
}
});
}
return series;
},
popModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
const index = series.indexOf(elem);
if (index >= 0) {
series.split(index, 1);
}
});
}
return series;
},
loadInitChart() {
return new Promise((resolve, reject) => {
try {
const that = this;
// echart
require.config(
{
paths: {
echarts: './js/dist'
}
}
);
//
require(
[
'echarts',
'echarts/lib/chart/line'
],
function (ec) {
if (that.myChart && that.myChart.isDisposed) {
that.myChart.clear();
}
that.myChart = ec.init(document.getElementById(that.runPlanId));
that.myChart.setOption(that.option);
that.reSize({ width: that.$store.state.runPlan.width, height: that.$store.state.runPlan.height });
// that.myChart.on('click', that.mouseClick);
resolve(true);
}
);
} catch (error) {
reject(error);
}
});
},
axisTooltip(param) {
if (param.data[1] >= this.option.yAxis.min + this.PlanConvert.EdgeHeight && param.data[1] <= this.option.yAxis.max - this.PlanConvert.EdgeHeight) {
const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [
`Point Data <hr size=1 style="margin: 3px 0">`,
`${this.$t('map.stationName')}: ${station.name}<br>`,
`${this.$t('map.stationKilometerMark')}: ${station.kmRange} km <br>`,
`${this.$t('map.arrivalTime')}: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
}
},
mouseClick(params) {
},
settingExac(data) {
this.myChart && this.myChart.setOption({
xAxis: this.option.xAxis,
yAxis: this.option.yAxis
});
this.myChart && this.myChart.dispatchAction({
type: 'dataZoom',
dataZoomIndex: [0, 1],
startValue: parseInt(data.startValue / 1000),
endValue: parseInt(data.endValue / 1000)
});
},
reSize(opt) {
if (this.myChart) {
this.myChart.resize({
width: opt.width,
height: opt.height,
silent: false
});
}
},
setPlanSize() {
this.$nextTick(() => {
if (this.mode !== 'draft') {
this.$store.dispatch('runPlan/resize', { width: this.width, height: this.height - 130 });
} else {
this.$store.dispatch('runPlan/resize', { width: this.$store.state.runPlan.width, height: this.height - 60 });
}
});
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose();
this.myChart = null;
}
},
back() {
if (this.$route.params.mode === 'everyDay') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanEveryDay}` });
} else if (this.$route.params.mode === 'template') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanTemplate}` });
} else if (this.$route.params.mode === 'common') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanCommon}` });
} else {
this.$router.go(-1);
}
}
}
};
</script>

View File

@ -1,84 +0,0 @@
<template>
<el-dialog v-dialogDrag :title="this.$t('map.setupOperationGraph')" :visible.sync="dialogShow" width="600px" :before-close="doClose" append-to-body>
<el-form ref="form" :model="formModel" label-width="160px" size="mini" :rules="rules">
<el-form-item :label="this.$t('map.selectOperationGraphDataRange')+':'" prop="timeArea">
<el-time-picker
v-model="formModel.timeArea"
is-range
range-separator="this.$t('map.to')"
start-placeholder="this.$t('global.startTime')"
end-placeholder="this.$t('global.endTime')"
placeholder="this.$t('map.selectionTimeRange')"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="handle">{{ $t(global.confirm) }}</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: 'ChartSetting',
data() {
return {
dialogShow: false,
intervalList: [
{ code: '01', value: this.$t('map.pointSystem1') },
{ code: '02', value: this.$t('map.pointSystem2') },
{ code: '05', value: this.$t('map.pointSystem5') }
],
formModel: {
timeArea: [new Date(2018, 10, 1), new Date(2018, 10, 1)]
}
};
},
computed: {
rules() {
return {
timeArea: [
{ required: true, message: this.$t('rules.selectDataRange'), trigger: 'change' }
]
};
}
},
methods: {
doShow() {
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
},
handle() {
this.$refs.form.validate((valid) => {
if (valid) {
const baseDate = new Date(2018, 10, 1);
const model = {
startValue: this.formModel.timeArea[0].valueOf() - baseDate.valueOf(),
endValue: this.formModel.timeArea[1].valueOf() - baseDate.valueOf(),
intervalLevel: parseFloat('01')
};
this.$emit('settingExac', model);
this.doClose();
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.dialog {
border-color: black;
border-style: solid;
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
}
</style>

View File

@ -1,70 +0,0 @@
<template>
<div class="main">
<div class="list" :style="{width: widthLeft+'px'}">
<!-- <chart-list ref="list" :height="height" /> -->
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view style="float: right;" :style="{width: width+'px'}" />
</transition>
</div>
</template>
<script>
import DrapLeft from '@/views/components/drapLeft/index';
// import ChartList from './manage/list';
export default {
name: 'RunPlan',
components: {
DrapLeft,
ChartList
},
data() {
return {
widthLeft: 320
};
},
computed: {
width() {
return this.$store.state.app.width - this.widthLeft;
},
height() {
return this.$store.state.app.height;
}
},
watch: {
widthLeft(val) {
this.setRunPlanResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.setRunPlanResize(this.widthLeft);
}
},
mounted() {
this.setRunPlanResize();
},
methods: {
drapWidth(width) {
this.widthLeft = Number(width);
},
setRunPlanResize(LeftWidth) {
this.$nextTick(() => {
this.$store.dispatch('runPlan/resize', { width: this.width, height: this.height - 60 });
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.main {
width: 100%;
height: 100%;
.list {
float: left;
}
}
</style>

View File

@ -10,7 +10,6 @@
</template> </template>
<script> <script>
import { getPublishMapInfo } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd'; import { getCommodityMapProduct } from '@/api/management/mapprd';
import { OperatorModel, PermissionType } from '@/scripts/ConstDic'; import { OperatorModel, PermissionType } from '@/scripts/ConstDic';
import { getTotalRemains } from '@/api/management/author'; import { getTotalRemains } from '@/api/management/author';
@ -18,295 +17,293 @@ import { superAdmin, admin } from '@/router';
import { getDimUserList } from '@/api/management/user'; import { getDimUserList } from '@/api/management/user';
export default { export default {
name: 'EditRule', name: 'EditRule',
props: { props: {
permissionTypeList: { permissionTypeList: {
type: Array, type: Array,
required: true required: true
}, },
publishMapList: { publishMapList: {
type: Array, type: Array,
required: true required: true
}, },
publisLessonList: { publisLessonList: {
type: Array, type: Array,
required: true required: true
} }
}, },
data() { data() {
return { return {
show: false, show: false,
type: '', type: '',
mapProductList: [], mapProductList: [],
filterPublisLessonList: [], filterPublisLessonList: [],
formModel: { formModel: {
permissionType: '', permissionType: '',
mapId: '', mapId: '',
lessonId: '', lessonId: '',
prdCode: '', prdCode: '',
date: '', date: '',
amount: 0, amount: 0,
ownerId: '', ownerId: '',
roleName: '' roleName: ''
}, },
DatePicker: { DatePicker: {
shortcuts: [{ shortcuts: [{
text: this.$t('global.today'), text: this.$t('global.today'),
onClick(picker) { onClick(picker) {
picker.$emit('pick', new Date()); picker.$emit('pick', new Date());
} }
}] }]
}, },
numberMessage: '' numberMessage: ''
}; };
}, },
computed: { computed: {
form() { form() {
const form = { const form = {
labelWidth: '120px', labelWidth: '120px',
items: [ items: [
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange }, { prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange },
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange }, { prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange },
{ prop: 'prdCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange }, { prop: 'prdCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList }, { prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' }, { prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' }, { prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
{ prop: 'amount', label: '权限个数', type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage } { prop: 'amount', label: '权限个数', type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage }
] ]
}; };
return form; return form;
}, },
rules() { rules() {
const that = this; const that = this;
const crules = { const crules = {
permissionType: [ permissionType: [
{ required: true, message: this.$t('rules.permissionTypeInput'), trigger: 'change' } { required: true, message: this.$t('rules.permissionTypeInput'), trigger: 'change' }
], ],
mapId: [ mapId: [
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' } { required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
], ],
prdCode: [ prdCode: [
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' } { required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
], ],
lessonId: [ lessonId: [
{ required: true, message: this.$t('rules.lessonInput'), trigger: 'change' } { required: true, message: this.$t('rules.lessonInput'), trigger: 'change' }
], ],
date: [ date: [
{ required: true, message: this.$t('rules.inputTime'), trigger: 'blur' } { required: true, message: this.$t('rules.inputTime'), trigger: 'blur' }
], ],
amount: [ amount: [
{ required: true, message: this.$t('rules.inputPermissionNumber'), trigger: 'change' }, { required: true, message: this.$t('rules.inputPermissionNumber'), trigger: 'change' },
{ {
validator(rule, value, callback) { validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) > 0) { if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback(); callback();
} else { } else {
callback(new Error(that.$t('rules.permissionNumberGreater0'))); callback(new Error(that.$t('rules.permissionNumberGreater0')));
} }
}, },
trigger: 'blur' trigger: 'blur'
} }
] ]
}; };
return crules; return crules;
}, },
title() { title() {
if (this.isAdd) { if (this.isAdd) {
return this.$t('permission.addPermissionPackageRule'); return this.$t('permission.addPermissionPackageRule');
} else { } else {
return this.$t('permission.editPermissionPackageRule'); return this.$t('permission.editPermissionPackageRule');
} }
}, },
disabled() { disabled() {
return this.formModel.amount > this.maxTotal || this.formModel.amount <= 0; return this.formModel.amount > this.maxTotal || this.formModel.amount <= 0;
}, },
isAdd() { isAdd() {
return this.type == 'add'; return this.type == 'add';
}, },
isAdministrator() { isAdministrator() {
return this.$store.state.user.roles.indexOf(superAdmin) || this.$store.state.user.roles.indexOf(admin); return this.$store.state.user.roles.indexOf(superAdmin) || this.$store.state.user.roles.indexOf(admin);
}, },
isShowMap() { isShowMap() {
return this.formModel.permissionType !== '04'; return this.formModel.permissionType !== '04';
}, },
isShowRole() { isShowRole() {
return this.$store.state.user.roles.indexOf(superAdmin) != -1; return this.$store.state.user.roles.indexOf(superAdmin) != -1;
}, },
isShowMapProduct() { isShowMapProduct() {
return this.formModel.permissionType !== '04'; return this.formModel.permissionType !== '04';
}, },
isShowLesson() { isShowLesson() {
return this.formModel.permissionType != '04' && this.formModel.permissionType != '03'; return this.formModel.permissionType != '04' && this.formModel.permissionType != '03';
} }
}, },
watch: { watch: {
formModel: { formModel: {
handler: function (val, old) { handler: function (val, old) {
this.setTotalMax(); this.setTotalMax();
}, },
deep: true deep: true
} }
}, },
methods: { methods: {
setTotalMax() { setTotalMax() {
let endTime; let endTime;
let startTime; let startTime;
if (this.formModel.date) { if (this.formModel.date) {
endTime = this.formModel.date[1]; endTime = this.formModel.date[1];
startTime = this.formModel.date[0]; startTime = this.formModel.date[0];
} }
var validator = {}; var validator = {};
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; }; validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; }; validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdCode; }; validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.SCREEN] = () => { return true; }; validator[PermissionType.SCREEN] = () => { return true; };
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) { if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
if (endTime > startTime) { if (endTime > startTime) {
const model = { const model = {
startTime: startTime, startTime: startTime,
endTime: endTime, endTime: endTime,
permissionType: this.formModel.permissionType, permissionType: this.formModel.permissionType,
ownerId: this.formModel.ownerId ownerId: this.formModel.ownerId
}; };
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) { if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode; model['prdCode'] = this.formModel.prdCode;
} else if (this.formModel.permissionType == PermissionType.SIMULATION) { } else if (this.formModel.permissionType == PermissionType.SIMULATION) {
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode; model['prdCode'] = this.formModel.prdCode;
} }
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 = '可用权限数量为0';
} else { } else {
this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`; this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`;
} }
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.obtainMaxNumberFailed')); this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
}); });
} else { } else {
this.numberMessage = '结束时间必须大于开始时间'; this.numberMessage = '结束时间必须大于开始时间';
} }
} else { } else {
this.numberMessage = ''; this.numberMessage = '';
} }
}, },
permissionTypeChange() { permissionTypeChange() {
this.formModel.mapId = ''; this.formModel.mapId = '';
this.formModel.prdCode = ''; this.formModel.prdCode = '';
this.formModel.lessonId = ''; this.formModel.lessonId = '';
}, },
mapChange(mapId) { mapChange(mapId) {
this.formModel.prdCode = ''; this.formModel.prdCode = '';
this.formModel.lessonId = ''; this.formModel.lessonId = '';
this.mapProductList = []; this.mapProductList = [];
getPublishMapInfo(mapId).then(resp => { getCommodityMapProduct(mapId).then(rest => {
getCommodityMapProduct(resp.data.skinCode).then(rest => { const list = rest.data || [];
const list = rest.data || []; this.mapProductList = list.map(elem => {
this.mapProductList = list.map(elem => { return { value: elem.code, label: elem.name };
return { value: elem.code, label: elem.name }; });
}); });
}); },
}); mapProductChange(prdCode) {
}, this.formModel.lessonId = '';
mapProductChange(prdCode) { this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.prdCode; });
this.formModel.lessonId = ''; },
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.prdCode; }); // input
}, async querySearchAsync(queryString, cb) {
// input // queryString
async querySearchAsync(queryString, cb) { const results = [];
// queryString if (queryString) {
const results = []; try {
if (queryString) { const params = {
try { fuzzyParam: queryString
const params = { };
fuzzyParam: queryString const res = await getDimUserList(params);
}; const list = res.data;
const res = await getDimUserList(params); list.forEach(item => {
const list = res.data; const value = {
list.forEach(item => { id: item.id,
const value = { value: `${item.nickname}(${item.name})${item.mobile}`
id: item.id, };
value: `${item.nickname}(${item.name})${item.mobile}` results.push(value);
}; });
results.push(value); cb(results);
}); } catch (error) {
cb(results); cb(results);
} catch (error) { }
cb(results); } else {
} cb(results);
} else { }
cb(results); },
} prdSelect(item) {
}, this.formModel.ownerId = item.id;
prdSelect(item) { },
this.formModel.ownerId = item.id; doShow(data) {
}, this.show = true;
doShow(data) { this.type = data.type;
this.show = true; if (!this.isAdd) {
this.type = data.type; const model = data.item;
if (!this.isAdd) { this.formModel = {
const model = data.item; permissionType: model.permissionType,
this.formModel = { mapId: model.mapId,
permissionType: model.permissionType, lessonId: model.lessonId,
mapId: model.mapId, prdCode: model.prdCode,
lessonId: model.lessonId, date: [model.startTime, model.endTime],
prdCode: model.prdCode, amount: model.amount,
date: [model.startTime, model.endTime], ownerId: this.formModel.ownerId,
amount: model.amount, roleName: this.formModel.roleName
ownerId: this.formModel.ownerId, };
roleName: this.formModel.roleName }
};
}
this.formModel.amount = 0; this.formModel.amount = 0;
}, },
doClose() { doClose() {
this.show = false; this.show = false;
}, },
draftRule() { draftRule() {
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
if (this.formModel.amount <= this.maxTotal && this.formModel.amount) { if (this.formModel.amount <= this.maxTotal && this.formModel.amount) {
if (this.isAdd) { if (this.isAdd) {
this.$emit('addRuleForm', { this.$emit('addRuleForm', {
operator: OperatorModel.TRANSFER, operator: OperatorModel.TRANSFER,
permissionType: this.formModel.permissionType, permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '', mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '', lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '', prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
startTime: this.formModel.date[0], startTime: this.formModel.date[0],
endTime: this.formModel.date[1], endTime: this.formModel.date[1],
amount: this.formModel.amount, amount: this.formModel.amount,
ownerId: this.formModel.ownerId, ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName roleName: this.formModel.roleName
}); });
} else { } else {
this.$emit('editRuleForm', { this.$emit('editRuleForm', {
operator: OperatorModel.TRANSFER, operator: OperatorModel.TRANSFER,
permissionType: this.formModel.permissionType, permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '', mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '', lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '', prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
startTime: this.formModel.date[0], startTime: this.formModel.date[0],
endTime: this.formModel.date[1], endTime: this.formModel.date[1],
amount: this.formModel.amount, amount: this.formModel.amount,
ownerId: this.formModel.ownerId, ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName roleName: this.formModel.roleName
}); });
} }
this.doClose(); this.doClose();
} }
}); });
} }
} }
}; };
</script> </script>

View File

@ -70,7 +70,7 @@
</template> </template>
<script> <script>
import { listPublishMap, getPublishMapInfo } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { getPublishLessonList } from '@/api/jmap/lesson'; import { getPublishLessonList } from '@/api/jmap/lesson';
import { getCommodityMapProduct } from '@/api/management/mapprd'; import { getCommodityMapProduct } from '@/api/management/mapprd';
import { packagePermissionDistribute } from '@/api/management/distribute'; import { packagePermissionDistribute } from '@/api/management/distribute';
@ -79,187 +79,184 @@ import EditRule from './editRule';
import CanTransfer from './canDistribute'; import CanTransfer from './canDistribute';
export default { export default {
name: 'PackRule', name: 'PackRule',
components: { components: {
EditRule, EditRule,
QrCode, QrCode,
CanTransfer CanTransfer
}, },
data() { data() {
return { return {
display: 1, display: 1,
urlInfo: {}, urlInfo: {},
PermissionTypeList: [], PermissionTypeList: [],
PublisLessonList: [], PublisLessonList: [],
PublishMapList: [], PublishMapList: [],
mapProductList: [], mapProductList: [],
ruleList: [] ruleList: []
}; };
}, },
computed: { computed: {
height() { height() {
return this.$store.state.app.height - 63; return this.$store.state.app.height - 63;
} }
}, },
mounted() { mounted() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
getSummaries(param) { getSummaries(param) {
const { columns, data } = param; const { columns, data } = param;
const sums = []; const sums = [];
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (index === 0) { if (index === 0) {
sums[index] = this.$t('global.totoal'); sums[index] = this.$t('global.totoal');
return; return;
} }
if (index === 6) { if (index === 6) {
const values = data.map(item => Number(item[column.property])); const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) { if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr); const value = Number(curr);
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr; return prev + curr;
} else { } else {
return prev; return prev;
} }
}, 0); }, 0);
} }
} }
}); });
return sums; return sums;
}, },
computedName(list, code) { computedName(list, code) {
let name = ''; let name = '';
list.forEach(elem => { list.forEach(elem => {
if (elem.value == code) { if (elem.value == code) {
name = elem.label; name = elem.label;
} }
}); });
return name; return name;
}, },
async computedMapProduct(item) { async computedMapProduct(item) {
let name = ''; let name = '';
const resp = await getPublishMapInfo(item.mapId); const rest = await getCommodityMapProduct(item.mapId);
const rest = await getCommodityMapProduct(resp.data.skinCode); const list = rest.data || [];
const list = rest.data || []; list.forEach(elem => {
list.forEach(elem => { if (elem.id == item.mapProductCode) {
if (elem.id == item.mapProductCode) { name = elem.name;
name = elem.name; return;
return; }
} });
}); return name;
return name; },
}, loadInitData() {
loadInitData() { this.PermissionTypeList = [];
this.PermissionTypeList = []; this.$Dictionary.permissionType().then(list => {
this.$Dictionary.permissionType().then(list => { this.PermissionTypeList = list.map(elem => {
this.PermissionTypeList = list.map(elem => { return { value: elem.code, label: elem.name };
return { value: elem.code, label: elem.name }; });
}); });
});
this.EffectiveTypeList = []; this.EffectiveTypeList = [];
this.$Dictionary.effectiveType().then(list => { this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list.map(elem => { this.EffectiveTypeList = list.map(elem => {
return { value: elem.code, label: elem.name }; return { value: elem.code, label: elem.name };
}); });
}); });
this.PublishMapList = []; this.PublishMapList = [];
listPublishMap().then(response => { listPublishMap().then(response => {
const list = response.data || []; const list = response.data || [];
this.PublishMapList = list.map(elem => { this.PublishMapList = list.map(elem => {
return { value: elem.id, label: elem.name }; return { value: elem.id, label: elem.name };
}); });
}); });
this.PublisLessonList = []; this.PublisLessonList = [];
getPublishLessonList().then(response => { getPublishLessonList().then(response => {
const list = response.data || []; const list = response.data || [];
this.PublisLessonList = list.map(elem => { this.PublisLessonList = list.map(elem => {
return { value: elem.id, label: elem.name, mapId: elem.mapId, prdCode: elem.prdCode }; return { value: elem.id, label: elem.name, mapId: elem.mapId, prdCode: elem.prdCode };
}); });
}); });
}, },
turnback() { turnback() {
this.$router.go(-1); this.$router.go(-1);
}, },
dialogAdd() { dialogAdd() {
this.$refs.addRule.doShow({ type: 'add' }); this.$refs.addRule.doShow({ type: 'add' });
}, },
dialogEdit(item) { dialogEdit(item) {
this.$refs.addRule.doShow({ type: 'edit', item: item }); this.$refs.addRule.doShow({ type: 'edit', item: item });
}, },
deleteForm(item) { deleteForm(item) {
var index = this.ruleList.indexOf(item); var index = this.ruleList.indexOf(item);
if (index >= 0) { if (index >= 0) {
this.ruleList.splice(index, 1); this.ruleList.splice(index, 1);
} }
}, },
addRuleForm(item) { addRuleForm(item) {
const index = this.ruleList.findIndex(elem => { const index = this.ruleList.findIndex(elem => {
return item.mapId == elem.mapId && return item.mapId == elem.mapId &&
item.lessonId == elem.lessonId && item.lessonId == elem.lessonId &&
item.prdCode == elem.prdCode && item.prdCode == elem.prdCode &&
item.permissionType == elem.permissionType; item.permissionType == elem.permissionType;
}); });
getPublishMapInfo(item.mapId).then(resp => { getCommodityMapProduct(item.mapId).then(rest => {
getCommodityMapProduct(resp.data.skinCode).then(rest => { const list = rest.data || [];
const list = rest.data || []; this.mapProductList = list.map(elem => {
this.mapProductList = list.map(elem => { return { value: elem.code, label: elem.name };
return { value: elem.code, label: elem.name }; });
}); });
}); if (index < 0) {
}); this.ruleList.push(item);
if (index < 0) { } else {
this.ruleList.push(item); this.$message.warning(this.$t('permission.hasExitRule'));
} else { }
this.$message.warning(this.$t('permission.hasExitRule')); },
} editRuleForm(item) {
}, const index = this.ruleList.findIndex(elem => {
editRuleForm(item) { return item.mapId == elem.mapId &&
const index = this.ruleList.findIndex(elem => {
return item.mapId == elem.mapId &&
item.lessonId == elem.lessonId && item.lessonId == elem.lessonId &&
item.mapProductCode == elem.mapProductCode && item.mapProductCode == elem.mapProductCode &&
item.permissionType == elem.permissionType; item.permissionType == elem.permissionType;
}); });
if (index >= 0) { if (index >= 0) {
Object.assign(this.ruleList[index], item); Object.assign(this.ruleList[index], item);
} }
}, },
packForm() { packForm() {
if (this.ruleList.length) { if (this.ruleList.length) {
this.$refs.canDistribute.doShow(); this.$refs.canDistribute.doShow();
} else { } else {
this.$messageBox(this.$t('permission.pleaseAddRule')); this.$messageBox(this.$t('permission.pleaseAddRule'));
} }
}, },
distribute(data) { distribute(data) {
this.url = ''; this.url = '';
this.ruleList.forEach(item => { this.ruleList.forEach(item => {
item.canDistribute = data.canDistribute; item.canDistribute = data.canDistribute;
}); });
packagePermissionDistribute(this.ruleList).then(resp => { packagePermissionDistribute(this.ruleList).then(resp => {
this.urlInfo = { this.urlInfo = {
url: resp.data, url: resp.data,
title: this.$t('global.distributeQrcode') title: this.$t('global.distributeQrcode')
}; };
this.qrcodeShow(); this.qrcodeShow();
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.packagePermissionFailed')); this.$messageBox(this.$t('error.packagePermissionFailed'));
}); });
}, },
qrcodeShow() { qrcodeShow() {
if (this.$refs) { if (this.$refs) {
this.$refs.qrCode.doShow(this.urlInfo); this.$refs.qrCode.doShow(this.urlInfo);
} }
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,43 +1,47 @@
<template> <template>
<el-card :style="{height: height+'px'}" style="overflow-y:scroll;padding-bottom:20px;"> <el-card :style="{height: height+'px'}" style="overflow-y:scroll;padding-bottom:20px;">
<div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;"> <div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<div class="runPlanList">{{$t('planMonitor.openRunPlan.runPlanList')}}</div> <div class="runPlanList">{{ $t('planMonitor.openRunPlan.runPlanList') }}</div>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">{{$t('planMonitor.createRunningDiagram')}}</el-button> <el-button v-if="isCreate" size="small" type="primary" class="createRunPlan" @click="handleCreate">{{ $t('planMonitor.createRunningDiagram') }}</el-button>
</div> </div>
<el-table :data="runPlanList" height="500" stripe <el-table
border :data="runPlanList"
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;"> height="500"
<el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" /> stripe
<el-table-column :label="this.$t('global.status')" v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))"> border
<template slot-scope="scope"> style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;"
<el-tag>{{handlerStatus(scope.row)}}</el-tag> >
</template> <el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" />
</el-table-column> <el-table-column v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))" :label="this.$t('global.status')">
<el-table-column <template slot-scope="scope">
prop="explanation" <el-tag>{{ handlerStatus(scope.row) }}</el-tag>
show-overflow-tooltip </template>
v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))" </el-table-column>
:label="this.$t('planMonitor.explanation')"> <el-table-column
</el-table-column> v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))"
<el-table-column :label="this.$t('planMonitor.creationDate')"> prop="explanation"
<template slot-scope="scope"> show-overflow-tooltip
<el-tag type="success">{{handleTime(scope.row.createTime)}}</el-tag> :label="this.$t('planMonitor.explanation')"
</template> />
</el-table-column> <el-table-column :label="this.$t('planMonitor.creationDate')">
<el-table-column :label="this.$t('global.operate')" width="400"> <template slot-scope="scope">
<template slot-scope="scope"> <el-tag type="success">{{ handleTime(scope.row.createTime) }}</el-tag>
<el-button size="mini" class="button_box" type="success" @click="handleConfirm(scope.row)" v-if="scope.row.status !=='1'">{{$t('planMonitor.load')}}</el-button> </template>
<el-button size="mini" class="button_box" type="primary" @click="handleEdit(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('planMonitor.modifyName')}}</el-button> </el-table-column>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('global.delete')}}</el-button> <el-table-column :label="this.$t('global.operate')" width="400">
<el-button size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)" v-if="isCreate && scope.row.status ==='0'">{{hasRelease?$t('global.release'):$t('planMonitor.applyRelease')}}</el-button> <template slot-scope="scope">
<el-button size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)" v-if="scope.row.status === '1'">{{$t('planMonitor.preview')}}</el-button> <el-button v-if="scope.row.status !=='1'" size="mini" class="button_box" type="success" @click="handleConfirm(scope.row)">{{ $t('planMonitor.load') }}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)" v-if="scope.row.status === '1'" >{{$t('planMonitor.revoke')}}</el-button> <el-button v-if="isCreate && scope.row.status !=='1'" size="mini" class="button_box" type="primary" @click="handleEdit(scope.row)">{{ $t('planMonitor.modifyName') }}</el-button>
</template> <el-button v-if="isCreate && scope.row.status !=='1'" size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)">{{ $t('global.delete') }}</el-button>
</el-table-column> <el-button v-if="isCreate && scope.row.status ==='0'" size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)">{{ hasRelease?$t('global.release'):$t('planMonitor.applyRelease') }}</el-button>
</el-table> <el-button v-if="scope.row.status === '1'" size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)">{{ $t('planMonitor.preview') }}</el-button>
<create-empty-plan ref="createEmptyPlan" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" @refresh="refresh"/> <el-button v-if="scope.row.status === '1'" size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)">{{ $t('planMonitor.revoke') }}</el-button>
<!-- @dispatchOperate="dispatchOperate" --> </template>
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" /> </el-table-column>
</el-table>
<create-empty-plan ref="createEmptyPlan" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" @refresh="refresh" />
<!-- @dispatchOperate="dispatchOperate" -->
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
</el-card> </el-card>
</template> </template>
<script> <script>
@ -48,156 +52,154 @@ import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
name: 'userRunPlanList', name: 'UserRunPlanList',
components: { components: {
CreateEmptyPlan, CreateEmptyPlan,
EditPlanName EditPlanName
// LimitList // LimitList
}, },
filters: { filters: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
// height: 260, // height: 260,
// planId: '', // planId: '',
// planName: '', // planName: '',
type: 'add', type: 'add',
// defaultShowKeys: [], // defaultShowKeys: [],
runPlanList: [], runPlanList: [],
runPlanDict: {}, runPlanDict: {},
isCreate:false, isCreate:false,
PlanConvert: {} PlanConvert: {}
// defaultProps: { // defaultProps: {
// label: 'name' // label: 'name'
// } // }
}; };
}, },
computed: { computed: {
height() { height() {
return this.$store.state.app.height - 60 -30; return this.$store.state.app.height - 60 - 30;
}, },
skinCode() { skinCode() {
return this.$route.query.skinCode || '02'; return this.$route.query.skinCode || '02';
}, },
hasRelease() { hasRelease() {
return this.$store.state.user.roles.includes('04') || return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05'); this.$store.state.user.roles.includes('05');
} }
}, },
created(){ watch: {
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode); '$route' () {
}, this.getRunPlanList();
mounted(){ }
this.getRunPlanList(); },
}, created() {
watch: { this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
'$route' () { },
this.getRunPlanList(); mounted() {
} this.getRunPlanList();
}, },
methods:{ methods:{
refresh(){ refresh() {
this.getRunPlanList(); this.getRunPlanList();
}, },
getRunPlanList() { getRunPlanList() {
if(/^\/design\/userlist/.test(this.$route.fullPath)){ if (/^\/design\/userlist/.test(this.$route.fullPath)) {
this.isCreate=false; this.isCreate = false;
getRpListByUserMapId(this.$route.params.mapId).then((resp) => { getRpListByUserMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data; this.runPlanList = resp.data;
this.runPlanList.forEach(elem => { this.runPlanList.forEach(elem => {
this.runPlanDict[elem.id] = elem.name; this.runPlanDict[elem.id] = elem.name;
}); });
// this.dialogShow = true; // this.dialogShow = true;
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail')); this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
}); });
} } else {
else{ this.isCreate = true;
this.isCreate=true; getRpListByMapId(this.$route.params.mapId).then((resp) => {
getRpListByMapId(this.$route.params.mapId).then((resp) => { this.runPlanList = resp.data;
this.runPlanList = resp.data; this.runPlanList.forEach(elem => {
this.runPlanList.forEach(elem => { this.runPlanDict[elem.id] = elem.name;
this.runPlanDict[elem.id] = elem.name; });
}); // this.dialogShow = true;
// this.dialogShow = true; }).catch(() => {
}).catch(() => { this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail')); });
}); }
} },
}, // dispatchOperate(){
// dispatchOperate(){ // this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
// this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params); // },
// }, dispatchDialog() {
dispatchDialog(){ this.$refs['createEmptyPlan'].doShow();
this.$refs['createEmptyPlan'].doShow(); },
}, handleCreate() {
handleCreate(){ this.$refs['createEmptyPlan'].doShow();
this.$refs['createEmptyPlan'].doShow(); },
}, handleConfirm(row) {
handleConfirm(row){ this.loadRunPlanData({
this.loadRunPlanData({ planId: row.id,
planId: row.id, skinCode: this.$route.query.skinCode,
skinCode: this.$route.query.skinCode, planName: row.name
planName: row.name });
}); },
}, //
// handleEdit(row) {
handleEdit(row) { if (row.id && row.name) {
if (row.id && row.name) { this.$refs.editPlan.doShow({id: row.id, name: row.name});
this.$refs.editPlan.doShow({id: row.id, name: row.name}); } else {
} else { this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan')); }
} },
}, loadRunPlanData({ refresh, planId, skinCode, planName }) {
loadRunPlanData({ refresh, planId, skinCode, planName }) { if (refresh) {
if (refresh) { this.$store.dispatch('runPlan/refresh');
this.$store.dispatch('runPlan/refresh'); } else {
} else { const query = { skinCode: skinCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };
const query = { skinCode: skinCode, mapId: this.$route.params.mapId, planId: planId, planName: planName }; if (/^\/design\/userlist/.test(this.$route.fullPath)) {
if(/^\/design\/userlist/.test(this.$route.fullPath)){ this.$router.push({ path: `${UrlConfig.plan.usertool}`, query: query });
this.$router.push({ path: `${UrlConfig.plan.usertool}`, query: query }); } else {
} this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
else{ }
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); }
} },
} //
}, handleDelete(row) {
// this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
handleDelete(row) {
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlan(row.id).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
// if (row.id === this.$route.query.planId) {
// const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
// this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
// }
this.refresh();
// this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
},
handlePublish(row) {
this.$confirm(this.hasRelease? this.$t('tip.publishRunPlanTips'):this.$t('tip.applyRunPlanTips'),this.$t('tip.hint'),{
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'), cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (this.hasRelease){ deleteRunPlan(row.id).then(Response => {
publishRunPlan(row.id,{runPlanName: name}).then(resp => { this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
// if (row.id === this.$route.query.planId) {
// const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
// this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
// }
this.refresh();
// this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
},
handlePublish(row) {
this.$confirm(this.hasRelease ? this.$t('tip.publishRunPlanTips') : this.$t('tip.applyRunPlanTips'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
if (this.hasRelease) {
publishRunPlan(row.id, {runPlanName: name}).then(resp => {
this.$message.success(this.$t('tip.publishRunPlanSuccess')); this.$message.success(this.$t('tip.publishRunPlanSuccess'));
this.refresh(); this.refresh();
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail')); this.$messageBox(this.$t('tip.publishRunPlanFail'));
this.refresh(); this.refresh();
}) });
} else { } else {
releaseOrCancelRunPlan(row.id, '1').then(resp => { releaseOrCancelRunPlan(row.id, '1').then(resp => {
this.$message.success(this.$t('tip.applyRunPlanSuccess')); this.$message.success(this.$t('tip.applyRunPlanSuccess'));
@ -205,58 +207,58 @@ export default {
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.applyRunPlanFail')); this.$messageBox(this.$t('tip.applyRunPlanFail'));
this.refresh(); this.refresh();
}) });
} }
}); });
}, },
handelRevert(row) { handelRevert(row) {
this.$confirm(this.$t('tip.cancelRunPlanTips'),this.$t('tip.hint'),{ this.$confirm(this.$t('tip.cancelRunPlanTips'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'), cancelButtonText: this.$t('tip.cancel'),
type:'warning' type:'warning'
}).then(() => { }).then(() => {
releaseOrCancelRunPlan(row.id,'0').then(resp=> { releaseOrCancelRunPlan(row.id, '0').then(resp=> {
this.$message.success(this.$t('tip.cancelRunPlanSuccess')); this.$message.success(this.$t('tip.cancelRunPlanSuccess'));
this.refresh(); this.refresh();
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.cancelRunPlanFail')) this.$messageBox(this.$t('tip.cancelRunPlanFail'));
this.refresh(); this.refresh();
}) });
}) });
}, },
handlerStatus(row) { handlerStatus(row) {
let lessonStatus = ''; let lessonStatus = '';
switch (row.status){ switch (row.status) {
case '0': case '0':
lessonStatus = this.$t('lesson.notRelease'); lessonStatus = this.$t('lesson.notRelease');
break; break;
case '1': case '1':
lessonStatus = this.$t('lesson.pendingReview'); lessonStatus = this.$t('lesson.pendingReview');
break; break;
case '2': case '2':
lessonStatus = this.$t('lesson.published'); lessonStatus = this.$t('lesson.published');
break; break;
case '3': case '3':
lessonStatus = this.$t('lesson.rejected'); lessonStatus = this.$t('lesson.rejected');
break; break;
} }
return lessonStatus; return lessonStatus;
}, },
handleTime(time) { handleTime(time) {
return time.replace("T"," "); return time.replace('T', ' ');
}, },
handlePreview(row){ handlePreview(row) {
previewRunPlan(row.id).then(resp => { previewRunPlan(row.id).then(resp => {
const query = { const query = {
skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id,from:'' skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id, from:''
}; };
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query }); this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message); this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
}); });
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>

View File

@ -12,7 +12,7 @@
> >
<div> <div>
<el-tabs v-model="activeTab" type="card"> <el-tabs v-model="activeTab" type="card">
<el-tab-pane :label="this.$t('planMonitor.normalNew')" name="first"> <el-tab-pane :label="this.$t('planMonitor.normalNew')" name="first">
<el-row> <el-row>
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent> <el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name"> <el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
@ -69,196 +69,196 @@ import { UrlConfig } from '@/router/index';
import XLSX from 'xlsx'; import XLSX from 'xlsx';
export default { export default {
name: 'CreateEmptyPlan', name: 'CreateEmptyPlan',
components: { components: {
}, },
props: { props: {
planConvert: { planConvert: {
type: Object, type: Object,
default: function() { default: function() {
return { }; return { };
} }
} }
}, },
data() { data() {
return { return {
activeTab: 'second', activeTab: 'second',
dialogShow: false, dialogShow: false,
loading: false, loading: false,
loadingDig: null, loadingDig: null,
publishMapList: [], publishMapList: [],
newModel: { newModel: {
name: '', name: '',
skinCode: this.$route.query.skinCode skinCode: this.$route.query.skinCode
}, },
pullModel: { pullModel: {
templateId: '', templateId: '',
name: '', name: '',
skinCode: this.$route.query.skinCode skinCode: this.$route.query.skinCode
} }
}; };
}, },
computed: { computed: {
title() { title() {
return this.$t('planMonitor.newRunGraph'); return this.$t('planMonitor.newRunGraph');
}, },
rules() { rules() {
return { return {
name: [ name: [
{ required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' }
] ]
}; };
}, },
pullRules() { pullRules() {
return { return {
templateId: [ templateId: [
{ required: true, message: this.$t('rules.chooseToPublishTheRunGraph'), trigger: 'change' } { required: true, message: this.$t('rules.chooseToPublishTheRunGraph'), trigger: 'change' }
], ],
name: [ name: [
{ required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' }
] ]
}; };
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
async initLoad() { async initLoad() {
const res = await queryRunPlanList(this.$route.query.skinCode); const res = await queryRunPlanList(this.$route.params.mapId);
if (res.code == 200 && res.data.length) { if (res.code == 200 && res.data.length) {
this.publishMapList = res.data; this.publishMapList = res.data;
} }
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
this.initLoad(); this.initLoad();
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.newModel.name = ''; this.newModel.name = '';
this.pullModel.templateId = ''; this.pullModel.templateId = '';
this.pullModel.name = ''; this.pullModel.name = '';
if (this.$refs.form) { if (this.$refs.form) {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
} }
if (this.$refs.pullForm) { if (this.$refs.pullForm) {
this.$refs.pullForm.resetFields(); this.$refs.pullForm.resetFields();
} }
}, },
handleCommit() { handleCommit() {
if (this.activeTab === 'first') { if (this.activeTab === 'first') {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
createEmptyPlan(this.newModel).then(resp => { createEmptyPlan(this.newModel).then(resp => {
const params = { const params = {
dialogName: 'openRunPlan', dialogName: 'openRunPlan',
operate: 'loadRunPlanData', operate: 'loadRunPlanData',
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.newModel.name, refresh: true } params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.newModel.name, refresh: true }
}; };
this.$emit('refresh'); this.$emit('refresh');
// this.$emit('dispatchOperate', params); // this.$emit('dispatchOperate', params);
this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully')); this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully'));
// this.jump(resp.data, this.newModel.name); // this.jump(resp.data, this.newModel.name);
this.doClose(); this.doClose();
}).catch((error) => { }).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed')+ this.$t('global.colon') + error.message); this.$messageBox(this.$t('error.createOperationGraphFailed') + this.$t('global.colon') + error.message);
this.doClose(); this.doClose();
}); });
} }
}); });
} else { } else {
this.$refs['pullForm'].validate((valid) => { this.$refs['pullForm'].validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
postCreatePlan(this.pullModel).then(resp => { postCreatePlan(this.pullModel).then(resp => {
this.$message.success(this.$t('tip.createARunGraphSuccessfully')); this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
// this.jump(resp.data, this.pullModel.name); // this.jump(resp.data, this.pullModel.name);
this.$emit('refresh'); this.$emit('refresh');
this.doClose(); this.doClose();
}).catch((error) => { }).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed')+ this.$t('global.colon') + error.message); this.$messageBox(this.$t('error.createOperationGraphFailed') + this.$t('global.colon') + error.message);
this.doClose(); this.doClose();
}); });
} }
}); });
} }
}, },
importf(item) { importf(item) {
const obj = this.$refs.files; const obj = this.$refs.files;
if (obj.files) { if (obj.files) {
const file = obj.files[0]; const file = obj.files[0];
this.handleImportRunPlan(file); this.handleImportRunPlan(file);
obj.value = ''; obj.value = '';
} }
}, },
loadingScreen() { loadingScreen() {
this.loadingDig = this.$loading({ this.loadingDig = this.$loading({
lock: true, lock: true,
text: this.$t('tip.underImport'), text: this.$t('tip.underImport'),
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
}, },
// //
handleImportRunPlan(file) { handleImportRunPlan(file) {
if (file) { if (file) {
this.loadingScreen(); this.loadingScreen();
setTimeout(() => { setTimeout(() => {
const that = this; const that = this;
const reader = new FileReader(); const reader = new FileReader();
if (reader) { if (reader) {
reader.onload = function (e) { reader.onload = function (e) {
let wb; let wb;
const data = e.target.result; const data = e.target.result;
if (that.rABS) { if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { // wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64' type: 'base64'
}); });
} else { } else {
wb = XLSX.read(data, { wb = XLSX.read(data, {
type: 'binary' type: 'binary'
}); });
} }
if (wb) { if (wb) {
try { try {
let jsonData = []; let jsonData = [];
for (const index in wb.Sheets) { for (const index in wb.Sheets) {
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData); jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
} }
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => { importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
that.loadingDig.close(); that.loadingDig.close();
that.$message.success(that.$t('tip.importOperationGraphSuccessfully')); that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} }); // this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
}).catch(error => { }).catch(error => {
that.loadingDig.close(); that.loadingDig.close();
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`); that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
}); });
} catch (error) { } catch (error) {
that.loadingDig.close(); that.loadingDig.close();
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`); that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
} }
} }
}; };
if (that.rABS) { if (that.rABS) {
reader.readAsArrayBuffer(file); reader.readAsArrayBuffer(file);
} else { } else {
reader.readAsBinaryString(file); reader.readAsBinaryString(file);
} }
} }
}, 200); }, 200);
} }
this.doClose(); this.doClose();
}, },
jump(planId, planName) { jump(planId, planName) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName }; const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

File diff suppressed because it is too large Load Diff

View File

@ -28,22 +28,22 @@ import home2 from '@/assets/home/plan2.png';
import home3 from '@/assets/home/plan3.png'; import home3 from '@/assets/home/plan3.png';
export default { export default {
name: 'Home', name: 'Home',
data() { data() {
return { return {
listImg: [ listImg: [
{ src: home1 }, { src: home1 },
{ src: home2 }, { src: home2 },
{ src: home3 } { src: home3 }
], ],
logo: logo logo: logo
}; };
}, },
computed: { computed: {
height() { height() {
return this.$store.state.app.height; return this.$store.state.app.height;
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -19,38 +19,38 @@ import drapLeft from '@/views/components/drapLeft/index';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'Exam', name: 'Exam',
components: { components: {
planList, planList,
drapLeft drapLeft
}, },
data() { data() {
return { return {
listShow: true, listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450 widthLeft: Number(localStore.get('LeftWidth')) || 450
}; };
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'lessonbar' 'lessonbar'
]), ]),
height() { height() {
return this.$store.state.app.height; return this.$store.state.app.height;
} }
}, },
watch: { watch: {
'lessonbar.opened': function (val) { 'lessonbar.opened': function (val) {
this.listShow = val; this.listShow = val;
} }
}, },
methods: { methods: {
refresh() { refresh() {
this.$refs && this.$refs.planList && this.$refs.planList.refresh(); this.$refs && this.$refs.planList && this.$refs.planList.refresh();
}, },
drapWidth(width) { drapWidth(width) {
this.widthLeft = Number(width); this.widthLeft = Number(width);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -27,61 +27,63 @@
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
data() { data() {
return { return {
show: false, show: false,
skinCodeList: [], skinCodeList: [],
formMdoel: { formMdoel: {
id: 0, id: 0,
skinCode: '', skinCode: '',
name: '' name: '',
} mapId: ''
}; }
}, };
computed: { },
title() { computed: {
return this.$t('publish.selectMap'); title() {
}, return this.$t('publish.selectMap');
rules() { },
return { rules() {
skinCode: [ return {
{ required: true, message: this.$t('publish.selectSkinCode'), trigger: 'change' } skinCode: [
], { required: true, message: this.$t('publish.selectSkinCode'), trigger: 'change' }
name: [ ],
{ required: true, message: this.$t('publish.enterRunPlanName'), trigger: 'blur' } name: [
] { required: true, message: this.$t('publish.enterRunPlanName'), trigger: 'blur' }
}; ]
} };
}, }
methods: { },
doShow(row) { methods: {
this.formMdoel.id = row.id; doShow(row) {
this.formMdoel.skinCode = ''; this.formMdoel.id = row.id;
this.formMdoel.name = row.name; this.formMdoel.skinCode = '';
this.show = true; this.formMdoel.name = row.name;
getSkinCodeList().then(response => { this.formMdoel.mapId = row.mapId;
this.skinCodeList = response.data; this.show = true;
if (this.skinCodeList.length) { getSkinCodeList().then(response => {
this.skinCodeList.forEach(item => { this.skinCodeList = response.data;
item.disabled = false; if (this.skinCodeList.length) {
if (item.code == row.skinCode) { this.skinCodeList.forEach(item => {
item.disabled = true; item.disabled = false;
} if (item.code == row.skinCode) {
}); item.disabled = true;
} }
}); });
}, }
doClose(done) { });
this.show = false; },
this.$refs.form.resetFields(); doClose(done) {
}, this.show = false;
handleCofirm() { this.$refs.form.resetFields();
this.$refs['form'].validate((valid) => { },
if (valid) { handleCofirm() {
this.$emit('confirm', this.formMdoel); this.$refs['form'].validate((valid) => {
} if (valid) {
}); this.$emit('confirm', this.formMdoel);
} }
} });
}
}
}; };
</script> </script>

View File

@ -15,174 +15,174 @@ import MapSelect from './mapSelect';
import CopyPlan from './copyPlan.vue'; import CopyPlan from './copyPlan.vue';
export default { export default {
name: 'RunPlanTemplate', name: 'RunPlanTemplate',
components: { components: {
MapSelect, MapSelect,
CopyPlan CopyPlan
}, },
data() { data() {
return { return {
skinCodeList: [], skinCodeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true,
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: this.$t('publish.runPlanName') label: this.$t('publish.runPlanName')
}, },
skinCode: { skinCode: {
type: 'select', type: 'select',
label: this.$t('publish.skinType'), label: this.$t('publish.skinType'),
config: { config: {
data: [] data: []
} }
} }
} }
}, },
queryList: { queryList: {
query: runPlanTemplateList, query: runPlanTemplateList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: this.$t('publish.runPlanName'), title: this.$t('publish.runPlanName'),
prop: 'name' prop: 'name'
}, },
{ {
title: this.$t('publish.skinType'), title: this.$t('publish.skinType'),
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: this.$t('publish.createTime'), title: this.$t('publish.createTime'),
prop: 'createTime' prop: 'createTime'
}, },
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '450', width: '450',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; }, hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [ buttons: [
{ {
name: this.$t('global.delete'), name: this.$t('global.delete'),
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
}, },
{ {
name: this.$t('publish.generateRunPlan'), name: this.$t('publish.generateRunPlan'),
handleClick: this.handleMapSelect, handleClick: this.handleMapSelect,
type: '' type: ''
}, },
{ {
name: this.$t('publish.copyRunPlan'), name: this.$t('publish.copyRunPlan'),
handleClick: this.handleCopyPlan, handleClick: this.handleCopyPlan,
type: '' type: ''
}, },
{ {
name: this.$t('global.preview'), name: this.$t('global.preview'),
handleClick: this.handleView, handleClick: this.handleView,
type: '' type: ''
} }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
}; };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.skinCodeList = [];
getSkinCodeList().then(response => { getSkinCodeList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
}); });
}); });
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm(this.$t('publish.wellDelTemplate'), this.$t('global.tips'), { this.$confirm(this.$t('publish.wellDelTemplate'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanTemplate(row.id).then(response => { deleteRunPlanTemplate(row.id).then(response => {
this.$message.success(this.$t('publish.deleteSuccess')); this.$message.success(this.$t('publish.deleteSuccess'));
this.reloadTable(); this.reloadTable();
}).catch(error => { }).catch(error => {
this.reloadTable(); this.reloadTable();
if (error.code == 500) { if (error.code == 500) {
this.$messageBox(this.$t('error.deleteFailed')); this.$messageBox(this.$t('error.deleteFailed'));
} else if (error.code == 500009) { } else if (error.code == 500009) {
this.$messageBox(this.$t('error.templateHasBeUse')); this.$messageBox(this.$t('error.templateHasBeUse'));
} }
}); });
}).catch(() => { }); }).catch(() => { });
}, },
// //
handleMapSelect(index, row) { handleMapSelect(index, row) {
this.$refs.map.doShow(row); this.$refs.map.doShow(row);
}, },
// //
handleCopyPlan(index, row) { handleCopyPlan(index, row) {
this.$refs.copyPlan.doShow(row); this.$refs.copyPlan.doShow(row);
}, },
// //
handleGenerateEveryDay({planId, mapId}) { handleGenerateEveryDay({planId, mapId}) {
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), { this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
generateCommonRunPlanEveryDay(planId, {mapId}).then(response => { generateCommonRunPlanEveryDay(planId, {mapId}).then(response => {
this.reloadTable(); this.reloadTable();
this.$refs.map.doClose(); this.$refs.map.doClose();
this.$message.success(this.$t('publish.createCommonSuccess')); this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => { }).catch(() => {
this.reloadTable(); this.reloadTable();
this.$messageBox(this.$t('error.operationFailure')); this.$messageBox(this.$t('error.operationFailure'));
}); });
}).catch(() => { }); }).catch(() => { });
}, },
// //
handleCopyRunPlan(data) { handleCopyRunPlan(data) {
this.$confirm(this.$t('publish.copyRunPlanContinue'), this.$t('global.tips'), { this.$confirm(this.$t('publish.copyRunPlanContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
postRunPlanTemplate({ id: data.id, skinCode: data.skinCode, name: data.name }).then(response => { postRunPlanTemplate({ id: data.id, mapId: data.mapId, name: data.name }).then(response => {
this.reloadTable(); this.reloadTable();
this.$refs.copyPlan.doClose(); this.$refs.copyPlan.doClose();
this.$message.success(this.$t('publish.createCommonSuccess')); this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => { }).catch(() => {
this.reloadTable(); this.reloadTable();
this.$messageBox(this.$t('error.operationFailure')); this.$messageBox(this.$t('error.operationFailure'));
}); });
}).catch(() => { }); }).catch(() => { });
}, },
// //
handleView(index, row) { handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinCode: row.skinCode, planId: row.id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinCode: row.skinCode, planId: row.id, mapId: row.mapId } });
}, },
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -0,0 +1,376 @@
<template>
<div class="main" style="background-color:floralwhite">
<div :id="runPlanId" />
<div v-if="isShowBack" style="float: right; margin-right: 2%; margin-top: 10px; margin-bottom: 20px">
<el-button-group>
<el-button type="primary" @click="back">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getStationList, queryRunPlan, queryRunPlanTemplate, queryRunPlanDaily } from '@/api/runplan';
import { timeFormat } from '@/utils/date';
import { UrlConfig } from '@/router/index';
export default {
name: 'RunPlan',
data() {
return {
runPlanId: 'main',
myChart: null,
PlanConvert: {},
option: {
title: {
text: '',
left: 'center'
},
grid: {
top: '30px',
left: '120px',
right: '2%',
bottom: '80px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
right: '2%',
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
tooltip: {
axisPointer: {
trigger: 'item',
type: 'cross'
},
formatter: this.axisTooltip,
borderWidth: 1
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
formatter: this.xAxisLableFormat,
textStyle: {
color: '#333'
}
},
axisPointer: {
snap: true,
label: {
formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
min: 0,
max: 0
},
series: [],
dataZoom: [
{
type: 'inside'
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
bottom: '25px'
}
]
},
kmRangeCoordMap: {}
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
isShowBack() {
if (this.$route.params.mode !== 'draft') {
return true;
}
return false;
},
mode() {
return this.$route.params.mode;
},
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
}
},
watch: {
'$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
},
'$store.state.app.windowSizeCount': function() {
this.setPlanSize();
},
$route() {
this.$nextTick(() => {
this.loadChartPage(this.$route.query);
});
}
},
mounted() {
this.setPlanSize();
this.loadChartPage(this.$route.query);
},
beforeDestroy() {
this.destroy();
},
methods: {
loadChartPage(opt) {
this.PlanConvert = this.$theme.loadPlanConvert(opt.skinCode);
this.$store.dispatch('runPlan/clear').then(resp => {
this.loadInitChart().then(() => {
if (opt.mapId && opt.planId) {
this.myChart && this.myChart.showLoading();
getStationList(opt.mapId).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
let queryFunc = null;
const params = opt.planId;
switch (this.mode) {
case 'common': queryFunc = queryRunPlanTemplate; break;
case 'template': queryFunc = queryRunPlanTemplate; break;
case 'everyDay': queryFunc = queryRunPlanDaily; break;
default: queryFunc = queryRunPlan; break;
}
queryFunc(params).then(resp => {
this.loadChartData(resp.data);
this.myChart && this.myChart.hideLoading();
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainStationListFailed'));
});
}
});
});
},
async loadChartData(data) {
try {
this.option.title.text = data.planName;
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(this.stations);
this.option.series = [];
this.pushModels(this.option.series, [this.PlanConvert.initializeYaxis(this.stations)]);
this.pushModels(this.option.series, this.PlanConvert.convertDataToModels(data, this.stations, this.kmRangeCoordMap, { width: 1 }));
this.loadInitData();
} catch (error) {
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
}
},
async loadInitData() {
await this.xAxisInit();
await this.yAxisInit();
await this.loadInitChart();
},
xAxisPointFormat(params) {
return timeFormat(params.value);
},
yAxisPointFormat(params) {
return this.PlanConvert.computedFormatYAxis(this.stations, params);
},
xAxisLableFormat(value, index) {
if (value % 60 === 0) {
return timeFormat(parseInt(value));
}
},
yAxisLableFormat(value, index) {
return '';
},
xAxisInit() {
const list = [];
for (var time = this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
list.push(time);
}
this.option.xAxis[0].data = list;
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = 3600 * 6 - 600 + this.PlanConvert.TranslationTime;
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = 3600 * 8 + 600 + this.PlanConvert.TranslationTime;
},
yAxisInit() {
if (Object.keys(this.PlanConvert).length) {
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
}
},
pushModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
if (elem) {
series.push(elem);
}
});
}
return series;
},
popModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
const index = series.indexOf(elem);
if (index >= 0) {
series.split(index, 1);
}
});
}
return series;
},
loadInitChart() {
return new Promise((resolve, reject) => {
try {
const that = this;
// echart
require.config(
{
paths: {
echarts: './js/dist'
}
}
);
//
require(
[
'echarts',
'echarts/lib/chart/line'
],
function (ec) {
if (that.myChart && that.myChart.isDisposed) {
that.myChart.clear();
}
that.myChart = ec.init(document.getElementById(that.runPlanId));
that.myChart.setOption(that.option);
that.reSize({ width: that.$store.state.runPlan.width, height: that.$store.state.runPlan.height });
// that.myChart.on('click', that.mouseClick);
resolve(true);
}
);
} catch (error) {
reject(error);
}
});
},
axisTooltip(param) {
if (param.data[1] >= this.option.yAxis.min + this.PlanConvert.EdgeHeight && param.data[1] <= this.option.yAxis.max - this.PlanConvert.EdgeHeight) {
const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [
`Point Data <hr size=1 style="margin: 3px 0">`,
`${this.$t('map.stationName')}: ${station.name}<br>`,
`${this.$t('map.stationKilometerMark')}: ${station.kmRange} km <br>`,
`${this.$t('map.arrivalTime')}: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
}
},
mouseClick(params) {
},
settingExac(data) {
this.myChart && this.myChart.setOption({
xAxis: this.option.xAxis,
yAxis: this.option.yAxis
});
this.myChart && this.myChart.dispatchAction({
type: 'dataZoom',
dataZoomIndex: [0, 1],
startValue: parseInt(data.startValue / 1000),
endValue: parseInt(data.endValue / 1000)
});
},
reSize(opt) {
if (this.myChart) {
this.myChart.resize({
width: opt.width,
height: opt.height,
silent: false
});
}
},
setPlanSize() {
this.$nextTick(() => {
if (this.mode !== 'draft') {
this.$store.dispatch('runPlan/resize', { width: this.width, height: this.height - 130 });
} else {
this.$store.dispatch('runPlan/resize', { width: this.$store.state.runPlan.width, height: this.height - 60 });
}
});
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose();
this.myChart = null;
}
},
back() {
if (this.$route.params.mode === 'everyDay') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanEveryDay}` });
} else if (this.$route.params.mode === 'template') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanTemplate}` });
} else if (this.$route.params.mode === 'common') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanCommon}` });
} else {
this.$router.go(-1);
}
}
}
};
</script>

View File

@ -3,6 +3,7 @@
<div class="clearfix"> <div class="clearfix">
<span>{{ $t('map.productCategories') }}</span> <span>{{ $t('map.productCategories') }}</span>
</div> </div>
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
<el-input v-model="filterText" :placeholder="$t('tip.enterKeywordsFiltering')" clearable /> <el-input v-model="filterText" :placeholder="$t('tip.enterKeywordsFiltering')" clearable />
<div style="height: calc(100% - 87px);"> <div style="height: calc(100% - 87px);">
<el-tree <el-tree
@ -29,13 +30,18 @@
</div> </div>
</template> </template>
<script> <script>
import { getProductTree } from '@/api/management/mapprd'; import { getPublishMapTree } from '@/api/management/mapprd';
import FilterCity from '@/views/components/filterCity';
export default { export default {
name: 'TreeOperate', name: 'TreeOperate',
components: {
FilterCity
},
data() { data() {
return { return {
loading: true, loading: true,
queryFunction: getPublishMapTree,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
@ -46,7 +52,8 @@ export default {
point: { point: {
x: 0, x: 0,
y: 0 y: 0
} },
localParamName: 'product_cityCode'
}; };
}, },
watch: { watch: {
@ -54,9 +61,6 @@ export default {
this.$refs.trainingTree.filter(val); this.$refs.trainingTree.filter(val);
} }
}, },
mounted() {
this.refresh();
},
methods: { methods: {
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
@ -90,14 +94,18 @@ export default {
} }
return tree; return tree;
}, },
refresh() { async refresh(filterSelect) {
getProductTree().then(response => { this.loading = true;
this.treeData = this.convertTreeData(response.data); try {
this.$nextTick(() => { this.loading = false; }); const res = await getPublishMapTree(filterSelect);
}).catch(() => { this.treeData = this.convertTreeData(res.data);
this.$messageBox(this.$t('tip.refreshFailure')); this.$nextTick(() => {
this.loading = false;
});
} catch (error) {
this.loading = false; this.loading = false;
}); this.$messageBox(this.$t('error.refreshFailed'));
}
} }
} }
}; };

View File

@ -1,144 +1,140 @@
<template> <template>
<div> <div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center> <el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate">{{$t('global.confirm')}}</el-button> <el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button> <el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd'; import { getCommodityMapProduct } from '@/api/management/mapprd';
export default { export default {
name: 'OnceGenerate', name: 'OnceGenerate',
data() { props: {
return { title: String,
dialogVisible: false, operateType:String
mapList: [], },
disabled:null, data() {
productList:[], return {
mapInfoList:[], dialogVisible: false,
projectList:[], mapList: [],
typeList:[], disabled:null,
formModel:{ productList:[],
mapId:'', mapInfoList:[],
name: "", projectList:[],
prdCode: "", typeList:[],
type: "", formModel:{
id:null, mapId:'',
} name: '',
prdCode: '',
type: '',
id:null
} }
}, };
mounted() { },
this.loadInitData(); computed: {
}, form() {
props: { let form = {};
title: String, if (this.operateType == 'add') {
operateType:String form = {
}, labelWidth: '150px',
computed: { items: [
form() { { prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true, options: this.projectList},
let form={}; { prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList, change:true, onChange:this.changeMap},
if(this.operateType=="add"){ { prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true, options:this.productList},
form={ { prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
labelWidth: '150px', { prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true, options: this.typeList}
items: [ ]
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true,options: this.projectList}, };
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true,options: this.mapList,change:true,onChange:this.changeMap}, } else {
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true,options:this.productList}, form = {
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,}, labelWidth: '150px',
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true,options: this.typeList}, items: [
] { prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true}
} ]
} };
else{
form={
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,},
]
}
}
return form
},
rules() {
let crules ={};
if(this.operateType=="add"){
crules ={customized:[
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'},
],
mapId:[
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'},
],
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' },
],
type:[
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'},
],
prdCode:[
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'},
]
}
}else{
crules ={
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' },
],
};
}
return crules
},
},
methods:{
loadInitData(){
this.projectList=[{value:'xty',label:'西铁院'}];
let customeredProductType=ConstConfig.ConstSelect.customeredProductType;
this.typeList=Cookies.get("user_lang")=="en"?
customeredProductType.map(elem => { return { value: elem.value, label: elem.enlabel } }):
customeredProductType.map(elem => { return { value: elem.value, label: elem.label } });
listPublishMap().then(response => {
this.mapInfoList=response.data;
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
changeMap(index){
this.productList=[];
let mapInfo=this.mapInfoList.find(elem=>{
return elem.id==index;
});
getCommodityMapProduct(mapInfo.skinCode).then((response) => {
this.productList = response.data.map(elem => { return { value: elem.code, label: elem.name } });
this.formModel.prdCode="";
});
},
doShow(data) {
if(data){
this.formModel.name=data.name;
this.formModel.id=data.id;
}
this.dialogVisible = true
},
doCreate() {
let self = this
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose()
})
},
doClose() {
this.$refs.dataform.resetForm();
this.dialogVisible = false
} }
return form;
},
rules() {
let crules = {};
if (this.operateType == 'add') {
crules = {customized:[
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'}
],
mapId:[
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'}
],
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' }
],
type:[
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'}
],
prdCode:[
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'}
]
};
} else {
crules = {
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' }
]
};
}
return crules;
} }
}; },
mounted() {
this.loadInitData();
},
methods:{
loadInitData() {
this.projectList = [{value:'xty', label:'西铁院'}];
const customeredProductType = ConstConfig.ConstSelect.customeredProductType;
this.typeList = Cookies.get('user_lang') == 'en'
? customeredProductType.map(elem => { return { value: elem.value, label: elem.enlabel }; })
: customeredProductType.map(elem => { return { value: elem.value, label: elem.label }; });
listPublishMap().then(response => {
this.mapInfoList = response.data;
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
});
},
changeMap(index) {
this.productList = [];
getCommodityMapProduct(index).then((response) => {
this.productList = response.data.map(elem => { return { value: elem.code, label: elem.name }; });
this.formModel.prdCode = '';
});
},
doShow(data) {
if (data) {
this.formModel.name = data.name;
this.formModel.id = data.id;
}
this.dialogVisible = true;
},
doCreate() {
const self = this;
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose();
});
},
doClose() {
this.$refs.dataform.resetForm();
this.dialogVisible = false;
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{ /deep/ .el-dialog--center .el-dialog__body{

View File

@ -60,156 +60,156 @@ import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'LessonDetail', name: 'LessonDetail',
components: { components: {
LimitList LimitList
}, },
data() { data() {
return { return {
num: 5, num: 5,
loading: false, loading: false,
WhetherTypeList: [], WhetherTypeList: [],
EffectiveTypeList: [], EffectiveTypeList: [],
courseModel: { courseModel: {
id: '', id: '',
name: '', name: '',
pmsList: [] pmsList: []
}, },
activeName: 'first', activeName: 'first',
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
expandList: [] expandList: []
}; };
}, },
computed: { computed: {
hasPermssion() { hasPermssion() {
return this.courseModel.pmsList.length > 0; return this.courseModel.pmsList.length > 0;
}, },
height() { height() {
return this.$store.state.app.height - 50; return this.$store.state.app.height - 50;
} }
}, },
watch: { watch: {
$route(newVal) { $route(newVal) {
this.initLoadPage(); this.initLoadPage();
} }
}, },
mounted() { mounted() {
this.$Dictionary.effectiveType().then(list => { this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list; this.EffectiveTypeList = list;
}); });
this.initLoadPage(); this.initLoadPage();
}, },
methods: { methods: {
initLoadPage() { initLoadPage() {
getPublishLessonTree(this.$route.query.lessonId).then(response => { getPublishLessonTree(this.$route.query.lessonId).then(response => {
if (response.data.tree && response.data.tree.length>0) { if (response.data.tree && response.data.tree.length > 0) {
this.courseModel = { this.courseModel = {
id: response.data.tree[0].id, id: response.data.tree[0].id,
name: response.data.tree[0].name, name: response.data.tree[0].name,
pmsList: response.data.permissionList || [], pmsList: response.data.permissionList || [],
treeList: response.data.tree, treeList: response.data.tree,
prdCode: this.$route.query.prdCode, prdCode: this.$route.query.prdCode,
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
PermissionType: PermissionType.LESSON PermissionType: PermissionType.LESSON
}; };
} }
this.getExpandList(this.courseModel.id); this.getExpandList(this.courseModel.id);
}).catch(error => { }).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message); this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
}); });
}, },
transfer() { transfer() {
this.loading = false; this.loading = false;
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel); this.$refs.limitList.transfer(this.courseModel);
} }
}, },
distribute() { distribute() {
this.loading = false; this.loading = false;
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel); this.$refs.limitList.distribute(this.courseModel);
} }
}, },
clickEvent(obj, node, ele) { clickEvent(obj, node, ele) {
if (obj && obj.type==='Training') { if (obj && obj.type === 'Training') {
if (obj.valid) { if (obj.valid) {
this.loading = true; this.loading = true;
trainingNotify({ trainingId: obj.id }).then(resp => { trainingNotify({ trainingId: obj.id }).then(resp => {
const query = { const query = {
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId, mapId: this.courseModel.mapId
}; };
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query }); this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
this.loading = false; this.loading = false;
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`); this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
}); });
} else { } else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel') cancelButtonText: this.$t('tip.cancel')
}).then(() => { }).then(() => {
this.buy(); this.buy();
}).catch(() => { }); }).catch(() => { });
} }
} }
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.name.indexOf(value) !== -1; return data.name.indexOf(value) !== -1;
}, },
buy() { buy() {
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query: path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
{ permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdCode: this.$route.query.prdCode, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem } { permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdCode: this.$route.query.prdCode, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
}); });
}, },
nodeExpand(obj, node, ele) { nodeExpand(obj, node, ele) {
const key = obj.id; const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key); this.expandList = this.expandList.filter(item => item !== key);
this.expandList.push(key); this.expandList.push(key);
setSessionStorage('trainingTeachExpandList'+this.courseModel.id, this.expandList); setSessionStorage('trainingTeachExpandList' + this.courseModel.id, this.expandList);
}, },
nodeCollapse(obj, node, ele) { nodeCollapse(obj, node, ele) {
const key = obj.id; const key = obj.id;
if (obj.type === 'Lesson') { if (obj.type === 'Lesson') {
this.expandList = []; this.expandList = [];
} else { } else {
this.expandList = this.expandList.filter(item => item!==key); this.expandList = this.expandList.filter(item => item !== key);
} }
setSessionStorage('trainingTeachExpandList'+this.courseModel.id, this.expandList); setSessionStorage('trainingTeachExpandList' + this.courseModel.id, this.expandList);
}, },
getExpandList(id) { getExpandList(id) {
let expand = getSessionStorage('trainingTeachExpandList'+id); let expand = getSessionStorage('trainingTeachExpandList' + id);
expand = expand?(expand+'').split(','):''; expand = expand ? (expand + '').split(',') : '';
if (expand instanceof Array) { if (expand instanceof Array) {
this.expandList = expand; this.expandList = expand;
} }
}, },
startTraining(data) { startTraining(data) {
if (data && data.type==='Training') { if (data && data.type === 'Training') {
if (data.valid) { if (data.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${data.id}/${this.courseModel.id}`}); this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${data.id}/${this.courseModel.id}`});
} else { } else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel') cancelButtonText: this.$t('tip.cancel')
}).then(() => { }).then(() => {
this.buy(); this.buy();
}).catch(() => { }); }).catch(() => { });
} }
} }
}, },
backLessonList() { backLessonList() {
localStore.remove('teachDetail'+this.$route.params.subSystem); localStore.remove('teachDetail' + this.$route.params.subSystem);
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${this.$route.params.subSystem}`}); this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${this.$route.params.subSystem}`});
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,131 +0,0 @@
<template>
<el-card>
<div slot="header" style="text-align: center;">
<b>{{ $t('teach.trainingName') }} {{ courseModel.name }}</b>
</div>
<div style="margin:50px">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height - 190 +'px' }">
<p class="list-item">
<span class="list-label">{{ $t('teach.trainingTime') }}</span>
<span class="list-elem"> {{ courseModel.minDuration | setTime }} {{ $t('teach.seconds') }}</span>
</p>
<p class="list-item">
<span class="list-label">{{ $t('teach.trainingMaximum') }}</span>
<span class="list-elem">{{ courseModel.maxDuration | setTime }} {{ $t('teach.seconds') }}</span>
</p>
<p class="list-item">
<span class="list-label">{{ $t('teach.trainingInstructions') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span>
</p>
</el-scrollbar>
</div>
<div class="btn-start">
<el-button :loading="loading" type="primary" @click="start">{{ $t('teach.startTraining') }}</el-button>
<el-button @click="back">{{ $t('global.back') }}</el-button>
</div>
</el-card>
</template>
<script>
import { getTrainingDetail } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import { UrlConfig } from '@/router/index';
import { launchFullscreen } from '@/utils/screen';
export default {
name: 'LessonPracticalDetail',
filters: {
setTime(val) {
return val;
}
},
data() {
return {
loading: false,
courseModel: {
id: '',
name: '',
maxDuration: '',
minDuration: '',
remarks: '',
updateTime: ''
}
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
const trainingId = this.$route.params.trainingId;
if (parseInt(trainingId)) {
getTrainingDetail(trainingId)
.then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,
maxDuration: res.data.maxDuration,
remarks: res.data.remarks,
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
})
.catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});
}
},
start() {
this.loading = true;
trainingNotify({ trainingId: this.$route.params.trainingId }).then(resp => {
const query = {
group: resp.data, trainingId: this.$route.params.trainingId, lessonId: this.$route.params.lessonId
};
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen();
}).catch(error => {
this.loading = false;
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
});
},
back() {
this.$router.back();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.list-item {
font-size: 16px;
margin-bottom: 20px;
}
.list-label {
display: inline-block;
text-align: right;
width: 160px;
}
.list-elem {
color: #808080 !important;
}
.btn-start {
position: relative;
text-align: center;
justify-content: center;
transform: translateY(-20px);
}
</style>