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'; 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) { export function postCreateRoom(data) {
return request({ 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) { export function getjointTrainList(params) {
return request({ 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) { export function putJointTrainingSimulationEntrance(group) {
return request({ return request({
@ -228,9 +41,7 @@ export function putJointTrainingSimulationEntrance(group) {
}); });
} }
/** // 权限获取(房间权限)
* 权限获取(房间权限)
*/
export function getPermissionJoint(group) { export function getPermissionJoint(group) {
return request({ return request({
url: '/api/jointTraining/qrCode', 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) { export function getSimulationMembersNew(group) {
return request({ return request({
@ -302,23 +59,6 @@ export function getSimulationMembersNew(group) {
method: 'get' 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) { export function startConversition(group, data, sign) {
return request({ return request({
@ -327,13 +67,6 @@ export function startConversition(group, data, sign) {
data data
}); });
} }
/** 根据会话id获取仿真会话 */
export function getSimulationConversition(group, conversationId) {
return request({
url: `/api/simulation/${group}/conversation/${conversationId}`,
method: 'get'
});
}
/** 发送会话消息 */ /** 发送会话消息 */
export function sendSimulationConversition(group, conversationId, file) { export function sendSimulationConversition(group, conversationId, file) {
return request({ return request({

View File

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

View File

@ -7,20 +7,20 @@ export function refereeExitSimulation(group) {
method: 'delete' method: 'delete'
}); });
} }
/** 裁判进入仿真 */ // /** 裁判进入仿真 */
export function refereeEnterSimulation(group) { // export function refereeEnterSimulation(group) {
return request({ // return request({
url: `/api/v1/competition/room/${group}/refree`, // url: `/api/v1/competition/room/${group}/refree`,
method: 'post' // method: 'post'
}); // });
} // }
/** 裁判查询竞赛人员的房间列表 */ // /** 裁判查询竞赛人员的房间列表 */
export function refereeGetCompetitionList(id) { // export function refereeGetCompetitionList(id) {
return request({ // return request({
url: `/api/v1/competition/${id}/room`, // url: `/api/v1/competition/${id}/room`,
method: 'get' // method: 'get'
}); // });
} // }
/** 参赛者创建演练房间 */ /** 参赛者创建演练房间 */
export function participantCreatTrainingRoom(id, data) { export function participantCreatTrainingRoom(id, data) {
return request({ return request({
@ -30,22 +30,22 @@ export function participantCreatTrainingRoom(id, data) {
}); });
} }
// 加载试卷 // // 加载试卷
export function loadingPaper(competitionId, data) { // export function loadingPaper(competitionId, data) {
return request({ // return request({
url: `/api/v1/competition/${competitionId}/testPaper`, // url: `/api/v1/competition/${competitionId}/testPaper`,
method: 'post', // method: 'post',
data // data
}); // });
} // }
/** 竞赛报名 */ // /** 竞赛报名 */
export function postSignUp(id, data) { // export function postSignUp(id, data) {
return request({ // return request({
url: `/api/race/${id}/signUp`, // url: `/api/race/${id}/signUp`,
method: 'post', // method: 'post',
data // data
}); // });
} // }
/** 查询用户是否已经报名该竞赛 */ /** 查询用户是否已经报名该竞赛 */
export function getIsSignUp(raceId, params = {}) { export function getIsSignUp(raceId, params = {}) {
@ -56,23 +56,23 @@ export function getIsSignUp(raceId, params = {}) {
}); });
} }
/** 分页查询竞赛报名人员 */ // /** 分页查询竞赛报名人员 */
export function getRaceUserList(params) { // export function getRaceUserList(params) {
return request({ // return request({
url: `/api/race/${params.raceId}/raceUser/page`, // url: `/api/race/${params.raceId}/raceUser/page`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
/** 裁判打分 */ // /** 裁判打分 */
export function putRefereeScoring(data) { // export function putRefereeScoring(data) {
return request({ // return request({
url: `/api/v1/competition/referee/scoring`, // url: `/api/v1/competition/referee/scoring`,
method: 'put', // method: 'put',
data // data
}); // });
} // }
/** 提交试卷 */ /** 提交试卷 */
export function postCompetitionTheory(data) { export function postCompetitionTheory(data) {
@ -83,13 +83,13 @@ export function postCompetitionTheory(data) {
}); });
} }
/** 查询本竞赛用的实操列表 */ // /** 查询本竞赛用的实操列表 */
export function getCompetitionPractical(competitionId) { // export function getCompetitionPractical(competitionId) {
return request({ // return request({
url: `/api/v1/competitionPractical/competition/${competitionId}`, // url: `/api/v1/competitionPractical/competition/${competitionId}`,
method: 'get' // method: 'get'
}); // });
} // }
/** 查询竞赛报名人员详情 */ /** 查询竞赛报名人员详情 */
export function getRaceUserById(raceId) { export function getRaceUserById(raceId) {
@ -169,67 +169,67 @@ export function getPracticalCompetitionResult(competitionId) {
}); });
} }
/** 回访准备 */ // /** 回访准备 */
export function playBackReady(params) { // export function playBackReady(params) {
return request({ // return request({
url: `/api/v1/simulationRecord/playback/ready`, // url: `/api/v1/simulationRecord/playback/ready`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
/** 设置倍速 */ // /** 设置倍速 */
export function setPlaySpeed(params) { // export function setPlaySpeed(params) {
return request({ // return request({
url: `/api/v1/simulationRecord/playback/setPlaySpeed`, // url: `/api/v1/simulationRecord/playback/setPlaySpeed`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
/** 开始播放 */ // /** 开始播放 */
export function startPlaying(params) { // export function startPlaying(params) {
return request({ // return request({
url: `/api/v1/simulationRecord/playback/startPlaying`, // url: `/api/v1/simulationRecord/playback/startPlaying`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
/** 暂停播放 */ // /** 暂停播放 */
export function playingPause(params) { // export function playingPause(params) {
return request({ // return request({
url: `/api/v1/simulationRecord/playback/pausePlaying`, // url: `/api/v1/simulationRecord/playback/pausePlaying`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
/** 结束播放 */ // /** 结束播放 */
export function endPlaying(params) { // export function endPlaying(params) {
return request({ // return request({
url: `/api/v1/simulationRecord/playback/endPlaying`, // url: `/api/v1/simulationRecord/playback/endPlaying`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
/** 从暂停中播放 */ // /** 从暂停中播放 */
export function fromPauseToPlay(params) { // export function fromPauseToPlay(params) {
return request({ // return request({
url: `/api/v1/simulationRecord/playback/playing`, // url: `/api/v1/simulationRecord/playback/playing`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
/** 裁判查询理论考试结果 */ // /** 裁判查询理论考试结果 */
export function getTheroyCompetitionResult(competitionId, raceUserId) { // export function getTheroyCompetitionResult(competitionId, raceUserId) {
return request({ // return request({
url: `api/v1/competitionTheory/detail/competition/${competitionId}/raceUser/${raceUserId}`, // url: `api/v1/competitionTheory/detail/competition/${competitionId}/raceUser/${raceUserId}`,
method: 'get' // method: 'get'
}); // });
} // }
// 以下drts项目使用 // 以下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) { // export function loadDraftScript(scriptId, memberId, group) {
return request({ // return request({
url: `/api/simulation/${group}/scriptDraft/${scriptId}?memberId=${memberId}`, // url: `/api/simulation/${group}/scriptDraft/${scriptId}?memberId=${memberId}`,
method: 'post' // method: 'post'
}); // });
} // }
/** 剧本预览选择角色 */ /** 剧本预览选择角色 */
export function loadDraftScriptNew(memberId, group) { export function loadDraftScriptNew(memberId, group) {
return request({ return request({
// url: `/simulation/${group}/choosePlay?memberId=${memberId}`,
url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}`, url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}`,
method: 'put' method: 'put'
}); });
} }
/** 剧本预览选择角色 */ // /** 剧本预览选择角色 */
export function loadDraftScriptNewMode(memberId, group, mode) { // export function loadDraftScriptNewMode(memberId, group, mode) {
return request({ // return request({
// url: `/simulation/${group}/choosePlay?memberId=${memberId}`, // url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}&mode=${mode}`,
url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}&mode=${mode}`, // method: 'put'
method: 'put' // });
}); // }
}
/** 获取已发布的有地图的城市列表*/
export function publisMapCityList(data) {
return request({
url: `/api/map/city?dicCode=${data}`,
method: 'get'
});
}

View File

@ -95,3 +95,10 @@ export function aKeyGeneratingLesson(data) {
data: 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) { // export function publishLesson(data) {
return request({ // return request({
url: `/api/lessonDraft/${data.id}/publish`, // url: `/api/lessonDraft/${data.id}/publish`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 课程章节拖拽排序*/ /** 课程章节拖拽排序*/
export function dragSortLessonChapter(data) { export function dragSortLessonChapter(data) {

View File

@ -16,13 +16,13 @@ export function getPublishMapListOnline() {
}); });
} }
/** 根据皮肤获取发布地图列表*/ // /** 根据皮肤获取发布地图列表*/
export function getPublishMapListByLineCode(lineCode) { // export function getPublishMapListByLineCode(lineCode) {
return request({ // return request({
url: `/api/map/${lineCode}/list`, // url: `/api/map/${lineCode}/list`,
method: 'get' // method: 'get'
}); // });
} // }
/** 根据地图id获取地图版本信息*/ /** 根据地图id获取地图版本信息*/
export function getPublishMapVersionById(id) { export function getPublishMapVersionById(id) {
@ -133,13 +133,13 @@ export function getPublishMapDetailList(params, code) {
}); });
} }
/** 获取有屏蔽门的站台列表*/ // /** 获取有屏蔽门的站台列表*/
export function hasDoorStationList(mapId) { // export function hasDoorStationList(mapId) {
return request({ // return request({
url: `/api/map/${mapId}/stand/hasDoor`, // url: `/api/map/${mapId}/stand/hasDoor`,
method: 'get' // method: 'get'
}); // });
} // }
// /** 修改发布地图城市*/ // /** 修改发布地图城市*/
// export function updatePublishMapCity(data) { // export function updatePublishMapCity(data) {
@ -254,3 +254,27 @@ export function getStandListByStationCode(id, stationCode) {
method: 'get' 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) { // export function listRouteRoute(mapId, params) {
return request({ // return request({
url: `/api/mapBuild/${mapId}/route`, // url: `/api/mapBuild/${mapId}/route`,
method: 'get', // method: 'get',
params: params // params: params
}); // });
} // }
/** 查询进路地图列表*/ // /** 查询进路地图列表*/
export function listRouteMapRoute(mapId) { // export function listRouteMapRoute(mapId) {
return request({ // return request({
url: `/api/mapBuild/${mapId}/route/all`, // url: `/api/mapBuild/${mapId}/route/all`,
method: 'get' // method: 'get'
}); // });
} // }
/** 查询进路明细*/ // /** 查询进路明细*/
export function queryRouteRouteDetail(data) { // export function queryRouteRouteDetail(data) {
return request({ // return request({
url: `/api/mapBuild/route/${data.id}`, // url: `/api/mapBuild/route/${data.id}`,
method: 'get' // method: 'get'
}); // });
} // }
/** 创建进路*/ // /** 创建进路*/
export function createRouteRoute(data) { // export function createRouteRoute(data) {
return request({ // return request({
url: `/api/mapBuild/route`, // url: `/api/mapBuild/route`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 删除进路*/ // /** 删除进路*/
export function deleteRouteRoute(id) { // export function deleteRouteRoute(id) {
return request({ // return request({
url: `/api/mapBuild/route/${id}`, // url: `/api/mapBuild/route/${id}`,
method: 'delete' // method: 'delete'
}); // });
} // }
/** 更新进路*/ // /** 更新进路*/
export function updateRouteRoute(data) { // export function updateRouteRoute(data) {
return request({ // return request({
url: `/api/mapBuild/route/${data.id}`, // url: `/api/mapBuild/route/${data.id}`,
method: 'put', // method: 'put',
data: data // data: data
}); // });
} // }
/** 创建联动道岔*/ // /** 创建联动道岔*/
export function createLinkageSwitch(data) { // export function createLinkageSwitch(data) {
return request({ // return request({
url: `/api/mapBuild/switchCoupled`, // url: `/api/mapBuild/switchCoupled`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 删除联动道岔*/ // /** 删除联动道岔*/
export function deleteLinkageSwitch(coupleId) { // export function deleteLinkageSwitch(coupleId) {
return request({ // return request({
url: `/api/mapBuild/switchCoupled/${coupleId}`, // url: `/api/mapBuild/switchCoupled/${coupleId}`,
method: 'delete' // method: 'delete'
}); // });
} // }
/** get联动道岔列表*/ // /** get联动道岔列表*/
export function listLinkageSwitch(mapId, params) { // export function listLinkageSwitch(mapId, params) {
return request({ // return request({
url: `/api/mapBuild/${mapId}/switchCoupled`, // url: `/api/mapBuild/${mapId}/switchCoupled`,
method: 'get', // method: 'get',
params: params // params: params
}); // });
} // }
/** 草稿地图数据校验*/ /** 草稿地图数据校验*/
export function verifyMap(id) { export function verifyMap(id) {
@ -204,48 +204,48 @@ export function verifyMap(id) {
}); });
} }
/** 分页查询交路数据*/ // /** 分页查询交路数据*/
export function listRouting(mapId, params) { // export function listRouting(mapId, params) {
return request({ // return request({
url: `/api/mapBuild/${mapId}/routing`, // url: `/api/mapBuild/${mapId}/routing`,
method: 'get', // method: 'get',
params: params // params: params
}); // });
} // }
/** 创建交路*/ // /** 创建交路*/
export function addRouting(data) { // export function addRouting(data) {
return request({ // return request({
url: `/api/mapBuild/routing`, // url: `/api/mapBuild/routing`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 删除交路*/ // /** 删除交路*/
export function deleteRouting(routingId) { // export function deleteRouting(routingId) {
return request({ // return request({
url: `/api/mapBuild/routing/${routingId}`, // url: `/api/mapBuild/routing/${routingId}`,
method: 'delete' // method: 'delete'
}); // });
} // }
/** 获取交路详情*/ // /** 获取交路详情*/
export function getRouting(routingId) { // export function getRouting(routingId) {
return request({ // return request({
url: `/api/mapBuild/routing/${routingId}`, // url: `/api/mapBuild/routing/${routingId}`,
method: 'get' // method: 'get'
}); // });
} // }
/** 更新交路*/ // /** 更新交路*/
export function updateRouting(data) { // export function updateRouting(data) {
return request({ // return request({
url: `/api/mapBuild/routing/${data.id}`, // url: `/api/mapBuild/routing/${data.id}`,
method: 'put', // method: 'put',
data: data // data: data
}); // });
} // }
/** 分页查询交路数据(新版)*/ /** 分页查询交路数据(新版)*/
export function listRoutingData(mapId, params) { export function listRoutingData(mapId, params) {
@ -307,48 +307,48 @@ export function generateStationRunData(routingId) {
}); });
} }
// 创建自动信号 old旧数据 // // 创建自动信号 old旧数据
export function postAutoSignal(data) { // export function postAutoSignal(data) {
return request({ // return request({
url: `/api/mapBuild/autoSignal`, // url: `/api/mapBuild/autoSignal`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
// 删除自动信号 old旧数据 // // 删除自动信号 old旧数据
export function delAutoSignal(autoSignalId) { // export function delAutoSignal(autoSignalId) {
return request({ // return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`, // url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'delete' // method: 'delete'
}); // });
} // }
// 分页获取自动信号列表 old旧数据 // // 分页获取自动信号列表 old旧数据
export function getAutoSignalList(mapId, params) { // export function getAutoSignalList(mapId, params) {
return request({ // return request({
url: `/api/mapBuild/${mapId}/autoSignal`, // url: `/api/mapBuild/${mapId}/autoSignal`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
// 获取自动信号详情 old旧数据 // // 获取自动信号详情 old旧数据
export function getAutoSignalDetail(autoSignalId) { // export function getAutoSignalDetail(autoSignalId) {
return request({ // return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`, // url: `/api/mapBuild/autoSignal/${autoSignalId}`,
method: 'get' // method: 'get'
}); // });
} // }
// 更新自动信号 old旧数据 // // 更新自动信号 old旧数据
export function putAutoSignal(data) { // export function putAutoSignal(data) {
return request({ // return request({
url: `/api/mapBuild/autoSignal/${data.autoSignalId}`, // url: `/api/mapBuild/autoSignal/${data.autoSignalId}`,
method: 'put', // method: 'put',
data: data // data: data
}); // });
} // }
// 分页获取自动信号列表 new新数据 // 分页获取自动信号列表 new新数据
export function getAutoSignalListNew(mapId, params) { export function getAutoSignalListNew(mapId, params) {
@ -393,12 +393,12 @@ export function putAutoSignalNew(data) {
}); });
} }
export function getListByCityCode(cityCode) { // export function getListByCityCode(cityCode) {
return request({ // return request({
url: `/api/mapBuild/${cityCode}/list`, // url: `/api/mapBuild/${cityCode}/list`,
method: 'get' // method: 'get'
}); // });
} // }
// 创建信号机接近区段 // 创建信号机接近区段
export function postApproachSection(data) { export function postApproachSection(data) {
@ -464,12 +464,12 @@ export function delContinueProtect(id) {
method: 'delete' method: 'delete'
}); });
} }
export function getContinueProtectById(id) { // export function getContinueProtectById(id) {
return request({ // return request({
url: `/api/mapBuild/overlap/${id}`, // url: `/api/mapBuild/overlap/${id}`,
method: 'get' // method: 'get'
}); // });
} // }
export function getContinueProtectList(mapId, params) { export function getContinueProtectList(mapId, params) {
return request({ return request({
url: `/api/mapBuild/${mapId}/overlap/paging`, url: `/api/mapBuild/${mapId}/overlap/paging`,
@ -545,14 +545,14 @@ export function getRouteNewList(mapId, params) {
params params
}); });
} }
// 获取自动折返分组列表 // // 获取自动折返分组列表
export function getAutoReentryGroupList(mapId, params) { // export function getAutoReentryGroupList(mapId, params) {
return request({ // return request({
url: `/api/mapBuild/${mapId}/autoReentry/group/reentryTrack`, // url: `/api/mapBuild/${mapId}/autoReentry/group/reentryTrack`,
method: 'get', // method: 'get',
params // params
}); // });
} // }
// 新建进路侧防 // 新建进路侧防
export function postFlankProtection(data) { 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) { // export function getRouteUnitList(id, data) {
return request({ // return request({
url: `/api/mapBuild/${id}/routeUnit`, // url: `/api/mapBuild/${id}/routeUnit`,
method: 'get', // method: 'get',
params: data // params: data
}); // });
} // }
/** 创建路径单元*/ // /** 创建路径单元*/
export function addRouteUnit(data) { // export function addRouteUnit(data) {
return request({ // return request({
url: `/api/mapBuild/routeUnit`, // url: `/api/mapBuild/routeUnit`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 删除路径单元*/ // /** 删除路径单元*/
export function delRouteUnit(id) { // export function delRouteUnit(id) {
return request({ // return request({
url: `/api/mapBuild/routeUnit/${id}`, // url: `/api/mapBuild/routeUnit/${id}`,
method: 'DELETE' // method: 'DELETE'
}); // });
} // }
/** 获取路径单元*/ // /** 获取路径单元*/
export function getRouteUnit(id) { // export function getRouteUnit(id) {
return request({ // return request({
url: `/api/mapBuild/routeUnit/${id}`, // url: `/api/mapBuild/routeUnit/${id}`,
method: 'get' // method: 'get'
}); // });
} // }
/** 更新路径单元*/ // /** 更新路径单元*/
export function setRouteUnit(data) { // export function setRouteUnit(data) {
return request({ // return request({
url: `/api/mapBuild/routeUnit/${data.id}`, // url: `/api/mapBuild/routeUnit/${data.id}`,
method: 'put', // method: 'put',
data: data // data: data
}); // });
} // }

View File

@ -1,28 +1,28 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 开始实训 0*/ // /** 开始实训 0*/
export function startTraining(args, group) { // export function startTraining(args, group) {
return request({ // return request({
url: `/api/training/${args.id}/start`, // url: `/api/training/${args.id}/start`,
method: 'get', // method: 'get',
params: { // params: {
group // group
} // }
}); // });
} // }
/** 实训结束*/ // /** 实训结束*/
export function endTraining(args, group) { // export function endTraining(args, group) {
return request({ // return request({
url: `/api/training/${args.lessonId}/${args.id}/end`, // url: `/api/training/${args.lessonId}/${args.id}/end`,
method: 'get', // method: 'get',
params: { // params: {
mode: args.mode, // mode: args.mode,
usedTime: args.usedTime, // usedTime: args.usedTime,
group // group
} // }
}); // });
} // }
/** 发送步骤数据*/ /** 发送步骤数据*/
export function sendTrainingNextStep(data, group) { export function sendTrainingNextStep(data, group) {
@ -35,31 +35,31 @@ export function sendTrainingNextStep(data, group) {
} }
}); });
} }
/** 获取章节基本信息 0*/ // /** 获取章节基本信息 0*/
export function getTrainingDetail(trainingId) { // export function getTrainingDetail(trainingId) {
return request({ // return request({
url: `/api/training/${trainingId}`, // url: `/api/training/${trainingId}`,
method: 'get' // method: 'get'
}); // });
} // }
/** 添加实训 0*/ // /** 添加实训 0*/
export function addTraining(data) { // export function addTraining(data) {
return request({ // return request({
url: '/api/training', // url: '/api/training',
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 获取实训步骤数据 0*/ // /** 获取实训步骤数据 0*/
export function getTrainingStepsDetail(trainingId, params) { // export function getTrainingStepsDetail(trainingId, params) {
return request({ // return request({
url: `/api/training/${trainingId}/detail`, // url: `/api/training/${trainingId}/detail`,
method: 'get', // method: 'get',
params: params // params: params
}); // });
} // }
/** 查询实训列表 0*/ /** 查询实训列表 0*/
export function pageQueryTraining(params) { export function pageQueryTraining(params) {
@ -69,40 +69,40 @@ export function pageQueryTraining(params) {
params: params params: params
}); });
} }
/** 自动生成实训操作 0*/ // /** 自动生成实训操作 0*/
export function addAutoTraining(data) { // export function addAutoTraining(data) {
return request({ // return request({
url: `/api/training/generate`, // url: `/api/training/generate`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 修改自动删除实训操作 0*/ // /** 修改自动删除实训操作 0*/
export function updateAutoTraining(data) { // export function updateAutoTraining(data) {
return request({ // return request({
url: `/api/training/batchUpdateGenerate`, // url: `/api/training/batchUpdateGenerate`,
method: 'put', // method: 'put',
data: data // data: data
}); // });
} // }
/** 删除自动生成实训 0*/ // /** 删除自动生成实训 0*/
export function deleteAutoTraining(params) { // export function deleteAutoTraining(params) {
return request({ // return request({
url: `/api/training/generate`, // url: `/api/training/generate`,
method: 'delete', // method: 'delete',
params: params // params: params
}); // });
} // }
/** 获取用户实训列表 0*/ // /** 获取用户实训列表 0*/
export function getTrainingList(data) { // export function getTrainingList(data) {
return request({ // return request({
url: `/api/training/list`, // url: `/api/training/list`,
method: 'get', // method: 'get',
params: data // params: data
}); // });
} // }
export function sendCommand(group, command) { export function sendCommand(group, command) {
return request({ return request({
@ -125,29 +125,29 @@ export function sendCommandNew(group, commandDefinitionId, command) {
data: command data: command
}); });
} }
// 添加用户实训数据 0 // // 添加用户实训数据 0
export function addUserTraining(data) { // export function addUserTraining(data) {
return request({ // return request({
url: `/api/training/userTraining`, // url: `/api/training/userTraining`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
// 更新用户实训数据 0 // // 更新用户实训数据 0
export function putUserTraining(data) { // export function putUserTraining(data) {
return request({ // return request({
url: `/api/training/userTraining/${data.id}`, // url: `/api/training/userTraining/${data.id}`,
method: 'put', // method: 'put',
data: data // data: data
}); // });
} // }
// 清除实训数据 0 // // 清除实训数据 0
export function deleteUserTraining(statsId) { // export function deleteUserTraining(statsId) {
return request({ // return request({
url: `/api/training/userTraining/${statsId}`, // url: `/api/training/userTraining/${statsId}`,
method: 'delete' // method: 'delete'
}); // });
} // }
/** 开始实训 (新版地图) */ /** 开始实训 (新版地图) */
export function startTrainingNew (args, group) { export function startTrainingNew (args, group) {
@ -184,7 +184,8 @@ export function getTrainingDetailNew(trainingId) {
url: `/api/v1/training/${trainingId}`, url: `/api/v1/training/${trainingId}`,
method: 'get' method: 'get'
}); });
}/** 添加实训(新版地图) */ }
/** 添加实训(新版地图) */
export function addTrainingNew(data) { export function addTrainingNew(data) {
return request({ return request({
url: '/api/v1/training', 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) { // export function createLessonPermisson(data) {
return request({ // return request({
url: '/api/permission', // url: '/api/permission',
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 获取权限详情*/ /** 获取权限详情*/
export function getPermissonDetail(id) { export function getPermissonDetail(id) {
@ -44,14 +44,14 @@ export function postPermissonList(mapId) {
}); });
} }
/** 获取用户某课程某段时间内可用的权限数量*/ // /** 获取用户某课程某段时间内可用的权限数量*/
export function getTotalRemains(params) { // export function getTotalRemains(params) {
return request({ // return request({
url: '/api/userPermission/totalRemains', // url: '/api/userPermission/totalRemains',
method: 'get', // method: 'get',
params: params // params: params
}); // });
} // }
/** 设置权限失效或有效*/ /** 设置权限失效或有效*/
export function setLessonPermisson(data) { export function setLessonPermisson(data) {
return request({ return request({
@ -61,21 +61,21 @@ export function setLessonPermisson(data) {
}); });
} }
/** 设置权限失效或有效*/ // /** 设置权限失效或有效*/
export function getPermissionList(id) { // export function getPermissionList(id) {
return request({ // return request({
url: `/api/permission/${id}`, // url: `/api/permission/${id}`,
method: 'get' // method: 'get'
}); // });
} // }
/** 获取大屏权限列表*/ // /** 获取大屏权限列表*/
export function queryPermissionScreen() { // export function queryPermissionScreen() {
return request({ // return request({
url: `/api/userPermission/bigScreen`, // url: `/api/userPermission/bigScreen`,
method: 'get' // method: 'get'
}); // });
} // }
/** /**
* 用户权限列表 * 用户权限列表
@ -99,13 +99,13 @@ export function listUserPermision(params) {
}); });
} }
/** 用户权限列表 */ // /** 用户权限列表 */
export function getDistribute(id) { // export function getDistribute(id) {
return request({ // return request({
url: `/api/distribute/${id}`, // url: `/api/distribute/${id}`,
method: 'get' // method: 'get'
}); // });
} // }
/** 设置权限所有者 */ /** 设置权限所有者 */
export function putPermissionOwner(data) { export function putPermissionOwner(data) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,10 +34,17 @@ export function updateRace(id, data) {
// }); // });
// } // }
/** 导入项目试题库 */ /** 导入项目试题库 */
export function importQuestionBand(data) { export function importQuestionBand(data, companyId) {
return request({ return request({
url: `/api/questionBank/questions/import`, url: `/api/questionBank/questions/import?id=${companyId}`,
method: 'post', method: 'post',
data 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'; 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({ return request({
url: `/api/rpTools/config`, url: `/api/rpTools/${planId}/config`,
method: 'get' method: 'get'
}) })
} }
@ -13,9 +44,9 @@ export function getRpConfig() {
/** /**
* 修改运行图配置 * 修改运行图配置
*/ */
export function modifyRpConfig(data) { export function modifyRpConfig(planId, data) {
return request({ return request({
url: `/api/rpTools/config`, url: `/api/rpTools/${planId}/config`,
method: 'put', method: 'put',
data data
}) })
@ -24,9 +55,9 @@ export function modifyRpConfig(data) {
/** /**
* 获取运行图数据 * 获取运行图数据
*/ */
export function getRpTools() { export function getRpTools(planId) {
return request({ return request({
url: '/api/rpTools', url: `/api/rpTools/${planId}`,
method: 'get' method: 'get'
}); });
} }
@ -34,9 +65,9 @@ export function getRpTools() {
/** /**
* 清除运行图 * 清除运行图
*/ */
export function clearRpPlan() { export function clearRpPlan(planId) {
return request({ return request({
url: `/api/rpTools/clear`, url: `/api/rpTools/${planId}/clear`,
method: 'put' method: 'put'
}) })
} }
@ -44,9 +75,9 @@ export function clearRpPlan() {
/** /**
* 添加车次 * 添加车次
*/ */
export function addRpTrip(data) { export function addRpTrip(planId, data) {
return request({ return request({
url: '/api/rpTools/trip', url: `/api/rpTools/${planId}/trip`,
method: 'post', method: 'post',
data data
}); });
@ -55,9 +86,9 @@ export function addRpTrip(data) {
/** /**
* 删除车次 * 删除车次
*/ */
export function delRpTrip(tripNo) { export function delRpTrip(planId, tripNo) {
return request({ return request({
url: `/api/rpTools/${tripNo}/trip`, url: `/api/rpTools/${planId}/${tripNo}/trip`,
method: 'delete' method: 'delete'
}) })
} }
@ -66,9 +97,9 @@ export function delRpTrip(tripNo) {
/** /**
* 平移服务 * 平移服务
*/ */
export function translateRpService(serviceNo, data) { export function translateRpService(planId, serviceNo, data) {
return request({ return request({
url: `/api/rpTools/${serviceNo}/service`, url: `/api/rpTools/${planId}/${serviceNo}/service`,
method: 'put', method: 'put',
data data
}) })
@ -77,9 +108,9 @@ export function translateRpService(serviceNo, data) {
/** /**
* 删除服务 * 删除服务
*/ */
export function delRpService(serviceNo) { export function delRpService(planId, serviceNo) {
return request({ return request({
url: `/api/rpTools/${serviceNo}/service`, url: `/api/rpTools/${planId}/${serviceNo}/service`,
method: 'delete' method: 'delete'
}) })
} }
@ -88,9 +119,9 @@ export function delRpService(serviceNo) {
/** /**
* 添加区域 * 添加区域
*/ */
export function createRpArea(data) { export function createRpArea(planId, data) {
return request({ return request({
url: `/api/rpTools/area`, url: `/api/rpTools/${planId}/area`,
method: 'post', method: 'post',
data data
}) })
@ -99,9 +130,9 @@ export function createRpArea(data) {
/** /**
* 修改区域 * 修改区域
*/ */
export function modifyRpArea(areaNo, data) { export function modifyRpArea(planId, areaNo, data) {
return request({ return request({
url: `/api/rpTools/${areaNo}/area`, url: `/api/rpTools/${planId}/${areaNo}/area`,
method: 'put', method: 'put',
data data
}) })
@ -110,9 +141,9 @@ export function modifyRpArea(areaNo, data) {
/** /**
* 修改区域文字 * 修改区域文字
*/ */
export function modifyAreaNote(areaNo, data) { export function modifyAreaNote(planId,areaNo, data) {
return request({ return request({
url: `/api/rpTools/${areaNo}/text`, url: `/api/rpTools/${planId}/${areaNo}/text`,
method: 'put', method: 'put',
data data
}) })
@ -120,9 +151,9 @@ export function modifyAreaNote(areaNo, data) {
/** /**
* 删除区域 * 删除区域
*/ */
export function delRpArea(areaNo) { export function delRpArea(planId, areaNo) {
return request({ return request({
url: `/api/rpTools/${areaNo}/area`, url: `/api/rpTools/${planId}/${areaNo}/area`,
method: 'delete' method: 'delete'
}) })
} }
@ -130,9 +161,9 @@ export function delRpArea(areaNo) {
/** /**
* 修改运行时间 * 修改运行时间
*/ */
export function justTripNoRunning(tripNo, data) { export function justTripNoRunning(planId, tripNo, data) {
return request({ return request({
url: `/api/rpTools/${tripNo}/running`, url: `/api/rpTools/${planId}/${tripNo}/running`,
method: 'put', method: 'put',
data data
}) })
@ -141,9 +172,9 @@ export function justTripNoRunning(tripNo, data) {
/** /**
* 修改停站时间 * 修改停站时间
*/ */
export function justTripNoStop(tripNo, data) { export function justTripNoStop(planId, tripNo, data) {
return request({ return request({
url: `/api/rpTools/${tripNo}/stop`, url: `/api/rpTools/${planId}/${tripNo}/stop`,
method: 'put', method: 'put',
data data
}) })
@ -152,9 +183,9 @@ export function justTripNoStop(tripNo, data) {
/** /**
* 修改折返时间 * 修改折返时间
*/ */
export function justTripTurnback(tripNo, data) { export function justTripTurnBack(planId, tripNo, data) {
return request({ return request({
url: `/api/rpTools/${tripNo}/turnBack`, url: `/api/rpTools/${planId}/${tripNo}/turnBack`,
method: 'put', method: 'put',
data 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) { export function newMapOperate(group, operationId, data) {
return request({ 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'; import pathToRegexp from 'path-to-regexp';
export default { export default {
data() { data() {
return { return {
levelList: null levelList: null
}; };
}, },
watch: { watch: {
$route() { $route() {
this.getBreadcrumb(); this.getBreadcrumb();
} }
}, },
created() { created() {
this.getBreadcrumb(); this.getBreadcrumb();
}, },
methods: { methods: {
getBreadcrumb() { getBreadcrumb() {
// only show routes with meta.title let matched = this.$route.matched.filter(item => item.meta && item.meta.title);
let matched = this.$route.matched.filter(item => item.meta && item.meta.title); const first = matched[0];
const first = matched[0];
if (!this.isDashboard(first)) { if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched); matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched);
} }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false); this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false);
}, },
isDashboard(route) { isDashboard(route) {
const name = route && route.name; const name = route && route.name;
if (!name) { if (!name) {
return false; return false;
} }
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase(); return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase();
}, },
pathCompile(path) { pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 const { params } = this.$route;
const { params } = this.$route; var toPath = pathToRegexp.compile(path);
var toPath = pathToRegexp.compile(path); return toPath(params);
return toPath(params); },
}, handleLink(item) {
handleLink(item) { const { redirect, path } = item;
const { redirect, path } = item; if (redirect) {
if (redirect) { this.$router.push(redirect);
this.$router.push(redirect); return;
return; }
} this.$router.push(this.pathCompile(path));
this.$router.push(this.pathCompile(path)); }
} }
}
}; };
</script> </script>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -85,8 +85,8 @@ class MouseController extends Eventful {
mousedown(e) { mousedown(e) {
// if (eventTool.notLeftMouse(e)) { // if (eventTool.notLeftMouse(e)) {
// return; // return;
// } // }
this.$zr.dom.focus(); this.$zr.dom.focus();
if (e.which == 1 || e.which == 3) { if (e.which == 1 || e.which == 3) {
var x = e.offsetX; var x = e.offsetX;
var y = e.offsetY; var y = e.offsetY;
@ -287,7 +287,7 @@ class MouseController extends Eventful {
} }
}); });
this.deviceList = includeDeviceList; this.deviceList = includeDeviceList;
store.dispatch('map/setSeclectDeviceList', this.deviceList); // 给store设置框选的 model store.commit('map/setSeclectDeviceList', this.deviceList); // 给store设置框选的 model
} }
// 生成包围盒对象坐标 // 生成包围盒对象坐标
createFakeBoundingRect(instance) { 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 EHighlight from '../element/EHighlight';
import ETrainStop from './ETrainStop'; import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart'; import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl';
import EPatternFilter from './EPatternFilter'; 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 {isShowThePrdType} from '../../utils/handlePath';
import {traverseLineElements} from '../utils/ShapeStatusCovert'; import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
class StationStand extends Group { class StationStand extends Group {
constructor(model, style) { constructor(model, style) {
@ -44,17 +48,17 @@ class StationStand extends Group {
this.isShowShape = true; this.isShowShape = true;
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) { // if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) {
this.createFunctionButton(); // this.createFunctionButton();
} // }
if (model.previewOrMapDraw) { // if (model.previewOrMapDraw) {
this.setShowMode(); // this.setShowMode();
} // }
this.setVisible(model.visible); this.setVisible(model.visible);
this.setState(model); this.setState(model);
this.checkIsDrawMap();
} }
create() { create() {
// 加载皮肤控制的元素
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
// // 站台所有的绘图元素 // // 站台所有的绘图元素
@ -85,139 +89,34 @@ class StationStand extends Group {
}; };
// 遍历当前线路下的绘图元素 组合模式 // 遍历当前线路下的绘图元素 组合模式
traverseLineElements(style.StationStand, elementTypeList, model, style, this); 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() { createMouseEvent() {
if (this.style.StationStand.mouseOverStyle) { const path = window.location.href;
this.mouseEvent = new EMouse(this); if (path.includes('/map/draw')) {
this.add(this.mouseEvent); this.highlight = new EHighlight(this);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); this.add(this.highlight);
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); this.on('mouseout', () => { this.highlight.mouseout(); });
} this.on('mouseover', () => { this.highlight.mouseover(); });
} } else {
if (this.style.StationStand.mouseOverStyle) {
createFunctionButton() { this.mouseEvent = new EMouse(this);
const model = this.model; this.add(this.mouseEvent);
const style = this.style; this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
if (model.stopJumpLamp) { this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
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);
} }
} }
@ -266,19 +165,19 @@ class StationStand extends Group {
} }
switch (opts.subDeviceType) { switch (opts.subDeviceType) {
case 'StopJumpLamp': { case 'StopJumpLamp': {
rect = this.stopJumpLampButton.getBoundingRect(); rect = this.stopJumpLamp.getBoundingRect();
break; break;
} }
case 'CancelStopJumpLamp': { case 'CancelStopJumpLamp': {
rect = this.cancelStopJumpLampButton.getBoundingRect(); rect = this.cancelStopJumpLamp.getBoundingRect();
break; break;
} }
case 'UpDetainLamp': { case 'UpDetainLamp': {
rect = this.upDetainLampButton.getBoundingRect(); rect = this.upDetainLamp.getBoundingRect();
break; break;
} }
case 'DownDetainLamp': { case 'DownDetainLamp': {
rect = this.downDetainLampButton.getBoundingRect(); rect = this.downDetainLamp.getBoundingRect();
break; break;
} }
default: { default: {
@ -299,31 +198,18 @@ class StationStand extends Group {
this.highlight && this.highlight.drawSelected(selected); 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() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.StationStand.common.functionButtonShow; const showConditions = this.style.StationStand.common.functionButtonShow;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.stopJumpLampButton && this.stopJumpLampButton.show(); this.stopJumpLamp && this.stopJumpLamp.show();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.show(); this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
this.upDetainLampButton && this.upDetainLampButton.show();
this.downDetainLampButton && this.downDetainLampButton.show();
this.upDetainLamp && this.upDetainLamp.show(); this.upDetainLamp && this.upDetainLamp.show();
this.downDetainLamp && this.downDetainLamp.show(); this.downDetainLamp && this.downDetainLamp.show();
} else { } else {
this.stopJumpLampButton && this.stopJumpLampButton.hide(); this.stopJumpLamp && this.stopJumpLamp.hide();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.hide(); this.cancelStopJumpLamp && this.cancelStopJumpLamp.hide();
this.upDetainLampButton && this.upDetainLampButton.hide();
this.downDetainLampButton && this.downDetainLampButton.hide();
this.upDetainLamp && this.upDetainLamp.hide(); this.upDetainLamp && this.upDetainLamp.hide();
this.downDetainLamp && this.downDetainLamp.hide(); this.downDetainLamp && this.downDetainLamp.hide();
} }

View File

@ -14,3 +14,20 @@ export function traverseLineElements(currentType, elementTypeList, model, style,
obj.add(obj[element]); 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> <template>
<div id="menuBar"> <div id="menuBar" :style="{height: $store.state.training.prdType === '01'? '90px': '130px'}">
<div class="haerbin-01__systerm nav"> <div class="haerbin-01__systerm nav">
<el-row> <el-row v-if="$store.state.training.prdType === '01'">
<el-col :span="2"> <el-col :span="2">
<div class="nav-border"> <div class="nav-border">
<el-row> <el-row>
@ -36,13 +36,13 @@
<el-col :span="10"> <el-col :span="10">
<div class="nav-border"> <div class="nav-border">
<el-row> <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 :style="{background: level === 'A'? '#F00': '#FFF' }" @click="clearLevel">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 :style="{background: level === 'B'? '#F00': '#FFF' }" @click="clearLevel">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 === '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-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">记录</el-button></el-col>
</el-row> </el-row>
<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">双屏</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">TGI</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">管理</el-button></el-col>
@ -64,14 +64,89 @@
</div> </div>
</el-col> </el-col>
</el-row> </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> </div>
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" /> <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> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import voiceIcon from '@/assets/voice.png';
import BuzzerAudio from '@/assets/buzzer.mp3';
export default { export default {
name: 'MenuBar', name: 'MenuBar',
@ -103,7 +178,11 @@ export default {
centralizedStationList2: [], centralizedStationList2: [],
colsNum: 0, colsNum: 0,
version: '', version: '',
centralizedMap: {} centralizedMap: {},
tipContent: [],
voiceIcon:voiceIcon,
level: '',
buzzerAudio: BuzzerAudio
}; };
}, },
computed: { computed: {
@ -152,6 +231,15 @@ export default {
if (list && list.length) { if (list && list.length) {
this.checkRoleChange(list); 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() { mounted() {
@ -163,6 +251,10 @@ export default {
} }
}, },
methods: { methods: {
handleAlarm(val) {
this.level = val.level;
this.controlAudio(true);
},
initMenu() { initMenu() {
// //
const centralizedStationList = []; const centralizedStationList = [];
@ -245,6 +337,20 @@ export default {
this.switchShowStation(this.centralizedMap[item.deviceCode]); 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; background: #ffffff;
cursor: not-allowed; 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> </style>

View File

@ -4,7 +4,6 @@ import router from './router/index_APP_TARGET';
import {loginInfo} from '@/scripts/ProjectConfig'; import {loginInfo} from '@/scripts/ProjectConfig';
import NProgress from 'nprogress'; import NProgress from 'nprogress';
import 'nprogress/nprogress.css'; import 'nprogress/nprogress.css';
// import { admin } from './router/index_APP_TARGET';
import { getToken, removeToken, getSessionStorage } from '@/utils/auth'; import { getToken, removeToken, getSessionStorage } from '@/utils/auth';
import localStore from 'storejs'; import localStore from 'storejs';
@ -14,22 +13,15 @@ import localStore from 'storejs';
// return roles.some(role => permissionRoles.indexOf(role) >= 0); // 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) { for (const val in loginInfo) {
if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) { if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) {
whiteList.push(loginInfo[val].loginPath); whiteList.push(loginInfo[val].loginPath);
} }
} }
// const loginPage = whiteList[0];
// const loginDesignPage = whiteList[1];
// 获取路径数据 // 登录路径判断获取
function getRouteInfo(to) { function getRouteInfo(to) {
let loginPath = ''; let loginPath = '';
const toRoutePath = to.redirectedFrom || to.path; const toRoutePath = to.redirectedFrom || to.path;
@ -71,14 +63,12 @@ function handleRoute(to, next, loginPath) {
}); });
} else { } else {
// 除没有动态改变权限的需求可直接next() 删下方权限判断 // 除没有动态改变权限的需求可直接next() 删下方权限判断
// if (hasPermission(store.getters.roles, to.meta.roles)) {
if (to.path === '/404' && to.redirectedFrom === '/') { if (to.path === '/404' && to.redirectedFrom === '/') {
const project = getSessionStorage('project'); const project = getSessionStorage('project');
next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform'); next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform');
} else { } else {
next(); next();
} }
// }
} }
} }

View File

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

View File

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

View File

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

View File

@ -7,9 +7,6 @@ const iscs = {
state: { state: {
iscs: null, // 数据 iscs: null, // 数据
iscsDevice: {}, // 解析后的地图数据
iscsList: {}, // 数据列表
iscsIdList: {}, // 数据列表(以id为标识)
updateDeviceData: {}, // 修改的数据 updateDeviceData: {}, // 修改的数据
rightClickCount: 0, // 右键点击设备 rightClickCount: 0, // 右键点击设备
selected: '', // 左键选中设备 selected: '', // 左键选中设备
@ -25,19 +22,19 @@ const iscs = {
alarmList: (state) => { alarmList: (state) => {
return state.alarmList; return state.alarmList;
}, },
iscsList: (state) => { // iscsList: (state) => {
return state.iscsList; // return state.iscsList;
}, // },
iscs: (state) => { iscs: (state) => {
return state.iscs; return state.iscs;
}, },
version: (state) => { // version: (state) => {
if (state.iscs) { // if (state.iscs) {
return state.iscs.version; // return state.iscs.version;
} else { // } else {
return null; // return null;
} // }
}, // },
updateDeviceData: (state) => { updateDeviceData: (state) => {
return state.updateDeviceData; return state.updateDeviceData;
}, },
@ -47,107 +44,107 @@ const iscs = {
} else { } else {
return []; 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: { mutations: {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,9 +54,6 @@ const training = {
order: (state) => { order: (state) => {
return state.order; return state.order;
}, },
offsetStationCode: (state) => {
return state.offsetStationCode;
},
basicInfo: (state) => { basicInfo: (state) => {
return state.basicInfo; return state.basicInfo;
}, },
@ -75,24 +72,9 @@ const training = {
usedTime: (state) => { usedTime: (state) => {
return state.usedTime; 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) => { memberList: (state) => {
return state.memberList; return state.memberList;
}, },
simulationUserList: (state) => {
return state.simulationUserList;
},
// 视图中的列车列表 // 视图中的列车列表
viewTrainList: (state) => () =>{ viewTrainList: (state) => () =>{
const trainList = []; const trainList = [];
@ -104,21 +86,6 @@ const training = {
}); });
return trainList; 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: { getters: {
trainingList: (state) => { trainingList: (state) => {
return state.trainingList; 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: { mutations: {
setIndex: (state, index) => { setIndex: (state, index) => {
@ -39,20 +39,6 @@ const trainingList = {
} }
}, },
actions: { 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) { setTrainingList({ commit }, trainingList) {
commit('setTrainingList', trainingList); commit('setTrainingList', trainingList);
}, },

View File

@ -2,7 +2,8 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.169:9000'; // 旭强 // BASE_API = 'http://192.168.3.169:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛 // BASE_API = 'http://192.168.3.175:9000'; // 张赛

View File

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

View File

@ -22,6 +22,34 @@
</template> </template>
</div> </div>
</template> </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"> <span slot="footer" class="dialog-footer">
<el-button @click="show = false">关闭</el-button> <el-button @click="show = false">关闭</el-button>
</span> </span>

View File

@ -10,6 +10,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
import { listQuestionPage, deleteQuestion } from '@/api/questionBank.js'; import { listQuestionPage, deleteQuestion } from '@/api/questionBank.js';
import DialogDetail from './dialog-detail'; import DialogDetail from './dialog-detail';
import { convertSheetToList } from '@/utils/runPlan'; import { convertSheetToList } from '@/utils/runPlan';
import { getCompanyList } from '@/api/company';
import XLSX from 'xlsx'; import XLSX from 'xlsx';
export default { export default {
@ -18,6 +19,7 @@ export default {
}, },
data() { data() {
return { return {
companyList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -25,7 +27,7 @@ export default {
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '80px', labelWidth: '80px',
leftSpan: 17, leftSpan: 16,
queryObject: { queryObject: {
type: { type: {
type: 'select', type: 'select',
@ -37,6 +39,13 @@ export default {
topic: { topic: {
type: 'text', type: 'text',
label: '题 目' label: '题 目'
},
companyId: {
type: 'select',
label: '单位',
config: {
data: []
}
} }
} }
}, },
@ -99,7 +108,8 @@ export default {
actions: [ actions: [
{ text: '添 加', handler: this.doCreate }, { text: '添 加', handler: this.doCreate },
{ text: '导 入', fileType: 'file', handler: this.importQuestionBank }, { 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; 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: { methods: {
doCreate() { doCreate() {
this.$router.push({path: `${UrlConfig.bank.questionCreate}`}); this.$router.push({path: `${UrlConfig.bank.questionCreate}`});
@ -178,100 +196,104 @@ export default {
'问答': 'answer' '问答': 'answer'
}; };
if (file) { if (file) {
setTimeout(() => { try {
const that = this; setTimeout(() => {
const reader = new FileReader(); const that = this;
if (reader) { const reader = new FileReader();
reader.onload = function (e) { if (reader) {
let wb; reader.onload = function (e) {
const data = e.target.result; let wb;
if (that.rABS) { const data = e.target.result;
wb = XLSX.read(btoa(that.fixdata(data)), { // if (that.rABS) {
type: 'base64' 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;
}
}); });
if (questionTypeIndex || questionTypeIndex === 0) { } else {
dataList[questionTypeIndex].forEach((item, index) => { wb = XLSX.read(data, {
if (item && item !== '题型') { type: 'binary'
const param = { });
type: questionTypeMap[item], }
topic: dataList[topicIndex][index], const questionList = [];
optionList: [] if (wb && wb.Sheets) {
}; for (const index in wb.Sheets) {
if (param.type === 'fill') { const dataList = convertSheetToList(wb.Sheets[index], true);
const answer = dataList[answerIndex][index]; let questionTypeIndex;
const answerList = answer.split('&&'); let topicIndex;
answerList && answerList.forEach(item => { let option1Index;
param.optionList.push({content: item, correct: true}); let option2Index;
}); let option3Index;
} else if (param.type === 'answer') { let option4Index;
param.optionList.push({content: dataList[answerIndex][index]}); let answerIndex;
} else { dataList.forEach((item, index) => {
param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' }); if (item[0] === '题型') {
param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' }); questionTypeIndex = index;
if (dataList[option3Index][index]) { } else if (item[0] === '题目') {
param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')}); topicIndex = index;
} } else if ( item[0] === '选项' && item[1] === 'A') {
if (dataList[option4Index][index]) { option1Index = index;
param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')}); } else if (!item[0] && item[1] === 'B') {
} option2Index = index;
} } else if (!item[0] && item[1] === 'C') {
questionList.push(param); 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`}); if (that.rABS) {
}).catch((e) => { reader.readAsArrayBuffer(file);
that.$message.error('导入题库失败!'); } else {
}); reader.readAsBinaryString(file);
// importQuestionBand(questionList, 'DRTS').then(resp => {
// this.$message.success('!');
// }).catch(()=>{
// this.$message.error('');
// });
} }
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
} }
} }, 200);
}, 200); } catch (e) {
this.$message.error('请根据下载模板导入题目!');
}
} }
}, },
importQuestionBank() { importQuestionBank() {
@ -282,6 +304,53 @@ export default {
}, },
questionsRuleManage() { questionsRuleManage() {
this.$router.push({ path: `/system/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>
<template v-if="type==='fill'"> <template v-if="type==='fill'">
<div v-for="(el, i) in answerList" :key="i" style="margin-bottom: 5px;"> <div v-for="(el, i) in answerList" :key="i" style="margin-bottom: 5px;">
<div>{{ `${i + 1}` }}</div> <div style="display: inline-block;margin-right: 10px;height: 40px; line-height: 40px;">{{ `${i + 1}` }}</div>
<item-rich v-model="el.value" :remove="i>0" @modify="doModify(el)" @remove="doRemove(i)" /> <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> </div>
<el-button class="item__button" type="primary" size="mini" icon="el-icon-plus" @click="doAppend" /> <el-button class="item__button" type="primary" size="mini" icon="el-icon-plus" @click="doAppend" />
</template> </template>
@ -36,11 +44,7 @@
</template> </template>
<script> <script>
import ItemRich from './item-rich';
export default { export default {
components: {
ItemRich
},
props: { props: {
optionList: { optionList: {
type: Array, type: Array,
@ -56,36 +60,43 @@ export default {
active: 0, active: 0,
activeList: [], activeList: [],
answer: '', answer: '',
answerList: [{value: ''}] answerList: ['']
}; };
}, },
watch: { watch: {
optionList(val) { optionList: {
if (this.type === 'judge' || this.type === 'select') { deep:true,
this.active = this.optionList.findIndex(ele => ele.correct); handler:function(newV, oldV) {
} else if (this.type === 'multi') { if (this.type === 'judge' || this.type === 'select') {
this.activeList = []; this.active = this.optionList.findIndex(ele => ele.correct);
this.optionList.forEach((el, i) => { } else if (this.type === 'multi') {
if (el.correct) { this.activeList = [];
this.activeList.push(i); this.optionList.forEach((el, i) => {
} if (el.correct) {
}); this.activeList.push(i);
} else if (this.type === 'fill') { }
this.answerList = []; });
this.optionList.forEach(el => { } else if (this.type === 'fill') {
this.answerList.push({value: el.content}); this.answerList = [];
}); this.optionList.forEach(el => {
} else if (this.type === 'answer') { this.answerList.push(el.content);
this.answer = (this.optionList[0] || {content: ''}).content; });
} else if (this.type === 'answer') {
this.answer = (this.optionList[0] || {content: ''}).content;
}
} }
} }
}, },
methods: { methods: {
onChange(e) { onChange(e) {
this.$emit('change', e); if (this.type === 'fill') {
this.$emit('change', this.answerList);
} else {
this.$emit('change', e);
}
}, },
doAppend() { doAppend() {
this.answerList.push({value: ''}); this.answerList.push('');
}, },
doModify(el) { doModify(el) {
this.$emit('modify', {model: el, prop: 'value'}); this.$emit('modify', {model: el, prop: 'value'});

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@
</template> </template>
<script> <script>
import { publisMapCityList} from '@/api/designPlatform'; import { publisMapCityList} from '@/api/jmap/map';
import localStore from 'storejs'; 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="createScene" title="创建场景" :script-list="scriptList" @reloadTable="reloadTable" />
<create-scene ref="updateScene" title="更新场景" :script-list="scriptList" @reloadTable="reloadTable" /> <create-scene ref="updateScene" title="更新场景" :script-list="scriptList" @reloadTable="reloadTable" />
<modify-step ref="modifyStep" title="编辑步骤数据" /> <modify-step ref="modifyStep" title="编辑步骤数据" />
<!-- <update-scene ref="modifyScene" :script-list="scriptList" @reloadTable="reloadTable" /> --> <import-scene ref="importScene" :script-list="scriptList" @refresh="reloadTable" />
</div> </div>
</template> </template>
<script> <script>
import { getCompetitionPracticalScene, deleteCompetitionPracticalScene } from '@/api/competition'; import { getCompetitionPracticalScene, deleteCompetitionPracticalScene, getSceneExport } from '@/api/competition';
import { getScriptPageListOnlineNew } from '@/api/script'; import { getScriptPageListOnlineNew } from '@/api/script';
import CreateScene from './create'; import CreateScene from './create';
import ModifyStep from './modify'; import ModifyStep from './modify';
import ImportScene from './importScene';
export default { export default {
name:'SceneManage', name:'SceneManage',
components:{ components:{
CreateScene, CreateScene,
ModifyStep ModifyStep,
ImportScene
}, },
data() { data() {
return { return {
@ -84,12 +86,18 @@ export default {
name: '删 除', name: '删 除',
handleClick: this.doDelete, handleClick: this.doDelete,
type: 'danger' type: 'danger'
},
{
name: '导 出',
handleClick: this.doExport,
type: 'primary'
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '添 加', handler: this.doCreate } { text: '添 加', handler: this.doCreate },
{ text: '导 入', handler: this.doImport }
] ]
} }
}; };
@ -122,6 +130,9 @@ export default {
doCreate() { doCreate() {
this.$refs.createScene.doShow(null); this.$refs.createScene.doShow(null);
}, },
doImport() {
this.$refs.importScene.doShow();
},
reloadTable() { reloadTable() {
if (this.queryList && this.queryList.reload) { if (this.queryList && this.queryList.reload) {
this.queryList.reload(); this.queryList.reload();
@ -129,6 +140,22 @@ export default {
}, },
doModify(index, row) { doModify(index, row) {
this.$refs.modifyStep.doShow(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 {getIscsData} from '@/iscs/constant/iscsData';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen'; import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat';
import { putJointTrainingSimulationUserNew} from '@/api/jointTraining'; import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
// import { handlerIscsEvent } from '@/api/simulation';
// import { IscsOperation } from '@/scripts/ConstDic';
import { deepAssign } from '@/utils/index'; import { deepAssign } from '@/utils/index';
import { getUID } from '@/iscs/utils/Uid'; import { getUID } from '@/iscs/utils/Uid';
@ -100,7 +97,6 @@ export default {
this.iscsDestroy(); this.iscsDestroy();
this.loading = true; this.loading = true;
// const data = parser(getIscsData(mode, system, part), {width: this.canvasWidth, height: this.canvasHeight});
this.$iscs = new Iscs({ this.$iscs = new Iscs({
dom: document.getElementById(this.iscsId), dom: document.getElementById(this.iscsId),
config: { config: {

View File

@ -5,7 +5,7 @@
<el-input v-model="operateModel.name" style="width: 300px" /> <el-input v-model="operateModel.name" style="width: 300px" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.mapName') + ':'" prop="mapId"> <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 <el-option
v-for="option in mapIdList" v-for="option in mapIdList"
:key="option.code" :key="option.code"
@ -65,7 +65,7 @@
<script> <script>
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie'; 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'; import { getOperateTrainingList } from '@/api/management/operation';
export default { export default {

View File

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

View File

@ -287,7 +287,7 @@ export default {
}, },
submitConfirmExam(submitData) { submitConfirmExam(submitData) {
this.loading = true; this.loading = true;
submitPracticeQuestionData('drts', {mode:'02', theoryAnswers:submitData}).then(res=>{ submitPracticeQuestionData('DRTS', {mode:'02', theoryAnswers:submitData}).then(res=>{
this.loading = false; this.loading = false;
this.isResult = true; this.isResult = true;
this.$message.success('提交成功'); this.$message.success('提交成功');
@ -369,7 +369,7 @@ export default {
} }
} }
this.isSelect = true; this.isSelect = true;
updatePracticeQuestionProgress('drts', {index:this.currentQuestionNum}).then(res=>{ updatePracticeQuestionProgress('DRTS', {index:this.currentQuestionNum}).then(res=>{
}).catch(error=>{ }).catch(error=>{
console.log(error.message); 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 MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform'; import { loadDraftScriptNew } from '@/api/designPlatform';
import Vue from 'vue'; import Vue from 'vue';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';

View File

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

View File

@ -154,7 +154,7 @@ export default {
}, },
clearList() { // clearList() { //
this.stationCode = ''; this.stationCode = '';
this.$store.dispatch('map/setSeclectDeviceList', []); this.$store.commit('map/setSeclectDeviceList', []);
this.seclectDeviceList = []; this.seclectDeviceList = [];
this.modelList = [ 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"> <template slot="header">
<div class="header"> <div class="header">
<div class="menus-left"> <div class="menus-left">
<el-button type="primary" @click="doNewPlan">New</el-button> <el-button type="primary" @click="drawer=true">Open</el-button>
<el-button type="primary" @click="onDialog(MenuEnum.planSetParams)">Set Param</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>
<div class="menus-right"> <div class="menus-right">
<span style="font-size:22px;padding:0 17px;">Plan</span> <span style="font-size:22px;padding:0 17px;">Plan</span>
@ -28,6 +30,7 @@
:model="model" :model="model"
:selected="selected" :selected="selected"
:target="target" :target="target"
:disabled="disabled"
@remove="onRemove" @remove="onRemove"
@clear="onClear" @clear="onClear"
/> />
@ -35,33 +38,58 @@
</div> </div>
</template> </template>
</schedule> </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-running :config="config" :selected="selected" :stations="stations" @justRunning="doJustRunning" />
<plan-just-stop :config="config" :selected="selected" @justStop="doJustStop"/> <plan-just-stop :config="config" :selected="selected" @justStop="doJustStop"/>
<plan-just-turnback :config="config" :selected="selected" @justTurnBack="doJustTurnback"/> <plan-just-turnback :config="config" :selected="selected" @justTurnBack="doJustTurnback"/>
<plan-set-params :config="config" @setParams="doSetPlanParams" /> <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"> <div class="fixed" v-show="show">
<textarea :auto-focus="true" v-if="textareaModel.show" v-focus v-model="textareaModel.text" class="fixed-textarea" <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', }"/> :style="{ left: rect.x+'px', top: rect.y+'px', width: rect.width+'px', height: rect.height+'px', }"/>
</div> </div>
</div> </div>
</template> </template>
<script> <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 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 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 { timeFormat } from '@/utils/date';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getStationList } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { import {
listRps, createRp, deleteRp,
getRpTools, clearRpPlan, addRpTrip, delRpTrip, getRpTools, clearRpPlan, addRpTrip, delRpTrip,
justTripNoRunning, justTripNoStop, justTripTurnback, justTripNoRunning, justTripNoStop, justTripTurnBack,
translateRpService, delRpService, translateRpService, delRpService,
getRpConfig, modifyRpConfig, getRpConfig, modifyRpConfig,
createRpArea, modifyRpArea, modifyAreaNote, delRpArea createRpArea, modifyRpArea, modifyAreaNote, delRpArea
@ -74,14 +102,21 @@ export default {
PlanJustStop, PlanJustStop,
PlanJustTurnback, PlanJustTurnback,
PlanSetParams, PlanSetParams,
Menus PlanCreate,
PlanExport,
Menus,
Drawer,
}, },
data() { data() {
return { return {
title: 'XXX', defaultProps: {
canvasId: 'canvas-plan', children: 'children',
label: 'name'
},
drawer: false,
planList: [],
stations: [], stations: [],
planData: [], planData: {},
selected: null, selected: null,
target: null, target: null,
textareaModel: { textareaModel: {
@ -111,6 +146,9 @@ export default {
} }
}, },
computed: { computed: {
disabled() {
return !this.planId;
},
show() { show() {
return this.textareaModel.show; return this.textareaModel.show;
}, },
@ -122,7 +160,10 @@ export default {
}, },
planId() { planId() {
return this.$route.query.planId; return this.$route.query.planId;
}, },
title() {
return this.$route.query.title||'';
},
mapId() { mapId() {
return 9; return 9;
}, },
@ -130,7 +171,7 @@ export default {
return '00'; return '00';
}, },
MenuEnum() { MenuEnum() {
return MenuEnum; return utils.MenuEnum;
} }
}, },
watch: { watch: {
@ -139,14 +180,18 @@ export default {
}, },
height() { height() {
this.setPosition(); this.setPosition();
}, },
$route() {
this.loadPlanData();
}
}, },
created() { created() {
this.planUtil = this.$theme.loadPlanConvert(this.lineCode); this.planUtil = this.$theme.loadPlanConvert(this.lineCode);
}, },
mounted() { mounted() {
this.setPosition(); this.setPosition();
this.loadInitData(); this.loadPlanList();
this.loadPlanData();
}, },
methods: { methods: {
setPosition() { setPosition() {
@ -154,32 +199,46 @@ export default {
this.$store.dispatch('rpTools/resize', { width: this.width, height: this.height }); 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 => { getStationList(this.mapId).then(resp => {
const stations = this.stations = resp.data.filter(el => { const stations = this.stations = resp.data.filter(el => {
return ['车辆段', '停车场'].findIndex(it => { return el.name.includes(it) }) < 0; return ['车辆段', '停车场'].findIndex(it => { return el.name.includes(it) }) < 0;
}); });
this.$store.commit('rpTools/setStations', stations); this.$store.commit('rpTools/setStations', stations);
this.$refs.schedule.loadChartPage(stations); this.$refs.schedule.loadChartPage(stations);
getRpTools().then(rest => { if (this.planId) {
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);
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.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(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 => { }).catch(error => {
this.$messageBox(error.message); this.$messageBox(error.message);
}) })
@ -272,16 +331,49 @@ export default {
break; 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() { doNewPlan() {
clearRpPlan().then(resp => { this.$refs.create.doShow();
this.refresh(); this.$nextTick(e => {
}).catch(error => { if (this.$refs.tree) {
this.refresh(); this.$refs.tree.setCurrentKey(this.planId);
this.$message.info(error.message); }
}) })
},
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) { doSetPlanParams(data) {
modifyRpConfig(data).then(resp => { modifyRpConfig(this.planId, data).then(resp => {
this.config = data; this.config = data;
this.$message.success('Parameters of plan were modified successfully.'); this.$message.success('Parameters of plan were modified successfully.');
}).catch(error => { }).catch(error => {
@ -293,7 +385,7 @@ export default {
text: data.text text: data.text
} }
modifyAreaNote(data.id, model).then(resp => { modifyAreaNote(this.planId, data.id, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -307,7 +399,7 @@ export default {
stationCode: this.selected.stationCode stationCode: this.selected.stationCode
} }
justTripNoRunning(this.selected.tripNo, model).then(resp => { justTripNoRunning(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -322,7 +414,7 @@ export default {
stationCode: this.selected.stationCode stationCode: this.selected.stationCode
} }
justTripNoStop(this.selected.tripNo, model).then(resp => { justTripNoStop(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -337,7 +429,7 @@ export default {
stationCode: this.selected.stationCode stationCode: this.selected.stationCode
} }
justTripTurnback(this.selected.tripNo, model).then(resp => { justTripTurnBack(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -353,7 +445,7 @@ export default {
endTime: timeFormat(data.endTime) endTime: timeFormat(data.endTime)
} }
addRpTrip(model).then(resp => { addRpTrip(this.planId, model).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -374,7 +466,7 @@ export default {
endTime: endTime < startTime? timeFormat(data.startTime): timeFormat(data.endTime) endTime: endTime < startTime? timeFormat(data.startTime): timeFormat(data.endTime)
} }
createRpArea(model).then(resp => { createRpArea(this.planId, model).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -388,7 +480,7 @@ export default {
seconds : this.selected.time seconds : this.selected.time
} }
translateRpService(this.selected.serviceNo, model).then(resp => { translateRpService(this.planId, this.selected.serviceNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.refresh(false); this.refresh(false);
@ -407,7 +499,7 @@ export default {
text: data.text text: data.text
} }
modifyRpArea(data.areaNo, model).then(resp => { modifyRpArea(this.planId, data.areaNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.refresh(false); this.refresh(false);
@ -422,7 +514,7 @@ export default {
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delRpService(this.selected.serviceNo).then(resp => { delRpService(this.planId, this.selected.serviceNo).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.refresh(); this.refresh();
@ -441,7 +533,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delRpTrip(this.selected.tripNo).then(resp => { delRpTrip(this.planId, this.selected.tripNo).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.refresh(); this.refresh();
@ -460,7 +552,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const data = this.target.model; const data = this.target.model;
delRpArea(data.areaNo).then(resp => { delRpArea(this.planId, data.areaNo).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.refresh(); this.refresh();
@ -472,8 +564,8 @@ export default {
} }
}, },
refresh(cls=true) { refresh(cls=true) {
getRpTools().then(rest => { getRpTools(this.planId).then(rest => {
const planData = rest.data; const planData = this.planData = rest.data;
this.$store.commit('rpTools/setPlanData', planData); this.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(planData); this.$refs.schedule.loadChartData(planData);
if (cls) { if (cls) {
@ -524,4 +616,11 @@ export default {
} }
} }
} }
.flex {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
</style> </style>

View File

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

View File

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

View File

@ -105,3 +105,9 @@ export function findPrev(list, idx, cb) {
} }
return null; 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> </template>
<script> <script>
import { getPublishLessonList } from '@/api/jmap/lesson'; import { getPublishLessonList, getExamClassList } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules, getExamClassList } from '@/api/management/exam'; import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
export default { export default {

View File

@ -3,6 +3,17 @@
<div class="scriptHeader"> <div class="scriptHeader">
<div class="scriptList">草稿{{ $t('scriptRecord.scriptList') }}</div> <div class="scriptList">草稿{{ $t('scriptRecord.scriptList') }}</div>
<el-button size="small" type="primary" class="createScript" @click="handleCreate">{{ $t('scriptRecord.scriptCreate') }}</el-button> <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> </div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" /> <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" /> <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 ConstConfig from '@/scripts/ConstConfig';
import { UrlConfig } from '@/scripts/ConstDic'; import { UrlConfig } from '@/scripts/ConstDic';
import { admin, superAdmin} from '@/router/index_APP_TARGET'; 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 { launchFullscreen } from '@/utils/screen';
import { scriptDraftRecordNotify, scriptDraftRecordNotifyNew, scriptRecordNotify, scriptRecordNotifyNew } from '@/api/simulation'; import { scriptDraftRecordNotifyNew, scriptRecordNotifyNew } from '@/api/simulation';
import CreateScript from './create'; import CreateScript from './create';
import ScriptPublish from './publish'; import ScriptPublish from './publish';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
@ -68,7 +79,7 @@ export default {
{ {
type: 'button', type: 'button',
title: this.$t('scriptRecord.operate'), title: this.$t('scriptRecord.operate'),
width: '400', width: '450',
buttons: [ buttons: [
{ {
name: this.$t('scriptRecord.scriptRecord'), name: this.$t('scriptRecord.scriptRecord'),
@ -105,6 +116,12 @@ export default {
handleClick: this.previewScript, handleClick: this.previewScript,
type: 'success' type: 'success'
// showControl:(row) => { return row.status==1}, // 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 => { }).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`); 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-left: 5px;
margin-top: 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> </style>

View File

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

View File

@ -2,16 +2,19 @@
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-company ref="editCompany" @reloadTable="reloadTable" /> <edit-company ref="editCompany" @reloadTable="reloadTable" />
<qr-code ref="qrCode" />
</div> </div>
</template> </template>
<script> <script>
import { getCompanyListPaging, deleteCompany } from '@/api/company'; import { getCompanyListPaging, deleteCompany } from '@/api/company';
import EditCompany from './add'; import EditCompany from './add';
import QrCode from '@/components/QrCode';
export default { export default {
name: 'CompanyManage', name: 'CompanyManage',
components: { components: {
EditCompany EditCompany,
QrCode
}, },
data() { data() {
return { return {
@ -31,15 +34,15 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '公司名称', title: '单位名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '公司电话', title: '单位电话',
prop: 'phone' prop: 'phone'
}, },
{ {
title: '公司地址', title: '单位地址',
prop: 'address' prop: 'address'
}, },
{ {
@ -51,6 +54,10 @@ export default {
name: this.$t('global.edit'), name: this.$t('global.edit'),
handleClick: this.handleUpdate handleClick: this.handleUpdate
}, },
{
name: '生成二维码',
handleClick: this.handleGenerateQrCode
},
{ {
name: '删除', name: '删除',
handleClick: this.handleDeleteCompany, handleClick: this.handleDeleteCompany,
@ -87,6 +94,13 @@ export default {
}, },
handlerBack() { handlerBack() {
this.$router.go(-1); 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> <template>
<el-dialog v-dialogDrag title="添加出题规则" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false"> <el-dialog v-dialogDrag title="添加出题规则" :visible.sync="dialogVisible" width="710" :before-close="handleClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <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"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button> <el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button> <el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
@ -10,6 +51,8 @@
<script> <script>
import { addQuestionRule, updateQuestionRule } from '@/api/questionsRule'; import { addQuestionRule, updateQuestionRule } from '@/api/questionsRule';
import { getSessionStorage } from '@/utils/auth';
import { selectQuestionTypeNum } from '@/api/race';
export default { export default {
name: 'Add', name: 'Add',
props: { props: {
@ -35,42 +78,41 @@ export default {
answerNum: 0, answerNum: 0,
answerPoint: 0 answerPoint: 0
}, },
questionNum: {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
},
update: false update: false
}; };
}, },
computed:{ computed:{
form() { isProject() {
const form = { const project = getSessionStorage('project');
labelWidth: '100px', return project !== 'login' && project !== 'design';
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;
} }
}, },
methods: { methods: {
selectQuestion() {
selectQuestionTypeNum(this.formModel.companyId).then(resp => {
resp.data.forEach(item => {
this.questionNum[item.type] = item.num;
});
});
},
doShow(data) { doShow(data) {
this.dialogVisible = true; this.dialogVisible = true;
this.update = false; this.update = false;
this.questionNum = {
select: 0,
judge: 0,
multi: 0,
fill:0,
answer: 0
};
this.selectQuestion();
if (data) { if (data) {
this.update = true; this.update = true;
this.formModel.id = data.id; this.formModel.id = data.id;
@ -150,7 +192,7 @@ export default {
this.$emit('reloadTable'); this.$emit('reloadTable');
}).catch(e => { }).catch(e => {
if (e.code == 10010) { if (e.code == 10010) {
this.$message.error('关联改公司数据已存在!'); this.$message.error('关联该单位数据已存在!');
} else { } else {
this.$message.error('添加出题规则失败!'); this.$message.error('添加出题规则失败!');
} }

View File

@ -1,6 +1,111 @@
<template> <template>
<div> <div style="text-align: center;">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <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" /> <edit-questions-rule ref="editQuestionsRule" :company-list="companyList" @reloadTable="reloadTable" />
</div> </div>
</template> </template>
@ -17,119 +122,10 @@ export default {
data() { data() {
return { return {
companyList: [], companyList: [],
pagerConfig: { currentPage: 1,
pageSize: 'pageSize', tableData: [],
pageIndex: 'pageNum' pageSize: 10,
}, totalNum: 0,
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}
]
},
currentModel: {} currentModel: {}
}; };
}, },
@ -137,24 +133,43 @@ export default {
getCompanyList().then(resp => { getCompanyList().then(resp => {
this.companyList = resp.data; this.companyList = resp.data;
}); });
this.queryData();
}, },
methods: { 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() { handlerAddCompany() {
this.$refs.editQuestionsRule.doShow(); this.$refs.editQuestionsRule.doShow();
}, },
handleDeleteCompany(index, row) { handleDeleteCompany(index, row) {
deleteQuestionRule(row.id).then(resp => { deleteQuestionRule(row.id).then(resp => {
this.$message.success('删除单位信息成功!'); this.$message.success('删除规则信息成功!');
this.reloadTable(); this.reloadTable();
}).catch(() => { }).catch(() => {
this.$message.error('删除单位信息失败!'); this.$message.error('删除规则信息失败!');
}); });
}, },
handleUpdate(index, row) { handleUpdate(index, row) {
this.$refs.editQuestionsRule.doShow(row); this.$refs.editQuestionsRule.doShow(row);
}, },
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryData();
}, },
handlerBack() { handlerBack() {
this.$router.go(-1); this.$router.go(-1);

View File

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