Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2020-10-27 18:49:16 +08:00
commit 15774b2773
87 changed files with 3210 additions and 2058 deletions

View File

@ -1,81 +1,6 @@
import request from '@/utils/request';
export function postDataBd(data) {
return request({
url: `/api/audio/bd?group=${data.group}&conversationId=${data.conversationId}`,
method: 'post',
data: data.file
});
}
// 创建/获取会话id
export function getConversation(data) {
return request({
url: `/api/audio/conversation`,
method: 'get',
params: {
group: data.group,
userId: data.userId,
code: data.code
}
});
}
export function postDataXf(data) {
return request({
url: `/api/audio/xf`,
method: 'post',
data: data
});
}
// 获取语音历史记录
export function getHistoryVoice(code) {
return request({
url: `/api/audio/${code}/history`,
method: 'get'
});
}
// 文字聊天 发送文字
export function chatWithText(data, group) {
return request({
url: `/api/jointTraining/chatWithText?group=${group}`,
method: 'post',
data: {
message: data
}
});
}
// 文字聊天 发送语音
export function chatWithAudio(file, group) {
return request({
url: `/api/jointTraining/chatWithAudio?group=${group}`,
method: 'post',
data: file
});
}
// 文字聊天 发送语音(新版)
export function chatWithAudioNew(file, group) {
return request({
url: `/api/v1/jointTraining/chatWithAudio?group=${group}`,
method: 'post',
data: file
});
}
// 生成分发二维码
export function getJoinTrainCode(data, group) {
return request({
url: `/api/jointTraining/qrCode?group=${group}`,
method: 'post',
data: data
});
}
// 创建房间
export function postCreateRoom(data) {
return request({
@ -85,34 +10,6 @@ export function postCreateRoom(data) {
});
}
// 检查房间存在
export function checkRoomExist(params) {
return request({
url: `/api/simulationRoom`,
method: 'get',
params
});
}
// 获取房间详情
export function postRoomDetail(group) {
return request({
url: `/api/jointTraining/room/${group}`,
method: 'get'
});
}
// 销毁房间
export function deljointTrainRoom(group) {
return request({
url: `/api/jointTraining/room`,
method: 'delete',
params: {
group: group
}
});
}
// 查询有权限房间列表
export function getjointTrainList(params) {
return request({
@ -133,90 +30,6 @@ export function getjointTraining(group) {
});
}
// 设置人员角色
export function putUserRoles(data, group) {
return request({
url: `/api/jointTraining/room/user/role?group=${group}`,
method: 'put',
data: data
});
}
// 获取房间里的用户列表
export function getJointTrainRoomUserList(group) {
return request({
url: `/api/jointTraining/room/${group}/user/list`,
method: 'get'
});
}
// 离开房间接口
export function putJointTrainingExit(group) {
return request({
url: `/api/jointTraining/room/exit`,
method: 'put',
params: {
group: group
}
});
}
// 开始联合演练
export function startJointTraining(group) {
return request({
url: `/api/jointTraining/room/simulation`,
method: 'post',
params: {
group: group
}
});
}
// 获取个人信息
export function getUserRoles(group) {
return request({
url: `/api/jointTraining/room/user/role`,
method: 'get',
params: {
group: group
}
});
}
// 踢出用户
export function putJointTrainingUserkicked(userId, group) {
return request({
url: `/api/jointTraining/room/user`,
method: 'put',
params: {
userId: userId,
group: group
}
});
}
// 管理员结束所有人的仿真
export function putJointTrainingSimulation(group) {
return request({
url: `/api/jointTraining/room/simulation/all`,
method: 'put',
params: {
group: group
}
});
}
// 结束仿真返回房间
export function putJointTrainingSimulationUser(group) {
return request({
url: `/api/jointTraining/room/simulation/user/exit`,
method: 'put',
params: {
group: group
}
});
}
// 进入仿真
export function putJointTrainingSimulationEntrance(group) {
return request({
@ -228,9 +41,7 @@ export function putJointTrainingSimulationEntrance(group) {
});
}
/**
* 权限获取(房间权限)
*/
// 权限获取(房间权限)
export function getPermissionJoint(group) {
return request({
url: '/api/jointTraining/qrCode',
@ -241,60 +52,6 @@ export function getPermissionJoint(group) {
});
}
// 添加或更新真实设备和仿真对象连接
export function setRealDevice(group, data) {
return request({
url: `/api/jointTraining/room/realDevice?group=${group}`,
method: 'post',
data: data
});
}
// 删除真实设备和仿真对象连接
export function delRealDevice(id, group) {
return request({
url: `/api/jointTraining/room/realDevice/${id}`,
method: 'delete',
params: { group: group }
});
}
// 获取真实设备列表
export function getRealDevices(group) {
return request({
url: `/api/jointTraining/room/${group}/devices`,
method: 'get'
});
}
// 获取房间真实设备连接关系
export function getRealDevicesInRoom(group) {
return request({
url: `/api/jointTraining/room/${group}/realDevice/connect`,
method: 'get'
});
}
// 更新真实设备的连接关系
export function updateRealDevices(group, data) {
return request({
url: `/api/jointTraining/room/${group}/realDevice`,
method: 'put',
data: data
});
}
// 真实设备是否被其他仿真使用
export function realDeviceIsUsed(group, projectCode) {
return request({
url: `/api/jointTraining/room/${group}/realDeviceUsed`,
method: 'get',
params: {
projectCode: projectCode
}
});
}
// 获取仿真成员列表(新版地图)
export function getSimulationMembersNew(group) {
return request({
@ -302,23 +59,6 @@ export function getSimulationMembersNew(group) {
method: 'get'
});
}
// 获取仿真会话消息列表(新版地图)
export function getSimulationContextListNew(group, conversationId) {
return request({
url: `/simulation/${group}/conversation/${conversationId}`,
method: 'get'
});
}
// 接受其他人的会话邀请 (新版地图)
export function acceptCoversitionInvite(group, conversationId) {
return request({
url: `/simulation/${group}/${conversationId}/accept`,
method: 'put'
});
}
/** 发起会话 */
export function startConversition(group, data, sign) {
return request({
@ -327,13 +67,6 @@ export function startConversition(group, data, sign) {
data
});
}
/** 根据会话id获取仿真会话 */
export function getSimulationConversition(group, conversationId) {
return request({
url: `/api/simulation/${group}/conversation/${conversationId}`,
method: 'get'
});
}
/** 发送会话消息 */
export function sendSimulationConversition(group, conversationId, file) {
return request({

View File

@ -22,13 +22,13 @@ export function deleteCompany(id) {
method: 'delete'
});
}
/** 根据id查询公司信心 */
export function getCompanyById(id) {
return request({
url: `/api/company/${id}`,
method: 'get'
});
}
// /** 根据id查询公司信心 */
// export function getCompanyById(id) {
// return request({
// url: `/api/company/${id}`,
// method: 'get'
// });
// }
/** 更新公司信息 */
export function updateCompany(id, data) {
return request({

View File

@ -7,20 +7,20 @@ export function refereeExitSimulation(group) {
method: 'delete'
});
}
/** 裁判进入仿真 */
export function refereeEnterSimulation(group) {
return request({
url: `/api/v1/competition/room/${group}/refree`,
method: 'post'
});
}
/** 裁判查询竞赛人员的房间列表 */
export function refereeGetCompetitionList(id) {
return request({
url: `/api/v1/competition/${id}/room`,
method: 'get'
});
}
// /** 裁判进入仿真 */
// export function refereeEnterSimulation(group) {
// return request({
// url: `/api/v1/competition/room/${group}/refree`,
// method: 'post'
// });
// }
// /** 裁判查询竞赛人员的房间列表 */
// export function refereeGetCompetitionList(id) {
// return request({
// url: `/api/v1/competition/${id}/room`,
// method: 'get'
// });
// }
/** 参赛者创建演练房间 */
export function participantCreatTrainingRoom(id, data) {
return request({
@ -30,22 +30,22 @@ export function participantCreatTrainingRoom(id, data) {
});
}
// 加载试卷
export function loadingPaper(competitionId, data) {
return request({
url: `/api/v1/competition/${competitionId}/testPaper`,
method: 'post',
data
});
}
/** 竞赛报名 */
export function postSignUp(id, data) {
return request({
url: `/api/race/${id}/signUp`,
method: 'post',
data
});
}
// // 加载试卷
// export function loadingPaper(competitionId, data) {
// return request({
// url: `/api/v1/competition/${competitionId}/testPaper`,
// method: 'post',
// data
// });
// }
// /** 竞赛报名 */
// export function postSignUp(id, data) {
// return request({
// url: `/api/race/${id}/signUp`,
// method: 'post',
// data
// });
// }
/** 查询用户是否已经报名该竞赛 */
export function getIsSignUp(raceId, params = {}) {
@ -56,23 +56,23 @@ export function getIsSignUp(raceId, params = {}) {
});
}
/** 分页查询竞赛报名人员 */
export function getRaceUserList(params) {
return request({
url: `/api/race/${params.raceId}/raceUser/page`,
method: 'get',
params
});
}
// /** 分页查询竞赛报名人员 */
// export function getRaceUserList(params) {
// return request({
// url: `/api/race/${params.raceId}/raceUser/page`,
// method: 'get',
// params
// });
// }
/** 裁判打分 */
export function putRefereeScoring(data) {
return request({
url: `/api/v1/competition/referee/scoring`,
method: 'put',
data
});
}
// /** 裁判打分 */
// export function putRefereeScoring(data) {
// return request({
// url: `/api/v1/competition/referee/scoring`,
// method: 'put',
// data
// });
// }
/** 提交试卷 */
export function postCompetitionTheory(data) {
@ -83,13 +83,13 @@ export function postCompetitionTheory(data) {
});
}
/** 查询本竞赛用的实操列表 */
export function getCompetitionPractical(competitionId) {
return request({
url: `/api/v1/competitionPractical/competition/${competitionId}`,
method: 'get'
});
}
// /** 查询本竞赛用的实操列表 */
// export function getCompetitionPractical(competitionId) {
// return request({
// url: `/api/v1/competitionPractical/competition/${competitionId}`,
// method: 'get'
// });
// }
/** 查询竞赛报名人员详情 */
export function getRaceUserById(raceId) {
@ -169,67 +169,67 @@ export function getPracticalCompetitionResult(competitionId) {
});
}
/** 回访准备 */
export function playBackReady(params) {
return request({
url: `/api/v1/simulationRecord/playback/ready`,
method: 'get',
params
});
}
// /** 回访准备 */
// export function playBackReady(params) {
// return request({
// url: `/api/v1/simulationRecord/playback/ready`,
// method: 'get',
// params
// });
// }
/** 设置倍速 */
export function setPlaySpeed(params) {
return request({
url: `/api/v1/simulationRecord/playback/setPlaySpeed`,
method: 'get',
params
});
}
// /** 设置倍速 */
// export function setPlaySpeed(params) {
// return request({
// url: `/api/v1/simulationRecord/playback/setPlaySpeed`,
// method: 'get',
// params
// });
// }
/** 开始播放 */
export function startPlaying(params) {
return request({
url: `/api/v1/simulationRecord/playback/startPlaying`,
method: 'get',
params
});
}
// /** 开始播放 */
// export function startPlaying(params) {
// return request({
// url: `/api/v1/simulationRecord/playback/startPlaying`,
// method: 'get',
// params
// });
// }
/** 暂停播放 */
export function playingPause(params) {
return request({
url: `/api/v1/simulationRecord/playback/pausePlaying`,
method: 'get',
params
});
}
// /** 暂停播放 */
// export function playingPause(params) {
// return request({
// url: `/api/v1/simulationRecord/playback/pausePlaying`,
// method: 'get',
// params
// });
// }
/** 结束播放 */
export function endPlaying(params) {
return request({
url: `/api/v1/simulationRecord/playback/endPlaying`,
method: 'get',
params
});
}
// /** 结束播放 */
// export function endPlaying(params) {
// return request({
// url: `/api/v1/simulationRecord/playback/endPlaying`,
// method: 'get',
// params
// });
// }
/** 从暂停中播放 */
export function fromPauseToPlay(params) {
return request({
url: `/api/v1/simulationRecord/playback/playing`,
method: 'get',
params
});
}
// /** 从暂停中播放 */
// export function fromPauseToPlay(params) {
// return request({
// url: `/api/v1/simulationRecord/playback/playing`,
// method: 'get',
// params
// });
// }
/** 裁判查询理论考试结果 */
export function getTheroyCompetitionResult(competitionId, raceUserId) {
return request({
url: `api/v1/competitionTheory/detail/competition/${competitionId}/raceUser/${raceUserId}`,
method: 'get'
});
}
// /** 裁判查询理论考试结果 */
// export function getTheroyCompetitionResult(competitionId, raceUserId) {
// return request({
// url: `api/v1/competitionTheory/detail/competition/${competitionId}/raceUser/${raceUserId}`,
// method: 'get'
// });
// }
// 以下drts项目使用
@ -360,3 +360,21 @@ export function getEmptyOperationalStatistics(group) {
});
}
// /** 草稿场景数据导入*/
// export function postSceneImport(scriptId, data) {
// return request({
// url: `/api/v1/competitionPractical/${scriptId}/import`,
// method: 'post',
// data: data,
// time: 60000
// });
// }
/** 草稿场景数据导出 */
export function getSceneExport(id) {
return request({
url: `/api/v1/competitionPractical/${id}/export`,
method: 'get'
});
}

View File

@ -138,37 +138,27 @@ export function previewRunPlan(planId) {
});
}
/** 加载剧本 */
export function loadDraftScript(scriptId, memberId, group) {
return request({
url: `/api/simulation/${group}/scriptDraft/${scriptId}?memberId=${memberId}`,
method: 'post'
});
}
// /** 加载剧本 */
// export function loadDraftScript(scriptId, memberId, group) {
// return request({
// url: `/api/simulation/${group}/scriptDraft/${scriptId}?memberId=${memberId}`,
// method: 'post'
// });
// }
/** 剧本预览选择角色 */
export function loadDraftScriptNew(memberId, group) {
return request({
// url: `/simulation/${group}/choosePlay?memberId=${memberId}`,
url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}`,
method: 'put'
});
}
/** 剧本预览选择角色 */
export function loadDraftScriptNewMode(memberId, group, mode) {
return request({
// url: `/simulation/${group}/choosePlay?memberId=${memberId}`,
url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}&mode=${mode}`,
method: 'put'
});
}
/** 获取已发布的有地图的城市列表*/
export function publisMapCityList(data) {
return request({
url: `/api/map/city?dicCode=${data}`,
method: 'get'
});
}
// /** 剧本预览选择角色 */
// export function loadDraftScriptNewMode(memberId, group, mode) {
// return request({
// url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}&mode=${mode}`,
// method: 'put'
// });
// }

View File

@ -95,3 +95,10 @@ export function aKeyGeneratingLesson(data) {
data: data
});
}
/** 根据课程ID获取班级 */
export function getExamClassList(lessonId) {
return request({
url: `/api/lesson/${lessonId}/classes`,
method: 'get'
});
}

View File

@ -85,14 +85,14 @@ export function getLessonChapterDetail(data) {
});
}
/** 发布课程*/
export function publishLesson(data) {
return request({
url: `/api/lessonDraft/${data.id}/publish`,
method: 'post',
data: data
});
}
// /** 发布课程*/
// export function publishLesson(data) {
// return request({
// url: `/api/lessonDraft/${data.id}/publish`,
// method: 'post',
// data: data
// });
// }
/** 课程章节拖拽排序*/
export function dragSortLessonChapter(data) {

View File

@ -16,13 +16,13 @@ export function getPublishMapListOnline() {
});
}
/** 根据皮肤获取发布地图列表*/
export function getPublishMapListByLineCode(lineCode) {
return request({
url: `/api/map/${lineCode}/list`,
method: 'get'
});
}
// /** 根据皮肤获取发布地图列表*/
// export function getPublishMapListByLineCode(lineCode) {
// return request({
// url: `/api/map/${lineCode}/list`,
// method: 'get'
// });
// }
/** 根据地图id获取地图版本信息*/
export function getPublishMapVersionById(id) {
@ -133,13 +133,13 @@ export function getPublishMapDetailList(params, code) {
});
}
/** 获取有屏蔽门的站台列表*/
export function hasDoorStationList(mapId) {
return request({
url: `/api/map/${mapId}/stand/hasDoor`,
method: 'get'
});
}
// /** 获取有屏蔽门的站台列表*/
// export function hasDoorStationList(mapId) {
// return request({
// url: `/api/map/${mapId}/stand/hasDoor`,
// method: 'get'
// });
// }
// /** 修改发布地图城市*/
// export function updatePublishMapCity(data) {
@ -254,3 +254,27 @@ export function getStandListByStationCode(id, stationCode) {
method: 'get'
});
}
/** 获取已发布的有地图的城市列表*/
export function publisMapCityList(data) {
return request({
url: `/api/map/city?dicCode=${data}`,
method: 'get'
});
}
// // 获取所有需要值班员的车站(新版)
// export function getAvailableStaionList(mapId) {
// return request({
// url: `/api/map/${mapId}/station/needSupervisor`,
// method: 'get'
// });
// }
/** 新版地图根据仿真mapId获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) {
return request({
url: `/api/map/${mapId}/mapData`,
method: 'get'
});
}

View File

@ -124,77 +124,77 @@ export function getBuildMapExport(mapId) {
});
}
/** 查询进路列表*/
export function listRouteRoute(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/route`,
method: 'get',
params: params
});
}
/** 查询进路地图列表*/
export function listRouteMapRoute(mapId) {
return request({
url: `/api/mapBuild/${mapId}/route/all`,
method: 'get'
});
}
/** 查询进路明细*/
export function queryRouteRouteDetail(data) {
return request({
url: `/api/mapBuild/route/${data.id}`,
method: 'get'
});
}
/** 创建进路*/
export function createRouteRoute(data) {
return request({
url: `/api/mapBuild/route`,
method: 'post',
data: data
});
}
/** 删除进路*/
export function deleteRouteRoute(id) {
return request({
url: `/api/mapBuild/route/${id}`,
method: 'delete'
});
}
/** 更新进路*/
export function updateRouteRoute(data) {
return request({
url: `/api/mapBuild/route/${data.id}`,
method: 'put',
data: data
});
}
// /** 查询进路列表*/
// export function listRouteRoute(mapId, params) {
// return request({
// url: `/api/mapBuild/${mapId}/route`,
// method: 'get',
// params: params
// });
// }
// /** 查询进路地图列表*/
// export function listRouteMapRoute(mapId) {
// return request({
// url: `/api/mapBuild/${mapId}/route/all`,
// method: 'get'
// });
// }
// /** 查询进路明细*/
// export function queryRouteRouteDetail(data) {
// return request({
// url: `/api/mapBuild/route/${data.id}`,
// method: 'get'
// });
// }
// /** 创建进路*/
// export function createRouteRoute(data) {
// return request({
// url: `/api/mapBuild/route`,
// method: 'post',
// data: data
// });
// }
// /** 删除进路*/
// export function deleteRouteRoute(id) {
// return request({
// url: `/api/mapBuild/route/${id}`,
// method: 'delete'
// });
// }
// /** 更新进路*/
// export function updateRouteRoute(data) {
// return request({
// url: `/api/mapBuild/route/${data.id}`,
// method: 'put',
// data: data
// });
// }
/** 创建联动道岔*/
export function createLinkageSwitch(data) {
return request({
url: `/api/mapBuild/switchCoupled`,
method: 'post',
data: data
});
}
// /** 创建联动道岔*/
// export function createLinkageSwitch(data) {
// return request({
// url: `/api/mapBuild/switchCoupled`,
// method: 'post',
// data: data
// });
// }
/** 删除联动道岔*/
export function deleteLinkageSwitch(coupleId) {
return request({
url: `/api/mapBuild/switchCoupled/${coupleId}`,
method: 'delete'
});
}
// /** 删除联动道岔*/
// export function deleteLinkageSwitch(coupleId) {
// return request({
// url: `/api/mapBuild/switchCoupled/${coupleId}`,
// method: 'delete'
// });
// }
/** get联动道岔列表*/
export function listLinkageSwitch(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/switchCoupled`,
method: 'get',
params: params
});
}
// /** get联动道岔列表*/
// export function listLinkageSwitch(mapId, params) {
// return request({
// url: `/api/mapBuild/${mapId}/switchCoupled`,
// method: 'get',
// params: params
// });
// }
/** 草稿地图数据校验*/
export function verifyMap(id) {
@ -204,48 +204,48 @@ export function verifyMap(id) {
});
}
/** 分页查询交路数据*/
export function listRouting(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/routing`,
method: 'get',
params: params
});
}
// /** 分页查询交路数据*/
// export function listRouting(mapId, params) {
// return request({
// url: `/api/mapBuild/${mapId}/routing`,
// method: 'get',
// params: params
// });
// }
/** 创建交路*/
export function addRouting(data) {
return request({
url: `/api/mapBuild/routing`,
method: 'post',
data: data
});
}
// /** 创建交路*/
// export function addRouting(data) {
// return request({
// url: `/api/mapBuild/routing`,
// method: 'post',
// data: data
// });
// }
/** 删除交路*/
export function deleteRouting(routingId) {
return request({
url: `/api/mapBuild/routing/${routingId}`,
method: 'delete'
});
}
// /** 删除交路*/
// export function deleteRouting(routingId) {
// return request({
// url: `/api/mapBuild/routing/${routingId}`,
// method: 'delete'
// });
// }
/** 获取交路详情*/
export function getRouting(routingId) {
return request({
url: `/api/mapBuild/routing/${routingId}`,
method: 'get'
});
}
// /** 获取交路详情*/
// export function getRouting(routingId) {
// return request({
// url: `/api/mapBuild/routing/${routingId}`,
// method: 'get'
// });
// }
/** 更新交路*/
export function updateRouting(data) {
return request({
url: `/api/mapBuild/routing/${data.id}`,
method: 'put',
data: data
});
}
// /** 更新交路*/
// export function updateRouting(data) {
// return request({
// url: `/api/mapBuild/routing/${data.id}`,
// method: 'put',
// data: data
// });
// }
/** 分页查询交路数据(新版)*/
export function listRoutingData(mapId, params) {
@ -307,48 +307,48 @@ export function generateStationRunData(routingId) {
});
}
// 创建自动信号 old旧数据
export function postAutoSignal(data) {
return request({
url: `/api/mapBuild/autoSignal`,
method: 'post',
data: data
});
}
// // 创建自动信号 old旧数据
// export function postAutoSignal(data) {
// return request({
// url: `/api/mapBuild/autoSignal`,
// method: 'post',
// data: data
// });
// }
// 删除自动信号 old旧数据
export function delAutoSignal(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'delete'
});
}
// // 删除自动信号 old旧数据
// export function delAutoSignal(autoSignalId) {
// return request({
// url: `/api/mapBuild/autoSignal/${autoSignalId}`,
// method: 'delete'
// });
// }
// 分页获取自动信号列表 old旧数据
export function getAutoSignalList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/autoSignal`,
method: 'get',
params
});
}
// // 分页获取自动信号列表 old旧数据
// export function getAutoSignalList(mapId, params) {
// return request({
// url: `/api/mapBuild/${mapId}/autoSignal`,
// method: 'get',
// params
// });
// }
// 获取自动信号详情 old旧数据
export function getAutoSignalDetail(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'get'
});
}
// // 获取自动信号详情 old旧数据
// export function getAutoSignalDetail(autoSignalId) {
// return request({
// url: `/api/mapBuild/autoSignal/${autoSignalId}`,
// method: 'get'
// });
// }
// 更新自动信号 old旧数据
export function putAutoSignal(data) {
return request({
url: `/api/mapBuild/autoSignal/${data.autoSignalId}`,
method: 'put',
data: data
});
}
// // 更新自动信号 old旧数据
// export function putAutoSignal(data) {
// return request({
// url: `/api/mapBuild/autoSignal/${data.autoSignalId}`,
// method: 'put',
// data: data
// });
// }
// 分页获取自动信号列表 new新数据
export function getAutoSignalListNew(mapId, params) {
@ -393,12 +393,12 @@ export function putAutoSignalNew(data) {
});
}
export function getListByCityCode(cityCode) {
return request({
url: `/api/mapBuild/${cityCode}/list`,
method: 'get'
});
}
// export function getListByCityCode(cityCode) {
// return request({
// url: `/api/mapBuild/${cityCode}/list`,
// method: 'get'
// });
// }
// 创建信号机接近区段
export function postApproachSection(data) {
@ -464,12 +464,12 @@ export function delContinueProtect(id) {
method: 'delete'
});
}
export function getContinueProtectById(id) {
return request({
url: `/api/mapBuild/overlap/${id}`,
method: 'get'
});
}
// export function getContinueProtectById(id) {
// return request({
// url: `/api/mapBuild/overlap/${id}`,
// method: 'get'
// });
// }
export function getContinueProtectList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/overlap/paging`,
@ -545,14 +545,14 @@ export function getRouteNewList(mapId, params) {
params
});
}
// 获取自动折返分组列表
export function getAutoReentryGroupList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/autoReentry/group/reentryTrack`,
method: 'get',
params
});
}
// // 获取自动折返分组列表
// export function getAutoReentryGroupList(mapId, params) {
// return request({
// url: `/api/mapBuild/${mapId}/autoReentry/group/reentryTrack`,
// method: 'get',
// params
// });
// }
// 新建进路侧防
export function postFlankProtection(data) {

View File

@ -1,44 +1,44 @@
import request from '@/utils/request';
// import request from '@/utils/request';
/** 获取路径单元列表*/
export function getRouteUnitList(id, data) {
return request({
url: `/api/mapBuild/${id}/routeUnit`,
method: 'get',
params: data
});
}
// /** 获取路径单元列表*/
// export function getRouteUnitList(id, data) {
// return request({
// url: `/api/mapBuild/${id}/routeUnit`,
// method: 'get',
// params: data
// });
// }
/** 创建路径单元*/
export function addRouteUnit(data) {
return request({
url: `/api/mapBuild/routeUnit`,
method: 'post',
data: data
});
}
// /** 创建路径单元*/
// export function addRouteUnit(data) {
// return request({
// url: `/api/mapBuild/routeUnit`,
// method: 'post',
// data: data
// });
// }
/** 删除路径单元*/
export function delRouteUnit(id) {
return request({
url: `/api/mapBuild/routeUnit/${id}`,
method: 'DELETE'
});
}
// /** 删除路径单元*/
// export function delRouteUnit(id) {
// return request({
// url: `/api/mapBuild/routeUnit/${id}`,
// method: 'DELETE'
// });
// }
/** 获取路径单元*/
export function getRouteUnit(id) {
return request({
url: `/api/mapBuild/routeUnit/${id}`,
method: 'get'
});
}
// /** 获取路径单元*/
// export function getRouteUnit(id) {
// return request({
// url: `/api/mapBuild/routeUnit/${id}`,
// method: 'get'
// });
// }
/** 更新路径单元*/
export function setRouteUnit(data) {
return request({
url: `/api/mapBuild/routeUnit/${data.id}`,
method: 'put',
data: data
});
}
// /** 更新路径单元*/
// export function setRouteUnit(data) {
// return request({
// url: `/api/mapBuild/routeUnit/${data.id}`,
// method: 'put',
// data: data
// });
// }

View File

@ -1,28 +1,28 @@
import request from '@/utils/request';
/** 开始实训 0*/
export function startTraining(args, group) {
return request({
url: `/api/training/${args.id}/start`,
method: 'get',
params: {
group
}
});
}
// /** 开始实训 0*/
// export function startTraining(args, group) {
// return request({
// url: `/api/training/${args.id}/start`,
// method: 'get',
// params: {
// group
// }
// });
// }
/** 实训结束*/
export function endTraining(args, group) {
return request({
url: `/api/training/${args.lessonId}/${args.id}/end`,
method: 'get',
params: {
mode: args.mode,
usedTime: args.usedTime,
group
}
});
}
// /** 实训结束*/
// export function endTraining(args, group) {
// return request({
// url: `/api/training/${args.lessonId}/${args.id}/end`,
// method: 'get',
// params: {
// mode: args.mode,
// usedTime: args.usedTime,
// group
// }
// });
// }
/** 发送步骤数据*/
export function sendTrainingNextStep(data, group) {
@ -35,31 +35,31 @@ export function sendTrainingNextStep(data, group) {
}
});
}
/** 获取章节基本信息 0*/
export function getTrainingDetail(trainingId) {
return request({
url: `/api/training/${trainingId}`,
method: 'get'
});
}
// /** 获取章节基本信息 0*/
// export function getTrainingDetail(trainingId) {
// return request({
// url: `/api/training/${trainingId}`,
// method: 'get'
// });
// }
/** 添加实训 0*/
export function addTraining(data) {
return request({
url: '/api/training',
method: 'post',
data: data
});
}
// /** 添加实训 0*/
// export function addTraining(data) {
// return request({
// url: '/api/training',
// method: 'post',
// data: data
// });
// }
/** 获取实训步骤数据 0*/
export function getTrainingStepsDetail(trainingId, params) {
return request({
url: `/api/training/${trainingId}/detail`,
method: 'get',
params: params
});
}
// /** 获取实训步骤数据 0*/
// export function getTrainingStepsDetail(trainingId, params) {
// return request({
// url: `/api/training/${trainingId}/detail`,
// method: 'get',
// params: params
// });
// }
/** 查询实训列表 0*/
export function pageQueryTraining(params) {
@ -69,40 +69,40 @@ export function pageQueryTraining(params) {
params: params
});
}
/** 自动生成实训操作 0*/
export function addAutoTraining(data) {
return request({
url: `/api/training/generate`,
method: 'post',
data: data
});
}
// /** 自动生成实训操作 0*/
// export function addAutoTraining(data) {
// return request({
// url: `/api/training/generate`,
// method: 'post',
// data: data
// });
// }
/** 修改自动删除实训操作 0*/
export function updateAutoTraining(data) {
return request({
url: `/api/training/batchUpdateGenerate`,
method: 'put',
data: data
});
}
/** 删除自动生成实训 0*/
export function deleteAutoTraining(params) {
return request({
url: `/api/training/generate`,
method: 'delete',
params: params
});
}
// /** 修改自动删除实训操作 0*/
// export function updateAutoTraining(data) {
// return request({
// url: `/api/training/batchUpdateGenerate`,
// method: 'put',
// data: data
// });
// }
// /** 删除自动生成实训 0*/
// export function deleteAutoTraining(params) {
// return request({
// url: `/api/training/generate`,
// method: 'delete',
// params: params
// });
// }
/** 获取用户实训列表 0*/
export function getTrainingList(data) {
return request({
url: `/api/training/list`,
method: 'get',
params: data
});
}
// /** 获取用户实训列表 0*/
// export function getTrainingList(data) {
// return request({
// url: `/api/training/list`,
// method: 'get',
// params: data
// });
// }
export function sendCommand(group, command) {
return request({
@ -125,29 +125,29 @@ export function sendCommandNew(group, commandDefinitionId, command) {
data: command
});
}
// 添加用户实训数据 0
export function addUserTraining(data) {
return request({
url: `/api/training/userTraining`,
method: 'post',
data: data
});
}
// 更新用户实训数据 0
export function putUserTraining(data) {
return request({
url: `/api/training/userTraining/${data.id}`,
method: 'put',
data: data
});
}
// 清除实训数据 0
export function deleteUserTraining(statsId) {
return request({
url: `/api/training/userTraining/${statsId}`,
method: 'delete'
});
}
// // 添加用户实训数据 0
// export function addUserTraining(data) {
// return request({
// url: `/api/training/userTraining`,
// method: 'post',
// data: data
// });
// }
// // 更新用户实训数据 0
// export function putUserTraining(data) {
// return request({
// url: `/api/training/userTraining/${data.id}`,
// method: 'put',
// data: data
// });
// }
// // 清除实训数据 0
// export function deleteUserTraining(statsId) {
// return request({
// url: `/api/training/userTraining/${statsId}`,
// method: 'delete'
// });
// }
/** 开始实训 (新版地图) */
export function startTrainingNew (args, group) {
@ -184,7 +184,8 @@ export function getTrainingDetailNew(trainingId) {
url: `/api/v1/training/${trainingId}`,
method: 'get'
});
}/** 添加实训(新版地图) */
}
/** 添加实训(新版地图) */
export function addTrainingNew(data) {
return request({
url: '/api/v1/training',

View File

@ -239,11 +239,3 @@ export function realDeviceIsUsedNew(group, projectCode) {
});
}
// 获取所有需要值班员的车站(新版)
export function getAvailableStaionList(mapId) {
return request({
url: `/api/map/${mapId}/station/needSupervisor`,
method: 'get'
});
}

View File

@ -10,14 +10,14 @@ export function getLessonPermissonPageList(params) {
});
}
/** 创建课程权限*/
export function createLessonPermisson(data) {
return request({
url: '/api/permission',
method: 'post',
data: data
});
}
// /** 创建课程权限*/
// export function createLessonPermisson(data) {
// return request({
// url: '/api/permission',
// method: 'post',
// data: data
// });
// }
/** 获取权限详情*/
export function getPermissonDetail(id) {
@ -44,14 +44,14 @@ export function postPermissonList(mapId) {
});
}
/** 获取用户某课程某段时间内可用的权限数量*/
export function getTotalRemains(params) {
return request({
url: '/api/userPermission/totalRemains',
method: 'get',
params: params
});
}
// /** 获取用户某课程某段时间内可用的权限数量*/
// export function getTotalRemains(params) {
// return request({
// url: '/api/userPermission/totalRemains',
// method: 'get',
// params: params
// });
// }
/** 设置权限失效或有效*/
export function setLessonPermisson(data) {
return request({
@ -61,21 +61,21 @@ export function setLessonPermisson(data) {
});
}
/** 设置权限失效或有效*/
export function getPermissionList(id) {
return request({
url: `/api/permission/${id}`,
method: 'get'
});
}
// /** 设置权限失效或有效*/
// export function getPermissionList(id) {
// return request({
// url: `/api/permission/${id}`,
// method: 'get'
// });
// }
/** 获取大屏权限列表*/
export function queryPermissionScreen() {
return request({
url: `/api/userPermission/bigScreen`,
method: 'get'
});
}
// /** 获取大屏权限列表*/
// export function queryPermissionScreen() {
// return request({
// url: `/api/userPermission/bigScreen`,
// method: 'get'
// });
// }
/**
* 用户权限列表
@ -99,13 +99,13 @@ export function listUserPermision(params) {
});
}
/** 用户权限列表 */
export function getDistribute(id) {
return request({
url: `/api/distribute/${id}`,
method: 'get'
});
}
// /** 用户权限列表 */
// export function getDistribute(id) {
// return request({
// url: `/api/distribute/${id}`,
// method: 'get'
// });
// }
/** 设置权限所有者 */
export function putPermissionOwner(data) {

View File

@ -1,31 +1,31 @@
import request from '@/utils/request';
/** 权限转增*/
export function getLessons(data) {
return request({
url: '/api/distribute/getLessons',
method: 'get',
data: data
});
}
// /** 权限转增*/
// export function getLessons(data) {
// return request({
// url: '/api/distribute/getLessons',
// method: 'get',
// data: data
// });
// }
/** 权限分发*/
export function giveLessons(data) {
return request({
url: '/api/distribute/distribute',
method: 'post',
data: data
});
}
// /** 权限分发*/
// export function giveLessons(data) {
// return request({
// url: '/api/distribute/distribute',
// method: 'post',
// data: data
// });
// }
/** 权限转增*/
export function permissionTurnAdd(data) {
return request({
url: '/api/distribute/transfer',
method: 'post',
data: data
});
}
// /** 权限转增*/
// export function permissionTurnAdd(data) {
// return request({
// url: '/api/distribute/transfer',
// method: 'post',
// data: data
// });
// }
/** 权限获取*/
export function getPermission(state) {
@ -35,23 +35,23 @@ export function getPermission(state) {
});
}
/** 接收课程权限*/
export function receiveLessons(data) {
return request({
url: '/api/distribute/receiveLessons',
method: 'get',
data: data
});
}
// /** 接收课程权限*/
// export function receiveLessons(data) {
// return request({
// url: '/api/distribute/receiveLessons',
// method: 'get',
// data: data
// });
// }
/** 考试权限分发*/
export function giveExams(data) {
return request({
url: `/api/distribute/giveExams`,
method: 'post',
data: data
});
}
// /** 考试权限分发*/
// export function giveExams(data) {
// return request({
// url: `/api/distribute/giveExams`,
// method: 'post',
// data: data
// });
// }
/** 权限打包分页查询*/
export function listPackagePermission(params) {
@ -62,14 +62,14 @@ export function listPackagePermission(params) {
});
}
/** 打包权限*/
export function packagePermissionDistribute(data) {
return request({
url: `/api/distribute/givePermission/package`,
method: 'post',
data: data
});
}
// /** 打包权限*/
// export function packagePermissionDistribute(data) {
// return request({
// url: `/api/distribute/givePermission/package`,
// method: 'post',
// data: data
// });
// }
/** 权限回收*/
export function restorePackagePermission(id) {
@ -97,31 +97,31 @@ export function getPermissionPackageDetail(id, params) {
});
}
/** 权限分发打包*/
export function permissionDistributePackage(data) {
return request({
url: `/api/distribute/package`,
method: 'post',
data: data
});
}
// /** 权限分发打包*/
// export function permissionDistributePackage(data) {
// return request({
// url: `/api/distribute/package`,
// method: 'post',
// data: data
// });
// }
/** 权限分发解包*/
export function permissionDistributeUnPackage(permissionId) {
return request({
url: `/api/distribute/${permissionId}/unPackage`,
method: 'delete'
});
}
// /** 权限分发解包*/
// export function permissionDistributeUnPackage(permissionId) {
// return request({
// url: `/api/distribute/${permissionId}/unPackage`,
// method: 'delete'
// });
// }
/** 查询可打包的权限分发*/
export function listCanPackagePermission(params) {
return request({
url: `/api/distribute/package`,
method: 'get',
params: params
});
}
// /** 查询可打包的权限分发*/
// export function listCanPackagePermission(params) {
// return request({
// url: `/api/distribute/package`,
// method: 'get',
// params: params
// });
// }
// 设置权限分发列表 权限失效
export function setCommodityStatus(id) {
@ -149,10 +149,10 @@ export function givePermission(data) {
});
}
/** 查询权限分发领取用户列表 */
export function distributeUsers(distributeId) {
return request({
url: `/api/distribute/${distributeId}/distributeUsers`,
method: 'get'
});
}
// /** 查询权限分发领取用户列表 */
// export function distributeUsers(distributeId) {
// return request({
// url: `/api/distribute/${distributeId}/distributeUsers`,
// method: 'get'
// });
// }

View File

@ -94,18 +94,10 @@ export function updateExamRules(data) {
});
}
/** 根据课程ID获取试卷 */
export function getExamParperList(lessonId) {
return request({
url: `/api/exam/${lessonId}/list`,
method: 'get'
});
}
/** 根据课程ID获取班级 */
export function getExamClassList(lessonId) {
return request({
url: `/api/lesson/${lessonId}/classes`,
method: 'get'
});
}
// /** 根据课程ID获取试卷 */
// export function getExamParperList(lessonId) {
// return request({
// url: `/api/exam/${lessonId}/list`,
// method: 'get'
// });
// }

View File

@ -20,16 +20,16 @@ export function getCommodityList(params) {
});
}
/**
* 保存商品明细列表
*/
export function saveCommodityList(params) {
return request({
url: '/api/goods',
method: 'post',
data: params
});
}
// /**
// * 保存商品明细列表
// */
// export function saveCommodityList(params) {
// return request({
// url: '/api/goods',
// method: 'post',
// data: params
// });
// }
/**
* 删除商品明细
@ -41,25 +41,25 @@ export function delCommodity(id) {
});
}
/**
* 获取商品地图产品课程列表
*/
export function getMapLesson() {
return request({
url: `/api/goods/tree`,
method: 'get'
});
}
// /**
// * 获取商品地图,产品,课程列表
// */
// export function getMapLesson() {
// return request({
// url: `/api/goods/tree`,
// method: 'get'
// });
// }
/**
* 获取商品地图产品课程列表
*/
export function getCommodityDetailById(id) {
return request({
url: `/api/goods/${id}`,
method: 'get'
});
}
// /**
// * 获取商品地图,产品,课程列表
// */
// export function getCommodityDetailById(id) {
// return request({
// url: `/api/goods/${id}`,
// method: 'get'
// });
// }
/**
* 获取商品地图产品课程列表
@ -110,44 +110,44 @@ export function getGoodsList() {
});
}
// 根据权限id查询商品
export function getGoodsByPermissionId(id) {
return request({
url: `/api/goods/permissionId`,
method: 'get',
params: {
permissionId: id
}
});
}
// // 根据权限id查询商品
// export function getGoodsByPermissionId(id) {
// return request({
// url: `/api/goods/permissionId`,
// method: 'get',
// params: {
// permissionId: id
// }
// });
// }
// 创建商品
export function postsPermissionGoods(data) {
return request({
// url: `/api/goods`,
url: `/api/goods/create/list`,
method: 'post',
data: data
});
}
// // 创建商品
// export function postsPermissionGoods(data) {
// return request({
// // url: `/api/goods`,
// url: `/api/goods/create/list`,
// method: 'post',
// data: data
// });
// }
// 创建万能权限商品
export function postPermissionIdsGoods(data) {
return request({
url: `/api/goods/permissionIds`,
method: 'post',
data: data
});
}
// // 创建万能权限商品
// export function postPermissionIdsGoods(data) {
// return request({
// url: `/api/goods/permissionIds`,
// method: 'post',
// data: data
// });
// }
// 创建万能权限商品
export function postCreatePackage(data) {
return request({
url: `/api/goods/create/package`,
method: 'post',
data: data
});
}
// // 创建万能权限商品
// export function postCreatePackage(data) {
// return request({
// url: `/api/goods/create/package`,
// method: 'post',
// data: data
// });
// }
// 获取订单对应的商品列表
export function getGoodsListByOrderId(id) {
return request({

View File

@ -26,13 +26,13 @@ export function delSkinCode(id) {
});
}
/** 根据id查询真实线路 */
export function querySkinCode(id) {
return request({
url: `/api/realLine/${id}`,
method: 'get'
});
}
// /** 根据id查询真实线路 */
// export function querySkinCode(id) {
// return request({
// url: `/api/realLine/${id}`,
// method: 'get'
// });
// }
/** 修改真实线路*/
export function updateSkinCode(data) {
@ -60,22 +60,22 @@ export function putRealLineConfig(id, data) {
});
}
/** 通过皮肤Code更新地图皮肤*/
export function updateSkinCodeByCode(data) {
return request({
url: `/api/realLine/${data.code}/update`,
method: 'put',
data: data
});
}
// /** 通过皮肤Code更新地图皮肤*/
// export function updateSkinCodeByCode(data) {
// return request({
// url: `/api/realLine/${data.code}/update`,
// method: 'put',
// data: data
// });
// }
/** 检查code是否存在*/
export function querySkinCodeExistByCode(code) {
return request({
url: `/api/realLine/${code}/exist`,
method: 'get'
});
}
// /** 检查code是否存在*/
// export function querySkinCodeExistByCode(code) {
// return request({
// url: `/api/realLine/${code}/exist`,
// method: 'get'
// });
// }
/** 获取真实线路列表*/
export function getLineCodeList() {

View File

@ -10,14 +10,14 @@ export function getOrderPageList(params) {
});
}
/** 根据ID获取订单数据*/
export function getOrderDetail(id, params) {
return request({
url: `/api/order/${id}`,
method: 'get',
params: params
});
}
// /** 根据ID获取订单数据*/
// export function getOrderDetail(id, params) {
// return request({
// url: `/api/order/${id}`,
// method: 'get',
// params: params
// });
// }
/** 创建一个订单*/
export function createOrder(data) {
@ -37,30 +37,30 @@ export function updateOrder(data) {
});
}
export function deleteOrder(id) {
return request({
url: `/api/order/${id}`,
method: 'delete'
});
}
// export function deleteOrder(id) {
// return request({
// url: `/api/order/${id}`,
// method: 'delete'
// });
// }
/** 订单权限领取*/
export function getOrder(params) {
return request({
url: '/api/order/getOrder',
method: 'get',
params: params
});
}
// /** 订单权限领取*/
// export function getOrder(params) {
// return request({
// url: '/api/order/getOrder',
// method: 'get',
// params: params
// });
// }
/** 订单权限分发*/
export function giveOrder(data) {
return request({
url: '/api/order/giveOrder',
method: 'post',
data: data
});
}
// /** 订单权限分发*/
// export function giveOrder(data) {
// return request({
// url: '/api/order/giveOrder',
// method: 'post',
// data: data
// });
// }
/** 订单续费*/
export function getOrderCharge(id) {
@ -104,13 +104,13 @@ export function cancalOrder(orderId) {
});
}
// 万能权限查询权限包商品
export function postFindPermission(ids) {
return request({
url: `/api/goods/permissionIds?ids=${ids}`,
method: 'get'
});
}
// // 万能权限查询权限包商品
// export function postFindPermission(ids) {
// return request({
// url: `/api/goods/permissionIds?ids=${ids}`,
// method: 'get'
// });
// }
// 获取订单的分发二维码
export function getDistributeFromOrder(orderCode) {

View File

@ -1,29 +1,29 @@
import request from '@/utils/request';
/** 注册用户*/
export function createUserInfo(data) {
return request({
url: '/api/userinfo/create',
method: 'put',
data: data
});
}
/** 根据用户Id获取用户信息*/
export function getUserInfoByOpenId(params) {
return request({
url: '/api/userinfo/getByOpenId',
method: 'get',
params: params
});
}
// /** 注册用户*/
// export function createUserInfo(data) {
// return request({
// url: '/api/userinfo/create',
// method: 'put',
// data: data
// });
// }
// /** 根据用户Id获取用户信息*/
// export function getUserInfoByOpenId(params) {
// return request({
// url: '/api/userinfo/getByOpenId',
// method: 'get',
// params: params
// });
// }
/** 根据姓名或者手机号查询用户*/
export function getUserInfoByNameOrMobile(params) {
return request({
url: '/api/userinfo/nameOrMobile',
method: 'get',
params: params
});
}
// /** 根据姓名或者手机号查询用户*/
// export function getUserInfoByNameOrMobile(params) {
// return request({
// url: '/api/userinfo/nameOrMobile',
// method: 'get',
// params: params
// });
// }
/** 查询用户参数*/
export function getUserConfigInfo() {
@ -33,14 +33,14 @@ export function getUserConfigInfo() {
});
}
/** 设置用户参数*/
export function setUserConfigInfo(data) {
return request({
url: '/api/user/config',
method: 'post',
data: data
});
}
// /** 设置用户参数*/
// export function setUserConfigInfo(data) {
// return request({
// url: '/api/user/config',
// method: 'post',
// data: data
// });
// }
/** 获取销售列表*/
export function getSellerList() {
@ -85,10 +85,10 @@ export function saveUserSubscribe(data) {
});
}
// 修改用户权限
// 修改用户信息
export function putRoles(data) {
return request({
url: `/api/user/${data.id}/role`,
url: `/api/user/${data.id}/info`,
method: 'put',
data: data
});
@ -211,14 +211,14 @@ export function exportStudentResults(projectCode, data) {
data: data
});
}
// 生成绑定微信二维码
export function getWxQrCode(params) {
return request({
url: `/api/user/wmurl`,
method: 'get',
params: params
});
}
// // 生成绑定微信二维码
// export function getWxQrCode(params) {
// return request({
// url: `/api/user/wmurl`,
// method: 'get',
// params: params
// });
// }
// 获取微信小程序绑定二维码
export function getBindWxQrCodeUrl() {

View File

@ -51,21 +51,21 @@ export function delPublishExam(id) {
});
}
/** 删除用户实训*/
export function delTrainingList() {
return request({
url: `/api/userExam/list`,
method: 'delet'
});
}
// /** 删除用户实训*/
// export function delTrainingList() {
// return request({
// url: `/api/userExam/list`,
// method: 'delet'
// });
// }
/** 设置试卷失效 */
export function setExamGive(id) {
return request({
url: `/api/userExam/${id}/abandon`,
method: 'put'
});
}
// /** 设置试卷失效 */
// export function setExamGive(id) {
// return request({
// url: `/api/userExam/${id}/abandon`,
// method: 'put'
// });
// }
export function updateExam(data) {
return request({

View File

@ -34,10 +34,17 @@ export function updateRace(id, data) {
// });
// }
/** 导入项目试题库 */
export function importQuestionBand(data) {
export function importQuestionBand(data, companyId) {
return request({
url: `/api/questionBank/questions/import`,
url: `/api/questionBank/questions/import?id=${companyId}`,
method: 'post',
data
});
}
/** 查询公司下题目类型数量 */
export function selectQuestionTypeNum(companyId) {
return request({
url: `/api/questionBank/type/number?companyId=${companyId}`,
method: 'get'
});
}

View File

@ -1,11 +1,42 @@
import request from '@/utils/request';
/**
* 查询运行图列表
*/
export function listRps() {
return request({
url: `/api/rpTools`,
method: 'get'
})
}
/**
* 创建运行图
*/
export function createRp(data) {
return request({
url: `/api/rpTools`,
method: 'post',
data
})
}
/**
* 删除运行图
*/
export function deleteRp(planId) {
return request({
url: `/api/rpTools/${planId}`,
method: 'delete'
})
}
/**
* 获取运行图配置
*/
export function getRpConfig() {
export function getRpConfig(planId) {
return request({
url: `/api/rpTools/config`,
url: `/api/rpTools/${planId}/config`,
method: 'get'
})
}
@ -13,9 +44,9 @@ export function getRpConfig() {
/**
* 修改运行图配置
*/
export function modifyRpConfig(data) {
export function modifyRpConfig(planId, data) {
return request({
url: `/api/rpTools/config`,
url: `/api/rpTools/${planId}/config`,
method: 'put',
data
})
@ -24,9 +55,9 @@ export function modifyRpConfig(data) {
/**
* 获取运行图数据
*/
export function getRpTools() {
export function getRpTools(planId) {
return request({
url: '/api/rpTools',
url: `/api/rpTools/${planId}`,
method: 'get'
});
}
@ -34,9 +65,9 @@ export function getRpTools() {
/**
* 清除运行图
*/
export function clearRpPlan() {
export function clearRpPlan(planId) {
return request({
url: `/api/rpTools/clear`,
url: `/api/rpTools/${planId}/clear`,
method: 'put'
})
}
@ -44,9 +75,9 @@ export function clearRpPlan() {
/**
* 添加车次
*/
export function addRpTrip(data) {
export function addRpTrip(planId, data) {
return request({
url: '/api/rpTools/trip',
url: `/api/rpTools/${planId}/trip`,
method: 'post',
data
});
@ -55,9 +86,9 @@ export function addRpTrip(data) {
/**
* 删除车次
*/
export function delRpTrip(tripNo) {
export function delRpTrip(planId, tripNo) {
return request({
url: `/api/rpTools/${tripNo}/trip`,
url: `/api/rpTools/${planId}/${tripNo}/trip`,
method: 'delete'
})
}
@ -66,9 +97,9 @@ export function delRpTrip(tripNo) {
/**
* 平移服务
*/
export function translateRpService(serviceNo, data) {
export function translateRpService(planId, serviceNo, data) {
return request({
url: `/api/rpTools/${serviceNo}/service`,
url: `/api/rpTools/${planId}/${serviceNo}/service`,
method: 'put',
data
})
@ -77,9 +108,9 @@ export function translateRpService(serviceNo, data) {
/**
* 删除服务
*/
export function delRpService(serviceNo) {
export function delRpService(planId, serviceNo) {
return request({
url: `/api/rpTools/${serviceNo}/service`,
url: `/api/rpTools/${planId}/${serviceNo}/service`,
method: 'delete'
})
}
@ -88,9 +119,9 @@ export function delRpService(serviceNo) {
/**
* 添加区域
*/
export function createRpArea(data) {
export function createRpArea(planId, data) {
return request({
url: `/api/rpTools/area`,
url: `/api/rpTools/${planId}/area`,
method: 'post',
data
})
@ -99,9 +130,9 @@ export function createRpArea(data) {
/**
* 修改区域
*/
export function modifyRpArea(areaNo, data) {
export function modifyRpArea(planId, areaNo, data) {
return request({
url: `/api/rpTools/${areaNo}/area`,
url: `/api/rpTools/${planId}/${areaNo}/area`,
method: 'put',
data
})
@ -110,9 +141,9 @@ export function modifyRpArea(areaNo, data) {
/**
* 修改区域文字
*/
export function modifyAreaNote(areaNo, data) {
export function modifyAreaNote(planId,areaNo, data) {
return request({
url: `/api/rpTools/${areaNo}/text`,
url: `/api/rpTools/${planId}/${areaNo}/text`,
method: 'put',
data
})
@ -120,9 +151,9 @@ export function modifyAreaNote(areaNo, data) {
/**
* 删除区域
*/
export function delRpArea(areaNo) {
export function delRpArea(planId, areaNo) {
return request({
url: `/api/rpTools/${areaNo}/area`,
url: `/api/rpTools/${planId}/${areaNo}/area`,
method: 'delete'
})
}
@ -130,9 +161,9 @@ export function delRpArea(areaNo) {
/**
* 修改运行时间
*/
export function justTripNoRunning(tripNo, data) {
export function justTripNoRunning(planId, tripNo, data) {
return request({
url: `/api/rpTools/${tripNo}/running`,
url: `/api/rpTools/${planId}/${tripNo}/running`,
method: 'put',
data
})
@ -141,9 +172,9 @@ export function justTripNoRunning(tripNo, data) {
/**
* 修改停站时间
*/
export function justTripNoStop(tripNo, data) {
export function justTripNoStop(planId, tripNo, data) {
return request({
url: `/api/rpTools/${tripNo}/stop`,
url: `/api/rpTools/${planId}/${tripNo}/stop`,
method: 'put',
data
})
@ -152,9 +183,9 @@ export function justTripNoStop(tripNo, data) {
/**
* 修改折返时间
*/
export function justTripTurnback(tripNo, data) {
export function justTripTurnBack(planId, tripNo, data) {
return request({
url: `/api/rpTools/${tripNo}/turnBack`,
url: `/api/rpTools/${planId}/${tripNo}/turnBack`,
method: 'put',
data
})

View File

@ -143,3 +143,20 @@ export function endScriptTraining(group) {
});
}
/** 草稿剧本数据导入*/
export function postScriptImport(mapId, data) {
return request({
url: `/api/script/draft/${mapId}/import`,
method: 'post',
data: data,
time: 60000
});
}
/** 草稿剧本数据导出 */
export function getScriptExport(id) {
return request({
url: `/api/script/draft/${id}/export`,
method: 'get'
});
}

View File

@ -673,14 +673,6 @@ export function getNewMapDataByGroup(group) {
});
}
/** 新版地图根据仿真mapId获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) {
return request({
url: `/api/map/${mapId}/mapData`,
method: 'get'
});
}
/** 新版地图指令操作定义 */
export function newMapOperate(group, operationId, data) {
return request({

BIN
src/assets/voice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -13,53 +13,51 @@
import pathToRegexp from 'path-to-regexp';
export default {
data() {
return {
levelList: null
};
},
watch: {
$route() {
this.getBreadcrumb();
}
},
created() {
this.getBreadcrumb();
},
methods: {
getBreadcrumb() {
// only show routes with meta.title
let matched = this.$route.matched.filter(item => item.meta && item.meta.title);
const first = matched[0];
data() {
return {
levelList: null
};
},
watch: {
$route() {
this.getBreadcrumb();
}
},
created() {
this.getBreadcrumb();
},
methods: {
getBreadcrumb() {
let matched = this.$route.matched.filter(item => item.meta && item.meta.title);
const first = matched[0];
if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched);
}
if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched);
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false);
},
isDashboard(route) {
const name = route && route.name;
if (!name) {
return false;
}
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase();
},
pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
const { params } = this.$route;
var toPath = pathToRegexp.compile(path);
return toPath(params);
},
handleLink(item) {
const { redirect, path } = item;
if (redirect) {
this.$router.push(redirect);
return;
}
this.$router.push(this.pathCompile(path));
}
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false);
},
isDashboard(route) {
const name = route && route.name;
if (!name) {
return false;
}
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase();
},
pathCompile(path) {
const { params } = this.$route;
var toPath = pathToRegexp.compile(path);
return toPath(params);
},
handleLink(item) {
const { redirect, path } = item;
if (redirect) {
this.$router.push(redirect);
return;
}
this.$router.push(this.pathCompile(path));
}
}
};
</script>

View File

@ -214,6 +214,7 @@
<el-select
v-model="formModel[item.prop]"
filterable
:clearable="item.clearable"
:placeholder="item.placeholder"
:disabled="item.disabled"
@change="((val)=>{deviceChange(val, item)})"

View File

@ -302,6 +302,7 @@ export default {
//
initPageData() {
this.modelFields = [];
this.formModel = {};
this.exportFlag = this.queryForm.canExport;
this.resetShow = this.queryForm.reset;
this.buildQueryField();

View File

@ -41,7 +41,7 @@ export default {
nickname: 'Nickname',
wellDelType: 'This operation will delete the type. Do you want to continue?',
permission: 'Permission',
editUserPermission: 'Edit User Rights',
editUserPermission: 'Edit User Info',
lessonName: 'Lesson Name',
selectTraining: 'Selection Training',
createUserTraining: 'Creating User Training',

View File

@ -41,7 +41,7 @@ export default {
nickname: '昵称',
wellDelType: '此操作将删除该类型, 是否继续?',
permission: '权限',
editUserPermission: '编辑用户权限',
editUserPermission: '编辑用户信息',
lessonName: '课程名称',
selectTraining: '选择实训',
createUserTraining: '创建用户实训',

View File

@ -363,9 +363,6 @@ class SkinCode extends defaultStyle {
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
}
// trainStop: {}, // 停车标志
// trainDepart: {}, // 停车计时
};
this[deviceType.StationCounter] = {

View File

@ -338,7 +338,7 @@ class Jlmap {
});
}
setUpdateMapDevice(list) {
store.dispatch('map/updateMapDevice', list);
store.commit('map/updateMapDevice', list);
(list || []).forEach(elem => {
const code = elem.code;
const type = elem._type;
@ -483,8 +483,7 @@ class Jlmap {
} else {
if (elem.deviceType === 'TRAIN') {
this.isUpdateShowTrainList = true;
store.dispatch('map/updateActiveTrainList', elem);
// store.dispatch('map/updateTrainState', elem);
store.commit('map/updateActiveTrainList', elem);
} else if (elem.deviceType === 'STAND') {
store.dispatch('map/updateStationStand', elem);
const psdDevice = this.mapDevice[this.mapDevice[elem.code].psdCode];
@ -505,9 +504,7 @@ class Jlmap {
if (elem.dispose) {
this.$painter.delete(oDevice);
} else {
// if (this.hookHandle(oDevice, elem)) {
this.$painter.update(oDevice);
// }
}
}
});

View File

@ -85,8 +85,8 @@ class MouseController extends Eventful {
mousedown(e) {
// if (eventTool.notLeftMouse(e)) {
// return;
// }
this.$zr.dom.focus();
// }
this.$zr.dom.focus();
if (e.which == 1 || e.which == 3) {
var x = e.offsetX;
var y = e.offsetY;
@ -287,7 +287,7 @@ class MouseController extends Eventful {
}
});
this.deviceList = includeDeviceList;
store.dispatch('map/setSeclectDeviceList', this.deviceList); // 给store设置框选的 model
store.commit('map/setSeclectDeviceList', this.deviceList); // 给store设置框选的 model
}
// 生成包围盒对象坐标
createFakeBoundingRect(instance) {

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class ECancelStopJumpLamp extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.cancelStopJumpLamp = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.cancelStopJumpLampPoint.x,
cy: model.cancelStopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'CancelStopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.cancelStopJumpLampPoint.x,
y: model.cancelStopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '取消跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.cancelStopJumpLamp);
}
}
export default ECancelStopJumpLamp;

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class EDownDetainLamp extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.downDetainLamp = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.downDetainLampPoint.x,
cy: model.downDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'DownDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.downDetainLampPoint.x,
y: model.downDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '下行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.downDetainLamp);
}
}
export default EDownDetainLamp;

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class EStopJumpLampButton extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.stopJumpLampButton = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.stopJumpLampPoint.x,
cy: model.stopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'StopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.stopJumpLampPoint.x,
y: model.stopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.stopJumpLampButton);
}
}
export default EStopJumpLampButton;

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class EUpDetainLamp extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.upDetainLamp = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.upDetainLampPoint.x,
cy: model.upDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'UpDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.upDetainLampPoint.x,
y: model.upDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '上行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.upDetainLamp);
}
}
export default EUpDetainLamp;

View File

@ -26,11 +26,15 @@ import EMouse from './EMouse';
import EHighlight from '../element/EHighlight';
import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl';
import EPatternFilter from './EPatternFilter';
import EStopJumpLamp from './functionButton/EStopJumpLamp';
import ECancelStopJumpLamp from './functionButton/ECancelStopJumpLamp';
import EUpDetainLamp from './functionButton/EUpDetainLamp';
import EDownDetainLamp from './functionButton/EDownDetainLamp';
import {isShowThePrdType} from '../../utils/handlePath';
import {traverseLineElements} from '../utils/ShapeStatusCovert';
import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
class StationStand extends Group {
constructor(model, style) {
@ -44,17 +48,17 @@ class StationStand extends Group {
this.isShowShape = true;
this.create();
this.createMouseEvent();
if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) {
this.createFunctionButton();
}
if (model.previewOrMapDraw) {
this.setShowMode();
}
// if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) {
// this.createFunctionButton();
// }
// if (model.previewOrMapDraw) {
// this.setShowMode();
// }
this.setVisible(model.visible);
this.setState(model);
this.checkIsDrawMap();
}
create() {
// 加载皮肤控制的元素
const model = this.model;
const style = this.style;
// // 站台所有的绘图元素
@ -85,139 +89,34 @@ class StationStand extends Group {
};
// 遍历当前线路下的绘图元素 组合模式
traverseLineElements(style.StationStand, elementTypeList, model, style, this);
// 加载后端返回的状态控制的绘图
const statusElementList = {
'stopJumpLamp':EStopJumpLamp,
'cancelStopJumpLamp':ECancelStopJumpLamp,
'upDetainLamp':EUpDetainLamp,
'downDetainLamp':EDownDetainLamp
};
// 遍历后端返回的状态控制的绘图
if (model.previewOrMapDraw || isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow)) {
traverseStatusElements(statusElementList, model, style, this);
}
}
createMouseEvent() {
if (this.style.StationStand.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
createFunctionButton() {
const model = this.model;
const style = this.style;
if (model.stopJumpLamp) {
this.stopJumpLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.stopJumpLampPoint.x,
cy: model.stopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'StopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.stopJumpLampPoint.x,
y: model.stopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.stopJumpLampButton);
}
if (model.cancelStopJumpLamp) {
this.cancelStopJumpLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.cancelStopJumpLampPoint.x,
cy: model.cancelStopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'CancelStopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.cancelStopJumpLampPoint.x,
y: model.cancelStopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '取消跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.cancelStopJumpLampButton);
}
if (model.upDetainLamp) {
this.upDetainLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.upDetainLampPoint.x,
cy: model.upDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'UpDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.upDetainLampPoint.x,
y: model.upDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '上行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.upDetainLampButton);
}
if (model.downDetainLamp) {
this.downDetainLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.downDetainLampPoint.x,
cy: model.downDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'DownDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.downDetainLampPoint.x,
y: model.downDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '下行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.downDetainLampButton);
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
} else {
if (this.style.StationStand.mouseOverStyle) {
this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
}
}
}
@ -266,19 +165,19 @@ class StationStand extends Group {
}
switch (opts.subDeviceType) {
case 'StopJumpLamp': {
rect = this.stopJumpLampButton.getBoundingRect();
rect = this.stopJumpLamp.getBoundingRect();
break;
}
case 'CancelStopJumpLamp': {
rect = this.cancelStopJumpLampButton.getBoundingRect();
rect = this.cancelStopJumpLamp.getBoundingRect();
break;
}
case 'UpDetainLamp': {
rect = this.upDetainLampButton.getBoundingRect();
rect = this.upDetainLamp.getBoundingRect();
break;
}
case 'DownDetainLamp': {
rect = this.downDetainLampButton.getBoundingRect();
rect = this.downDetainLamp.getBoundingRect();
break;
}
default: {
@ -299,31 +198,18 @@ class StationStand extends Group {
this.highlight && this.highlight.drawSelected(selected);
}
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
// 设置显示模式
setShowMode() {
const showMode = this.model.showMode;
const showConditions = this.style.StationStand.common.functionButtonShow;
if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.stopJumpLampButton && this.stopJumpLampButton.show();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.show();
this.upDetainLampButton && this.upDetainLampButton.show();
this.downDetainLampButton && this.downDetainLampButton.show();
this.stopJumpLamp && this.stopJumpLamp.show();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
this.upDetainLamp && this.upDetainLamp.show();
this.downDetainLamp && this.downDetainLamp.show();
} else {
this.stopJumpLampButton && this.stopJumpLampButton.hide();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.hide();
this.upDetainLampButton && this.upDetainLampButton.hide();
this.downDetainLampButton && this.downDetainLampButton.hide();
this.stopJumpLamp && this.stopJumpLamp.hide();
this.cancelStopJumpLamp && this.cancelStopJumpLamp.hide();
this.upDetainLamp && this.upDetainLamp.hide();
this.downDetainLamp && this.downDetainLamp.hide();
}

View File

@ -14,3 +14,20 @@ export function traverseLineElements(currentType, elementTypeList, model, style,
obj.add(obj[element]);
});
}
// 遍历后端返回的状态控制的绘图
export function traverseStatusElements(statusElementList, model, style, obj) {
// if (model.showMode == undefined || model.showMode) {
Object.keys(statusElementList).forEach(element => {
const ClassName = statusElementList[element];
if (model[element]) {
obj[element] = new ClassName({
zlevel: model.zlevel,
z: 1,
style: style,
modelData:model
});
obj.add(obj[element]);
}
});
// }
}

View File

@ -0,0 +1,19 @@
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
list: [
{
maxDuration: 8,
minDuration: 5,
operateType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN.value,
skinCode: '03',
trainingName: '设置扣车({10}-{12} 站台)',
trainingRemark: '设置扣车功能',
trainingType:'Stand',
productTypes: ['02'], // 产品类型 01 现地 02 行调
stepVOList: [
{ deviceType: '06', orderNum: 1, operateCode: '504', tip: '鼠标右键菜单选择【设置扣车】'},
{ deviceType: '06', orderNum: 2, operateCode: '504', tip: '鼠标左键点击【确定】按钮' }
]
}
]
};

View File

@ -1,7 +1,7 @@
<template>
<div id="menuBar">
<div id="menuBar" :style="{height: $store.state.training.prdType === '01'? '90px': '130px'}">
<div class="haerbin-01__systerm nav">
<el-row>
<el-row v-if="$store.state.training.prdType === '01'">
<el-col :span="2">
<div class="nav-border">
<el-row>
@ -36,13 +36,13 @@
<el-col :span="10">
<div class="nav-border">
<el-row>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">A级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">B级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">C级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain :style="{background: level === 'A'? '#F00': '#FFF' }" @click="clearLevel">A级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain :style="{background: level === 'B'? '#F00': '#FFF' }" @click="clearLevel">B级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain :style="{background: level === 'C'? '#F00': '#FFF' }" @click="clearLevel">C级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">记录</el-button></el-col>
</el-row>
<el-row>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">声音</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="controlAudio(false)">声音</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">双屏</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">TGI</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">管理</el-button></el-col>
@ -64,14 +64,89 @@
</div>
</el-col>
</el-row>
<el-row v-else-if="$store.state.training.prdType === '02'" style="padding: 3px;">
<el-col :span="16">
<div style="width: calc(100% - 10px);border: 2px solid #DDD9CA;border-radius: 5px;">
<el-row style="padding: 4px;">
<div class="tip-content-box">
<div v-if="tipContent[0]">{{ `${tipContent[0].level}` }}</div>
<div v-if="tipContent[0]">{{ `${tipContent[0].time}` }}</div>
<div v-if="tipContent[0]">{{ `${tipContent[0].confirm ? '确认': '未确认'}` }}</div>
</div>
<div class="tip-content-box">
<div v-if="tipContent[1]">{{ `${tipContent[1].level}` }}</div>
<div v-if="tipContent[1]">{{ `${tipContent[1].time}` }}</div>
<div v-if="tipContent[1]">{{ `${tipContent[1].confirm ? '确认': '未确认'}` }}</div>
</div>
<div class="tip-content-box">
<div v-if="tipContent[2]">{{ `${tipContent[2].level}` }}</div>
<div v-if="tipContent[2]">{{ `${tipContent[2].time}` }}</div>
<div v-if="tipContent[2]">{{ `${tipContent[2].confirm ? '确认': '未确认'}` }}</div>
</div>
</el-row>
<el-row class="button-row">
<div class="div-simulate-button" @click="undeveloped">系统</div>
<div class="div-simulate-button" @click="undeveloped">联锁</div>
<div class="div-simulate-button" @click="undeveloped">列监</div>
<div class="div-simulate-button" @click="undeveloped">站控</div>
<div class="div-simulate-button" @click="undeveloped">车场</div>
<div class="div-simulate-button" @click="undeveloped">编表</div>
<div class="div-simulate-button" @click="undeveloped">车辆段</div>
</el-row>
<el-row class="button-row" style="margin-top: 10px;">
<div class="div-simulate-button" @click="undeveloped">轨道</div>
<div class="div-simulate-button" @click="undeveloped">调度</div>
<div class="div-simulate-button" @click="undeveloped">录放</div>
<div class="div-simulate-button" @click="undeveloped">管理</div>
<div class="div-simulate-button" @click="undeveloped">列车信息</div>
<div class="div-simulate-button" @click="undeveloped">职权</div>
<div style="width: 80px;" />
</el-row>
</div>
</el-col>
<el-col :span="4">
<div style="width: calc(100% - 10px);border: 2px solid #DDD9CA;border-radius: 5px;">
<el-row style="height: 68px;display: flex; justify-content: space-between;align-items: center;">
<div style="width: 40px;" class="div-simulate-button" :style="{background: level === 'A'? '#F00': '#FFF' }" @click="clearLevel">A</div>
<div style="width: 40px;" class="div-simulate-button" :style="{background: level === 'B'? '#F00': '#FFF' }" @click="clearLevel">B</div>
<div style="width: 40px;" class="div-simulate-button" :style="{background: level === 'C'? '#F00': '#FFF' }" @click="clearLevel">C</div>
<div style="width: 60px;height: 45px;" class="div-simulate-button" @click="controlAudio(false)"><img :src="voiceIcon" style="width: 40px;height: 40px;"></div>
</el-row>
<el-row class="button-row">
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">报警</div>
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">运图</div>
</el-row>
<el-row class="button-row" style="margin-top: 10px;">
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">报表</div>
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">时刻表</div>
</el-row>
</div>
</el-col>
<el-col :span="4" style="border: 2px solid #DDD9CA;border-radius: 5px;">
<el-row style="height: 68px;" />
<el-row class="button-row">
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">考评</div>
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">日志</div>
</el-row>
<el-row class="button-row" style="margin-top: 10px;">
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">锁屏</div>
<div style="width: 80px;" class="div-simulate-button" @click="undeveloped">退出</div>
</el-row>
</el-col>
</el-row>
</div>
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
<audio id="buzzer" controls loop="loop" style="width: 0;height: 0">
<source :src="buzzerAudio" type="audio/mpeg">
</audio>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { EventBus } from '@/scripts/event-bus';
import voiceIcon from '@/assets/voice.png';
import BuzzerAudio from '@/assets/buzzer.mp3';
export default {
name: 'MenuBar',
@ -103,7 +178,11 @@ export default {
centralizedStationList2: [],
colsNum: 0,
version: '',
centralizedMap: {}
centralizedMap: {},
tipContent: [],
voiceIcon:voiceIcon,
level: '',
buzzerAudio: BuzzerAudio
};
},
computed: {
@ -152,6 +231,15 @@ export default {
if (list && list.length) {
this.checkRoleChange(list);
}
},
'$store.state.socket.simulationAlarmInfo': function(val) {
if (val) {
this.tipContent.push(val);
this.handleAlarm(val);
if (this.tipContent.length > 3) {
this.tipContent.shift();
}
}
}
},
mounted() {
@ -163,6 +251,10 @@ export default {
}
},
methods: {
handleAlarm(val) {
this.level = val.level;
this.controlAudio(true);
},
initMenu() {
//
const centralizedStationList = [];
@ -245,6 +337,20 @@ export default {
this.switchShowStation(this.centralizedMap[item.deviceCode]);
}
});
},
clearLevel() {
this.level = '';
},
controlAudio(val) {
const audio = document.getElementById('buzzer');
// console.log(val, audio);
if (audio !== null) {
if (val) {
audio.play();
} else if (val === false) {
audio.pause();
}
}
}
}
};
@ -423,4 +529,32 @@ export default {
background: #ffffff;
cursor: not-allowed;
}
.div-simulate-button{
height: 20px;
line-height: 20px;
display: inline-block;
font-size: 14px;
color: #303030;
border: 1px solid #44556D;
background: #FFF;
text-align: center;
border-radius: 5px;
width: 80px;
}
.tip-content-box{
height: 20px;
width: 100%;
line-height: 20px;
background: #001528;
color: #C20F29;
font-size: 14px;
display: flex;
justify-content: space-around;
}
.button-row{
height: 20px;
line-height: 20px;
display: flex;
justify-content:space-between;
}
</style>

View File

@ -4,7 +4,6 @@ import router from './router/index_APP_TARGET';
import {loginInfo} from '@/scripts/ProjectConfig';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
// import { admin } from './router/index_APP_TARGET';
import { getToken, removeToken, getSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
@ -14,22 +13,15 @@ import localStore from 'storejs';
// return roles.some(role => permissionRoles.indexOf(role) >= 0);
// }
const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUStool']; // 不重定向白名单
const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool']; // 不重定向白名单
// const designPageRegex = [/^\/design/, /^\/scriptDisplay/, /^\/publish/, /^\/orderauthor/, /^\/system/, /^\/iscs/, /^\/display\/record/, /^\/display\/manage/, /^\/apply/, /^\/plan/, /^\/display\/plan/, /^\/displayNew\/record/, /^\/displayNew\/manage/, /^\/displayNew\/plan/, /^\/practiceDisplayNew/, /^\/bigSplitScreen/];
// function isDesignPage(toRoutePath) {
// return designPageRegex.some(item => item.test(toRoutePath) );
// }
for (const val in loginInfo) {
if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) {
whiteList.push(loginInfo[val].loginPath);
}
}
// const loginPage = whiteList[0];
// const loginDesignPage = whiteList[1];
// 获取路径数据
// 登录路径判断获取
function getRouteInfo(to) {
let loginPath = '';
const toRoutePath = to.redirectedFrom || to.path;
@ -71,14 +63,12 @@ function handleRoute(to, next, loginPath) {
});
} else {
// 除没有动态改变权限的需求可直接next() 删下方权限判断
// if (hasPermission(store.getters.roles, to.meta.roles)) {
if (to.path === '/404' && to.redirectedFrom === '/') {
const project = getSessionStorage('project');
next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform');
} else {
next();
}
// }
}
}

View File

@ -80,7 +80,8 @@ const ExamCourseDetail = () => import('@/views/exam/detail/courseDetail');
const DemonstrationDetail = () => import('@/views/demonstration/detail/index');
const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index');
const PlanMonitorEditAUSTool = () => import('@/views/planMonitor/editToolAUS/index');
const PlanMonitorEditAUSTool = () => import('@/views/planMonitor/editToolAUS/tool/index');
const PlanMonitorEditAUSLine = () => import('@/views/planMonitor/editToolAUS/line/index');
const PlanMonitorDetail = () => import('@/views/planMonitor/detail');
const DesignPlatformHome = () => import('@/views/designPlatform/home');
@ -210,12 +211,17 @@ export const constantRoutes = [
path: '/design/jlmap3d/assetmanager',
component: Jlmap3dAssetManager,
hidden: true
},
},
{ // 线信息
path: '/AUSline',
component: PlanMonitorEditAUSLine,
hidden: true
},
{ // 运行图编辑
path: '/AUStool',
component: PlanMonitorEditAUSTool,
hidden: true
},
},
{
path: '/jlmap3d/sandbox',
component: Jlmap3dSandbox,

View File

@ -74,15 +74,9 @@ const exam = {
actions: {
start({ commit }) {
commit('setStarted', true);
// commit('setSuspend', false);
// commit('setUsedTime', 0);
// commit('countUsedTime');
},
over({ commit }) {
commit('setStarted', false);
// commit('setSuspend', true);
// commit('setUsedTime', 0);
// commit('stopCountTime');
},
isOver() {
const trainingList = store.getters['trainingList/trainingList'];

View File

@ -8,34 +8,31 @@ const ibp = {
state: {
ibp: null, // 数据
ibpDevice: {}, // 解析后的地图数据
ibpList: {}, // 数据列表
ibpIdList: {}, // 数据列表(以id为标识)
updateDeviceData: {}, // 修改的数据
rightClickCount: 0, // 右键点击设备
ibpBgDevice: {} // ibp背景设备
},
getters: {
ibpList: (state) => {
return state.ibpList;
},
// ibpList: (state) => {
// return state.ibpList;
// },
ibp: (state) => {
return state.ibp;
},
version: (state) => {
if (state.ibp) {
return state.ibp.version;
} else {
return null;
}
},
// version: (state) => {
// if (state.ibp) {
// return state.ibp.version;
// } else {
// return null;
// }
// },
updateDeviceData: (state) => {
return state.updateDeviceData;
},
ibpBgDevice: (state) => {
return state.ibpBgDevice;
}
// ibpBgDevice: (state) => {
// return state.ibpBgDevice;
// }
},
mutations: {

View File

@ -7,9 +7,6 @@ const iscs = {
state: {
iscs: null, // 数据
iscsDevice: {}, // 解析后的地图数据
iscsList: {}, // 数据列表
iscsIdList: {}, // 数据列表(以id为标识)
updateDeviceData: {}, // 修改的数据
rightClickCount: 0, // 右键点击设备
selected: '', // 左键选中设备
@ -25,19 +22,19 @@ const iscs = {
alarmList: (state) => {
return state.alarmList;
},
iscsList: (state) => {
return state.iscsList;
},
// iscsList: (state) => {
// return state.iscsList;
// },
iscs: (state) => {
return state.iscs;
},
version: (state) => {
if (state.iscs) {
return state.iscs.version;
} else {
return null;
}
},
// version: (state) => {
// if (state.iscs) {
// return state.iscs.version;
// } else {
// return null;
// }
// },
updateDeviceData: (state) => {
return state.updateDeviceData;
},
@ -47,107 +44,107 @@ const iscs = {
} else {
return [];
}
},
vidiconList: (state) => {
if (state.iscs) {
return state.iscs.vidiconList;
} else {
return [];
}
},
vidiconCloudList: (state) => {
if (state.iscs.vidiconCloudList) {
return state.iscs.vidiconCloudList;
} else {
return [];
}
},
frozenPumpList:(state)=>{
if (state.iscs.frozenPumpList) {
return state.iscs.frozenPumpList;
} else {
return [];
}
},
airConditionerList:(state)=>{
if (state.iscs.airConditionerList) {
return state.iscs.airConditionerList;
} else {
return [];
}
},
tunnelFanList:(state)=>{
if (state.iscs.tunnelFanList) {
return state.iscs.tunnelFanList;
} else {
return [];
}
},
orbitalVentilatorList:(state)=>{
if (state.iscs.orbitalVentilatorList) {
return state.iscs.orbitalVentilatorList;
} else {
return [];
}
},
smookProofFdList:(state)=>{
if (state.iscs.smookProofFdList) {
return state.iscs.smookProofFdList;
} else {
return [];
}
},
chillerList:(state)=>{
if (state.iscs.chillerList) {
return state.iscs.chillerList;
} else {
return [];
}
},
coolTowerList:(state)=>{
if (state.iscs.coolTowerList) {
return state.iscs.coolTowerList;
} else {
return [];
}
},
fireDamperList:(state)=>{
if (state.iscs.fireDamperList) {
return state.iscs.fireDamperList;
} else {
return [];
}
},
jetFanList:(state)=>{
if (state.iscs.jetFanList) {
return state.iscs.jetFanList;
} else {
return [];
}
},
ventilatorList:(state)=>{
if (state.iscs.ventilatorList) {
return state.iscs.ventilatorList;
} else {
return [];
}
},
arcStatusList:(state)=>{
if (state.iscs.arcStatusList) {
return state.iscs.arcStatusList;
} else {
return [];
}
},
selected: (state) => {
return state.selected;
},
selectedCount: (state) => {
return state.selectedCount;
},
getDeviceByCode: (state) => (code) => {
return state.iscsDevice[code];
}
// vidiconList: (state) => {
// if (state.iscs) {
// return state.iscs.vidiconList;
// } else {
// return [];
// }
// },
// vidiconCloudList: (state) => {
// if (state.iscs.vidiconCloudList) {
// return state.iscs.vidiconCloudList;
// } else {
// return [];
// }
// },
// frozenPumpList:(state)=>{
// if (state.iscs.frozenPumpList) {
// return state.iscs.frozenPumpList;
// } else {
// return [];
// }
// },
// airConditionerList:(state)=>{
// if (state.iscs.airConditionerList) {
// return state.iscs.airConditionerList;
// } else {
// return [];
// }
// },
// tunnelFanList:(state)=>{
// if (state.iscs.tunnelFanList) {
// return state.iscs.tunnelFanList;
// } else {
// return [];
// }
// },
// orbitalVentilatorList:(state)=>{
// if (state.iscs.orbitalVentilatorList) {
// return state.iscs.orbitalVentilatorList;
// } else {
// return [];
// }
// },
// smookProofFdList:(state)=>{
// if (state.iscs.smookProofFdList) {
// return state.iscs.smookProofFdList;
// } else {
// return [];
// }
// },
// chillerList:(state)=>{
// if (state.iscs.chillerList) {
// return state.iscs.chillerList;
// } else {
// return [];
// }
// },
// coolTowerList:(state)=>{
// if (state.iscs.coolTowerList) {
// return state.iscs.coolTowerList;
// } else {
// return [];
// }
// },
// fireDamperList:(state)=>{
// if (state.iscs.fireDamperList) {
// return state.iscs.fireDamperList;
// } else {
// return [];
// }
// },
// jetFanList:(state)=>{
// if (state.iscs.jetFanList) {
// return state.iscs.jetFanList;
// } else {
// return [];
// }
// },
// ventilatorList:(state)=>{
// if (state.iscs.ventilatorList) {
// return state.iscs.ventilatorList;
// } else {
// return [];
// }
// },
// arcStatusList:(state)=>{
// if (state.iscs.arcStatusList) {
// return state.iscs.arcStatusList;
// } else {
// return [];
// }
// },
// selected: (state) => {
// return state.selected;
// },
// selectedCount: (state) => {
// return state.selectedCount;
// },
// getDeviceByCode: (state) => (code) => {
// return state.iscsDevice[code];
// }
},
mutations: {

View File

@ -1,5 +1,4 @@
import deviceType from '@/jmapNew/constant/deviceType';
// import { parser, updateMapData } from '@/jmap/utils/parser';
import { parser, updateMapData } from '@/jmapNew/utils/parser';
import Vue from 'vue';
import { deepAssign } from '@/utils/index';
@ -237,15 +236,15 @@ const map = {
holdStatus: false, // 是否有扣车状态
jumpStandList: [], // 跳停站台列表
jumpStatus: false, // 是否有跳停状态
selectDeviceFlag: false, // 设备管理激活判断
// selectDeviceFlag: false, // 设备管理激活判断
keyboardEnterCount: 0, // 键盘enter键触发
controlTransfer:[] // 控制权转移消息
},
getters: {
mapList: (state) => {
return state.mapList;
},
// mapList: (state) => {
// return state.mapList;
// },
trainWindowSectionCode: (state) => {
return state.trainWindowSectionCode;
},
@ -258,13 +257,13 @@ const map = {
routeData: (state) => {
return state.routeData;
},
routeStartSignalData: (state) => {
if (state.map) {
return state.map.routeStartSignalData || {};
} else {
return {};
}
},
// routeStartSignalData: (state) => {
// if (state.map) {
// return state.map.routeStartSignalData || {};
// } else {
// return {};
// }
// },
overlapData: (state) => {
return state.overlapData;
},
@ -274,12 +273,12 @@ const map = {
autoReentryList: (state) => {
return state.autoReentryList;
},
signalApproachSectionData: (state) => {
return state.signalApproachSectionData;
},
signalApproachSectionList: (state) => {
return state.signalApproachSectionList;
},
// signalApproachSectionData: (state) => {
// return state.signalApproachSectionData;
// },
// signalApproachSectionList: (state) => {
// return state.signalApproachSectionList;
// },
seclectDeviceList: (state) => {
return state.seclectDeviceList;
},
@ -318,20 +317,20 @@ const map = {
return null;
}
},
version: (state) => {
if (state.map) {
return state.version;
} else {
return null;
}
},
linkList: (state) => {
if (state.map) {
return state.map.linkList;
} else {
return [];
}
},
// version: (state) => {
// if (state.map) {
// return state.version;
// } else {
// return null;
// }
// },
// linkList: (state) => {
// if (state.map) {
// return state.map.linkList;
// } else {
// return [];
// }
// },
switchList: (state) => {
if (state.map) {
return state.map.switchList;
@ -346,13 +345,13 @@ const map = {
return [];
}
},
buttonList: (state) => {
if (state.map) {
return state.map.buttonList;
} else {
return [];
}
},
// buttonList: (state) => {
// if (state.map) {
// return state.map.buttonList;
// } else {
// return [];
// }
// },
signalList: (state) => {
if (state.map) {
return state.map.signalList;
@ -549,15 +548,15 @@ const map = {
return [];
}
},
trainDetails: (state) => {
return state.trainDetails;
},
// trainDetails: (state) => {
// return state.trainDetails;
// },
flankProtectList: (state) => {
return state.flankProtectList;
},
mapDevice: (state) => {
return state.mapDevice;
},
// mapDevice: (state) => {
// return state.mapDevice;
// },
getDeviceByCode: (state) => (code) => {
return state.mapDevice[code];
},
@ -596,21 +595,21 @@ const map = {
return device;
},
// 查询所属车站关联的控制模式
getStationControlByStationCode: (state) => (code) => {
let device = null;
if (code &&
state.map &&
state.map.stationControlList && state.map.stationControlList.length) {
state.map.stationControlList.forEach(elem => {
if (elem.stationCode == code) {
device = state.mapDevice[elem.code];
}
});
}
// // 查询所属车站关联的控制模式
// getStationControlByStationCode: (state) => (code) => {
// let device = null;
// if (code &&
// state.map &&
// state.map.stationControlList && state.map.stationControlList.length) {
// state.map.stationControlList.forEach(elem => {
// if (elem.stationCode == code) {
// device = state.mapDevice[elem.code];
// }
// });
// }
return device;
},
// return device;
// },
// 查询所属车站的控制模式
getDeviceStationCodeByStationCode: (state) => (code) => {
@ -654,6 +653,7 @@ const map = {
},
mutations: {
// 设置地图数据
setMapData: (state, map) => {
if (map && map.skinVO) {
state.map = map;
@ -673,12 +673,15 @@ const map = {
state.mapDevice[elem.code] = deepAssign(state.mapDevice[elem.code] || {}, elem);
});
},
// 设置地图所属线路
setMapConfig: (state, config) => {
state.mapConfig = config;
},
// 获取包围框选中元素列表
setSeclectDeviceList: (state, list) => {
state.seclectDeviceList = list;
},
// 设置缩放位置
setDataZoom: (state, dataZoom) => {
state.dataZoom = dataZoom;
},
@ -784,6 +787,7 @@ const map = {
setMousemove: (state) => {
state.mousemove++;
},
// 设置进路数据
setRouteData: (state, routeDataList) => {
state.routeData = {};
state.routeStartSignalData = {};
@ -795,7 +799,7 @@ const map = {
state.routeStartSignalData[data.startSignalCode] = [data];
}
});
state.map.automaticRouteButtonList && state.map.automaticRouteButtonList.forEach(item => {
state.map && state.map.automaticRouteButtonList && state.map.automaticRouteButtonList.forEach(item => {
state.routeData[item.automaticRouteCode].automaticRouteCode = item.code;
});
state.routeList = routeDataList;
@ -812,7 +816,7 @@ const map = {
autoReentryList.forEach(data => {
state.autoReentryData[data.code] = data;
});
state.map.cycleButtonList && state.map.cycleButtonList.forEach(item => {
state.map && state.map.cycleButtonList && state.map.cycleButtonList.forEach(item => {
state.autoReentryData[item.cycleCode].cycleButtonCode = item.code;
});
state.autoReentryList = autoReentryList;
@ -830,11 +834,6 @@ const map = {
updateAutoReentryState: (state, status) => {
state.autoReentryData[status.code] = deepAssign(state.autoReentryData[status.code], status);
},
// updateTrainState:(state, status) =>{
// if (state.map.trainList) {
// state.map.trainList[parseInt(status.code) - 1] = deepAssign(state.map.trainList[parseInt(status.code) - 1] || {}, status);
// }
// },
updateStationStand: (state, status) => {
const holdIndex = state.holdStandList.indexOf(status.code);
const jumpIndex = state.jumpStandList.indexOf(status.code);
@ -870,6 +869,7 @@ const map = {
}
});
},
// 更新激活的列车信息
updateActiveTrainList: (state, data)=>{
let isExist = false;
state.activeTrainList.forEach(elem => {
@ -899,31 +899,12 @@ const map = {
},
actions: {
mapClear: ({ commit }) => {
setMapData:({ commit }, mapData) => {
commit('setMapData', mapData);
},
mapClear:({ commit }) => {
commit('mapClear');
},
// 获取包围框选中元素列表
setSeclectDeviceList: ({ commit }, list) => {
commit('setSeclectDeviceList', list);
},
// 设置缩放位置
updateZoom: ({ commit }, dataZoom) => {
commit('setDataZoom', dataZoom);
},
setMapData: ({ commit }, map) => { // 设置地图数据
commit('setMapData', map);
},
updateMapDevice: ({ commit }, list) => {
commit('updateMapDevice', list);
},
setMapConfig: ({ commit }, config) => { // 设置地图所属线路
commit('setMapConfig', config);
},
setRouteData: ({ commit }, routeData) => { // 设置进路数据
commit('setRouteData', routeData);
},
setOverlapData: ({ commit }, overlapData) => {
commit('setOverlapData', overlapData);
commit('mapRender', overlapData);
@ -940,9 +921,6 @@ const map = {
updateAutoReentryState: ({ commit }, status) => {
commit('updateAutoReentryState', status);
},
// updateTrainState:({ commit }, status) => {
// commit('updateTrainState', status);
// },
updateStationStand: ({ commit }, status) => {
commit('updateStationStand', status);
},
@ -970,11 +948,6 @@ const map = {
}
},
// 更新激活的列车信息
updateActiveTrainList:({ commit }, train) => {
commit('updateActiveTrainList', train);
},
setMapDataIdList: ({ state }, data) => {
state.mapIdList[`mapDate_${data.mapId}`] = data.mapData;
},

View File

@ -7,9 +7,9 @@ const order = {
orderList: [] // 选中的商品列表,
},
getters: {
orderList: (state)=>{
return state.orderList;
}
// orderList: (state)=>{
// return state.orderList;
// }
},
mutations: {
setOrderList: (state, orderList) => {

View File

@ -9,20 +9,20 @@ const runPlan = {
planLoadedCount: 0, // 运行图数据更新
planUpdateCount: 0, // 运行图更新标识
selected: {}, // 选择的对象
refreshCount: 0, // 刷新页面重新加载
width: 800, // 运行图canvas 容器 宽度
height: 600, // 运行图canvas 容器 高度
refreshCount: 0, // 刷新页面重新加载
width: 800, // 运行图canvas 容器 宽度
height: 600 // 运行图canvas 容器 高度
},
getters: {
stations: (state) => {
return state.stations || [];
},
planData: (state) => {
return state.planData || [];
}
},
planData: (state) => {
return state.planData || [];
}
},
mutations: {
setWidth: (state, width) => {
setWidth: (state, width) => {
state.width = width;
state.planSizeCount += 1;
},
@ -51,11 +51,11 @@ const runPlan = {
}
},
actions: {
/** 更新数据*/
updateRunPlanData: ({ commit }, data) => {
commit('updateRunPlanData', data);
},
/** 设置运行图大小*/
/** 更新数据*/
updateRunPlanData: ({ commit }, data) => {
commit('updateRunPlanData', data);
},
/** 设置运行图大小*/
resize({ commit }, opt) {
if (opt.width) {
commit('setWidth', opt.width);

View File

@ -3,29 +3,29 @@ import defaultSettings from '@/settings';
const { showSettings, fixedHeader, sidebarLogo } = defaultSettings;
const state = {
showSettings: showSettings,
fixedHeader: fixedHeader,
sidebarLogo: sidebarLogo
showSettings: showSettings,
fixedHeader: fixedHeader,
sidebarLogo: sidebarLogo
};
const mutations = {
CHANGE_SETTING: (state, { key, value }) => {
if (state.hasOwnProperty(key)) {
state[key] = value;
}
}
CHANGE_SETTING: (state, { key, value }) => {
if (state.hasOwnProperty(key)) {
state[key] = value;
}
}
};
const actions = {
changeSetting({ commit }, data) {
commit('CHANGE_SETTING', data);
}
changeSetting({ commit }, data) {
commit('CHANGE_SETTING', data);
}
};
export default {
namespaced: true,
state,
mutations,
actions
namespaced: true,
state,
mutations,
actions
};

View File

@ -138,6 +138,9 @@ function handle(state, data) {
case 'Simulation_Competition_Practice_Finish':
state.competitionPracticeFinish++;
break;
case 'Simulation_Alarm':
state.simulationAlarmInfo = msg;
break;
}
}
@ -240,7 +243,6 @@ const socket = {
simulationStart: '', // 仿真-开始消息
simulationOver:0, // 退出仿真推送消息
simulationReset: 0, // 仿真-异常消息
// coversitionList:{}, // 历史仿真-用户消息列表
inviteSimulationConversition: {}, // 仿真会话邀请消息
acceptConversionInvite:{}, // 仿真会话成员接收邀请
createConversition:{}, // 仿真创建会话
@ -274,7 +276,8 @@ const socket = {
roomInvite: {},
simulationTimeSync: '', // 仿真时间
simulationIbpStatus: null,
competitionPracticeFinish:0 // 竞赛场景结束标识
competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: {} // 仿真报警信息
},
getters: {
},

View File

@ -54,9 +54,6 @@ const training = {
order: (state) => {
return state.order;
},
offsetStationCode: (state) => {
return state.offsetStationCode;
},
basicInfo: (state) => {
return state.basicInfo;
},
@ -75,24 +72,9 @@ const training = {
usedTime: (state) => {
return state.usedTime;
},
tipEvent: (state) => {
return state.tipEvent;
},
initTime: (state) => {
return state.initTime;
},
prdType: (state) => {
return state.prdType;
},
roles: (state) => {
return state.roles;
},
memberList: (state) => {
return state.memberList;
},
simulationUserList: (state) => {
return state.simulationUserList;
},
// 视图中的列车列表
viewTrainList: (state) => () =>{
const trainList = [];
@ -104,21 +86,6 @@ const training = {
});
return trainList;
},
commonMenuStep: (state) => {
return state.commonMenuStep;
},
scriptQuitCount: (state) => {
return state.scriptQuitCount;
},
scriptOperationType: (state) => {
return state.scriptOperationType;
},
triggerFaultCount: (state) => {
return state.triggerFaultCount;
},
triggerFaultDevice: (state) => {
return state.triggerFaultDevice;
}
},

View File

@ -8,23 +8,23 @@ const trainingList = {
getters: {
trainingList: (state) => {
return state.trainingList;
},
prevTraining: (state) => () => {
if (state.trainingList && state.trainingList.length > 0) {
state.index = state.index - 1;
if (state.index >= 0) {
return state.trainingList[state.index];
}
}
},
nextTraining: (state) => () => {
if (state.trainingList && state.trainingList.length > 0) {
state.index = state.index + 1;
if (state.index < state.trainingList.length) {
return state.trainingList[state.index];
}
}
}
// prevTraining: (state) => () => {
// if (state.trainingList && state.trainingList.length > 0) {
// state.index = state.index - 1;
// if (state.index >= 0) {
// return state.trainingList[state.index];
// }
// }
// },
// nextTraining: (state) => () => {
// if (state.trainingList && state.trainingList.length > 0) {
// state.index = state.index + 1;
// if (state.index < state.trainingList.length) {
// return state.trainingList[state.index];
// }
// }
// }
},
mutations: {
setIndex: (state, index) => {
@ -39,20 +39,6 @@ const trainingList = {
}
},
actions: {
setIndex({ commit }, index) {
commit('setIndex', index);
},
setIndexByTrainingObj({ commit, state }, trainingId) {
let index = 0;
if (state.trainingList && state.trainingList.length) {
state.trainingList.forEach((elem, i) => {
if (elem.id === trainingId) {
index = i;
}
});
}
commit('setIndex', index);
},
setTrainingList({ commit }, trainingList) {
commit('setTrainingList', trainingList);
},

View File

@ -2,7 +2,8 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// 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.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.169:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛

View File

@ -1,6 +1,6 @@
import store from '@/store/index_APP_TARGET';
import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
import { getNewMapDataByGroup, getNewMapDataByMapId } from '@/api/simulation';
import { getPublishMapVersionById, getPublishMapDetailById, getNewMapDataByMapId} from '@/api/jmap/map';
import { getNewMapDataByGroup } from '@/api/simulation';
// 获取地图版本数据和store里面的map版本做比较如果不同
// 获取发布的地图数据
@ -68,6 +68,10 @@ export function covertData(resp, type, resolve) {
resolve();
});
});
} else if (type == 'mapId') {
store.dispatch('map/setMapData', mapData).then(() => {
resolve();
});
}
const routeData = resp.data.logicDataNew.routeList; // 设置进路数据
@ -77,12 +81,12 @@ export function covertData(resp, type, resolve) {
overlapData.forEach(item => {
item._type = 'OverAp';
});
store.dispatch('map/setRouteData', routeData);
store.commit('map/setRouteData', routeData);
store.dispatch('map/setOverlapData', overlapData);
store.dispatch('map/setAutoReentryData', autoReentryData);
store.dispatch('map/setSignalApproachSectionData', signalApproachSectionData);
const mapConfig = resp.data.configVO;
store.dispatch('map/setMapConfig', mapConfig);
store.commit('map/setMapConfig', mapConfig);
store.dispatch('map/setMapVersion', resp.data.version);
}

View File

@ -22,6 +22,34 @@
</template>
</div>
</template>
<template v-else-if="checkType(form, 'multi')">
<div v-for="(el,i) in options" :key="i" class="option" :label="$str2number(el.id)">
<span>{{ $asc2chart(i+65) }}. </span>
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
</div>
<div class="answer">
:
<template v-for="(el,i) in options">
<span v-if="el.correct" :key="i">{{ $asc2chart(i+65) }} </span>
</template>
</div>
</template>
<template v-else-if="checkType(form, 'fill')">
<div class="answer">
:
<template v-for="(el,i) in options">
<span v-if="el.correct" :key="i">{{ el.content }} </span>
</template>
</div>
</template>
<template v-else-if="checkType(form, 'answer')">
<div class="answer">
:
<template v-for="(el,i) in options">
<span v-if="el.correct" :key="i">{{ el.content }} </span>
</template>
</div>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="show = false">关闭</el-button>
</span>

View File

@ -10,6 +10,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
import { listQuestionPage, deleteQuestion } from '@/api/questionBank.js';
import DialogDetail from './dialog-detail';
import { convertSheetToList } from '@/utils/runPlan';
import { getCompanyList } from '@/api/company';
import XLSX from 'xlsx';
export default {
@ -18,6 +19,7 @@ export default {
},
data() {
return {
companyList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -25,7 +27,7 @@ export default {
queryForm: {
reset: true,
labelWidth: '80px',
leftSpan: 17,
leftSpan: 16,
queryObject: {
type: {
type: 'select',
@ -37,6 +39,13 @@ export default {
topic: {
type: 'text',
label: '题 目'
},
companyId: {
type: 'select',
label: '单位',
config: {
data: []
}
}
}
},
@ -99,7 +108,8 @@ export default {
actions: [
{ text: '添 加', handler: this.doCreate },
{ text: '导 入', fileType: 'file', handler: this.importQuestionBank },
{ text: '出题规则管理', handler: this.questionsRuleManage}
{ text: '出题规则管理', handler: this.questionsRuleManage},
{ text: '模板导出', handler: this.exportTemplate}
]
}
};
@ -109,6 +119,14 @@ export default {
return this.$store.state.user.id;
}
},
mounted() {
this.companyList = [];
getCompanyList().then(resp => {
resp.data.forEach(item => {
this.queryForm.queryObject.companyId.config.data.push({ value: item.id, label: item.name });
});
});
},
methods: {
doCreate() {
this.$router.push({path: `${UrlConfig.bank.questionCreate}`});
@ -178,100 +196,104 @@ export default {
'问答': 'answer'
};
if (file) {
setTimeout(() => {
const that = this;
const reader = new FileReader();
if (reader) {
reader.onload = function (e) {
let wb;
const data = e.target.result;
if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
const questionList = [];
if (wb && wb.Sheets) {
for (const index in wb.Sheets) {
const dataList = convertSheetToList(wb.Sheets[index], true);
let questionTypeIndex;
let topicIndex;
let option1Index;
let option2Index;
let option3Index;
let option4Index;
let answerIndex;
dataList.forEach((item, index) => {
if (item[0] === '题型') {
questionTypeIndex = index;
} else if (item[0] === '题目') {
topicIndex = index;
} else if ( item[0] === '选项' && item[1] === 'A') {
option1Index = index;
} else if (!item[0] && item[1] === 'B') {
option2Index = index;
} else if (!item[0] && item[1] === 'C') {
option3Index = index;
} else if (!item[0] && item[1] === 'D') {
option4Index = index;
} else if (item[0] === '答案') {
answerIndex = index;
}
try {
setTimeout(() => {
const that = this;
const reader = new FileReader();
if (reader) {
reader.onload = function (e) {
let wb;
const data = e.target.result;
if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64'
});
if (questionTypeIndex || questionTypeIndex === 0) {
dataList[questionTypeIndex].forEach((item, index) => {
if (item && item !== '题型') {
const param = {
type: questionTypeMap[item],
topic: dataList[topicIndex][index],
optionList: []
};
if (param.type === 'fill') {
const answer = dataList[answerIndex][index];
const answerList = answer.split('&&');
answerList && answerList.forEach(item => {
param.optionList.push({content: item, correct: true});
});
} else if (param.type === 'answer') {
param.optionList.push({content: dataList[answerIndex][index]});
} else {
param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' });
param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' });
if (dataList[option3Index][index]) {
param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')});
}
if (dataList[option4Index][index]) {
param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')});
}
}
questionList.push(param);
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
const questionList = [];
if (wb && wb.Sheets) {
for (const index in wb.Sheets) {
const dataList = convertSheetToList(wb.Sheets[index], true);
let questionTypeIndex;
let topicIndex;
let option1Index;
let option2Index;
let option3Index;
let option4Index;
let answerIndex;
dataList.forEach((item, index) => {
if (item[0] === '题型') {
questionTypeIndex = index;
} else if (item[0] === '题目') {
topicIndex = index;
} else if ( item[0] === '选项' && item[1] === 'A') {
option1Index = index;
} else if (!item[0] && item[1] === 'B') {
option2Index = index;
} else if (!item[0] && item[1] === 'C') {
option3Index = index;
} else if (!item[0] && item[1] === 'D') {
option4Index = index;
} else if (item[0] === '答案') {
answerIndex = index;
}
});
if (questionTypeIndex || questionTypeIndex === 0) {
dataList[questionTypeIndex].forEach((item, index) => {
if (item && item !== '题型') {
const param = {
type: questionTypeMap[item],
topic: dataList[topicIndex][index],
optionList: []
};
if (param.type === 'fill') {
const answer = dataList[answerIndex][index];
const answerList = answer.split('&&');
answerList && answerList.forEach(item => {
param.optionList.push({content: item, correct: true});
});
} else if (param.type === 'answer') {
param.optionList.push({content: dataList[answerIndex][index]});
} else {
param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' });
param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' });
if (dataList[option3Index][index]) {
param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')});
}
if (dataList[option4Index][index]) {
param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')});
}
}
questionList.push(param);
}
});
}
}
that.$store.dispatch('race/setPreTheoryData', questionList).then(() => {
that.$router.push({ path: `/system/preTheoryImport`});
}).catch((e) => {
that.$message.error('导入题库失败!');
});
// importQuestionBand(questionList, 'DRTS').then(resp => {
// this.$message.success('!');
// }).catch(()=>{
// this.$message.error('');
// });
}
that.$store.dispatch('race/setPreTheoryData', questionList).then(() => {
that.$router.push({ path: `/system/preTheoryImport`});
}).catch((e) => {
that.$message.error('导入题库失败!');
});
// importQuestionBand(questionList, 'DRTS').then(resp => {
// this.$message.success('!');
// }).catch(()=>{
// this.$message.error('');
// });
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
}
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
}
}
}, 200);
}, 200);
} catch (e) {
this.$message.error('请根据下载模板导入题目!');
}
}
},
importQuestionBank() {
@ -282,6 +304,53 @@ export default {
},
questionsRuleManage() {
this.$router.push({ path: `/system/questionsRuleManage`});
},
exportTemplate() {
const wb = XLSX.utils.book_new();
const data1 = [{A: '序号', B: '题型', C:'题目', D:'选项', E: '', F: '', G: '', H: '答案'}];
const data2 = [{A: '', B: '', C:'', D:'A', E: 'B', F: 'C', G: 'D', H: ''}];
const data3 = [{A: '1', B: '判断', C:'题目一', D:'', E: '', F: '', G: '', H: '√'}];
const data4 = [{A: '2', B: '判断', C:'题目二', D:'', E: '', F: '', G: '', H: '×'}];
const data5 = [{A: '3', B: '单选', C:'题目三', D:'选项A', E: '选项B', F: '选项C', G: '选项D', H: 'A'}];
const data6 = [{A: '4', B: '多选', C:'题目四', D:'选项A', E: '选项B', F: '选项C', G: '选项D', H: 'ABCD'}];
const data7 = [{A: '5', B: '填空', C:'题目五', D:'', E: '', F: '', G: '', H: '第一空答案&&第二空答案&&第三空答案'}];
const data8 = [{A: '6', B: '问答', C:'题目六', D:'', E: '', F: '', G: '', H: '问答题答案'}];
const data = [...data1, ...data2, ...data3, ...data4, ...data5, ...data6, ...data7, ...data8];
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
ws['!merges'] = [
{
s: {c: 3, r: 0},
e: {c: 6, r: 0}
},
{
s: {c: 0, r: 0},
e: {c: 0, r: 1}
},
{
s: {c: 1, r: 0},
e: {c: 1, r: 1}
},
{
s: {c: 2, r: 0},
e: {c: 2, r: 1}
},
{
s: {c: 7, r: 0},
e: {c: 7, r: 1}
}
];
ws['!cols'] = [
{width: 10},
{width: 10},
{width: 50},
{width: 15},
{width: 15},
{width: 15},
{width: 15},
{width: 15}
];
XLSX.utils.book_append_sheet(wb, ws, 'file');
XLSX.writeFile(wb, '题库模板' + '.xlsx');
}
}
};

View File

@ -18,8 +18,16 @@
</template>
<template v-if="type==='fill'">
<div v-for="(el, i) in answerList" :key="i" style="margin-bottom: 5px;">
<div>{{ `${i + 1}` }}</div>
<item-rich v-model="el.value" :remove="i>0" @modify="doModify(el)" @remove="doRemove(i)" />
<div style="display: inline-block;margin-right: 10px;height: 40px; line-height: 40px;">{{ `${i + 1}` }}</div>
<el-input
v-model="answerList[i]"
style="display: inline-block;width: calc(100% - 100px);"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4}"
placeholder="请输入答案"
@change="onChange"
/>
<el-button v-if="i>0" class="item__button" type="danger" size="mini" icon="el-icon-delete" circle @click="doRemove(i)" />
</div>
<el-button class="item__button" type="primary" size="mini" icon="el-icon-plus" @click="doAppend" />
</template>
@ -36,11 +44,7 @@
</template>
<script>
import ItemRich from './item-rich';
export default {
components: {
ItemRich
},
props: {
optionList: {
type: Array,
@ -56,36 +60,43 @@ export default {
active: 0,
activeList: [],
answer: '',
answerList: [{value: ''}]
answerList: ['']
};
},
watch: {
optionList(val) {
if (this.type === 'judge' || this.type === 'select') {
this.active = this.optionList.findIndex(ele => ele.correct);
} else if (this.type === 'multi') {
this.activeList = [];
this.optionList.forEach((el, i) => {
if (el.correct) {
this.activeList.push(i);
}
});
} else if (this.type === 'fill') {
this.answerList = [];
this.optionList.forEach(el => {
this.answerList.push({value: el.content});
});
} else if (this.type === 'answer') {
this.answer = (this.optionList[0] || {content: ''}).content;
optionList: {
deep:true,
handler:function(newV, oldV) {
if (this.type === 'judge' || this.type === 'select') {
this.active = this.optionList.findIndex(ele => ele.correct);
} else if (this.type === 'multi') {
this.activeList = [];
this.optionList.forEach((el, i) => {
if (el.correct) {
this.activeList.push(i);
}
});
} else if (this.type === 'fill') {
this.answerList = [];
this.optionList.forEach(el => {
this.answerList.push(el.content);
});
} else if (this.type === 'answer') {
this.answer = (this.optionList[0] || {content: ''}).content;
}
}
}
},
methods: {
onChange(e) {
this.$emit('change', e);
if (this.type === 'fill') {
this.$emit('change', this.answerList);
} else {
this.$emit('change', e);
}
},
doAppend() {
this.answerList.push({value: ''});
this.answerList.push('');
},
doModify(el) {
this.$emit('modify', {model: el, prop: 'value'});

View File

@ -1,16 +1,24 @@
<template>
<div style="text-align: center;padding: 10px;">
<div style="text-align: right;margin-top: 10px;margin-bottom: 10px;">
<el-button
size="mini"
type="primary"
@click="doSave"
>保存</el-button>
<el-button
size="mini"
type="danger"
@click="doCancel"
>取消</el-button>
<div style="margin-top: 10px;margin-bottom: 10px;display: flex;justify-content: space-between;">
<div style="display: inline-block;font-size: 14px;">
<span>单位</span>
<el-select v-model="companyId" placeholder="请选择单位" clearable size="mini" style="margin-left: 10px;">
<el-option v-for="it in companyList" :key="it.id" :label="it.name" :value="it.id" />
</el-select>
</div>
<div style="display: inline-block;">
<el-button
size="mini"
type="primary"
@click="doSave"
>保存</el-button>
<el-button
size="mini"
type="danger"
@click="doCancel"
>取消</el-button>
</div>
</div>
<el-table
:data="tableData"
@ -66,13 +74,16 @@
<script>
import { UrlConfig } from '@/scripts/ConstDic';
import { importQuestionBand } from '@/api/race';
import { getCompanyList } from '@/api/company';
export default {
data() {
return {
currentPage: 1,
tableData: [],
pageSize: 10
pageSize: 10,
companyId: null,
companyList: []
};
},
computed: {
@ -85,10 +96,14 @@ export default {
},
mounted() {
this.handlePreDataPaging();
getCompanyList().then(resp => {
this.companyList = resp.data;
});
},
methods: {
edit(index, row) {
this.$router.push({path: `${UrlConfig.bank.questionUpdate}/${index}`, query:{ draft: true }});
const number = (this.currentPage - 1) * this.pageSize + index;
this.$router.push({path: `${UrlConfig.bank.questionUpdate}/${number}`, query:{ draft: true }});
},
handlePreDataPaging() {
const preData = this.$store.state.race.preTheoryData;
@ -151,7 +166,7 @@ export default {
this.handlePreDataPaging();
},
doSave() {
importQuestionBand(this.$store.state.race.preTheoryData).then(resp => {
importQuestionBand(this.$store.state.race.preTheoryData, this.companyId).then(resp => {
this.$store.dispatch('race/setPreTheoryData', []);
this.$message.success('导入题库成功!');
this.$router.go(-1);

View File

@ -2,7 +2,7 @@
<div class="page">
<div class="page__container">
<el-card class="page__container-body">
<question-form ref="info" :option="formModel" :remove="true" @modify="doModify" />
<question-form ref="info" :option="formModel" :remove="true" @modify="doModify" @companyIdChange="companyIdChange" />
</el-card>
<div class="page__container-footer">
<el-button type="primary" :is-create="true" @click="create"> </el-button>
@ -33,7 +33,8 @@ export default {
type: 'select',
answer: 0,
optionList: []
}
},
companyId: null
};
},
computed: {
@ -58,9 +59,13 @@ export default {
doModify(node) {
this.$refs.rich.doShow(node);
},
companyIdChange(value) {
this.companyId = value;
},
create() {
this.$refs.info.validate().then(valid => {
if (valid) {
this.formModel.companyId = parseInt(this.companyId);
createQuestion(this.formModel).then(resp => {
authUtils.setSessionStorage(this.path, JSON.stringify({
type: this.formModel.type

View File

@ -1,6 +1,11 @@
<template>
<div>
<el-form ref="form" :model="option" :rules="rules" label-width="80px">
<el-form-item v-if="!$route.query.draft && !isProject" label="单 位" prop="companyId">
<el-select v-model="companyId" placeholder="请选择单位" clearable @change="companyIdChange">
<el-option v-for="it in companyList" :key="it.id" :label="it.name" :value="it.id" />
</el-select>
</el-form-item>
<el-form-item label="类 型" prop="type">
<el-select v-model="option.type" :disabled="update" placeholder="请选择试题类型" @change="onTypeChnage">
<el-option v-for="it in QuestionTypeList" :key="it.value" :label="it.label" :value="it.value" />
@ -14,7 +19,7 @@
<item-options :option-list="optionList" :type="option.type" :add="isSelect" :remove="remove" @remove="onRemove" @modify="onModify" @append="onAppend" />
</el-form-item>
<el-form-item label="答 案" prop="answer">
<item-answer :option-list="optionList" :type="option.type" @change="onAnswerChnage" @modify="onModify" />
<item-answer refs="itemAnswer" :option-list="optionList" :type="option.type" @change="onAnswerChnage" @modify="onModify" />
</el-form-item>
</template>
</el-form>
@ -25,6 +30,8 @@
import ItemRich from './item-rich';
import ItemOptions from './item-options';
import ItemAnswer from './item-answer';
import { getCompanyList } from '@/api/company';
import { getSessionStorage } from '@/utils/auth';
export default {
components: {
@ -52,12 +59,18 @@ export default {
},
data() {
return {
companyList: [],
companyId: null
};
},
computed: {
isSelect() {
return this.remove && this.option.type == 'select';
},
isProject() {
const project = getSessionStorage('project');
return project !== 'login' && project !== 'design';
},
templateMap() {
return {
select: function() {
@ -106,6 +119,9 @@ export default {
},
mounted() {
this.onTypeChnage(this.option.type);
getCompanyList().then(resp => {
this.companyList = resp.data;
});
},
methods: {
validate() {
@ -115,6 +131,9 @@ export default {
});
});
},
companyIdChange(e) {
this.$emit('companyIdChange', e);
},
onTypeChnage(type) {
if (this.templateMap[type] && !this.update) {
this.option.optionList = this.templateMap[type]();
@ -126,12 +145,19 @@ export default {
} else if (this.option.type === 'multi') {
this.option.optionList.forEach((el, i) => { el.correct = answer.includes(i); });
} else if (this.option.type === 'fill') {
this.option.optionList = [];
answer.forEach(item => {
this.option.optionList.push({ content: item.value, correct: true });
answer.forEach((item, index) => {
if (this.option.optionList[index]) {
this.option.optionList[index].content = item;
} else {
this.option.optionList[index] = { content: item, correct: true };
}
});
} else if (this.option.type === 'answer') {
this.option.optionList = [{content: answer, correct:true}];
if (this.option.optionList[0]) {
this.option.optionList[0].content = answer;
} else {
this.option.optionList[0] = [{content: answer, correct:true}];
}
}
},
onModify(node) {

View File

@ -2,7 +2,7 @@
<div class="page">
<div class="page__container">
<el-card class="page__container-body">
<question-form ref="info" :option="formModel" :remove="true" :update="true" @modify="doModify" />
<question-form ref="info" :option="formModel" :remove="true" :update="true" @modify="doModify" @companyIdChange="companyIdChange" />
</el-card>
</div>
<div class="page__container-footer">
@ -17,6 +17,7 @@
import QuestionForm from './question-form.vue';
import DialogModifyRich from './dialog-modify-rich';
import { getQuestionInfo, updateOption } from '@/api/questionBank.js';
import { deepAssign } from '@/utils/index';
export default {
components: {
@ -51,8 +52,10 @@ export default {
methods: {
loadInitData() {
if (this.$route.query.draft) {
this.formModel = this.$store.state.race.preTheoryData[this.questionId];
this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
setTimeout(() => {
this.formModel = deepAssign({}, this.$store.state.race.preTheoryData[this.questionId]);
this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
}, 500);
} else {
getQuestionInfo(this.questionId).then(resp => {
this.formModel = resp.data;
@ -63,6 +66,9 @@ export default {
doBack() {
this.$router.go(-1);
},
companyIdChange(value) {
this.companyId = value;
},
doModify(node) {
this.$refs.rich.doShow(node);
},
@ -72,6 +78,7 @@ export default {
this.$store.state.race.preTheoryData[this.questionId] = this.formModel;
this.doBack();
} else if (valid) {
this.formModel.companyId = parseInt(this.companyId);
updateOption(this.formModel).then(resp => {
this.doBack();
}).catch(error => {

View File

@ -9,7 +9,7 @@
</template>
<script>
import { publisMapCityList} from '@/api/designPlatform';
import { publisMapCityList} from '@/api/jmap/map';
import localStore from 'storejs';

View File

@ -0,0 +1,152 @@
<template>
<el-dialog v-dialogDrag title="场景导入" :visible.sync="dialogShow" width="360px" :before-close="handleClose" custom-class="importClass">
<div>
<div v-show="!formDisplay" class="eachButton uploadDemo">
<i class="el-icon-plus avatar-uploader-icon el-icon-other" />
<input ref="files" type="file" class="file_box" accept=".json, application/json" @change="importf">
</div>
<el-form v-show="formDisplay" ref="form" label-position="right" :model="editModel" label-width="100px" size="mini" @submit.native.prevent>
<el-form-item label="请选择剧本" prop="scriptId">
<el-select v-model="editModel.scriptId">
<el-option v-for="item in scriptList" :key="item.code" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<div style="margin-left:18px;color:red;font-size:13px;">{{ validateText }}</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="importScene">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { postSceneImport } from '@/api/competition';
export default {
name:'ImportScene',
props: {
scriptList:{
type: Array,
default() {
return [];
}
}
},
data() {
return {
formDisplay:false,
dialogShow: false,
loading: false,
jsonData:null,
validateText:'',
editModel: {
scriptId: ''
}
};
},
methods:{
close() {
this.$refs.form.resetFields();
this.formDisplay = false;
this.editModel.scriptId = '';
this.jsonData = null;
this.dialogShow = false;
this.validateText = '';
},
handleClose() {
this.close();
},
doShow() {
this.validateText = '';
this.dialogShow = true;
},
importf() {
const that = this;
setTimeout(() => {
const obj = this.$refs.files;
if (!obj.files) return;
const f = obj.files[0];
if (f.type != 'application/json') {
this.$message.error('请上传json格式的文件');
return;
}
const reader = new FileReader();
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
that.formDisplay = true;
const json = JSON.parse(data);
that.jsonData = json;
obj.value = '';
that.validateText = '';
};
});
},
importScene() {
if (!this.jsonData) {
this.validateText = '请选择文件';
return false;
} else if (!this.editModel.scriptId) {
this.validateText = '请选择剧本';
return false;
}
const loading = this.$loading({
lock: true,
text: '正在导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const that = this;
that.loading = true;
this.dialogShow = false;
this.validateText = '';
postSceneImport(this.editModel.scriptId, this.jsonData).then(res => {
loading.close();
that.loading = false;
that.$message.success('导入成功!');
this.$emit('refresh');
// loading.close();
this.close();
}).catch(error => {
loading.close();
that.loading = false;
this.close();
that.$message.error('导入失败' + error.message);
});
}
}
};
</script>
<style lang="scss" scoped>
.eachButton{
margin-left:10px;
width:100px;
height:100px;
border:1px #ccc dashed;
margin-bottom: 10px;
}
.el-icon-other{
width: 100%;
text-align: center;
height: 100%;
line-height: 72px;
font-size: 16px;
}
.uploadDemo {
position: relative;
overflow: hidden;
// float: right;
padding: 9px 15px;
margin-right: 3px;
cursor: pointer;
input {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
}
}
</style>

View File

@ -4,19 +4,21 @@
<create-scene ref="createScene" title="创建场景" :script-list="scriptList" @reloadTable="reloadTable" />
<create-scene ref="updateScene" title="更新场景" :script-list="scriptList" @reloadTable="reloadTable" />
<modify-step ref="modifyStep" title="编辑步骤数据" />
<!-- <update-scene ref="modifyScene" :script-list="scriptList" @reloadTable="reloadTable" /> -->
<import-scene ref="importScene" :script-list="scriptList" @refresh="reloadTable" />
</div>
</template>
<script>
import { getCompetitionPracticalScene, deleteCompetitionPracticalScene } from '@/api/competition';
import { getCompetitionPracticalScene, deleteCompetitionPracticalScene, getSceneExport } from '@/api/competition';
import { getScriptPageListOnlineNew } from '@/api/script';
import CreateScene from './create';
import ModifyStep from './modify';
import ImportScene from './importScene';
export default {
name:'SceneManage',
components:{
CreateScene,
ModifyStep
ModifyStep,
ImportScene
},
data() {
return {
@ -84,12 +86,18 @@ export default {
name: '删 除',
handleClick: this.doDelete,
type: 'danger'
},
{
name: '导 出',
handleClick: this.doExport,
type: 'primary'
}
]
}
],
actions: [
{ text: '添 加', handler: this.doCreate }
{ text: '添 加', handler: this.doCreate },
{ text: '导 入', handler: this.doImport }
]
}
};
@ -122,6 +130,9 @@ export default {
doCreate() {
this.$refs.createScene.doShow(null);
},
doImport() {
this.$refs.importScene.doShow();
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
@ -129,6 +140,22 @@ export default {
},
doModify(index, row) {
this.$refs.modifyStep.doShow(row);
},
doExport(index, row) {
getSceneExport(row.id).then(res=>{
const resultData = res.data;
if (resultData === false) {
return;
}
const content = new Blob([JSON.stringify(resultData)]);
const urlObject = window.URL || window.webkitURL || window;
const url = urlObject.createObjectURL(content);
const el = document.createElement('a');
el.href = url;
el.download = `${resultData.name}.json`;
el.click();
urlObject.revokeObjectURL(url);
});
}
}
};

View File

@ -13,10 +13,7 @@ import {getIscsData} from '@/api/iscs';
// import {getIscsData} from '@/iscs/constant/iscsData';
import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat';
import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
// import { handlerIscsEvent } from '@/api/simulation';
// import { IscsOperation } from '@/scripts/ConstDic';
import { deepAssign } from '@/utils/index';
import { getUID } from '@/iscs/utils/Uid';
@ -100,7 +97,6 @@ export default {
this.iscsDestroy();
this.loading = true;
// const data = parser(getIscsData(mode, system, part), {width: this.canvasWidth, height: this.canvasHeight});
this.$iscs = new Iscs({
dom: document.getElementById(this.iscsId),
config: {

View File

@ -5,7 +5,7 @@
<el-input v-model="operateModel.name" style="width: 300px" />
</el-form-item>
<el-form-item :label="this.$t('lesson.mapName') + ':'" prop="mapId">
<el-select v-model="operateModel.mapId" style="width: 300px" :disabled="this.disable">
<el-select v-model="operateModel.mapId" style="width: 300px" :disabled="disable">
<el-option
v-for="option in mapIdList"
:key="option.code"
@ -65,7 +65,7 @@
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { addAutoTraining, updateAutoTraining, deleteAutoTraining, addTraining, addAutoTrainingNew, updateAutoTrainingNew, deleteAutoTrainingNew, addTrainingNew } from '@/api/jmap/training';
import { addAutoTrainingNew, updateAutoTrainingNew, deleteAutoTrainingNew, addTrainingNew } from '@/api/jmap/training';
import { getOperateTrainingList } from '@/api/management/operation';
export default {

View File

@ -59,7 +59,7 @@
</el-table>
<div class="OSTSignInfo">
<span>运营指标信息</span>
<span style="margin-left:10px;">{{ '(得分: '+fullScoreOfOperationIndex+' / 满分: '+ userScoreOfOperationIndex+')' }}</span>
<span style="margin-left:10px;">{{ '(得分: '+userScoreOfOperationIndex+' / 满分: '+fullScoreOfOperationIndex+')' }}</span>
</div>
<div class="OSTSignInfoTips">
<span class="el-icon-info" style="font-size: 16px;" /> 若竞赛未完成运营指标不得分

View File

@ -287,7 +287,7 @@ export default {
},
submitConfirmExam(submitData) {
this.loading = true;
submitPracticeQuestionData('drts', {mode:'02', theoryAnswers:submitData}).then(res=>{
submitPracticeQuestionData('DRTS', {mode:'02', theoryAnswers:submitData}).then(res=>{
this.loading = false;
this.isResult = true;
this.$message.success('提交成功');
@ -369,7 +369,7 @@ export default {
}
}
this.isSelect = true;
updatePracticeQuestionProgress('drts', {index:this.currentQuestionNum}).then(res=>{
updatePracticeQuestionProgress('DRTS', {index:this.currentQuestionNum}).then(res=>{
}).catch(error=>{
console.log(error.message);
});

View File

@ -43,7 +43,7 @@ import FaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { mapGetters } from 'vuex';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform';
import { loadDraftScriptNew } from '@/api/designPlatform';
import Vue from 'vue';
import ConstConfig from '@/scripts/ConstConfig';

View File

@ -84,7 +84,6 @@ export default {
computed: {
...mapGetters('training', [
'mode'
// 'offsetStationCode'
]),
canvasId() {
const canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
@ -377,7 +376,7 @@ export default {
offsetX: this.dataZoom.offsetX,
lineCode: lineCode
};
this.$store.dispatch('map/updateZoom', this.dataZoom);
this.$store.commit('map/setDataZoom', this.dataZoom);
localStore.set(`scaleRate_${lineCode}`, JSON.stringify(param)); //
}

View File

@ -154,7 +154,7 @@ export default {
},
clearList() { //
this.stationCode = '';
this.$store.dispatch('map/setSeclectDeviceList', []);
this.$store.commit('map/setSeclectDeviceList', []);
this.seclectDeviceList = [];
this.modelList = [
{

View File

@ -0,0 +1,138 @@
<template>
<div class="drawer" :class="{visible}" tabindex="-1">
<div class="drawer__wrapper" tabindex="-1" @click="doClose">
<div class="layer" :class="[direction]" :style="{width: width+'px'}" tabindex="-1">
<div class="title">
<span>
<slot name="title" />
</span>
<i class="el-icon-close" @click.stop="doClose" />
</div>
<div class="container">
<slot />
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
direction: {
type: String,
default: 'ltr'
},
title: {
type: String,
default: ''
},
width: {
type: Number,
default: 360
},
visible: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
methods: {
doClose() {
this.$emit('before-close');
}
}
}
</script>
<style lang="scss" scoped>
.visible {
visibility: visible !important;
.ltr {
transform: translateX(0) !important;
}
}
.ltr {
transition: all .3s cubic-bezier(.7, .3, .1, 1);
position: absolute;
height: 100%;
top: 0;
left: 0;
transform: translateX(-100%);
}
.drawer {
position: fixed;
z-index: 2001;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
margin: 0;
visibility: hidden;
&__wrapper {
position: relative;
left: 0;
right: 0;
top: 0;
bottom: 0;
height: 100%;
width: 100%;
background: rgba(0,0,0,0.5);
.layer {
background: #fff;
border: 1px solid #eee;
box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
overflow: hidden;
position: relative;
.title {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
width: 100%;
padding: 0 10px;
height: 40px;
background: rgba(240,240, 240, 0.4);
i {
cursor: pointer;
padding: 3px;
}
}
.container {
overflow-y: auto;
width: 100%;
height: calc(100% - 40px);
&::-webkit-scrollbar {
width: 5px;
height: 5px;
}
&::-webkit-scrollbar-track {
background: rgb(239, 239, 239);
border-radius: 2px;
}
&::-webkit-scrollbar-thumb {
background: #bfbfbf;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb:hover {
background: #666;
}
&::-webkit-scrollbar-corner {
background: #fff;
}
}
}
}
}
</style>

View File

@ -0,0 +1,56 @@
<template>
<el-dialog v-dialogDrag append-to-body title="Create Run Plan" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
<el-form ref="form" label-width="100px" :model="formModel" :rules="rules">
<el-form-item label="Name" prop="name">
<el-input v-model="formModel.name" placeholder="Please Input Run Plan Name." />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" @click="doConfirm">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { MenuEnum } from '../utils.js';
export default {
data() {
return {
dialogShow: false,
formModel: {
name: '',
},
rules: {
name: [
{
required: true, message: 'Please Input Run Plan Name.', trigger: 'blur'
}
]
}
};
},
watch: {
selected: function(val) {
}
},
methods: {
doShow() {
this.formModel.name = '';
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
},
doConfirm() {
this.$refs.form.validate((valid) => {
if(valid) {
this.$emit('createPlan', this.formModel);
this.doClose();
}
});
}
}
};
</script>

View File

@ -0,0 +1,268 @@
<template>
<el-dialog title="Export" fullscreen append-to-body :visible.sync="show" :before-close="doClose">
<div class="export">
<div :id="canvasId" />
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="doClose"> </el-button>
<el-button type="primary" @click="doExport"> </el-button>
</span>
</el-dialog>
</template>
<script>
import * as utils from '../utils'
import echarts from 'echarts';
import { timeFormat } from '@/utils/date';
export default {
props: {
planUtil: {
type: Object,
required: true
},
width: {
type: Number,
default: 5000,
},
height: {
type: Number,
default: 800
},
title: {
type: String,
default: ''
},
canvasId: {
type: String,
default: 'canvas-export'
}
},
data() {
return {
myChart: null,
planData: {},
show: false
}
},
computed: {
option() {
return {
title: {
text: this.title,
left: 'center',
top: '10px'
},
grid: {
top: '60px',
left: '160px',
right: '100px',
bottom: '60px',
containLabel: true,
backgroundColor: 'floralwhite'
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
formatter: (value, index) => { return timeFormat(value); },
textStyle: {
color: '#333'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
inside: true,
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
show:true,
inside:true,
formatter: (value, index) => { return '' }
},
minInterval: 0.1,
maxInterval: 1,
min: 0,
max: 0
},
graphic: [{
id: 'shape',
elements: []
}],
series: [],
dataZoom: [
{
show: false,
fiterMode: 'filter',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}
]
}
}
},
methods: {
loadInitChart() {
return new Promise((resolve, reject) => {
try {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.clear();
}
this.myChart = echarts.init(document.getElementById(this.canvasId));
this.myChart.setOption(this.option, {notMerge: true});
this.reSize({ width: this.width, height: this.height });
resolve(true);
} catch (error) {
reject(error);
}
});
},
loadChartPage(stations) {
try {
if (this.myChart) {
this.stations = stations;
this.xAxisInit(stations);
this.yAxisInit(stations);
this.myChart.setOption(this.option, {notMerge: true});
}
} catch (error) {
this.$message.info(error.message);
}
},
loadChartData(planData) {
try {
const option = this.myChart.getOption();
option.title.text = this.title;
option.series = [];
option.graphic[0].elements = [];
this.planData = planData;
this.pushModels(option.series, [this.planUtil.initializeYaxis(this.stations)]);
this.pushModels(option.series, this.planUtil.parseDataToSeries(this.myChart, planData, this.stations));
this.pushModels(option.graphic[0].elements, this.planUtil.parseDataToGraph(this.myChart, planData, this.stations));
this.myChart.setOption(option, {notMerge: true});
} catch (error) {
this.$messageBox(error.message);
}
},
xAxisInit(stations) {
const option = this.option;
const list = [];
for (var time = 0 + this.planUtil.TranslationTime; time <= 3600 * 24 + this.planUtil.TranslationTime; time++) {
list.push(time);
}
option.xAxis[0].data = list;
option.dataZoom[0].startValue = 0 + this.planUtil.TranslationTime;
option.dataZoom[0].endValue = 3600 * 24 + this.planUtil.TranslationTime;
},
yAxisInit(stations) {
const option = this.option;
if (Object.keys(this.planUtil).length) {
this.pushModels(option.series, [this.planUtil.initializeYaxis(stations)]);
option.yAxis.min = this.planUtil.computedYaxisMinValue(stations);
option.yAxis.max = this.planUtil.computedYaxisMaxValue(stations);
}
},
reSize({width, height}) {
if (this.myChart) {
this.myChart.resize({ width, height, silent: false });
}
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose();
this.myChart = null;
}
},
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;
},
doShow(stations, planData) {
this.show = true;
this.$nextTick(() => {
this.loadInitChart().then(resp => {
this.loadChartPage(stations);
this.loadChartData(planData);
});
})
},
doClose() {
this.show = false;
this.destroy();
},
doExport() {
const urlObject = window.URL || window.webkitURL || window;
const export_blob = utils.dataURItoBlob(this.myChart.getDataURL({
pixelRatio: 2,
backgroundColor: '#fff'
}), 'png');
const save_link = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
save_link.href = urlObject.createObjectURL(export_blob);
save_link.download = 'plan.png';
save_link.click();
}
}
}
</script>
<style lang="scss" scoped>
.export {
width: 100%;
overflow-y: auto;
background: #fff;
}
</style>

View File

@ -0,0 +1,135 @@
<template>
<div class="line">
<el-menu class="menus" default-active="2-1" :collapse="true">
<el-submenu index="2">
<template slot="title">
<i class="el-icon-document" />
</template>
<el-menu-item-group>
<span slot="title">Line List</span>
<el-tree :data="lineList" :props="defaultProps" @node-click="onSelectLine">
<template slot-scope="{data}">
<span class="flex" >
<span><i class="el-icon-document"/>&ensp;{{data.name}}</span>
<el-button
type="text"
style="color:red"
size="mini"
@click="doDeletePlan(data)">
Delete
</el-button>
</span>
</template>
</el-tree>
</el-menu-item-group>
</el-submenu>
</el-menu>
<div class="container">
<div class="title">
<span>title</span>
</div>
<div class="form">
11111111111
</div>
</div>
</div>
</template>
<script>
import Drawer from '../components/drawer.vue';
export default {
components: {
Drawer
},
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
lineList: [
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
{name: '1', id: 1},
{name: '2', id: 2},
]
}
},
methods: {
onSelectLine(el) {
}
}
}
</script>
<style lang="scss" scoped>
.line {
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
.menus {
height: 100%;
}
.container {
flex: 1;
.title {
width: 100%;
height: 32px;
font-size: 26px;
padding: 7px;
background: rgba(240,240,240,0.3);
display: flex;
justify-content: center;
align-items: center;
}
.form {
padding: 30px;
width: 50%;
margin: auto;
}
}
}
</style>

View File

@ -19,8 +19,10 @@
<template slot="header">
<div class="header">
<div class="menus-left">
<el-button type="primary" @click="doNewPlan">New</el-button>
<el-button type="primary" @click="onDialog(MenuEnum.planSetParams)">Set Param</el-button>
<el-button type="primary" @click="drawer=true">Open</el-button>
<el-button type="primary" @click="doNewPlan">New</el-button>
<el-button type="primary" :disabled="disabled" @click="onDialog(MenuEnum.planSetParams)">Set Param</el-button>
<el-button type="primary" @click="doExport" :disabled="disabled"> Export </el-button>
</div>
<div class="menus-right">
<span style="font-size:22px;padding:0 17px;">Plan</span>
@ -28,6 +30,7 @@
:model="model"
:selected="selected"
:target="target"
:disabled="disabled"
@remove="onRemove"
@clear="onClear"
/>
@ -35,33 +38,58 @@
</div>
</template>
</schedule>
<drawer :visible.sync="drawer" @before-close="e => drawer=false">
<template slot="title">Run Plan List</template>
<el-tree style="padding-right: 20px" :data="planList" :props="defaultProps" @node-click="onSelectPlan">
<template slot-scope="{data}">
<span class="flex" >
<span><i class="el-icon-document"/>&ensp;{{data.name}}</span>
<el-button
type="text"
style="color:red"
size="mini"
@click="doDeletePlan(data)">
Delete
</el-button>
</span>
</template>
</el-tree>
</drawer>
<plan-just-running :config="config" :selected="selected" :stations="stations" @justRunning="doJustRunning" />
<plan-just-stop :config="config" :selected="selected" @justStop="doJustStop"/>
<plan-just-turnback :config="config" :selected="selected" @justTurnBack="doJustTurnback"/>
<plan-set-params :config="config" @setParams="doSetPlanParams" />
<plan-create ref="create" @createPlan="doCreatePlan" />
<plan-export ref="export" :planUtil="planUtil" :title="title" :width="3600*2+2050" :height="height-160" />
<div class="fixed" v-show="show">
<textarea :auto-focus="true" v-if="textareaModel.show" v-focus v-model="textareaModel.text" class="fixed-textarea"
:style="{ left: rect.x+'px', top: rect.y+'px', width: rect.width+'px', height: rect.height+'px', }"/>
<textarea :auto-focus="true" v-if="textareaModel.show" v-focus v-model="textareaModel.text" class="fixed-textarea"
:style="{ left: rect.x+'px', top: rect.y+'px', width: rect.width+'px', height: rect.height+'px', }"/>
</div>
</div>
</template>
<script>
import PlanJustRunning from '../dialog/planJustRunning.vue';
import PlanJustStop from '../dialog/planJustStop.vue';
import PlanJustTurnback from '../dialog/planJustTurnback.vue';
import PlanSetParams from '../dialog/planSetParams.vue';
import PlanCreate from '../dialog/planCreate.vue';
import PlanExport from '../dialog/planExport.vue';
import Schedule from './schedule.vue';
import PlanJustRunning from './dialog/planJustRunning.vue';
import PlanJustStop from './dialog/planJustStop.vue';
import PlanJustTurnback from './dialog/planJustTurnback.vue';
import PlanSetParams from './dialog/planSetParams.vue';
import Menus from './menus.vue';
import { MenuEnum } from './utils.js';
import Drawer from '../components/drawer.vue';
import * as utils from '../utils.js';
import { timeFormat } from '@/utils/date';
import { mapGetters } from 'vuex';
import { getStationList } from '@/api/runplan';
import {
listRps, createRp, deleteRp,
getRpTools, clearRpPlan, addRpTrip, delRpTrip,
justTripNoRunning, justTripNoStop, justTripTurnback,
justTripNoRunning, justTripNoStop, justTripTurnBack,
translateRpService, delRpService,
getRpConfig, modifyRpConfig,
createRpArea, modifyRpArea, modifyAreaNote, delRpArea
@ -74,14 +102,21 @@ export default {
PlanJustStop,
PlanJustTurnback,
PlanSetParams,
Menus
PlanCreate,
PlanExport,
Menus,
Drawer,
},
data() {
return {
title: 'XXX',
canvasId: 'canvas-plan',
defaultProps: {
children: 'children',
label: 'name'
},
drawer: false,
planList: [],
stations: [],
planData: [],
planData: {},
selected: null,
target: null,
textareaModel: {
@ -111,6 +146,9 @@ export default {
}
},
computed: {
disabled() {
return !this.planId;
},
show() {
return this.textareaModel.show;
},
@ -122,7 +160,10 @@ export default {
},
planId() {
return this.$route.query.planId;
},
},
title() {
return this.$route.query.title||'';
},
mapId() {
return 9;
},
@ -130,7 +171,7 @@ export default {
return '00';
},
MenuEnum() {
return MenuEnum;
return utils.MenuEnum;
}
},
watch: {
@ -139,14 +180,18 @@ export default {
},
height() {
this.setPosition();
},
},
$route() {
this.loadPlanData();
}
},
created() {
this.planUtil = this.$theme.loadPlanConvert(this.lineCode);
},
mounted() {
this.setPosition();
this.loadInitData();
this.loadPlanList();
this.loadPlanData();
},
methods: {
setPosition() {
@ -154,32 +199,46 @@ export default {
this.$store.dispatch('rpTools/resize', { width: this.width, height: this.height });
});
},
loadInitData() {
loadPlanList() {
listRps().then(resp => {
this.planList = resp.data;
})
},
loadPlanData() {
getStationList(this.mapId).then(resp => {
const stations = this.stations = resp.data.filter(el => {
return ['车辆段', '停车场'].findIndex(it => { return el.name.includes(it) }) < 0;
});
this.$store.commit('rpTools/setStations', stations);
this.$refs.schedule.loadChartPage(stations);
getRpTools().then(rest => {
const planData = rest.data;
if (this.planId) {
getRpTools(this.planId).then(rest => {
const planData = this.planData = rest.data;
this.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(planData);
getRpConfig(this.planId).then(resm => {
const data = resm.data;
this.config = {
averageSpeed: data.averageSpeed,
maxSpeed: data.maxSpeed,
stopTime: data.stopTime,
minStopTime: data.minStopTime,
minIntervalTime: data.minIntervalTime,
turnBackTime: data.turnBackTime
}
}).catch(error => {
this.$message.info(error.message);
})
}).catch(error => {
this.$message.info(error.message);
})
} else {
const planData = {}
this.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(planData);
getRpConfig().then(resm => {
const data = resm.data;
this.config = {
averageSpeed: data.averageSpeed,
maxSpeed: data.maxSpeed,
stopTime: data.stopTime,
minStopTime: data.minStopTime,
minIntervalTime: data.minIntervalTime,
turnBackTime: data.turnBackTime
}
}).catch(error => {
this.$message.info(error.message)
})
});
}
}).catch(error => {
this.$messageBox(error.message);
})
@ -272,16 +331,49 @@ export default {
break;
}
},
onSelectPlan(el) {
this.$router.replace({ path: 'AUStool', query: { planId: el.id, title: el.name }});
this.drawer = false;
},
doExport() {
this.$refs.export.doShow(this.stations, this.planData);
},
doNewPlan() {
clearRpPlan().then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
this.$message.info(error.message);
})
this.$refs.create.doShow();
this.$nextTick(e => {
if (this.$refs.tree) {
this.$refs.tree.setCurrentKey(this.planId);
}
})
},
doCreatePlan(model) {
createRp(model).then(resp => {
this.loadPlanList();
this.onSelectPlan({id: resp.data, name: model.name});
}).catch(error => {
this.$message.info(error.message);
})
},
doDeletePlan(el) {
this.$confirm('This operation will permanently delete the data. Do you want to continue?', 'Tips', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
deleteRp(el.id).then(resp => {
this.loadPlanList();
this.planId == el.id
? this.$router.replace({ path: 'AUStool'})
: this.loadPlanData();
}).catch(error => {
this.$message.info(error.message);
})
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
});
},
doSetPlanParams(data) {
modifyRpConfig(data).then(resp => {
modifyRpConfig(this.planId, data).then(resp => {
this.config = data;
this.$message.success('Parameters of plan were modified successfully.');
}).catch(error => {
@ -293,7 +385,7 @@ export default {
text: data.text
}
modifyAreaNote(data.id, model).then(resp => {
modifyAreaNote(this.planId, data.id, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.$message.info(error.message);
@ -307,7 +399,7 @@ export default {
stationCode: this.selected.stationCode
}
justTripNoRunning(this.selected.tripNo, model).then(resp => {
justTripNoRunning(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.$message.info(error.message);
@ -322,7 +414,7 @@ export default {
stationCode: this.selected.stationCode
}
justTripNoStop(this.selected.tripNo, model).then(resp => {
justTripNoStop(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.$message.info(error.message);
@ -337,7 +429,7 @@ export default {
stationCode: this.selected.stationCode
}
justTripTurnback(this.selected.tripNo, model).then(resp => {
justTripTurnBack(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.$message.info(error.message);
@ -353,7 +445,7 @@ export default {
endTime: timeFormat(data.endTime)
}
addRpTrip(model).then(resp => {
addRpTrip(this.planId, model).then(resp => {
this.refresh();
}).catch(error => {
this.$message.info(error.message);
@ -374,7 +466,7 @@ export default {
endTime: endTime < startTime? timeFormat(data.startTime): timeFormat(data.endTime)
}
createRpArea(model).then(resp => {
createRpArea(this.planId, model).then(resp => {
this.refresh();
}).catch(error => {
this.$message.info(error.message);
@ -388,7 +480,7 @@ export default {
seconds : this.selected.time
}
translateRpService(this.selected.serviceNo, model).then(resp => {
translateRpService(this.planId, this.selected.serviceNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.refresh(false);
@ -407,7 +499,7 @@ export default {
text: data.text
}
modifyRpArea(data.areaNo, model).then(resp => {
modifyRpArea(this.planId, data.areaNo, model).then(resp => {
this.refresh(false);
}).catch(error => {
this.refresh(false);
@ -422,7 +514,7 @@ export default {
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
delRpService(this.selected.serviceNo).then(resp => {
delRpService(this.planId, this.selected.serviceNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
@ -441,7 +533,7 @@ export default {
type: 'warning'
}).then(() => {
delRpTrip(this.selected.tripNo).then(resp => {
delRpTrip(this.planId, this.selected.tripNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
@ -460,7 +552,7 @@ export default {
type: 'warning'
}).then(() => {
const data = this.target.model;
delRpArea(data.areaNo).then(resp => {
delRpArea(this.planId, data.areaNo).then(resp => {
this.refresh();
}).catch(error => {
this.refresh();
@ -472,8 +564,8 @@ export default {
}
},
refresh(cls=true) {
getRpTools().then(rest => {
const planData = rest.data;
getRpTools(this.planId).then(rest => {
const planData = this.planData = rest.data;
this.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(planData);
if (cls) {
@ -524,4 +616,11 @@ export default {
}
}
}
.flex {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
</style>

View File

@ -5,7 +5,7 @@
</el-select>
<div v-if="option">
<el-button-group v-if="option.radioList" v-model="model.action">
<el-button v-for="(el,i) in option.radioList"
<el-button v-for="(el,i) in option.radioList" :disabled="disabled"
:key="i"
:type="el.value == model.action? 'primary':''"
@click="doBtnSelect(el, i)">
@ -13,7 +13,7 @@
</el-button>
</el-button-group>
<el-button-group v-if="option.buttonList" style="margin-left: 20px">
<el-button v-for="(el,i) in option.buttonList"
<el-button v-for="(el,i) in option.buttonList" :disabled="disabled"
:key="i"
:type="execProp('type', el, i)"
:icon="execProp('icon', el, i)"
@ -43,6 +43,10 @@ export default {
default() {
return null
}
},
disabled: {
type: Boolean,
default: false
}
},
data() {

View File

@ -1,6 +1,5 @@
import echarts from 'echarts';
import * as utils from './utils'
import { MenuEnum } from './utils';
import * as utils from '../utils'
export default {
data() {
@ -435,15 +434,15 @@ export default {
this.doSetSelected({e, pointInGrid});
if (e.dataIndex < length - 1 && e.value[1] == near[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: MenuEnum.planJustStop });
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: utils.MenuEnum.planJustStop });
} else if (e.dataIndex < length - 1 && e.value[1] != near[1] && e.value[1] == next[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: MenuEnum.planJustTurnBack });
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: utils.MenuEnum.planJustTurnBack });
} else if (e.dataIndex == 0 || e.dataIndex > 0 && e.value[1] == prev[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: MenuEnum.planJustRunning });
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: utils.MenuEnum.planJustRunning });
}
} else if (e.target && e.target.subType == 'area') {
if (this.model.action == 'Note') {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: MenuEnum.planSetAreaNote });
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: utils.MenuEnum.planSetAreaNote });
}
}
},

View File

@ -11,7 +11,7 @@
</template>
<script>
import * as utils from './utils'
import * as utils from '../utils'
import echarts from 'echarts';
import Monitor from './monitor.js';
import { timeFormat } from '@/utils/date';
@ -41,7 +41,7 @@ export default {
},
canvasId: {
type: String,
default: 'service-tool'
default: 'canvas-plan'
}
},
data() {
@ -55,7 +55,7 @@ export default {
option() {
return {
title: {
text: '',
text: this.title,
left: 'center',
top: '10px'
},
@ -95,14 +95,11 @@ export default {
}
},
axisLabel: {
formatter: this.xAxisLableFormat,
formatter: this.xAxisLabelFormat,
textStyle: {
color: '#333'
}
},
axisTick: {
inside: true
},
axisPointer: {
snap: true,
label: {
@ -131,7 +128,7 @@ export default {
axisLabel: {
show:true,
inside:true,
formatter: this.yAxisLableFormat
formatter: this.yAxisLabelFormat
},
axisPointer: {
xAxisIndex: 'all',
@ -158,7 +155,7 @@ export default {
moveOnMouseMove : 'ctrl',
},
{
fiterMode: 'slider',
fiterMode: 'filter',
handleSize: '80%',
handleStyle: {
color: '#fff',
@ -168,7 +165,7 @@ export default {
shadowOffsetY: 2
},
bottom: '20px'
}
}
]
}
}
@ -194,10 +191,10 @@ export default {
yAxisPointFormat(params) {
return this.planUtil.computedFormatYAxis(this.stations, params);
},
xAxisLableFormat(value, index) {
xAxisLabelFormat(value, index) {
return timeFormat(value);
},
yAxisLableFormat(value, index) {
yAxisLabelFormat(value, index) {
return '';
},
axisTooltip(param) {
@ -227,9 +224,6 @@ export default {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.clear();
}
if (this.$route.query.planName || this.$route.query.prdType === '05') {
this.option.title.text = this.this.title;
}
this.myChart = echarts.init(document.getElementById(this.canvasId));
this.myChart.setOption(this.option, {notMerge: true});
@ -260,6 +254,7 @@ export default {
try {
const option = this.myChart.getOption();
option.title.text = this.title;
option.series = [];
option.graphic[0].elements = [];
@ -311,7 +306,7 @@ export default {
const offsetTime = 3600 / 2;
const list = [];
for (var time = 0 + this.planUtil.TranslationTime; time < 3600 * 24 + this.planUtil.TranslationTime; time++) {
for (var time = 0 + this.planUtil.TranslationTime; time <= 3600 * 24 + this.planUtil.TranslationTime; time++) {
list.push(time);
}

View File

@ -105,3 +105,9 @@ export function findPrev(list, idx, cb) {
}
return null;
}
export function dataURItoBlob(dataURI, dataTYPE) {
var binary = atob(dataURI.split(',')[1]), array = [];
for(var i = 0; i < binary.length; i++) array.push(binary.charCodeAt(i));
return new Blob([new Uint8Array(array)], {type: dataTYPE});
}

View File

@ -72,8 +72,8 @@
</template>
<script>
import { getPublishLessonList } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules, getExamClassList } from '@/api/management/exam';
import { getPublishLessonList, getExamClassList } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
import { getSessionStorage } from '@/utils/auth';
export default {

View File

@ -3,6 +3,17 @@
<div class="scriptHeader">
<div class="scriptList">草稿{{ $t('scriptRecord.scriptList') }}</div>
<el-button size="small" type="primary" class="createScript" @click="handleCreate">{{ $t('scriptRecord.scriptCreate') }}</el-button>
<el-button type="primary" class="uploadDemo" size="mini">
<input
id="importResults"
ref="files"
type="file"
class="file_box"
accept=".json, application/json"
@change="importScript"
>
导入剧本
</el-button>
</div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<script-publish ref="publishScript" :title="$t('scriptRecord.publishScript')" @reloadTable="reloadTable" @create="handleConfirmPublish" />
@ -16,9 +27,9 @@ import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig';
import { UrlConfig } from '@/scripts/ConstDic';
import { admin, superAdmin} from '@/router/index_APP_TARGET';
import {retractScript, publishScript, updateScript, deleteScript, getScriptPageList, createScript} from '@/api/script';
import {retractScript, publishScript, updateScript, deleteScript, getScriptPageList, createScript, postScriptImport, getScriptExport} from '@/api/script';
import { launchFullscreen } from '@/utils/screen';
import { scriptDraftRecordNotify, scriptDraftRecordNotifyNew, scriptRecordNotify, scriptRecordNotifyNew } from '@/api/simulation';
import { scriptDraftRecordNotifyNew, scriptRecordNotifyNew } from '@/api/simulation';
import CreateScript from './create';
import ScriptPublish from './publish';
import { getSessionStorage } from '@/utils/auth';
@ -68,7 +79,7 @@ export default {
{
type: 'button',
title: this.$t('scriptRecord.operate'),
width: '400',
width: '450',
buttons: [
{
name: this.$t('scriptRecord.scriptRecord'),
@ -105,6 +116,12 @@ export default {
handleClick: this.previewScript,
type: 'success'
// showControl:(row) => { return row.status==1},
},
{
name: '导出',
handleClick: this.exportScript,
type: 'primary',
showControl:(row) => { return !(row.status == 1); }
}
]
}
@ -269,6 +286,51 @@ export default {
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
});
},
exportScript(index, row) {
getScriptExport(row.id).then(res=>{
const resultData = res.data;
if (resultData === false) {
return;
}
const content = new Blob([JSON.stringify(resultData)]);
const urlObject = window.URL || window.webkitURL || window;
const url = urlObject.createObjectURL(content);
const el = document.createElement('a');
el.href = url;
el.download = `${resultData.name}.json`;
el.click();
urlObject.revokeObjectURL(url);
});
},
importScript() {
const loading = this.$loading({
lock: true,
text: '正在导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
const obj = this.$refs.files;
if (!obj.files) return;
const f = obj.files[0];
const reader = new FileReader();
const that = this;
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
postScriptImport(that.$route.params.mapId, JSON.parse(data)).then(res => {
loading.close();
that.$message.success('导入成功!');
that.reloadTable();
loading.close();
}).catch(error => {
loading.close();
that.$message.error('导入失败' + error.message);
});
obj.value = '';
};
});
}
}
};
@ -293,4 +355,23 @@ export default {
margin-left: 5px;
margin-top: 5px;
}
.uploadDemo {
position: relative;
overflow: hidden;
float: right;
margin-right: 10px;
cursor: pointer;
padding: 10px 15px;
margin-top: 0px !important;
}
.file_box {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
z-index: 100;
}
</style>

View File

@ -29,7 +29,7 @@ export default {
const form = {
labelWidth: '100px',
items: [
{ prop: 'name', label: '称', type: 'text' },
{ prop: 'name', label: '称', type: 'text' },
{ prop: 'phone', label: '电话', type: 'text' },
{ prop: 'address', label: '地址', type: 'text' }
]

View File

@ -2,16 +2,19 @@
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-company ref="editCompany" @reloadTable="reloadTable" />
<qr-code ref="qrCode" />
</div>
</template>
<script>
import { getCompanyListPaging, deleteCompany } from '@/api/company';
import EditCompany from './add';
import QrCode from '@/components/QrCode';
export default {
name: 'CompanyManage',
components: {
EditCompany
EditCompany,
QrCode
},
data() {
return {
@ -31,15 +34,15 @@ export default {
indexShow: true,
columns: [
{
title: '公司名称',
title: '单位名称',
prop: 'name'
},
{
title: '公司电话',
title: '单位电话',
prop: 'phone'
},
{
title: '公司地址',
title: '单位地址',
prop: 'address'
},
{
@ -51,6 +54,10 @@ export default {
name: this.$t('global.edit'),
handleClick: this.handleUpdate
},
{
name: '生成二维码',
handleClick: this.handleGenerateQrCode
},
{
name: '删除',
handleClick: this.handleDeleteCompany,
@ -87,6 +94,13 @@ export default {
},
handlerBack() {
this.$router.go(-1);
},
handleGenerateQrCode(index, row) {
const param = {
url: `companyName=${row.name}&&companyId=${row.id}`,
title: '单位二维码'
};
this.$refs.qrCode.doShow(param);
}
}
};

View File

@ -1,6 +1,47 @@
<template>
<el-dialog v-dialogDrag title="添加出题规则" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<el-dialog v-dialogDrag title="添加出题规则" :visible.sync="dialogVisible" width="710" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="form" :model="formModel" label-width="100px" :inline="true">
<el-form-item v-if="!isProject" label="单位">
<el-select v-model="formModel.companyId" placeholder="请选择单位" clearable size="small" style="width: 400px;">
<el-option
v-for="item in companyList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="判断题数量">
<el-input-number v-model="formModel.judgeNum" :min="0" :max="questionNum.judge" /><div style="display: inline-block;width: 70px;">{{ `(${questionNum.judge})` }}</div>
</el-form-item>
<el-form-item label="判断题分数">
<el-input-number v-model="formModel.judgePoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="单选题数量">
<el-input-number v-model="formModel.selectNum" :min="0" :max="questionNum.select" /><div style="display: inline-block;width: 70px;">{{ `(${questionNum.select})` }}</div>
</el-form-item>
<el-form-item label="单选题分数">
<el-input-number v-model="formModel.selectPoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="多选题数量">
<el-input-number v-model="formModel.multiNum" :min="0" :max="questionNum.multi" /><div style="display: inline-block;width: 70px;">{{ `(${questionNum.multi})` }}</div>
</el-form-item>
<el-form-item label="多选题分数">
<el-input-number v-model="formModel.multiPoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="填空题数量">
<el-input-number v-model="formModel.fillNum" :min="0" :max="questionNum.fill" /><div style="display: inline-block;width: 70px;">{{ `(${questionNum.fill})` }}</div>
</el-form-item>
<el-form-item label="填空题分数">
<el-input-number v-model="formModel.fillPoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="填空题数量">
<el-input-number v-model="formModel.answerNum" :min="0" :max="questionNum.answer" /><div style="display: inline-block;width: 70px;">{{ `(${questionNum.answer})` }}</div>
</el-form-item>
<el-form-item label="填空题分数">
<el-input-number v-model="formModel.answerPoint" :min="0" :max="10" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
@ -10,6 +51,8 @@
<script>
import { addQuestionRule, updateQuestionRule } from '@/api/questionsRule';
import { getSessionStorage } from '@/utils/auth';
import { selectQuestionTypeNum } from '@/api/race';
export default {
name: 'Add',
props: {
@ -35,42 +78,41 @@ export default {
answerNum: 0,
answerPoint: 0
},
questionNum: {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
},
update: false
};
},
computed:{
form() {
const form = {
labelWidth: '100px',
items: [
{ prop: 'companyId', label: '公司名称', type: 'select', options: this.companyList, optionValue: 'id', optionLabel: 'name' },
{ prop: 'judgeNum', label: '判断题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'judgePoint', label: '判断题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'selectNum', label: '单选题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'selectPoint', label: '单选题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'multiNum', label: '多选题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'multiPoint', label: '多选题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'fillNum', label: '填空题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'fillPoint', label: '填空题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'answerNum', label: '问答题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'answerPoint', label: '问答题分数', type: 'number', min: 0, max: 99, step: 1 }
]
};
return form;
},
rules() {
const crules = {
companyId: [
{ required: true, message: '请选择单位', trigger: 'change' }
]
};
return crules;
isProject() {
const project = getSessionStorage('project');
return project !== 'login' && project !== 'design';
}
},
methods: {
selectQuestion() {
selectQuestionTypeNum(this.formModel.companyId).then(resp => {
resp.data.forEach(item => {
this.questionNum[item.type] = item.num;
});
});
},
doShow(data) {
this.dialogVisible = true;
this.update = false;
this.questionNum = {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
};
this.selectQuestion();
if (data) {
this.update = true;
this.formModel.id = data.id;
@ -150,7 +192,7 @@ export default {
this.$emit('reloadTable');
}).catch(e => {
if (e.code == 10010) {
this.$message.error('关联改公司数据已存在!');
this.$message.error('关联该单位数据已存在!');
} else {
this.$message.error('添加出题规则失败!');
}

View File

@ -1,6 +1,111 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div style="text-align: center;">
<div style="text-align: right;margin: 10px;">
<el-button
size="mini"
type="primary"
@click="queryData"
>查询</el-button>
<el-button
size="mini"
type="primary"
@click="handlerAddCompany"
>添加</el-button>
<el-button
size="mini"
type="danger"
@click="handlerBack"
>返回</el-button>
</div>
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="companyId" label="单位名称">
<template slot-scope="scope">
<span>{{ $convertField(scope.row.companyId, companyList, ['id', 'name']) }}</span>
</template>
</el-table-column>
<el-table-column label="判断题">
<el-table-column prop="rules" label="数量">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'judge', 'num') }}</span>
</template>
</el-table-column>
<el-table-column prop="rules" label="分数">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'judge', 'point') }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="单选题">
<el-table-column prop="rules" label="数量">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'select', 'num') }}</span>
</template>
</el-table-column>
<el-table-column prop="rules" label="分数">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'select', 'point') }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="多选题">
<el-table-column prop="rules" label="数量">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'multi', 'num') }}</span>
</template>
</el-table-column>
<el-table-column prop="rules" label="分数">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'multi', 'point') }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="填空题">
<el-table-column prop="rules" label="数量">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'fill', 'num') }}</span>
</template>
</el-table-column>
<el-table-column prop="rules" label="分数">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'fill', 'point') }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="问答题">
<el-table-column prop="rules" label="数量">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'answer', 'num') }}</span>
</template>
</el-table-column>
<el-table-column prop="rules" label="分数">
<template slot-scope="scope">
<span>{{ handlerRuleData(scope.row.rules, 'answer', 'point') }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleUpdate(scope.$index, scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="danger"
@click="handleDeleteCompany(scope.$index, scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:page-sizes="[10, 20, 30, 50]"
:total="totalNum"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<edit-questions-rule ref="editQuestionsRule" :company-list="companyList" @reloadTable="reloadTable" />
</div>
</template>
@ -17,119 +122,10 @@ export default {
data() {
return {
companyList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
}
},
queryList: {
query: getQustionRuleListPage,
selectCheckShow: false,
columns: [
{
title: '公司名称',
prop: 'companyId',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.companyId, this.companyList, ['id', 'name']); },
tagType: (row) => { return 'default'; }
},
{
title: '判断题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'judge', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '判断题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'judge', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '单选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'select', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '单选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'select', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '多选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'multi', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '多选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'multi', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '填空题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'fill', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '填空题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'fill', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '问答题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'answer', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '问答题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'answer', 'point'); },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleUpdate
},
{
name: '删除',
handleClick: this.handleDeleteCompany,
type: 'danger'
}
]
}
],
actions: [
{ text: '添加', btnCode: 'employee_auto', handler: this.handlerAddCompany },
{ text: '返回', btnCode: 'employee_auto', handler: this.handlerBack}
]
},
currentPage: 1,
tableData: [],
pageSize: 10,
totalNum: 0,
currentModel: {}
};
},
@ -137,24 +133,43 @@ export default {
getCompanyList().then(resp => {
this.companyList = resp.data;
});
this.queryData();
},
methods: {
queryData() {
const param = {
pageSize: this.pageSize,
pageNum: this.currentPage
};
getQustionRuleListPage(param).then(resp => {
this.totalNum = resp.data.total;
this.tableData = resp.data.list;
});
},
handleSizeChange(val) {
this.pageSize = val;
this.queryData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.queryData();
},
handlerAddCompany() {
this.$refs.editQuestionsRule.doShow();
},
handleDeleteCompany(index, row) {
deleteQuestionRule(row.id).then(resp => {
this.$message.success('删除单位信息成功!');
this.$message.success('删除规则信息成功!');
this.reloadTable();
}).catch(() => {
this.$message.error('删除单位信息失败!');
this.$message.error('删除规则信息失败!');
});
},
handleUpdate(index, row) {
this.$refs.editQuestionsRule.doShow(row);
},
reloadTable() {
this.queryList.reload();
this.queryData();
},
handlerBack() {
this.$router.go(-1);

View File

@ -10,6 +10,7 @@
<script>
import { putRoles } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
export default {
name: 'DictionaryEdit',
@ -22,8 +23,10 @@ export default {
// nickname: '',
// mobile: '',
// email: '',
companyId: '',
roles: []
}
},
companyList: []
};
},
computed: {
@ -35,7 +38,8 @@ export default {
// { prop: 'nickname', label: '', type: 'text' },
// { prop: 'mobile', label: '', type: 'number' },
// { 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 },
{ prop: 'companyId', label: '单位', type: 'select', options: this.companyList, clearable: true }
]
};
return form;
@ -60,6 +64,13 @@ export default {
return crules;
}
},
mounted() {
getCompanyList().then(resp => {
resp.data.forEach(item => {
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
});
},
methods: {
doShow(data) {
this.dialogVisible = true;
@ -70,6 +81,7 @@ export default {
// nickname: data.nickname,
// mobile: data.mobile,
// email: data.email,
companyId: data.companyId,
roles: data.roles
};
}
@ -94,6 +106,7 @@ export default {
this.formModel = {
id: '',
name: '',
companyId: '',
roles: []
};
this.$refs.dataform.resetForm();