This commit is contained in:
fan 2019-08-08 14:37:39 +08:00
commit 33844220d3
52 changed files with 4420 additions and 4393 deletions

View File

@ -5,7 +5,7 @@ export function postDataBd(data) {
return request({ return request({
url: `/api/audio/bd?group=${data.group}&conversationId=${data.conversationId}`, url: `/api/audio/bd?group=${data.group}&conversationId=${data.conversationId}`,
method: 'post', method: 'post',
data: data.file, data: data.file
}); });
} }
@ -44,7 +44,7 @@ export function chatWithText(data, group) {
url: `/api/jointTraining/chatWithText?group=${group}`, url: `/api/jointTraining/chatWithText?group=${group}`,
method: 'post', method: 'post',
data: { data: {
message: data, message: data
} }
}); });
} }
@ -67,7 +67,6 @@ export function getJoinTrainCode(data, group) {
}); });
} }
// 创建房间 // 创建房间
export function postCreateRoom(data) { export function postCreateRoom(data) {
return request({ return request({
@ -90,7 +89,7 @@ export function checkRoomExist(params) {
export function postRoomDetail(group) { export function postRoomDetail(group) {
return request({ return request({
url: `/api/jointTraining/room/${group}`, url: `/api/jointTraining/room/${group}`,
method: 'get', method: 'get'
}); });
} }
@ -100,7 +99,7 @@ export function deljointTrainRoom(group) {
url: `/api/jointTraining/room`, url: `/api/jointTraining/room`,
method: 'delete', method: 'delete',
params: { params: {
group: group, group: group
} }
}); });
} }
@ -119,7 +118,7 @@ export function getjointTraining(group) {
url: `/api/jointTraining/room/join`, url: `/api/jointTraining/room/join`,
method: 'put', method: 'put',
params: { params: {
group: group, group: group
} }
}); });
} }
@ -137,7 +136,7 @@ export function putUserRoles(data, group) {
export function getJointTrainRoomUserList(group) { export function getJointTrainRoomUserList(group) {
return request({ return request({
url: `/api/jointTraining/room/${group}/user/list`, url: `/api/jointTraining/room/${group}/user/list`,
method: 'get', method: 'get'
}); });
} }
@ -147,7 +146,7 @@ export function putJointTrainingExit(group) {
url: `/api/jointTraining/room/exit`, url: `/api/jointTraining/room/exit`,
method: 'put', method: 'put',
params: { params: {
group: group, group: group
} }
}); });
} }
@ -178,7 +177,7 @@ export function getUserRoles(group) {
export function putJointTrainingState() { export function putJointTrainingState() {
return request({ return request({
url: `/api/jointTraining/room/back`, url: `/api/jointTraining/room/back`,
method: 'put', method: 'put'
}); });
} }
@ -189,7 +188,7 @@ export function putJointTrainingUserkicked(userId, group) {
method: 'put', method: 'put',
params: { params: {
userId: userId, userId: userId,
group: group, group: group
} }
}); });
} }
@ -200,7 +199,7 @@ export function putJointTrainingSimulation(group) {
url: `/api/jointTraining/room/simulation/all`, url: `/api/jointTraining/room/simulation/all`,
method: 'put', method: 'put',
params: { params: {
group: group, group: group
} }
}); });
} }
@ -211,7 +210,7 @@ export function putJointTrainingSimulationUser(group) {
url: `/api/jointTraining/room/simulation/user/exit`, url: `/api/jointTraining/room/simulation/user/exit`,
method: 'put', method: 'put',
params: { params: {
group: group, group: group
} }
}); });
} }
@ -222,7 +221,7 @@ export function putJointTrainingSimulationEntrance(group) {
url: `/api/jointTraining/room/simulation/user/entrance`, url: `/api/jointTraining/room/simulation/user/entrance`,
method: 'put', method: 'put',
params: { params: {
group: group, group: group
} }
}); });
} }

View File

@ -10,14 +10,13 @@ export function getPublishMapVersion(skinStyle) {
/** 获取发布地图详细内容*/ /** 获取发布地图详细内容*/
export function getPublishMapDetail(skinStyle) { export function getPublishMapDetail(skinStyle) {
let datad = request({ const datad = request({
url: `/api/map/${skinStyle}/details`, url: `/api/map/${skinStyle}/details`,
method: 'get' method: 'get'
}); });
return datad.then(); return datad.then();
} }
/** 根据地图id获取地图信息*/ /** 根据地图id获取地图信息*/
export function getPublishMapInfo(mapId) { export function getPublishMapInfo(mapId) {
return request({ return request({
@ -26,7 +25,6 @@ export function getPublishMapInfo(mapId) {
}); });
} }
/** 获取草稿地图详细内容*/ /** 获取草稿地图详细内容*/
export function getMapDetail(id) { export function getMapDetail(id) {
return request({ return request({
@ -44,7 +42,7 @@ export function set3dMapData(data) {
}); });
} }
/**通过地图id获取地图3d数据*/ /** 通过地图id获取地图3d数据*/
export function get3dMapData(mapId) { export function get3dMapData(mapId) {
return request({ return request({
url: `/api/mapBuild/3dMapData/${mapId}`, url: `/api/mapBuild/3dMapData/${mapId}`,
@ -69,7 +67,7 @@ export function loadmap3dModel() {
}); });
} }
export function getPublish3dMapDetail(skinStyle) { export function getPublish3dMapDetail(skinStyle) {
let datad = request({ const datad = request({
url: `/api/map/${skinStyle}/3dMapData`, url: `/api/map/${skinStyle}/3dMapData`,
method: 'get' method: 'get'
}); });

View File

@ -2,67 +2,67 @@ import request from '@/utils/request';
/** 获取发布的课程列表*/ /** 获取发布的课程列表*/
export function getPublishLessonList() { export function getPublishLessonList() {
return request({ return request({
url: '/api/lesson', url: '/api/lesson',
method: 'get' method: 'get'
}); });
} }
/** 获取发布列表树*/ /** 获取发布列表树*/
export function getPublishLessonTree(params) { export function getPublishLessonTree(params) {
return request({ return request({
url: '/api/lesson/tree', url: '/api/lesson/tree',
method: 'get', method: 'get',
params: params || {} params: params || {}
}); });
} }
/** 获取发布课程列表*/ /** 获取发布课程列表*/
export function getPublishLessonDetail(data) { export function getPublishLessonDetail(data) {
return request({ return request({
url: `/api/lesson/${data.id}`, url: `/api/lesson/${data.id}`,
method: 'get' method: 'get'
}); });
} }
/** 发布课程分页列表列表*/ /** 发布课程分页列表列表*/
export function publishLessonList(param) { export function publishLessonList(param) {
return request({ return request({
url: `/api/lesson/publishedLesson`, url: `/api/lesson/publishedLesson`,
method: 'get', method: 'get',
params: param params: param
}); });
} }
/** 删除发布课程*/ /** 删除发布课程*/
export function delPublishLesson(lessonId) { export function delPublishLesson(lessonId) {
return request({ return request({
url: `/api/lesson/publishedLesson/${lessonId}`, url: `/api/lesson/publishedLesson/${lessonId}`,
method: 'delete' method: 'delete'
}); });
} }
/**发布课程上架*/ /** 发布课程上架*/
export function putLessonOnLine(id) { export function putLessonOnLine(id) {
return request({ return request({
url: `/api/lesson/${id}/onLine`, url: `/api/lesson/${id}/onLine`,
method: 'put', method: 'put'
}); });
} }
/**发布课程下架*/ /** 发布课程下架*/
export function putLessonOffLine(id) { export function putLessonOffLine(id) {
return request({ return request({
url: `/api/lesson/${id}/offLine`, url: `/api/lesson/${id}/offLine`,
method: 'put', method: 'put'
}); });
} }
/** /**
* 获取地图产品下的课程列表 * 获取地图产品下的课程列表
*/ */
export function getCommodityProductLesson(prdCode) { export function getCommodityProductLesson(prdCode) {
return request({ return request({
url: `/api/lesson/${prdCode}/list`, url: `/api/lesson/${prdCode}/list`,
method: 'get', method: 'get'
}); });
} }

View File

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

View File

@ -2,98 +2,98 @@ import request from '@/utils/request';
/** 获取发布地图管理分页*/ /** 获取发布地图管理分页*/
export function getPublishMapList(params) { export function getPublishMapList(params) {
return request({ return request({
url: '/api/map', url: '/api/map',
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 根据皮肤获取发布地图列表*/ /** 根据皮肤获取发布地图列表*/
export function getPublishMapListBySkinStyle(skinStyle) { export function getPublishMapListBySkinStyle(skinStyle) {
return request({ return request({
url: `/api/map/${skinStyle}/list`, url: `/api/map/${skinStyle}/list`,
method: 'get' method: 'get'
}); });
} }
/** 获取地图版本信息*/ /** 获取地图版本信息*/
export function getPublishMapVersion(skinStyle) { export function getPublishMapVersion(skinStyle) {
return request({ return request({
url: `/api/map/${skinStyle}/version`, url: `/api/map/${skinStyle}/version`,
method: 'get' method: 'get'
}); });
} }
/** 获取发布地图详细内容*/ /** 获取发布地图详细内容*/
export function getPublishMapDetail(skinStyle) { export function getPublishMapDetail(skinStyle) {
return request({ return request({
url: `/api/map/${skinStyle}/details`, url: `/api/map/${skinStyle}/details`,
method: 'get' method: 'get'
}); });
} }
/** 获取发布地图列车列表*/ /** 获取发布地图列车列表*/
export function getPublishTrainList(skinStyle) { export function getPublishTrainList(skinStyle) {
return request({ return request({
url: `/api/map/${skinStyle}/train`, url: `/api/map/${skinStyle}/train`,
method: 'get' method: 'get'
}); });
} }
/** 获取发布地图列表*/ /** 获取发布地图列表*/
export function listPublishMap() { export function listPublishMap() {
return request({ return request({
url: '/api/map/list', url: '/api/map/list',
method: 'get' method: 'get'
}); });
} }
/** 根据地图id获取地图信息*/ /** 根据地图id获取地图信息*/
export function getPublishMapInfo(mapId) { export function getPublishMapInfo(mapId) {
return request({ return request({
url: `/api/map/${mapId}`, url: `/api/map/${mapId}`,
method: 'get' method: 'get'
}); });
} }
/** 发布地图数据导出*/ /** 发布地图数据导出*/
export function getPublishMapExport(mapId) { export function getPublishMapExport(mapId) {
return request({ return request({
url: `/api/map/${mapId}/export`, url: `/api/map/${mapId}/export`,
method: 'get' method: 'get'
}); });
} }
/** 删除发布地图*/ /** 删除发布地图*/
export function delPublishMap(mapId) { export function delPublishMap(mapId) {
return request({ return request({
url: `/api/map/${mapId}`, url: `/api/map/${mapId}`,
method: 'DELETE' method: 'DELETE'
}); });
} }
/**发布地图上架*/ /** 发布地图上架*/
export function putMapOnLine(mapId) { export function putMapOnLine(mapId) {
return request({ return request({
url: `/api/map/${mapId}/onLine`, url: `/api/map/${mapId}/onLine`,
method: 'put', method: 'put'
}); });
} }
/**发布地图下架*/ /** 发布地图下架*/
export function putMapOffLine(mapId) { export function putMapOffLine(mapId) {
return request({ return request({
url: `/api/map/${mapId}/offLine`, url: `/api/map/${mapId}/offLine`,
method: 'put', method: 'put'
}); });
} }
/**修改发布地图名称*/ /** 修改发布地图名称*/
export function updatePublishMapName(data) { export function updatePublishMapName(data) {
return request({ return request({
url: `/api/map/${data.mapId}/updateName`, url: `/api/map/${data.mapId}/updateName`,
method: 'put', method: 'put',
data: data data: data
}); });
} }

View File

@ -2,339 +2,337 @@ import request from '@/utils/request';
/** 获取地图树形类表*/ /** 获取地图树形类表*/
export function getMapTree() { export function getMapTree() {
return request({ return request({
url: '/api/mapBuild/tree', url: '/api/mapBuild/tree',
method: 'get' method: 'get'
}); });
} }
/** 草稿地图列表*/ /** 草稿地图列表*/
export function listMap() { export function listMap() {
return request({ return request({
url: '/api/mapBuild/list', url: '/api/mapBuild/list',
method: 'get' method: 'get'
}); });
} }
/** 获取草稿地图详细内容*/ /** 获取草稿地图详细内容*/
export function getMapDetail(id) { export function getMapDetail(id) {
return request({ return request({
url: `/api/mapBuild/${id}/mapDataDetail`, url: `/api/mapBuild/${id}/mapDataDetail`,
method: 'get' method: 'get'
}); });
} }
/** 新建草稿地图*/ /** 新建草稿地图*/
export function newMap(data) { export function newMap(data) {
return request({ return request({
url: '/api/mapBuild/create', url: '/api/mapBuild/create',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 更新草稿地图*/ /** 更新草稿地图*/
export function updateMap(data) { export function updateMap(data) {
return request({ return request({
url: `/api/mapBuild/${data.id}`, url: `/api/mapBuild/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 删除草稿地图*/ /** 删除草稿地图*/
export function deleteMap(data) { export function deleteMap(data) {
return request({ return request({
url: `/api/mapBuild/delete/${data}`, url: `/api/mapBuild/delete/${data}`,
method: 'delete' method: 'delete'
}); });
} }
/** 保存草稿地图*/ /** 保存草稿地图*/
export function saveMap(data) { export function saveMap(data) {
return request({ return request({
url: `/api/mapBuild/${data.mapId}/saveElements`, url: `/api/mapBuild/${data.mapId}/saveElements`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 草稿地图另存为*/ /** 草稿地图另存为*/
export function saveAsMap(data) { export function saveAsMap(data) {
return request({ return request({
url: `/api/mapBuild/${data.id}/saveAs`, url: `/api/mapBuild/${data.id}/saveAs`,
method: 'post', method: 'post',
data: { data: {
name: data.name name: data.name
} }
}); });
} }
/** 使用发布地图新建草稿地图*/ /** 使用发布地图新建草稿地图*/
export function newUsePublishMap(data) { export function newUsePublishMap(data) {
return request({ return request({
url: '/api/mapBuild/createFrom', url: '/api/mapBuild/createFrom',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 发布地图*/ /** 发布地图*/
export function publishMap(data) { export function publishMap(data) {
return request({ return request({
url: `/api/mapBuild/${data.id}/publish`, url: `/api/mapBuild/${data.id}/publish`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 草稿地图数据导入*/ /** 草稿地图数据导入*/
export function postBuildMapImport(data) { export function postBuildMapImport(data) {
return request({ return request({
url: `/api/mapBuild/import`, url: `/api/mapBuild/import`,
method: 'post', method: 'post',
data: data, data: data,
time: 60000 time: 60000
}); });
} }
/** 获取延续保护道岔数据列表*/ /** 获取延续保护道岔数据列表*/
export function listOverlapSwitch(mapId, routeCode) { export function listOverlapSwitch(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/overlapSwitch`, url: `/api/mapBuild/${mapId}/${routeCode}/overlapSwitch`,
method: 'get' method: 'get'
}); });
} }
/** 获取自动触发区段数据列表*/ /** 获取自动触发区段数据列表*/
export function listTriggerSection(mapId, routeCode) { export function listTriggerSection(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/triggerSection`, url: `/api/mapBuild/${mapId}/${routeCode}/triggerSection`,
method: 'get' method: 'get'
}); });
} }
/** 获取延续保护区段数据列表*/ /** 获取延续保护区段数据列表*/
export function listOverlapSection(mapId, routeCode) { export function listOverlapSection(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/overlapSection`, url: `/api/mapBuild/${mapId}/${routeCode}/overlapSection`,
method: 'get' method: 'get'
}); });
} }
/** 获取物理区段数据列表*/ /** 获取物理区段数据列表*/
export function listPhysicsSection(mapId, routeCode) { export function listPhysicsSection(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/physicsSection`, url: `/api/mapBuild/${mapId}/${routeCode}/physicsSection`,
method: 'get' method: 'get'
}); });
} }
/** 获取屏蔽门数据列表*/ /** 获取屏蔽门数据列表*/
export function listStationStand(mapId, routeCode) { export function listStationStand(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/stationStand`, url: `/api/mapBuild/${mapId}/${routeCode}/stationStand`,
method: 'get' method: 'get'
}); });
} }
/** 获取道岔段数据列表*/ /** 获取道岔段数据列表*/
export function listSwitch(mapId, routeCode) { export function listSwitch(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/switch`, url: `/api/mapBuild/${mapId}/${routeCode}/switch`,
method: 'get' method: 'get'
}); });
} }
/** 获取敌对进路数据列表*/ /** 获取敌对进路数据列表*/
export function listAgainstRoute(mapId, routeCode) { export function listAgainstRoute(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/againstRoute`, url: `/api/mapBuild/${mapId}/${routeCode}/againstRoute`,
method: 'get' method: 'get'
}); });
} }
/** 查询进路侧防道岔*/ /** 查询进路侧防道岔*/
export function listFlankProtectionSwitch(mapId, routeCode) { export function listFlankProtectionSwitch(mapId, routeCode) {
return request({ return request({
url: `/api/mapBuild/${mapId}/${routeCode}/flankProtection`, url: `/api/mapBuild/${mapId}/${routeCode}/flankProtection`,
method: 'get' method: 'get'
}); });
} }
/** 查询进路列表*/ /** 查询进路列表*/
export function listRouteAccess(mapId, params) { export function listRouteAccess(mapId, params) {
return request({ return request({
url: `/api/mapBuild/${mapId}/access`, url: `/api/mapBuild/${mapId}/access`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 查询进路地图列表*/ /** 查询进路地图列表*/
export function listRouteMapAccess(mapId) { export function listRouteMapAccess(mapId) {
return request({ return request({
url: `/api/mapBuild/${mapId}/access/all`, url: `/api/mapBuild/${mapId}/access/all`,
method: 'get' method: 'get'
}); });
} }
/** 查询进路明细*/ /** 查询进路明细*/
export function queryRouteAccessDetail(data) { export function queryRouteAccessDetail(data) {
return request({ return request({
url: `/api/mapBuild/${data.mapId}/access/${data.id}`, url: `/api/mapBuild/${data.mapId}/access/${data.id}`,
method: 'get' method: 'get'
}); });
} }
/** 创建进路*/ /** 创建进路*/
export function createRouteAccess(data) { export function createRouteAccess(data) {
return request({ return request({
url: `/api/mapBuild/${data.mapId}/access`, url: `/api/mapBuild/${data.mapId}/access`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 删除进路*/ /** 删除进路*/
export function deleteRouteAccess(mapId, id) { export function deleteRouteAccess(mapId, id) {
return request({ return request({
url: `/api/mapBuild/${mapId}/access/${id}`, url: `/api/mapBuild/${mapId}/access/${id}`,
method: 'delete' method: 'delete'
}); });
} }
/** 更新进路*/ /** 更新进路*/
export function updateRouteAccess(data) { export function updateRouteAccess(data) {
return request({ return request({
url: `/api/mapBuild/${data.mapId}/access/${data.id}`, url: `/api/mapBuild/${data.mapId}/access/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 更新敌对进路*/ /** 更新敌对进路*/
export function updateAgainstAccess(data) { export function updateAgainstAccess(data) {
return request({ return request({
url: `/api/mapBuild/${data.mapId}/access/${data.id}/againstRel`, url: `/api/mapBuild/${data.mapId}/access/${data.id}/againstRel`,
method: 'post', method: 'post',
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(mapId, coupleId) { export function deleteLinkageSwitch(mapId, coupleId) {
return request({ return request({
url: `/api/mapBuild/switchCoupled/${mapId}/${coupleId}`, url: `/api/mapBuild/switchCoupled/${mapId}/${coupleId}`,
method: 'delete' method: 'delete'
}); });
} }
/** get联动道岔列表*/ /** get联动道岔列表*/
export function listLinkageSwitch(mapId, params) { export function listLinkageSwitch(mapId, params) {
return request({ return request({
url: `/api/mapBuild/switchCoupled/list/${mapId}`, url: `/api/mapBuild/switchCoupled/list/${mapId}`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 草稿地图数据校验*/ /** 草稿地图数据校验*/
export function verifyMap(id) { export function verifyMap(id) {
return request({ return request({
url: `/api/mapBuild/${id}/checkData`, url: `/api/mapBuild/${id}/checkData`,
method: 'get', method: 'get'
}); });
} }
/** 分页查询交路数据*/ /** 分页查询交路数据*/
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 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
}); });
} }
// 删除自动信号 // 删除自动信号
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'
}); });
} }
// 删除自动信号 // 删除自动信号
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
}); });
} }
// 获取自动信号 // 获取自动信号
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'
}); });
} }
// 更新自动信号 // 更新自动信号
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
}); });
} }

View File

@ -2,43 +2,43 @@ 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

@ -44,7 +44,6 @@ export function sendTrainingNextStep(data, group) {
}); });
} }
/** 获取实训树*/ /** 获取实训树*/
export function getTrainingTree() { export function getTrainingTree() {
return request({ return request({
@ -153,7 +152,7 @@ export function deleteAutoTraining(params) {
}); });
} }
/**获取用户实训列表*/ /** 获取用户实训列表*/
export function getTrainingList(data) { export function getTrainingList(data) {
return request({ return request({
url: `/api/training/list`, url: `/api/training/list`,
@ -202,6 +201,6 @@ export function putUserTraining(data) {
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'
}); });
} }

View File

@ -1,68 +1,67 @@
import request from '@/utils/request'; import request from '@/utils/request';
// 账号密码 其他系统 // 账号密码 其他系统
export function login(params) { export function login(params) {
return request({ return request({
url: '/api/login', url: '/api/login',
method: 'post', method: 'post',
data: params data: params
}); });
} }
// 获取登陆url 二维码 其他系统 // 获取登陆url 二维码 其他系统
export function getLoginUrl(params) { export function getLoginUrl(params) {
return request({ return request({
url: '/api/login/url', url: '/api/login/url',
method: 'get', method: 'get',
params: params params: params
}); });
} }
// 获取登录信息 // 获取登录信息
export function getInfo(token) { export function getInfo(token) {
return request({ return request({
url: '/api/login/getUserInfo', url: '/api/login/getUserInfo',
method: 'get', method: 'get',
params: { token } params: { token }
}); });
} }
// 登出 // 登出
export function logout(token) { export function logout(token) {
return request({ return request({
url: '/api/login/logout', url: '/api/login/logout',
method: 'get', method: 'get',
params: { params: {
token token
} }
}); });
} }
// 检查登陆状态 // 检查登陆状态
export function checkLoginStatus(sessionId) { export function checkLoginStatus(sessionId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
request({ request({
url: '/api/login/checkStatus', url: '/api/login/checkStatus',
method: 'get', method: 'get',
params: { params: {
sessionId: sessionId sessionId: sessionId
} }
}).then(response => { }).then(response => {
if (response.data.status === '2') { if (response.data.status === '2') {
resolve(response); resolve(response);
} else { } else {
reject(response); reject(response);
} }
}).catch(error => { }).catch(error => {
reject(error); reject(error);
}); });
}); });
} }
// 检测持续在线 防止掉线在大屏或者仿真系统下 // 检测持续在线 防止掉线在大屏或者仿真系统下
export function checkLoginLine() { export function checkLoginLine() {
return request({ return request({
url: '/api/cache/heartBeat', url: '/api/cache/heartBeat',
method: 'get', method: 'get'
}); });
} }

View File

@ -1,15 +1,13 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 分页获取课程权限数据*/ /** 分页获取课程权限数据*/
export function getLessonPermissonPageList(params) { export function getLessonPermissonPageList(params) {
return request({ return request({
url: '/api/permission', url: '/api/permission',
method: 'get', method: 'get',
params: params params: params
}); });
} }
// 根据ID获取权限数据 // 根据ID获取权限数据
@ -22,45 +20,45 @@ 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 getTotalRemains(params) { export function getTotalRemains(params) {
return request({ return request({
url: '/api/permission/totalRemains', url: '/api/permission/totalRemains',
method: 'get', method: 'get',
params: params params: params
}); });
} }
/**设置权限失效或有效*/ /** 设置权限失效或有效*/
export function setLessonPermisson(data) { export function setLessonPermisson(data) {
return request({ return request({
url: `/api/permission/${data.id}/status`, url: `/api/permission/${data.id}/status`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** /**
* 查询仿真权限列表 * 查询仿真权限列表
*/ */
export function queryPermissionSimulation(data) { export function queryPermissionSimulation(data) {
return request({ return request({
url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`, url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`,
method: 'get' method: 'get'
}); });
} }
/**获取大屏权限列表*/ /** 获取大屏权限列表*/
export function queryPermissionScreen() { export function queryPermissionScreen() {
return request({ return request({
url: `/api/permission/bigScreen`, url: `/api/permission/bigScreen`,
method: 'get' method: 'get'
}); });
} }
/** 更新课程权限*/ /** 更新课程权限*/
@ -84,31 +82,30 @@ export function deleteLessonPermisson(id) {
} }
*/ */
/** /**
* 用户权限列表 * 用户权限列表
*/ */
export function listUserPermision(params) { export function listUserPermision(params) {
return request({ return request({
url: `/api/permission/my`, url: `/api/permission/my`,
method: 'get', method: 'get',
params: params params: 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) {
return request({ return request({
url: `/api/permission/${data.id}/owner`, url: `/api/permission/${data.id}/owner`,
method: 'put', method: 'put',
data: data.owner data: data.owner
}); });
} }

View File

@ -1,51 +1,51 @@
import request from '@/utils/request'; import request from '@/utils/request';
export function list(params) { export function list(params) {
return request({ return request({
url: '/api/dictionary/list', url: '/api/dictionary/list',
method: 'get', method: 'get',
params: params params: params
}); });
} }
export function checkDicCodeExist(code) { export function checkDicCodeExist(code) {
return request({ return request({
url: '/api/dictionary/checkExistByCode', url: '/api/dictionary/checkExistByCode',
method: 'get', method: 'get',
params: { params: {
code: code code: code
} }
}); });
} }
export function getData(id) { export function getData(id) {
return request({ return request({
url: `/api/dictionary/${id}`, url: `/api/dictionary/${id}`,
method: 'get' method: 'get'
}); });
} }
export function create(data) { export function create(data) {
return request({ return request({
url: '/api/dictionary/create', url: '/api/dictionary/create',
method: 'post', method: 'post',
data: data data: data
}); });
} }
export function del(id) { export function del(id) {
return request({ return request({
url: `/api/dictionary/delete/${id}`, url: `/api/dictionary/delete/${id}`,
method: 'delete' method: 'delete'
}); });
} }
export function update(data) { export function update(data) {
return request({ return request({
url: `/api/dictionary/update/${data.id}`, url: `/api/dictionary/update/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** /**
@ -53,11 +53,11 @@ export function update(data) {
* @param {*} code * @param {*} code
*/ */
export function getDetailList(code) { export function getDetailList(code) {
return request({ return request({
url: '/api/dictionary/getDetailListByCode', url: '/api/dictionary/getDetailListByCode',
method: 'get', method: 'get',
params: { params: {
code: code code: code
} }
}); });
} }

View File

@ -1,49 +1,49 @@
import request from '@/utils/request'; import request from '@/utils/request';
export function list(dicId, params) { export function list(dicId, params) {
return request({ return request({
url: `/api/dictionary/${dicId}/detail/list`, url: `/api/dictionary/${dicId}/detail/list`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
export function checkDicDetailCodeExist(dicId, code) { export function checkDicDetailCodeExist(dicId, code) {
return request({ return request({
url: `/api/dictionary/${dicId}/detail/checkExistByCode`, url: `/api/dictionary/${dicId}/detail/checkExistByCode`,
method: 'get', method: 'get',
params: { params: {
code: code code: code
} }
}); });
} }
export function getData(dicId, id) { export function getData(dicId, id) {
return request({ return request({
url: `/api/dictionary/${dicId}/detail/${id}`, url: `/api/dictionary/${dicId}/detail/${id}`,
method: 'get' method: 'get'
}); });
} }
export function create(dicId, data) { export function create(dicId, data) {
return request({ return request({
url: `/api/dictionary/${dicId}/detail/create`, url: `/api/dictionary/${dicId}/detail/create`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
export function del(dicId, id) { export function del(dicId, id) {
return request({ return request({
url: `/api/dictionary/${dicId}/detail/delete/${id}`, url: `/api/dictionary/${dicId}/detail/delete/${id}`,
method: 'delete' method: 'delete'
}); });
} }
export function update(dicId, data) { export function update(dicId, data) {
return request({ return request({
url: `/api/dictionary/${dicId}/detail/update/${data.id}`, url: `/api/dictionary/${dicId}/detail/update/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }

View File

@ -2,106 +2,106 @@ 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/givePermission', url: '/api/distribute/givePermission',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 接收课程权限*/ /** 接收课程权限*/
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) {
return request({ return request({
url: '/api/distribute', url: '/api/distribute',
method: 'get', method: 'get',
params: params params: 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) {
return request({ return request({
url: `/api/distribute/${id}/restore`, url: `/api/distribute/${id}/restore`,
method: 'put', method: 'put'
}); });
} }
/** 生成打包权限二维码*/ /** 生成打包权限二维码*/
export function getPackageQrCode(params) { export function getPackageQrCode(params) {
return request({ return request({
url: `/api/distribute/package/qrCode`, url: `/api/distribute/package/qrCode`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 权限分发打包详情*/ /** 权限分发打包详情*/
export function getPermissionPackageDetail(id, params) { export function getPermissionPackageDetail(id, params) {
return request({ return request({
url: `/api/distribute/package/${id}/detail`, url: `/api/distribute/package/${id}/detail`,
method: 'get', method: 'get',
params: params params: 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
}); });
} }

View File

@ -2,95 +2,95 @@ import request from '@/utils/request';
/** 获取考试列表树*/ /** 获取考试列表树*/
export function getCourseLessonTree(params) { export function getCourseLessonTree(params) {
return request({ return request({
url: '/api/exam/tree', url: '/api/exam/tree',
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 创建对应课程考题 */ /** 创建对应课程考题 */
export function setCourseList(data) { export function setCourseList(data) {
return request({ return request({
url: `/api/exam`, url: `/api/exam`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 获取对应课程下类型 */ /** 获取对应课程下类型 */
export function getCourseTypeList(data) { export function getCourseTypeList(data) {
return request({ return request({
url: `/api/exam/${data.lessonId}/trainingTypes`, url: `/api/exam/${data.lessonId}/trainingTypes`,
method: 'get', method: 'get'
}); });
} }
/** 获取考试课程详情 */ /** 获取考试课程详情 */
export function getCourseLessonDetail(data) { export function getCourseLessonDetail(data) {
return request({ return request({
url: `/api/exam/${data.lessonId}/list`, url: `/api/exam/${data.lessonId}/list`,
method: 'get' method: 'get'
}); });
} }
/** 获取试卷详情 */ /** 获取试卷详情 */
export function getExamLessonDetail(examId) { export function getExamLessonDetail(examId) {
return request({ return request({
url: `/api/exam/${examId}`, url: `/api/exam/${examId}`,
method: 'get' method: 'get'
}); });
} }
/** 获取试卷列表 */ /** 获取试卷列表 */
export function getExamList(data) { export function getExamList(data) {
return request({ return request({
url: '/api/exam/list', url: '/api/exam/list',
method: 'get', method: 'get',
params: data params: data
}); });
} }
/** 删除试卷 */ /** 删除试卷 */
export function deleteExam(data) { export function deleteExam(data) {
return request({ return request({
url: `/api/exam/${data.id}`, url: `/api/exam/${data.id}`,
method: 'delete' method: 'delete'
}); });
} }
/** 设置试卷下架 */ /** 设置试卷下架 */
export function setExamEfficacy(data) { export function setExamEfficacy(data) {
return request({ return request({
url: `/api/exam/${data.id}/offLine`, url: `/api/exam/${data.id}/offLine`,
method: 'put' method: 'put'
}); });
} }
/** 设置试卷上架 */ /** 设置试卷上架 */
export function setExamEffectivey(data) { export function setExamEffectivey(data) {
return request({ return request({
url: `/api/exam/${data.id}/onLine`, url: `/api/exam/${data.id}/onLine`,
method: 'put' method: 'put'
}); });
} }
/** 查询课程下类型题数 */ /** 查询课程下类型题数 */
export function getLessonTypeNum(data) { export function getLessonTypeNum(data) {
return request({ return request({
url: `/api/exam/trainingNum/${data.lessonId}/${data.trainingType}`, url: `/api/exam/trainingNum/${data.lessonId}/${data.trainingType}`,
method: 'get', method: 'get',
params: { params: {
operateType: data.operateType operateType: data.operateType
}, }
}); });
} }
/** 更新考试规则*/ /** 更新考试规则*/
export function updateExamRules(data) { export function updateExamRules(data) {
return request({ return request({
url: `/api/exam/${data.id}`, url: `/api/exam/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }

View File

@ -2,111 +2,110 @@ import request from '@/utils/request';
/** 获取商品信息 */ /** 获取商品信息 */
export function getCommodityDetailByParams(data) { export function getCommodityDetailByParams(data) {
return request({ return request({
url: `/api/goods/detail`, url: `/api/goods/detail`,
method: 'get', method: 'get',
params: data params: data
}); });
} }
/** /**
* 获取商品明细列表 * 获取商品明细列表
*/ */
export function getCommodityList(params) { export function getCommodityList(params) {
return request({ return request({
url: '/api/goods', url: '/api/goods',
method: 'get', method: 'get',
params: params params: 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
}); });
} }
/** /**
* 删除商品明细 * 删除商品明细
*/ */
export function delCommodity(id) { export function delCommodity(id) {
return request({ return request({
url: `/api/goods/${id}`, url: `/api/goods/${id}`,
method: 'delete' method: 'delete'
}); });
} }
/** /**
* 获取商品地图产品课程列表 * 获取商品地图产品课程列表
*/ */
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'
}); });
} }
/** /**
* 获取商品地图产品课程列表 * 获取商品地图产品课程列表
*/ */
export function updataCommodityList(data) { export function updataCommodityList(data) {
return request({ return request({
url: `/api/goods`, url: `/api/goods`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** /**
* 设置失效或有效切换 * 设置失效或有效切换
*/ */
export function setCommodityStatus(id) { export function setCommodityStatus(id) {
return request({ return request({
url: `/api/goods/${id}/status`, url: `/api/goods/${id}/status`,
method: 'put', method: 'put'
}); });
} }
/**获取试用时长*/ /** 获取试用时长*/
export function getGoodsTryUse(data) { export function getGoodsTryUse(data) {
return request({ return request({
url: `/api/goods/tryUse`, url: `/api/goods/tryUse`,
method: 'get', method: 'get',
params: data params: data
}); });
} }
/**设置试用时长*/ /** 设置试用时长*/
export function setGoodsTryUse(data) { export function setGoodsTryUse(data) {
return request({ return request({
url: `/api/goods/${data.goodsId}/tryUse`, url: `/api/goods/${data.goodsId}/tryUse`,
method: 'put', method: 'put',
data: { data: {
time: data.time time: data.time
} }
}); });
} }
/** 获取商品列表*/ /** 获取商品列表*/
export function getGoodsList() { export function getGoodsList() {
return request({ return request({
url: `/api/goods/list`, url: `/api/goods/list`,
method: 'get' method: 'get'
}); });
} }

View File

@ -2,113 +2,113 @@ import request from '@/utils/request';
/** 获取发布地图树*/ /** 获取发布地图树*/
export function getPublishMapTree(cityCode) { export function getPublishMapTree(cityCode) {
return request({ return request({
url: `/api/mapPrd/${cityCode}/tree`, url: `/api/mapPrd/${cityCode}/tree`,
method: 'get' method: 'get'
}); });
} }
/** 获取产品详细内容*/ /** 获取产品详细内容*/
export function getProductDetail(prdCode) { export function getProductDetail(prdCode) {
return request({ return request({
url: `/api/mapPrd/${prdCode}`, url: `/api/mapPrd/${prdCode}`,
method: 'get' method: 'get'
}); });
} }
/** 检查实训编码是否已存在*/ /** 检查实训编码是否已存在*/
export function checkCodeExist(data) { export function checkCodeExist(data) {
return request({ return request({
url: '/api/mapPrd/checkCodeExist', url: '/api/mapPrd/checkCodeExist',
method: 'get', method: 'get',
params: data params: data
}); });
} }
/** 获取产品类目数*/ /** 获取产品类目数*/
export function getProductTree() { export function getProductTree() {
return request({ return request({
url: `/api/mapPrd/tree`, url: `/api/mapPrd/tree`,
method: 'get' method: 'get'
}); });
} }
/** 创建实训类目*/ /** 创建实训类目*/
export function createTrainingCategory(data) { export function createTrainingCategory(data) {
return request({ return request({
url: '/api/mapPrd', url: '/api/mapPrd',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 更新实训类目*/ /** 更新实训类目*/
export function updateTrainingCategory(data) { export function updateTrainingCategory(data) {
return request({ return request({
url: `/api/mapPrd/${data.id}`, url: `/api/mapPrd/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 删除实训类目*/ /** 删除实训类目*/
export function deleteTrainingCategory(data) { export function deleteTrainingCategory(data) {
return request({ return request({
url: `/api/mapPrd/${data.id}`, url: `/api/mapPrd/${data.id}`,
method: 'delete', method: 'delete'
}); });
} }
/** /**
* 获取地图下的产品列表 * 获取地图下的产品列表
*/ */
export function getCommodityMapProduct(skinStyle) { export function getCommodityMapProduct(skinStyle) {
return request({ return request({
url: `/api/mapPrd/${skinStyle}/list`, url: `/api/mapPrd/${skinStyle}/list`,
method: 'get', method: 'get'
}); });
} }
/** /**
* 获取地图下的产品详情 * 获取地图下的产品详情
*/ */
export function getMapProductDetail(prdCode) { export function getMapProductDetail(prdCode) {
return request({ return request({
url: `/api/mapPrd/${prdCode}`, url: `/api/mapPrd/${prdCode}`,
method: 'get', method: 'get'
}); });
} }
/**获取产品管理列表*/ /** 获取产品管理列表*/
export function getProductList(data) { export function getProductList(data) {
return request({ return request({
url: `/api/mapPrd/list`, url: `/api/mapPrd/list`,
method: 'get', method: 'get',
params: data params: data
}); });
} }
/**发布地图产品上架*/ /** 发布地图产品上架*/
export function putMapProductOnLine(id) { export function putMapProductOnLine(id) {
return request({ return request({
url: `/api/mapPrd/${id}/onLine`, url: `/api/mapPrd/${id}/onLine`,
method: 'put', method: 'put'
}); });
} }
/**发布地图产品下架*/ /** 发布地图产品下架*/
export function putMapProductOffLine(id) { export function putMapProductOffLine(id) {
return request({ return request({
url: `/api/mapPrd/${id}/offLine`, url: `/api/mapPrd/${id}/offLine`,
method: 'put', method: 'put'
}); });
} }
/**校验产品code是否已存在*/ /** 校验产品code是否已存在*/
export function checkMapProductCodeExist(params) { export function checkMapProductCodeExist(params) {
return request({ return request({
url: `/api/mapPrd/checkCodeExist`, url: `/api/mapPrd/checkCodeExist`,
method: 'get', method: 'get',
params: params params: params
}); });
} }

View File

@ -2,68 +2,68 @@ import request from '@/utils/request';
/** 分页查询皮肤*/ /** 分页查询皮肤*/
export function getSkinStylePageList(params) { export function getSkinStylePageList(params) {
return request({ return request({
url: `/api/mapSkin`, url: `/api/mapSkin`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 添加皮肤*/ /** 添加皮肤*/
export function addSkinStyle(data) { export function addSkinStyle(data) {
return request({ return request({
url: `/api/mapSkin`, url: `/api/mapSkin`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 删除皮肤*/ /** 删除皮肤*/
export function delSkinStyle(id) { export function delSkinStyle(id) {
return request({ return request({
url: `/api/mapSkin/${id}`, url: `/api/mapSkin/${id}`,
method: 'delete' method: 'delete'
}); });
} }
/** 查询地图皮肤 */ /** 查询地图皮肤 */
export function querySkinStyle(id) { export function querySkinStyle(id) {
return request({ return request({
url: `/api/mapSkin/${id}`, url: `/api/mapSkin/${id}`,
method: 'get' method: 'get'
}); });
} }
/** 修改地图皮肤*/ /** 修改地图皮肤*/
export function updateSkinStyle(data) { export function updateSkinStyle(data) {
return request({ return request({
url: `/api/mapSkin/${data.id}`, url: `/api/mapSkin/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 通过皮肤Code更新地图皮肤*/ /** 通过皮肤Code更新地图皮肤*/
export function updateSkinStyleByCode(data) { export function updateSkinStyleByCode(data) {
return request({ return request({
url: `/api/mapSkin/${data.code}/update`, url: `/api/mapSkin/${data.code}/update`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 查询皮肤是否存在*/ /** 查询皮肤是否存在*/
export function querySkinStyleExistByCode(code) { export function querySkinStyleExistByCode(code) {
return request({ return request({
url: `/api/mapSkin/${code}/exist`, url: `/api/mapSkin/${code}/exist`,
method: 'get' method: 'get'
}); });
} }
/** 获取皮肤列表*/ /** 获取皮肤列表*/
export function getSkinStyleList() { export function getSkinStyleList() {
return request({ return request({
url: `/api/mapSkin/list`, url: `/api/mapSkin/list`,
method: 'get' method: 'get'
}); });
} }

View File

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

View File

@ -3,104 +3,103 @@ import request from '@/utils/request';
/** 分页获取订单数据*/ /** 分页获取订单数据*/
export function getOrderPageList(params) { export function getOrderPageList(params) {
return request({ return request({
url: '/api/order', url: '/api/order',
method: 'get', method: 'get',
params: params params: 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) {
return request({ return request({
url: '/api/order', url: '/api/order',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 更新订单*/ /** 更新订单*/
export function updateOrder(data) { export function updateOrder(data) {
return request({ return request({
url: '/api/order', url: '/api/order',
method: 'put', method: 'put',
data: data data: 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) {
return request({ return request({
url: `/api/order/${id}/charge`, url: `/api/order/${id}/charge`,
method: 'get' method: 'get'
}); });
} }
/** 计算总价*/ /** 计算总价*/
export function calcuteOrderSumPrice(args) { export function calcuteOrderSumPrice(args) {
return request({ return request({
url: `/api/order/price`, url: `/api/order/price`,
method: 'get', method: 'get',
params: args params: args
}); });
} }
/** 提交订单*/ /** 提交订单*/
export function commitOrder(data) { export function commitOrder(data) {
return request({ return request({
url: '/api/order/submit', url: '/api/order/submit',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 确认订单*/ /** 确认订单*/
export function confirmOrder(data) { export function confirmOrder(data) {
return request({ return request({
url: `/api/order/${data.orderId}/${data.type}/pay`, url: `/api/order/${data.orderId}/${data.type}/pay`,
method: 'get' method: 'get'
}); });
} }
/** 取消订单*/ /** 取消订单*/
export function cancalOrder(orderId) { export function cancalOrder(orderId) {
return request({ return request({
url: `/api/order/${orderId}/cancelPay`, url: `/api/order/${orderId}/cancelPay`,
method: 'put' method: 'put'
}); });
} }

View File

@ -1,18 +1,18 @@
import request from '@/utils/request'; import request from '@/utils/request';
/**获取组织/企业数据*/ /** 获取组织/企业数据*/
export function getOrganizationList() { export function getOrganizationList() {
return request({ return request({
url: '/api/organization', url: '/api/organization',
method: 'get' method: 'get'
}); });
} }
/** 添加组织/企业*/ /** 添加组织/企业*/
export function addOrganization(data) { export function addOrganization(data) {
return request({ return request({
url: '/api/organization', url: '/api/organization',
method: 'post', method: 'post',
data: data data: data
}); });
} }

View File

@ -2,34 +2,34 @@ import request from '@/utils/request';
/** 创建实训生成任务*/ /** 创建实训生成任务*/
export function addAutoGenerateTask(data) { export function addAutoGenerateTask(data) {
return request({ return request({
url: `/api/task`, url: `/api/task`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** get任务列表*/ /** get任务列表*/
export function getTaskList(param) { export function getTaskList(param) {
return request({ return request({
url: '/api/task', url: '/api/task',
method: 'get', method: 'get',
params: param params: param
}); });
} }
/** 开始任务*/ /** 开始任务*/
export function postTask(data) { export function postTask(data) {
return request({ return request({
url: `/api/task/${data.id}/execute`, url: `/api/task/${data.id}/execute`,
method: 'post' method: 'post'
}); });
} }
/** 开始任务*/ /** 开始任务*/
export function postTaskCancel(id) { export function postTaskCancel(id) {
return request({ return request({
url: `/api/task/${id}/cancel`, url: `/api/task/${id}/cancel`,
method: 'post' method: 'post'
}); });
} }

View File

@ -1,97 +1,95 @@
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() {
return request({ return request({
url: '/api/user/config', url: '/api/user/config',
method: 'get' method: 'get'
}); });
} }
/** 设置用户参数*/ /** 设置用户参数*/
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() {
return request({ return request({
url: `/api/user/seller`, url: `/api/user/seller`,
method: 'get' method: 'get'
}); });
} }
/** 查询用户列表*/ /** 查询用户列表*/
export function getUserList(params) { export function getUserList(params) {
return request({ return request({
url: `/api/user`, url: `/api/user`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 模糊查询用户 昵称、名称、手机号*/ /** 模糊查询用户 昵称、名称、手机号*/
export function getDimUserList(params) { export function getDimUserList(params) {
return request({ return request({
url: `/api/user/fuzzy`, url: `/api/user/fuzzy`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 获取用户订阅地图列表*/ /** 获取用户订阅地图列表*/
export function getUserSubscribe(userId) { export function getUserSubscribe(userId) {
return request({ return request({
url: `/api/user/subscribe/${userId}`, url: `/api/user/subscribe/${userId}`,
method: 'get' method: 'get'
}); });
} }
/** 保存用户订阅地图列表*/ /** 保存用户订阅地图列表*/
export function saveUserSubscribe(data) { export function saveUserSubscribe(data) {
return request({ return request({
url: '/api/user/subscribe', url: '/api/user/subscribe',
method: 'post', method: 'post',
data: data data: data
}); });
} }
// 修改用户权限 // 修改用户权限
export function putRoles(data) { export function putRoles(data) {
return request({ return request({
url: `/api/user/${data.id}/role`, url: `/api/user/${data.id}/role`,
method: 'put', method: 'put',
data: data data: data
}); });
} }

View File

@ -1,77 +1,76 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 获取考题列表*/ /** 获取考题列表*/
export function generateExamList(examId) { export function generateExamList(examId) {
return request({ return request({
url: `/api/userExam/${examId}/generate`, url: `/api/userExam/${examId}/generate`,
method: 'get' method: 'get'
}); });
} }
/** 刷新考题列表*/ /** 刷新考题列表*/
export function refreshExamList(userExamId) { export function refreshExamList(userExamId) {
return request({ return request({
url: `/api/userExam/${userExamId}`, url: `/api/userExam/${userExamId}`,
method: 'get' method: 'get'
}); });
} }
/** 提交一个考题*/ /** 提交一个考题*/
export function finishOneExamQuestion(data) { export function finishOneExamQuestion(data) {
return request({ return request({
url: '/api/userExam/finish', url: '/api/userExam/finish',
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 考试完成提交*/ /** 考试完成提交*/
export function submitExam(examId) { export function submitExam(examId) {
return request({ return request({
url: `/api/userExam/${examId}/submit`, url: `/api/userExam/${examId}/submit`,
method: 'put' method: 'put'
}); });
} }
/**获取用户考试列表*/ /** 获取用户考试列表*/
export function getPublishExam(data) { export function getPublishExam(data) {
return request({ return request({
url: `/api/userExam/list`, url: `/api/userExam/list`,
method: 'get', method: 'get',
params: data params: data
}); });
} }
/**删除用户考试*/ /** 删除用户考试*/
export function delPublishExam(id) { export function delPublishExam(id) {
return request({ return request({
url: `/api/userExam/${id}`, url: `/api/userExam/${id}`,
method: 'delete' method: 'delete'
}); });
} }
/**删除用户实训*/ /** 删除用户实训*/
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({
url: `/api/userExam/${data.id}`, url: `/api/userExam/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }

View File

@ -2,54 +2,54 @@ import request from '@/utils/request';
/** 分页查找仿真任务*/ /** 分页查找仿真任务*/
export function getQuestPageList(params) { export function getQuestPageList(params) {
return request({ return request({
url: `/api/quest/paging`, url: `/api/quest/paging`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 创建任务 */ /** 创建任务 */
export function createQuest(data) { export function createQuest(data) {
return request({ return request({
url: `/api/quest`, url: `/api/quest`,
method: 'post', method: 'post',
data data
}); });
} }
/** 根据任务id删除任务 */ /** 根据任务id删除任务 */
export function deleteQuest(id) { export function deleteQuest(id) {
return request({ return request({
url: `/api/quest/${id}`, url: `/api/quest/${id}`,
method: 'delete' method: 'delete'
}); });
} }
/** 根据id查询任务基础信息 */ /** 根据id查询任务基础信息 */
export function getQuestById(id) { export function getQuestById(id) {
return request({ return request({
url: `/api/quest/${id}`, url: `/api/quest/${id}`,
method: 'get', method: 'get'
}); });
} }
/** 根据id查询任务基础信息 */ /** 根据id查询任务基础信息 */
export function getQuestByIdList(id) { export function getQuestByIdList(id) {
return request({ return request({
url: `/api/quest/${id}/detail`, url: `/api/quest/${id}/detail`,
method: 'get', method: 'get'
}); });
} }
/** 更新任务基本信息 */ /** 更新任务基本信息 */
export function updateQuest(id, data) { export function updateQuest(id, data) {
return request({ return request({
url: `/api/quest/${id}`, url: `/api/quest/${id}`,
method: 'put', method: 'put',
data data
}); });
} }
/** 更新任务地图定位信息 */ /** 更新任务地图定位信息 */
export function updateMapLocation(id, data) { export function updateMapLocation(id, data) {
return request({ return request({
url: `/api/quest/${id}/mapLocation`, url: `/api/quest/${id}/mapLocation`,
method: 'put', method: 'put',
data data
}); });
} }

View File

@ -2,80 +2,78 @@ import request from '@/utils/request';
/** 获取故障规则列表*/ /** 获取故障规则列表*/
export function getFailureGenerateRules(params) { export function getFailureGenerateRules(params) {
return request({ return request({
url: `/api/simulation/failureGenerateRules`, url: `/api/simulation/failureGenerateRules`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 设置自动故障*/ /** 设置自动故障*/
export function setFailureMode(data, group) { export function setFailureMode(data, group) {
return request({ return request({
url: `/api/simulation/${group}/failureMode`, url: `/api/simulation/${group}/failureMode`,
method: 'post', method: 'post',
data: data, data: data
}); });
} }
/** /**
* 仿真系统按计划行车 * 仿真系统按计划行车
*/ */
export function runDiagramStart(params, group) { export function runDiagramStart(params, group) {
return request({ return request({
url: `/api/simulation/${group}/start`, url: `/api/simulation/${group}/start`,
method: 'put', method: 'put',
params: params params: params
}); });
} }
/** /**
* 仿真系统结束计划行车 * 仿真系统结束计划行车
*/ */
export function runDiagramOver(group) { export function runDiagramOver(group) {
return request({ return request({
url: `/api/simulation/${group}/over`, url: `/api/simulation/${group}/over`,
method: 'put', method: 'put'
}); });
} }
/** /**
* 退出仿真系统 * 退出仿真系统
*/ */
export function runDiagramQuit(group) { export function runDiagramQuit(group) {
return request({ return request({
url: `/api/simulation/${group}/quit`, url: `/api/simulation/${group}/quit`,
method: 'put', method: 'put'
}); });
} }
/** 获取仿真系统时间*/ /** 获取仿真系统时间*/
export function runDiagramGetTime(group) { export function runDiagramGetTime(group) {
return request({ return request({
url: `/api/simulation/${group}/systemTime`, url: `/api/simulation/${group}/systemTime`,
method: 'get' method: 'get'
}); });
} }
// 查看是否开始按计划行车 // 查看是否开始按计划行车
export function runDiagramIsStart(group) { export function runDiagramIsStart(group) {
return request({ return request({
url: `/api/simulation/${group}/isRunPlanStart`, url: `/api/simulation/${group}/isRunPlanStart`,
method: 'get' method: 'get'
}); });
} }
/** /**
* 仿真系统CBTC * 仿真系统CBTC
* @param {*} mapId * @param {*} mapId
*/ */
export function simulationNotify({ mapId, code }) { export function simulationNotify({ mapId, code }) {
return request({ return request({
url: `/api/simulation/${mapId}/${code}`, url: `/api/simulation/${mapId}/${code}`,
method: 'get' method: 'get'
}); });
} }
/** /**
@ -83,10 +81,10 @@ export function simulationNotify({ mapId, code }) {
* @param {*} mapId * @param {*} mapId
*/ */
export function bitScreenNotify({ mapId }) { export function bitScreenNotify({ mapId }) {
return request({ return request({
url: `/api/simulation/bigScreen/${mapId}`, url: `/api/simulation/bigScreen/${mapId}`,
method: 'get' method: 'get'
}); });
} }
/** /**
@ -94,10 +92,10 @@ export function bitScreenNotify({ mapId }) {
* @param {*} data * @param {*} data
*/ */
export function trainingNotify({ trainingId }) { export function trainingNotify({ trainingId }) {
return request({ return request({
url: `/api/simulation/training/${trainingId}`, url: `/api/simulation/training/${trainingId}`,
method: 'get' method: 'get'
}); });
} }
/** /**
@ -105,63 +103,61 @@ export function trainingNotify({ trainingId }) {
* @param {*} data * @param {*} data
*/ */
export function examNotify({ examId }) { export function examNotify({ examId }) {
return request({ return request({
url: `/api/simulation/exam/${examId}`, url: `/api/simulation/exam/${examId}`,
method: 'get' method: 'get'
}); });
} }
/** 获取用户实训列表*/
/**获取用户实训列表*/
export function getSimulationList(data) { export function getSimulationList(data) {
return request({ return request({
url: `/api/simulation/stats`, url: `/api/simulation/stats`,
method: 'get', method: 'get',
params: data params: data
}); });
} }
/**添加用户仿真数据*/ /** 添加用户仿真数据*/
export function postSimulationStats(data) { export function postSimulationStats(data) {
return request({ return request({
url: `/api/simulation/stats`, url: `/api/simulation/stats`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/**更新用户仿真数据*/ /** 更新用户仿真数据*/
export function putSimulationStats(data) { export function putSimulationStats(data) {
return request({ return request({
url: `/api/simulation/${data.id}/stats`, url: `/api/simulation/${data.id}/stats`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/**删除用户仿真数据*/ /** 删除用户仿真数据*/
export function deleteSimulationStats(statsId) { export function deleteSimulationStats(statsId) {
return request({ return request({
url: `/api/simulation/${statsId}`, url: `/api/simulation/${statsId}`,
method: 'delete', method: 'delete'
}); });
} }
/** 获取用户鼠标左键选中的设备信息*/ /** 获取用户鼠标左键选中的设备信息*/
export function letfMouseSelectDevice(deviceCode, group) { export function letfMouseSelectDevice(deviceCode, group) {
return request({ return request({
url: `/api/simulation/${group}/device/${deviceCode}`, url: `/api/simulation/${group}/device/${deviceCode}`,
method: 'get', method: 'get'
}); });
} }
/** 获取每日运行图*/ /** 获取每日运行图*/
export function getEveryDayRunPlanData(group) { export function getEveryDayRunPlanData(group) {
return request({ return request({
url: `/api/simulation/${group}/runPlan`, url: `/api/simulation/${group}/runPlan`,
method: 'get', method: 'get'
}); });
} }
/** 生成手机同步仿真二维码*/ /** 生成手机同步仿真二维码*/
@ -174,214 +170,209 @@ export function getEveryDayRunPlanData(group) {
/** 录制脚本仿真*/ /** 录制脚本仿真*/
export function scriptRecordNotify(questId) { export function scriptRecordNotify(questId) {
return request({ return request({
url: `/api/simulation/questRecord/${questId}`, url: `/api/simulation/questRecord/${questId}`,
method: 'get' method: 'get'
}) });
} }
/** 保存剧本背景*/ /** 保存剧本背景*/
export function saveScriptScenes(group) { export function saveScriptScenes(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/scenes`, url: `/api/simulation/${group}/questRecord/scenes`,
method: 'post' method: 'post'
}) });
} }
/** 保存录制任务数据*/ /** 保存录制任务数据*/
export function saveScriptData(group) { export function saveScriptData(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord`, url: `/api/simulation/${group}/questRecord`,
method: 'post', method: 'post'
}); });
} }
/** 清除仿真剧本数据*/ /** 清除仿真剧本数据*/
export function dumpScriptData(scriptId) { export function dumpScriptData(scriptId) {
return request({ return request({
url: `/api/simulation/${scriptId}/clearScriptRecord`, url: `/api/simulation/${scriptId}/clearScriptRecord`,
method: 'post' method: 'post'
}); });
} }
/** 查询录制剧本步骤*/ /** 查询录制剧本步骤*/
export function queryScriptStep(group) { export function queryScriptStep(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptRecordStage`, url: `/api/simulation/${group}/scriptRecordStage`,
method: 'get' method: 'get'
}); });
} }
/** 获取指定时间里可加载列车的个数*/ /** 获取指定时间里可加载列车的个数*/
export function getDesignatedTimeTrainNum(params, group) { export function getDesignatedTimeTrainNum(params, group) {
return request({ return request({
url: `/api/simulation/${group}/plan/trainNum`, url: `/api/simulation/${group}/plan/trainNum`,
method: 'get', method: 'get',
params params
}) });
} }
/** 根据成员角色查询设备列表*/ /** 根据成员角色查询设备列表*/
export function getDevicesByRole(group, params) { export function getDevicesByRole(group, params) {
return request({ return request({
url: `/api/simulation/${group}/role/devices`, url: `/api/simulation/${group}/role/devices`,
method: 'get', method: 'get',
params params
}) });
} }
/** 获取任务录制的成员角色列表 */ /** 获取任务录制的成员角色列表 */
export function getMembersByGroup(group) { export function getMembersByGroup(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/members`, url: `/api/simulation/${group}/questRecord/members`,
method: 'get', method: 'get'
}) });
} }
/** 添加任务角色成员 */ /** 添加任务角色成员 */
export function postQuestMember(group, data) { export function postQuestMember(group, data) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/member`, url: `/api/simulation/${group}/questRecord/member`,
method: 'post', method: 'post',
data data
}) });
} }
/** 删除任务角色成员 */ /** 删除任务角色成员 */
export function deleteQuestMember(group, memberId) { export function deleteQuestMember(group, memberId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/member/${memberId}`, url: `/api/simulation/${group}/questRecord/member/${memberId}`,
method: 'delete', method: 'delete'
}) });
} }
// /** 添加/修改任务角色行为 */ // /** 添加/修改任务角色行为 */
export function postMemberBehavior(group, memberId, data) { export function postMemberBehavior(group, memberId, data) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/${memberId}/behavior`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
method: 'post', method: 'post',
data data
}) });
} }
/** 删除任务角色行为 */ /** 删除任务角色行为 */
export function deleteMemberBehavior(group, memberId, behaviorId) { export function deleteMemberBehavior(group, memberId, behaviorId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
method: 'delete' method: 'delete'
}) });
} }
/** 删除任务角色行为动作 */ /** 删除任务角色行为动作 */
export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) { export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
method: 'delete' method: 'delete'
}) });
} }
/** 添加/修改任务角色行为动作 */ /** 添加/修改任务角色行为动作 */
export function postMemberBehaviorAction(group, memberId, behaviorId, data) { export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
method: 'post', method: 'post',
data data
}) });
} }
/** 添加/修改任务目标条件*/ /** 添加/修改任务目标条件*/
export function postTargetConditionAction(group, data) { export function postTargetConditionAction(group, data) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/targetCondition`, url: `/api/simulation/${group}/questRecord/targetCondition`,
method: 'post', method: 'post',
data data
}) });
} }
/** 删除任务目标条件*/ /** 删除任务目标条件*/
export function deleteTargetConditionAction(group, tcId) { export function deleteTargetConditionAction(group, tcId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`, url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
method: 'delete' method: 'delete'
}) });
} }
/** 分页查询存在的仿真 */ /** 分页查询存在的仿真 */
export function getExistingSimulation(params) { export function getExistingSimulation(params) {
return request({ return request({
url: `/api/simulation/manage/page`, url: `/api/simulation/manage/page`,
method: 'get', method: 'get',
params, params
}); });
} }
/** 删除存在的仿真 */ /** 删除存在的仿真 */
export function deleteExistingSimulation(group) { export function deleteExistingSimulation(group) {
return request({ return request({
url: `/api/simulation/manage/${group}`, url: `/api/simulation/manage/${group}`,
method: 'delete', method: 'delete'
}); });
} }
/** 根据设备类型获取设备列表 */ /** 根据设备类型获取设备列表 */
export function getDeviceCodeByDeviceType(group, params) { export function getDeviceCodeByDeviceType(group, params) {
return request({ return request({
url: `/api/simulation/${group}/deviceType/devices`, url: `/api/simulation/${group}/deviceType/devices`,
method: 'get', method: 'get',
params params
}); });
} }
/** 根据设备类型获取设备条件列表 */ /** 根据设备类型获取设备条件列表 */
export function getDeviceCoditionByDeviceType(params) { export function getDeviceCoditionByDeviceType(params) {
return request({ return request({
url: `/api/simulation/deviceType/conditions`, url: `/api/simulation/deviceType/conditions`,
method: 'get', method: 'get',
params params
}); });
} }
/** 获取任务录制的数据*/ /** 获取任务录制的数据*/
export function getQuestRecord(group) { export function getQuestRecord(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord`, url: `/api/simulation/${group}/questRecord`,
method: 'get', method: 'get'
}); });
} }
/** 加载任务*/ /** 加载任务*/
export function loadQuest(questId, group) { export function loadQuest(questId, group) {
return request({ return request({
url: `/api/simulation/${group}/quest/${questId}`, url: `/api/simulation/${group}/quest/${questId}`,
method: 'post', method: 'post'
}); });
} }
/** 退出任务*/ /** 退出任务*/
export function quitQuest(group) { export function quitQuest(group) {
return request({ return request({
url: `/api/simulation/${group}/quest`, url: `/api/simulation/${group}/quest`,
method: 'put' method: 'put'
}) });
} }
/** 根据group获取仿真对象*/ /** 根据group获取仿真对象*/
export function getSimulationInfo(group) { export function getSimulationInfo(group) {
return request({ return request({
url: `/api/simulation/${group}`, url: `/api/simulation/${group}`,
method: 'get' method: 'get'
}) });
} }
/** 获取可用的设备指令*/ /** 获取可用的设备指令*/
export function getAvailableDeviceCommand() { export function getAvailableDeviceCommand() {
return request({ return request({
url: `/api/simulation/deviceCommand/available`, url: `/api/simulation/deviceCommand/available`,
method: 'get' method: 'get'
}) });
} }
/** 保存/修改任务剧本*/ /** 保存/修改任务剧本*/
export function saveTaskScript(group,data) { export function saveTaskScript(group, data) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/script`, url: `/api/simulation/${group}/questRecord/script`,
method: 'post', method: 'post',
data data
}) });
} }

View File

@ -3,65 +3,65 @@ import request from '@/utils/request';
/** 分页查询仿真记录*/ /** 分页查询仿真记录*/
export function getSimulationRelpayList(params) { export function getSimulationRelpayList(params) {
return request({ return request({
url: `/api/simulationRecord`, url: `/api/simulationRecord`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
// 删除回放 // 删除回放
export function delSimulationRecord(replayId) { export function delSimulationRecord(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}`, url: `/api/simulationRecord/${replayId}`,
method: 'delete', method: 'delete'
}); });
} }
/** 回放*/ /** 回放*/
export function simulationRelpay(replayId) { export function simulationRelpay(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/playBack`, url: `/api/simulationRecord/${replayId}/playBack`,
method: 'get' method: 'get'
}); });
} }
// 结束回放 // 结束回放
export function putsSimulationRecord(replayId) { export function putsSimulationRecord(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/over`, url: `/api/simulationRecord/${replayId}/over`,
method: 'put', method: 'put'
}); });
} }
// 暂停回放 // 暂停回放
export function putsSimulationRecordPause(replayId) { export function putsSimulationRecordPause(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/pause`, url: `/api/simulationRecord/${replayId}/pause`,
method: 'put', method: 'put'
}); });
} }
// 播放回放 // 播放回放
export function putsSimulationRecordPlay(replayId) { export function putsSimulationRecordPlay(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/play`, url: `/api/simulationRecord/${replayId}/play`,
method: 'put', method: 'put'
}); });
} }
// 设置速度回放 // 设置速度回放
export function putsSimulationRecordPlaySpeed(replayId, speed) { export function putsSimulationRecordPlaySpeed(replayId, speed) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/playSpeed?playSpeed=${speed}`, url: `/api/simulationRecord/${replayId}/playSpeed?playSpeed=${speed}`,
method: 'put', method: 'put'
}); });
} }
// 播放 // 播放
export function putsSimulationRecordplayTime(replayId, offsetSeconds) { export function putsSimulationRecordplayTime(replayId, offsetSeconds) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/playTime?offsetSeconds=${offsetSeconds}`, url: `/api/simulationRecord/${replayId}/playTime?offsetSeconds=${offsetSeconds}`,
method: 'put', method: 'put'
}); });
} }

View File

@ -1,9 +1,9 @@
import request from '@/utils/request'; import request from '@/utils/request';
export function getList(params) { export function getList(params) {
return request({ return request({
url: '/table/list', url: '/table/list',
method: 'get', method: 'get',
params params
}); });
} }

View File

@ -10,57 +10,57 @@
</template> </template>
<script> <script>
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 // 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 // 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>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -24,10 +24,10 @@ export default {
}, },
methods: { methods: {
toggleClick() { toggleClick() {
this.$emit('toggleClick') this.$emit('toggleClick');
} }
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@ -13,7 +13,7 @@
v-show="show" v-show="show"
style="list-style: none; margin: 0px; padding: 0px; padding-right:0px; border-radius:0px;" style="list-style: none; margin: 0px; padding: 0px; padding-right:0px; border-radius:0px;"
> >
<li v-for="(child, index) in item.children" :key="index"> <li v-for="(child, idx) in item.children" :key="idx">
<template v-if="child.type === 'separator'"> <template v-if="child.type === 'separator'">
<div class="separator">&ensp;</div> <div class="separator">&ensp;</div>
</template> </template>

View File

@ -1,44 +1,44 @@
<template> <template>
<el-dialog :title="title" :visible.sync="dialogVisible" width="35%" :before-close="done => {}" :show-close="false" center> <el-dialog :title="title" :visible.sync="dialogVisible" width="35%" :before-close="done => {}" :show-close="false" center>
<div style="text-align:center; margin:auto;"> <div style="text-align:center; margin:auto;">
<qrcode-vue :value="url" :size="400" v-loading="loading"></qrcode-vue> <qrcode-vue v-loading="loading" :value="url" :size="400" />
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="doClose">关闭</el-button> <el-button @click="doClose">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import QrcodeVue from 'qrcode.vue'; import QrcodeVue from 'qrcode.vue';
export default { export default {
name: 'QrCode', name: 'QrCode',
components: { QrcodeVue }, components: { QrcodeVue },
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
title: '', title: '',
loading: false, loading: false,
url: '' url: ''
} };
}, },
methods: { methods: {
clearModel() { clearModel() {
this.url = ''; this.url = '';
this.title = ''; this.title = '';
}, },
doShow(data) { doShow(data) {
this.clearModel(); this.clearModel();
if (data) { if (data) {
this.url = data.url; this.url = data.url;
this.title = data.title; this.title = data.title;
this.dialogVisible = true; this.dialogVisible = true;
} }
}, },
doClose() { doClose() {
this.dialogVisible = false this.dialogVisible = false;
} }
} }
} };
</script> </script>

View File

@ -148,7 +148,7 @@
</div> </div>
</template> </template>
<script> <script>
import localStore from 'storejs' import localStore from 'storejs';
export default { export default {
name: 'QueryForm', name: 'QueryForm',
@ -156,7 +156,7 @@ export default {
queryList: { queryList: {
type: Object, type: Object,
default: function() { default: function() {
return { actions: [] } return { actions: [] };
} }
}, },
queryForm: { queryForm: {
@ -165,6 +165,9 @@ export default {
}, },
beforeQuery: { beforeQuery: {
type: Function, type: Function,
default() {
return () => {};
}
}, },
canQuery: { canQuery: {
type: Boolean, type: Boolean,
@ -185,191 +188,191 @@ export default {
accessKeySecret: '7F7aWIi3ymq3J7uGxs9M2c2DnfSiF3', accessKeySecret: '7F7aWIi3ymq3J7uGxs9M2c2DnfSiF3',
bucket: 'kfexcel' bucket: 'kfexcel'
} }
} };
}, },
computed: { computed: {
rowColumnList() { rowColumnList() {
const alocateColumnNum = function(field) { const alocateColumnNum = function(field) {
let need = 1 let need = 1;
switch (field.type) { switch (field.type) {
case 'daterange': case 'daterange':
need = 2 need = 2;
break break;
case 'timerange': case 'timerange':
need = 2 need = 2;
break break;
case 'datetimerange': case 'datetimerange':
need = 2 need = 2;
break break;
} }
field.columnNeed = need field.columnNeed = need;
return need return need;
} };
const objNumList = [] const objNumList = [];
let tempColumnNum = 0 let tempColumnNum = 0;
let rowColumnNum = 0 let rowColumnNum = 0;
for (const item in this.queryObject) { for (const item in this.queryObject) {
var colNum = alocateColumnNum(this.queryObject[item]) var colNum = alocateColumnNum(this.queryObject[item]);
tempColumnNum = tempColumnNum + colNum tempColumnNum = tempColumnNum + colNum;
if (tempColumnNum > this.columnNum) { if (tempColumnNum > this.columnNum) {
objNumList.push(rowColumnNum) objNumList.push(rowColumnNum);
rowColumnNum = 1 rowColumnNum = 1;
tempColumnNum = colNum tempColumnNum = colNum;
} else if (tempColumnNum === this.columnNum) { } else if (tempColumnNum === this.columnNum) {
objNumList.push(++rowColumnNum) objNumList.push(++rowColumnNum);
rowColumnNum = 0 rowColumnNum = 0;
tempColumnNum = 0 tempColumnNum = 0;
} else { } else {
++rowColumnNum ++rowColumnNum;
} }
} }
if (tempColumnNum > 0 && rowColumnNum > 0) { if (tempColumnNum > 0 && rowColumnNum > 0) {
objNumList.push(rowColumnNum) objNumList.push(rowColumnNum);
} }
return objNumList return objNumList;
} }
}, },
watch: { watch: {
'queryForm.queryObject': function(newVal) { 'queryForm.queryObject': function(newVal) {
this.initPageData() this.initPageData();
}, },
canQuery(newVal) { canQuery(newVal) {
this.queryFlag = newVal this.queryFlag = newVal;
}, },
formModel: { formModel: {
handler: function(form) { handler: function(form) {
if (form) { if (form) {
localStore.set(this.$route.path, form) localStore.set(this.$route.path, form);
} }
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
this.initPageData() this.initPageData();
this.initQueryModel() this.initQueryModel();
}, },
methods: { methods: {
// //
initQueryModel() { initQueryModel() {
this.formModel = localStore.get(this.$route.path) || this.formModel this.formModel = localStore.get(this.$route.path) || this.formModel;
if (typeof this.queryForm.initLoadCallback === 'function') { if (typeof this.queryForm.initLoadCallback === 'function') {
this.queryForm.initLoadCallback(this.formModel) this.queryForm.initLoadCallback(this.formModel);
} }
this.query() this.query();
}, },
// //
initPageData() { initPageData() {
this.modelFields = [] this.modelFields = [];
this.exportFlag = this.queryForm.canExport this.exportFlag = this.queryForm.canExport;
this.resetShow = this.queryForm.reset this.resetShow = this.queryForm.reset;
this.buildQueryField() this.buildQueryField();
this.buildForm() this.buildForm();
}, },
// //
buildForm() { buildForm() {
// Field // Field
const getDefaultValueByField = function(field) { const getDefaultValueByField = function(field) {
let defaultValue = '' let defaultValue = '';
switch (field.type) { switch (field.type) {
case 'select': case 'select':
if (field.config.multiple) { if (field.config.multiple) {
defaultValue = [] defaultValue = [];
} else { } else {
defaultValue = '' defaultValue = '';
} }
break break;
case 'daterange': case 'daterange':
defaultValue = [] defaultValue = [];
break break;
case 'timerange': case 'timerange':
defaultValue = [] defaultValue = [];
break break;
case 'datetimerange': case 'datetimerange':
defaultValue = [] defaultValue = [];
break break;
} }
return defaultValue return defaultValue;
} };
// //
const queryObject = {} const queryObject = {};
const model = {} const model = {};
for (const item in this.queryForm.queryObject) { for (const item in this.queryForm.queryObject) {
if (this.queryForm.queryObject.show === false) { if (this.queryForm.queryObject.show === false) {
continue continue;
} else if (this.queryForm.queryObject.visible === false) { } else if (this.queryForm.queryObject.visible === false) {
model[item] = this.queryForm.queryObject[item].value model[item] = this.queryForm.queryObject[item].value;
} else { } else {
queryObject[item] = this.queryForm.queryObject[item] queryObject[item] = this.queryForm.queryObject[item];
model[item] = this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]) model[item] = this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
} }
} }
this.queryObject = queryObject this.queryObject = queryObject;
this.formModel = model this.formModel = model;
}, },
// fieldName // fieldName
buildQueryField() { buildQueryField() {
const fields = [] const fields = [];
for (const item in this.queryForm.queryObject) { for (const item in this.queryForm.queryObject) {
if (this.queryForm.queryObject.show === false) { if (this.queryForm.queryObject.show === false) {
continue continue;
} else if (this.queryForm.queryObject.visible === false) { } else if (this.queryForm.queryObject.visible === false) {
fields.push({ field: item }) fields.push({ field: item });
} else { } else {
const type = this.queryForm.queryObject[item].type const type = this.queryForm.queryObject[item].type;
switch (type) { switch (type) {
case 'text': case 'text':
fields.push({ field: item }) fields.push({ field: item });
break break;
case 'date': case 'date':
fields.push({ field: item }) fields.push({ field: item });
break break;
case 'daterange': case 'daterange':
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName }) fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
break break;
case 'time': case 'time':
fields.push({ field: item }) fields.push({ field: item });
break break;
case 'timerange': case 'timerange':
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName }) fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
break break;
case 'datetime': case 'datetime':
fields.push({ field: item }) fields.push({ field: item });
break break;
case 'datetimerange': case 'datetimerange':
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName }) fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
break break;
case 'select': case 'select':
fields.push({ field: item }) fields.push({ field: item });
break break;
} }
} }
} }
this.modelFields = fields this.modelFields = fields;
}, },
checkColumnIndex(rowIndex, objIndex) { checkColumnIndex(rowIndex, objIndex) {
var flag = false var flag = false;
if (rowIndex === 0) { if (rowIndex === 0) {
if (objIndex >= 0 && objIndex < this.rowColumnList[rowIndex]) { if (objIndex >= 0 && objIndex < this.rowColumnList[rowIndex]) {
flag = true flag = true;
} }
} else { } else {
let objNum = 0 let objNum = 0;
for (var i = 0; i < rowIndex; ++i) { for (var i = 0; i < rowIndex; ++i) {
objNum += this.rowColumnList[i] objNum += this.rowColumnList[i];
} }
if (objIndex >= objNum && objIndex < objNum + this.rowColumnList[rowIndex]) { if (objIndex >= objNum && objIndex < objNum + this.rowColumnList[rowIndex]) {
flag = true flag = true;
} }
} }
return flag return flag;
}, },
checkFieldType(field, type, name) { checkFieldType(field, type, name) {
if (field.type === type) { if (field.type === type) {
return true return true;
} else { } else {
return false return false;
} }
}, },
handleTreeListChildren(treeList) { handleTreeListChildren(treeList) {
@ -377,66 +380,66 @@ export default {
if (list && list.length > 0) { if (list && list.length > 0) {
list.forEach(element => { list.forEach(element => {
if (element.children != null && element.children.length > 0) { if (element.children != null && element.children.length > 0) {
traverse(element.children) traverse(element.children);
} else if (element.children != null && element.children.length === 0) { } else if (element.children != null && element.children.length === 0) {
element.children = null element.children = null;
} }
}) });
} }
} };
if (treeList && treeList.length > 0) { if (treeList && treeList.length > 0) {
traverse(treeList) traverse(treeList);
return treeList return treeList;
} else { } else {
return [] return [];
} }
}, },
// //
doClean() { doClean() {
this.initPageData() this.initPageData();
this.query() this.query();
}, },
// //
doExport() { doExport() {
this.doExportFront() this.doExportFront();
}, },
// //
doExportFront() { doExportFront() {
const resultData = this.prepareQueryData() const resultData = this.prepareQueryData();
if (resultData === false) { if (resultData === false) {
return return;
} }
this.$emit('queryExport', resultData) this.$emit('queryExport', resultData);
}, },
// //
prepareQueryData() { prepareQueryData() {
let resultData = {} let resultData = {};
// formModel // formModel
for (const item in this.formModel) { for (const item in this.formModel) {
for (var i = 0; i < this.modelFields.length; ++i) { for (var i = 0; i < this.modelFields.length; ++i) {
if (item === this.modelFields[i].field) { if (item === this.modelFields[i].field) {
if (this.modelFields[i].type === 'treeSelect') { if (this.modelFields[i].type === 'treeSelect') {
const qo = this.queryForm.queryObject[item] const qo = this.queryForm.queryObject[item];
const nodeKey = qo.treeConfig.nodeKey ? qo.treeConfig.nodeKey : 'id' const nodeKey = qo.treeConfig.nodeKey ? qo.treeConfig.nodeKey : 'id';
const tmpIds = [] const tmpIds = [];
for (var v = 0; v < this.formModel[item].length; ++v) { for (var v = 0; v < this.formModel[item].length; ++v) {
tmpIds[v] = this.formModel[item][v][nodeKey] tmpIds[v] = this.formModel[item][v][nodeKey];
} }
resultData[item] = tmpIds resultData[item] = tmpIds;
break break;
} else { } else {
if (this.modelFields[i].subFields) { if (this.modelFields[i].subFields) {
for (var j = 0; j < this.modelFields[i].subFields.length; ++j) { for (var j = 0; j < this.modelFields[i].subFields.length; ++j) {
if (this.formModel[item] && this.formModel[item].length > j) { if (this.formModel[item] && this.formModel[item].length > j) {
resultData[this.modelFields[i].subFields[j]] = this.formModel[item][j] resultData[this.modelFields[i].subFields[j]] = this.formModel[item][j];
} else { } else {
resultData[this.modelFields[i].subFields[j]] = '' resultData[this.modelFields[i].subFields[j]] = '';
} }
} }
break break;
} else { } else {
resultData[item] = this.formModel[item] resultData[item] = this.formModel[item];
break break;
} }
} }
} }
@ -445,27 +448,27 @@ export default {
// trim // trim
for (const item in resultData) { for (const item in resultData) {
if (resultData[item].trim) { if (resultData[item].trim) {
resultData[item] = resultData[item].trim() resultData[item] = resultData[item].trim();
} }
} }
// //
resultData = this.beforeQuery ? this.beforeQuery(resultData) : resultData resultData = this.beforeQuery ? this.beforeQuery(resultData) : resultData;
return resultData return resultData;
}, },
query() { query() {
const resultData = this.prepareQueryData() const resultData = this.prepareQueryData();
if (resultData === false) { if (resultData === false) {
return return;
} }
this.$emit('query', resultData) this.$emit('query', resultData);
}, },
selectChange(row, form) { selectChange(row, form) {
if (row.change) { if (row.change) {
row.change(form) row.change(form);
} }
} }
} }
} };
</script> </script>
<style scoped> <style scoped>
.query-form-main-custom .el-input { .query-form-main-custom .el-input {

View File

@ -323,10 +323,10 @@ export default {
queryExportData() { queryExportData() {
}, },
/** /**
* 翻页方法 * 翻页方法
* pageIndex: 翻页后是第几页 * pageIndex: 翻页后是第几页
* params: 查询条件 * params: 查询条件
**/ **/
changePage(pageIndex, params) { changePage(pageIndex, params) {
this.pageIndex = pageIndex; this.pageIndex = pageIndex;
this.pageOffset = (this.pageIndex - 1) * this.pageSize; this.pageOffset = (this.pageIndex - 1) * this.pageSize;
@ -344,8 +344,8 @@ export default {
this.queryList.reload(); this.queryList.reload();
}, },
/** /**
* 改变分页大小回调函数执行完毕后iview会自动触发changePage事件去查第一页数据 * 改变分页大小回调函数执行完毕后iview会自动触发changePage事件去查第一页数据
*/ */
pageSizeChange(newPageSize) { pageSizeChange(newPageSize) {
if (newPageSize) { if (newPageSize) {
this.pageSize = newPageSize; this.pageSize = newPageSize;
@ -353,8 +353,8 @@ export default {
} }
}, },
/** /**
* 把分页信息混合到this.queryData里 * 把分页信息混合到this.queryData里
*/ */
mixinBackPageInfoToQueryData() { mixinBackPageInfoToQueryData() {
// //
const pagerParams = { const pagerParams = {

View File

@ -19,17 +19,17 @@ export default {
}, },
computed: { computed: {
iconName() { iconName() {
return `#icon-${this.iconClass}` return `#icon-${this.iconClass}`;
}, },
svgClass() { svgClass() {
if (this.className) { if (this.className) {
return 'svg-icon ' + this.className return 'svg-icon ' + this.className;
} else { } else {
return 'svg-icon' return 'svg-icon';
} }
} }
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@ -17,14 +17,14 @@ export default {
data() { data() {
return { return {
} };
}, },
methods: { methods: {
turnback() { turnback() {
this.$router.go(-1) this.$router.go(-1);
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,9 +1,9 @@
import Vue from 'vue' import Vue from 'vue';
import SvgIcon from '@/components/SvgIcon'// svg component import SvgIcon from '@/components/SvgIcon';// svg component
// register globally // register globally
Vue.component('svg-icon', SvgIcon) Vue.component('svg-icon', SvgIcon);
const req = require.context('./svg', false, /\.svg$/) const req = require.context('./svg', false, /\.svg$/);
const requireAll = requireContext => requireContext.keys().map(requireContext) const requireAll = requireContext => requireContext.keys().map(requireContext);
requireAll(req) requireAll(req);

View File

@ -1,185 +1,194 @@
<template> <template>
<el-dialog class="fuzhou-01__systerm view-train-id" title="列车识别号显示设置" :visible.sync="show" width="420px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="padding: 10px 20px; border: 1px double lightgray;"> class="fuzhou-01__systerm view-train-id"
<span class="base-label">计划车显示模式</span> title="列车识别号显示设置"
<el-radio-group v-model="planMode"> :visible.sync="show"
<el-row> width="420px"
<el-col :span="10"> :before-close="doClose"
<el-radio :label="1">表号+车次号</el-radio> :z-index="2000"
</el-col> :modal="false"
<el-col :span="10" :offset="4"> :close-on-click-modal="false"
<el-radio :label="2">表号+车组号</el-radio> >
</el-col> <div style="padding: 10px 20px; border: 1px double lightgray;">
</el-row> <span class="base-label">计划车显示模式</span>
<el-row> <el-radio-group v-model="planMode">
<el-col :span="10"> <el-row>
<el-radio :label="3">目的地号+车次号</el-radio> <el-col :span="10">
</el-col> <el-radio :label="1">表号+车次号</el-radio>
<el-col :span="10" :offset="4"> </el-col>
<el-radio :label="4">目的地号+车组号</el-radio> <el-col :span="10" :offset="4">
</el-col> <el-radio :label="2">表号+车组号</el-radio>
</el-row> </el-col>
<el-row>
<el-col :span="10">
<el-radio :label="5">目的地号+表号+车次号</el-radio>
</el-col>
<el-col :span="10" :offset="4">
<el-radio :label="6">目的地号+表号+车组号</el-radio>
</el-col>
</el-row>
</el-radio-group>
</div>
<div style="padding: 10px 20px; border: 1px double lightgray; margin: 20px 0px;">
<span class="base-label">头码车显示模式</span>
<el-radio-group v-model="headMode">
<el-row>
<el-col :span="10">
<el-radio :label="3">目的地号+车次号</el-radio>
</el-col>
<el-col :span="6" :offset="8">
<el-radio :label="4">目的地号+车组号</el-radio>
</el-col>
</el-row>
</el-radio-group>
</div>
<div style="padding: 10px 20px; border: 1px double lightgray;">
<span class="base-label">字体大小</span>
<el-row>
<el-col :span="10">
<el-input v-model="fontSize" size="small" min="16" max="99"></el-input>
</el-col>
<el-col :span="10" :offset="1">
<span style="height:32px; line-height:32px;">范围16-99</span>
</el-col>
</el-row>
</div>
<el-row class="button-group">
<el-col :span="6" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="4" :offset="8">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo"></notice-info> <el-row>
</el-dialog> <el-col :span="10">
<el-radio :label="3">目的地号+车次号</el-radio>
</el-col>
<el-col :span="10" :offset="4">
<el-radio :label="4">目的地号+车组号</el-radio>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-radio :label="5">目的地号+表号+车次号</el-radio>
</el-col>
<el-col :span="10" :offset="4">
<el-radio :label="6">目的地号+表号+车组号</el-radio>
</el-col>
</el-row>
</el-radio-group>
</div>
<div style="padding: 10px 20px; border: 1px double lightgray; margin: 20px 0px;">
<span class="base-label">头码车显示模式</span>
<el-radio-group v-model="headMode">
<el-row>
<el-col :span="10">
<el-radio :label="3">目的地号+车次号</el-radio>
</el-col>
<el-col :span="6" :offset="8">
<el-radio :label="4">目的地号+车组号</el-radio>
</el-col>
</el-row>
</el-radio-group>
</div>
<div style="padding: 10px 20px; border: 1px double lightgray;">
<span class="base-label">字体大小</span>
<el-row>
<el-col :span="10">
<el-input v-model="fontSize" size="small" min="16" max="99" />
</el-col>
<el-col :span="10" :offset="1">
<span style="height:32px; line-height:32px;">范围16-99</span>
</el-col>
</el-row>
</div>
<el-row class="button-group">
<el-col :span="6" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="4" :offset="8">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template> </template>
<script> <script>
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/ConstDic';
import deviceType from '@/jmap/constant/deviceType'; // import deviceType from '@/jmap/constant/deviceType';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default { export default {
name: 'ViewTrainId', name: 'ViewTrainId',
data() { components: {
return { NoticeInfo
dialogShow: false, },
loading: false, data() {
operate: null, return {
operation: '', dialogShow: false,
planMode: 5, loading: false,
headMode: 5, operate: null,
fontSize: 16, operation: '',
} planMode: 5,
}, headMode: 5,
components: { fontSize: 16
NoticeInfo };
}, },
computed: { computed: {
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.setTrainDispaly(); this.setTrainDispaly();
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
doShow(operate) { doShow(operate) {
this.operate = operate || {}; this.operate = operate || {};
this.operation = operate.operation; this.operation = operate.operation;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.loading = false; this.loading = false;
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
cancel() { cancel() {
let operate = { const operate = {
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}) });
}, },
commit() { commit() {
let operate = { const operate = {
over: true, over: true,
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation, operation: OperationEvent.Command.close.confirm.operation,
val: [this.planMode, this.headMode, this.fontSize].join('::') val: [this.planMode, this.headMode, this.fontSize].join('::')
} };
this.loading = true this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false this.loading = false;
if (valid) { if (valid) {
this.setTrainDispaly(); this.setTrainDispaly();
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
}) });
}, },
setTrainDispaly() { setTrainDispaly() {
let updatlist = []; const updatlist = [];
let trainList = this.$store.getters['training/viewTrainList']; const trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) { if (trainList && trainList.length > 0) {
let nameFormat = this.trainNameFormatBy(this.planMode); const nameFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize; const nameFontSize = this.fontSize;
trainList.forEach(elem => { trainList.forEach(elem => {
updatlist.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {nameFormat, nameFontSize })); updatlist.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {nameFormat, nameFontSize }));
}); });
this.$store.dispatch('map/updateMapDevices', updatlist); this.$store.dispatch('map/updateMapDevices', updatlist);
} }
}, },
trainNameFormatBy(mode) { trainNameFormatBy(mode) {
switch (mode.toString()) { switch (mode.toString()) {
case '1': return 'serviceNumber:tripNumber'; //+ case '1': return 'serviceNumber:tripNumber'; // +
case '2': return 'serviceNumber:groupNumber'; //+ case '2': return 'serviceNumber:groupNumber'; // +
case '3': return 'targetCode:tripNumber'; //+ case '3': return 'targetCode:tripNumber'; // +
case '4': return 'targetCode:groupNumber'; //+ case '4': return 'targetCode:groupNumber'; // +
case '5': return 'targetCode:serviceNumber:tripNumber'; //++ case '5': return 'targetCode:serviceNumber:tripNumber'; // ++
case '6': return 'targetCode:serviceNumber:groupNumber'; //++ case '6': return 'targetCode:serviceNumber:groupNumber'; // ++
} }
return ''; // return ''; //
} }
} }
} };
</script> </script>

View File

@ -1,288 +1,317 @@
<template> <template>
<el-dialog :title="title" :visible.sync="dialogShow" :before-close="handleCancel" :closeOnClickModal="false"> <el-dialog :title="title" :visible.sync="dialogShow" :before-close="handleCancel" :close-on-click-modal="false">
<el-form :model="form" ref="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="实训类型" prop="course"> <el-form-item label="实训类型" prop="course">
<el-select v-model="form.course" placeholder="请选择类型范围" v-bind:disabled="editOk" <el-select
@change="changeCourse(form.course)"> v-model="form.course"
<el-option :label="nor.name" :value="nor.code" v-for="nor in options" :key="nor.id" placeholder="请选择类型范围"
:disabled="nor.disabled"></el-option> :disabled="editOk"
</el-select> @change="changeCourse(form.course)"
</el-form-item> >
<el-form-item label="操作类型"> <el-option
<el-select v-model="form.operateType" clearable placeholder="请选择范围" v-bind:disabled="editOk" v-for="nor in options"
@change="changeOperation(form.operateType)"> :key="nor.id"
<el-option v-for="nor in operationTypeList" :label="nor.name" :value="nor.code" :key="nor.id" :label="nor.name"
:disabled="nor.disabled"></el-option> :value="nor.code"
</el-select> :disabled="nor.disabled"
</el-form-item> />
<el-form-item label="题数" prop="number"> </el-select>
<el-input v-model="form.number" placeholder="" </el-form-item>
style="width: calc(100% - 200px); float: left; margin-right: 10px;"></el-input> <el-form-item label="操作类型">
<span style="width: 190px; float: left;">此类型有{{topicNum}}道题</span> <el-select
</el-form-item> v-model="form.operateType"
<el-form-item label="每题分值" prop="mark"> clearable
<el-input v-model="form.mark" placeholder=""></el-input> placeholder="请选择范围"
</el-form-item> :disabled="editOk"
</el-form> @change="changeOperation(form.operateType)"
<div slot="footer" class="dialog-footer"> >
<el-button @click="handleCancel"> </el-button> <el-option
<el-button type="primary" @click="handleOk"> </el-button> v-for="nor in operationTypeList"
</div> :key="nor.id"
</el-dialog> :label="nor.name"
:value="nor.code"
:disabled="nor.disabled"
/>
</el-select>
</el-form-item>
<el-form-item label="题数" prop="number">
<el-input
v-model="form.number"
placeholder=""
style="width: calc(100% - 200px); float: left; margin-right: 10px;"
/>
<span style="width: 190px; float: left;">此类型有{{ topicNum }}道题</span>
</el-form-item>
<el-form-item label="每题分值" prop="mark">
<el-input v-model="form.mark" placeholder="" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleOk"> </el-button>
</div>
</el-dialog>
</template> </template>
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { getLessonTypeNum, getCourseTypeList } from '@/api/management/exam'; import { getLessonTypeNum, getCourseTypeList } from '@/api/management/exam';
import { getDetailList } from '@/api/management/dictionary'; import { getDetailList } from '@/api/management/dictionary';
export default { export default {
name: 'editRule', name: 'EditRule',
props: { props: {
courseId: { courseId: {
type: String, type: String,
}, required: true
editCourse: { },
type: Object, editCourse: {
} type: Object,
}, required: true
data() { }
var number = (rule, value, callback) => { },
if (!value) { data() {
return callback(new Error('请输入题数')); var number = (rule, value, callback) => {
} if (!value) {
setTimeout(() => { return callback(new Error('请输入题数'));
if (Number(value) == 0) { }
callback(new Error('输入的题数大于0')); setTimeout(() => {
} else if (!Number(value)) { if (Number(value) == 0) {
callback(new Error('请输入有效数字')); callback(new Error('输入的题数大于0'));
} else if (Number(value) > this.topicNum) { } else if (!Number(value)) {
callback(new Error('输入值必须大于题数')); callback(new Error('请输入有效数字'));
} else { } else if (Number(value) > this.topicNum) {
callback(); callback(new Error('输入值必须大于题数'));
} } else {
}, 100); callback();
}; }
var mark = (rule, value, callback) => { }, 100);
if (!value) { };
return callback(new Error('请输入每题分值')); var mark = (rule, value, callback) => {
} if (!value) {
setTimeout(() => { return callback(new Error('请输入每题分值'));
if (!Number(value)) { }
callback(new Error('请输入数字值')); setTimeout(() => {
} else { if (!Number(value)) {
callback(); callback(new Error('请输入数字值'));
} } else {
}, 100); callback();
}; }
return { }, 100);
title: '添加规则', };
form: { return {
course: '', title: '添加规则',
operateType: '', form: {
number: '', course: '',
mark: '', operateType: '',
}, number: '',
topicNum: 0, mark: ''
dialogShow: false, },
editOk: false, topicNum: 0,
rules: { dialogShow: false,
course: [ editOk: false,
{ required: true, message: '请选择试题类型', trigger: 'change' } rules: {
], course: [
number: [ { required: true, message: '请选择试题类型', trigger: 'change' }
{ required: true, validator: number, trigger: 'blur' } ],
], number: [
mark: [ { required: true, validator: number, trigger: 'blur' }
{ required: true, validator: mark, trigger: 'blur' } ],
] mark: [
}, { required: true, validator: mark, trigger: 'blur' }
options: this.course, ]
typeList: [], },
operationTypeList: [], options: this.course,
trainingOperateTypeMap: {}, typeList: [],
} operationTypeList: [],
}, trainingOperateTypeMap: {}
computed: { };
...mapState([ },
'course', computed: {
]), ...mapState([
}, 'course'
watch: { ])
editCourse: function (val) { },
this.title = '修改规则'; watch: {
this.editOk = true; editCourse: function (val) {
this.form = { this.title = '修改规则';
course: val.trainingType, this.editOk = true;
operateType: val.operateType, this.form = {
number: val.num, course: val.trainingType,
mark: val.point, operateType: val.operateType,
}; number: val.num,
this.changeCourse(val.trainingType); mark: val.point
this.changeOperation(val.operateType); };
} this.changeCourse(val.trainingType);
}, this.changeOperation(val.operateType);
async mounted() { }
await this.getList(); },
await this.refresh(); async mounted() {
this.trainingOperateTypeMap = {}; await this.getList();
this.$Dictionary.stationControl().then(list => { await this.refresh();
this.trainingOperateTypeMap['01'] = list; // this.trainingOperateTypeMap = {};
}); this.$Dictionary.stationControl().then(list => {
this.$Dictionary.signalOperation().then(list => { this.trainingOperateTypeMap['01'] = list; //
this.trainingOperateTypeMap['02'] = list; // });
}); this.$Dictionary.signalOperation().then(list => {
this.$Dictionary.switchOperation().then(list => { this.trainingOperateTypeMap['02'] = list; //
this.trainingOperateTypeMap['03'] = list; // });
}); this.$Dictionary.switchOperation().then(list => {
this.$Dictionary.sectionOperation().then(list => { this.trainingOperateTypeMap['03'] = list; //
this.trainingOperateTypeMap['04'] = list; // });
}); this.$Dictionary.sectionOperation().then(list => {
this.$Dictionary.stationStandOperation().then(list => { this.trainingOperateTypeMap['04'] = list; //
this.trainingOperateTypeMap['05'] = list; // });
}); this.$Dictionary.stationStandOperation().then(list => {
this.$Dictionary.trainPlanOperation().then(list => { this.trainingOperateTypeMap['05'] = list; //
this.trainingOperateTypeMap['06'] = list; // });
}); this.$Dictionary.trainPlanOperation().then(list => {
this.$Dictionary.trainOperation().then(list => { this.trainingOperateTypeMap['06'] = list; //
this.trainingOperateTypeMap['07'] = list; // });
}); this.$Dictionary.trainOperation().then(list => {
}, this.trainingOperateTypeMap['07'] = list; //
methods: { });
show() { },
this.dialogShow = true; methods: {
}, show() {
handleOk() { this.dialogShow = true;
this.$refs['form'].validate((valid) => { },
if (valid) { handleOk() {
this.operationTypeList.forEach(item => { this.$refs['form'].validate((valid) => {
if (item.code == this.form.operateType) { if (valid) {
this.form.name = item.name; this.operationTypeList.forEach(item => {
return; if (item.code == this.form.operateType) {
} this.form.name = item.name;
}); return;
if (this.editOk) { }
// });
this.$emit('editRuleList', this.form); if (this.editOk) {
this.editOk = false; //
setTimeout(() => { this.$emit('editRuleList', this.form);
this.handleCancel(); this.editOk = false;
}, 300) setTimeout(() => {
} else { this.handleCancel();
// }, 300);
this.$emit('addRuleList', this.form); } else {
setTimeout(() => { //
this.handleCancel(); this.$emit('addRuleList', this.form);
}, 300) setTimeout(() => {
} this.handleCancel();
this.topicNum = 0; }, 300);
} else { }
this.dialogShow = true; this.topicNum = 0;
return false; } else {
} this.dialogShow = true;
}); return false;
}, }
handleCancel() { });
this.$refs['form'].resetFields(); },
this.clearBoth(); handleCancel() {
this.dialogShow = false; this.$refs['form'].resetFields();
this.editOk = false; this.clearBoth();
this.topicNum = 0; this.dialogShow = false;
this.operationTypeList = []; this.editOk = false;
}, this.topicNum = 0;
clearBoth() { this.operationTypeList = [];
this.form = { },
course: '', clearBoth() {
number: '', this.form = {
mark: '', course: '',
}; number: '',
}, mark: ''
// };
async refresh() { },
await getCourseTypeList({ lessonId: this.courseId }).then(res => { //
let list = []; async refresh() {
Array.sort(res.data); await getCourseTypeList({ lessonId: this.courseId }).then(res => {
res.data.forEach(ele => { const list = [];
this.typeList.forEach(v => { Array.sort(res.data);
if (ele == v.code) { res.data.forEach(ele => {
list.push(v); this.typeList.forEach(v => {
} if (ele == v.code) {
}); list.push(v);
}) }
this.options = list; });
this.changeCourseDisable(); });
this.$store.dispatch('app/handleCourse', this.options); this.options = list;
}).catch(error => { this.changeCourseDisable();
this.$messageBox('刷新失败') this.$store.dispatch('app/handleCourse', this.options);
}); }).catch(() => {
}, this.$messageBox('刷新失败');
async getList() { });
this.typeList = []; },
await getDetailList('training_type').then(res => { async getList() {
this.typeList = res.data; this.typeList = [];
}).catch(error => { await getDetailList('training_type').then(res => {
// console.log('' + error.message); this.typeList = res.data;
reject(error); }).catch(() => {
}); // console.log('' + error.message);
}, });
async changeCourse(val) { },
let param = { async changeCourse(val) {
lessonId: this.courseId, const param = {
trainingType: val, lessonId: this.courseId,
operateType: '', trainingType: val,
}; operateType: ''
this.operationTypeList = this.trainingOperateTypeMap[val]; };
this.operationTypeList.forEach(item => { this.operationTypeList = this.trainingOperateTypeMap[val];
item.disabled = false; this.operationTypeList.forEach(item => {
}); item.disabled = false;
this.changeOperationDisabled(); // });
let res = await getLessonTypeNum(param); this.changeOperationDisabled(); //
if (res.code == 200) return this.topicNum = res.data; const resp = await getLessonTypeNum(param);
this.$store.dispatch('app/handleCourse', this.options); if (resp.code == 200) {
}, this.topicNum = resp.data;
async changeOperation(val) { return this.topicNum;
let param = { }
lessonId: this.courseId, this.$store.dispatch('app/handleCourse', this.options);
trainingType: this.form.course, },
operateType: val, async changeOperation(val) {
}; const param = {
let res = await getLessonTypeNum(param); lessonId: this.courseId,
if (res.code == 200) return this.topicNum = res.data; trainingType: this.form.course,
this.$store.dispatch('app/handleCourse', this.options); operateType: val
}, };
// const resp = await getLessonTypeNum(param);
changeCourseDisable() { if (resp.code == 200) {
let arr = this.$store.state.app.ruleList; this.topicNum = resp.data;
arr.forEach(ele => { return this.topicNum;
this.options.forEach(res => { }
// operateType this.$store.dispatch('app/handleCourse', this.options);
if (ele.trainingType == res.code && !ele.operateType) { },
res.disabled = true; //
} changeCourseDisable() {
}); const arr = this.$store.state.app.ruleList;
arr.forEach(ele => {
this.options.forEach(res => {
// operateType
if (ele.trainingType == res.code && !ele.operateType) {
res.disabled = true;
}
});
}) });
}, },
changeOperationDisabled() { changeOperationDisabled() {
let arr = this.$store.state.app.ruleList; const arr = this.$store.state.app.ruleList;
arr.forEach(ele => { arr.forEach(ele => {
this.operationTypeList.forEach(res => { this.operationTypeList.forEach(res => {
if (ele.operateType == res.code) { if (ele.operateType == res.code) {
res.disabled = true; res.disabled = true;
} }
}); });
}) });
}, },
changeListDisabled(val) { changeListDisabled(val) {
this.options.forEach(res => { this.options.forEach(res => {
if (res.code == val) { if (res.code == val) {
res.disabled = false; res.disabled = false;
} }
}); });
this.$store.dispatch('app/handleCourse', this.options); this.$store.dispatch('app/handleCourse', this.options);
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
/deep/ { /deep/ {

View File

@ -1,264 +1,282 @@
<template> <template>
<div class="exam-rule"> <div class="exam-rule">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height: height + 'px'}"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height + 'px'}">
<el-form :model="form" :rules="rules" ref="form" label-width="90px" class="demo-form"> <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="demo-form">
<el-form-item label="试题名称" prop="name"> <el-form-item label="试题名称" prop="name">
<el-input v-model="form.name" placeholder="请填写试题名称"></el-input> <el-input v-model="form.name" placeholder="请填写试题名称" />
</el-form-item> </el-form-item>
<el-form-item label="试题范围" prop="region"> <el-form-item label="试题范围" prop="region">
<el-select v-model="form.region" placeholder="请选择试题范围" style="width: 100%;" <el-select
v-bind:disabled="selectDisable" :disabled="isEdit"> v-model="form.region"
<el-option v-for="nor in options" :label="nor.name" :value="nor.id" :key="nor.id"></el-option> placeholder="请选择试题范围"
</el-select> style="width: 100%;"
</el-form-item> :disabled="isEdit || selectDisable"
<el-form-item label="时长" prop="duration"> >
<el-input v-model="form.duration" placeholder="90" style="float: left; width: calc(100% - 40px);" <el-option v-for="nor in options" :key="nor.id" :label="nor.name" :value="nor.id" />
:disabled="isEdit"> </el-select>
</el-input> </el-form-item>
<span style="width: 40px; display: block;float: left; text-align: center;">分钟</span> <el-form-item label="时长" prop="duration">
</el-form-item> <el-input
<el-form-item label="考试时间"> v-model="form.duration"
<el-col :span="11"> placeholder="90"
<el-form-item prop="startDate"> style="float: left; width: calc(100% - 40px);"
<el-date-picker type="datetime" placeholder="开始考试时间" v-model="form.startDate" :disabled="isEdit"
style="width: 100%;" value-format="timestamp" :disabled="isEdit"></el-date-picker> />
</el-form-item> <span style="width: 40px; display: block;float: left; text-align: center;">分钟</span>
</el-col> </el-form-item>
<el-col class="line" :span="2">-</el-col> <el-form-item label="考试时间">
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="endDate"> <el-form-item prop="startDate">
<el-date-picker type="datetime" placeholder="结束考试时间" v-model="form.endDate" disabled <el-date-picker
style="width: 100%;" value-format="timestamp" :disabled="isEdit"></el-date-picker> v-model="form.startDate"
</el-form-item> type="datetime"
</el-col> placeholder="开始考试时间"
</el-form-item> style="width: 100%;"
<el-form-item label="满分" prop="fullMark"> value-format="timestamp"
<el-input v-model="form.fullMark" placeholder="" :disabled="isEdit"></el-input> :disabled="isEdit"
</el-form-item> />
<el-form-item label="及格分" prop="passMark"> </el-form-item>
<el-input v-model="form.passMark" placeholder="" :disabled="isEdit"></el-input> </el-col>
</el-form-item> <el-col class="line" :span="2">-</el-col>
<el-form-item label="是否试用" required v-if="trialShow"> <el-col :span="11">
<el-radio-group v-model="trial"> <el-form-item prop="endDate">
<el-radio label="1"></el-radio> <el-date-picker
<el-radio label="2"></el-radio> v-model="form.endDate"
</el-radio-group> type="datetime"
</el-form-item> placeholder="结束考试时间"
<el-form-item label="试题描述" prop="desc"> style="width: 100%;"
<el-input type="textarea" v-model="form.desc" placeholder="请填写试题描述" :disabled="isEdit"></el-input> value-format="timestamp"
</el-form-item> :disabled="isEdit"
<!-- <el-form-item> />
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="满分" prop="fullMark">
<el-input v-model="form.fullMark" placeholder="" :disabled="isEdit" />
</el-form-item>
<el-form-item label="及格分" prop="passMark">
<el-input v-model="form.passMark" placeholder="" :disabled="isEdit" />
</el-form-item>
<el-form-item v-if="trialShow" label="是否试用" required>
<el-radio-group v-model="trial">
<el-radio label="1"></el-radio>
<el-radio label="2"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="试题描述" prop="desc">
<el-input v-model="form.desc" type="textarea" placeholder="请填写试题描述" :disabled="isEdit" />
</el-form-item>
<!-- <el-form-item>
<el-button type="primary" @click="updateForm" v-if="isEdit">修改</el-button> <el-button type="primary" @click="updateForm" v-if="isEdit">修改</el-button>
<el-button type="primary" @click="submitForm" v-else>下一步</el-button> <el-button type="primary" @click="submitForm" v-else>下一步</el-button>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
</div> </div>
</template> </template>
<script> <script>
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonTree } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules } from '@/api/management/exam'; import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
import { mapState } from 'vuex';
export default { export default {
name: 'examFrom', name: 'ExamFrom',
props: { props: {
height: { height: {
type: Number, type: Number,
default: 800 default: 800
} }
}, },
data() { data() {
var fullMark = (rule, value, callback) => { var fullMark = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error('请输入满分')); return callback(new Error('请输入满分'));
} }
setTimeout(() => { setTimeout(() => {
if (!Number(value)) { if (!Number(value)) {
callback(new Error('请输入数字类型')); callback(new Error('请输入数字类型'));
} else { } else {
callback(); callback();
} }
}, 100); }, 100);
}; };
var passMark = (rule, value, callback) => { var passMark = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error('请输入及格分')); return callback(new Error('请输入及格分'));
} }
setTimeout(() => { setTimeout(() => {
if (!Number(value)) { if (!Number(value)) {
callback(new Error('请输入数字类型')); callback(new Error('请输入数字类型'));
} else { } else {
if (Number(value) > this.form.fullMark) { if (Number(value) > this.form.fullMark) {
callback(new Error('输入的值大于满分')); callback(new Error('输入的值大于满分'));
} else { } else {
callback(); callback();
} }
} }
}, 100); }, 100);
}; };
var duration = (rule, value, callback) => { var duration = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error('请输入时长')); return callback(new Error('请输入时长'));
} }
setTimeout(() => { setTimeout(() => {
if (!Number(value)) { if (!Number(value)) {
callback(new Error('请输入数字类型')); callback(new Error('请输入数字类型'));
} else { } else {
callback(); callback();
} }
}, 100); }, 100);
}; };
return { return {
formDetail: { formDetail: {
name: '', name: '',
region: '', region: '',
startDate: '', startDate: '',
endDate: '', endDate: '',
desc: '', desc: '',
type: '', type: '',
duration: '', duration: '',
fullMark: '', fullMark: '',
passMark: '', passMark: ''
}, },
trial: '1', trial: '1',
trialShow: false, trialShow: false,
form: this.$store.state.app.courseDetail, form: this.$store.state.app.courseDetail,
options: [], options: [],
selectDisable: false, selectDisable: false,
rules: { rules: {
name: [ name: [
{ required: true, message: '请输入活动名称', trigger: 'blur' } { required: true, message: '请输入活动名称', trigger: 'blur' }
], ],
region: [ region: [
{ required: true, message: '请选择活动区域', trigger: 'change' } { required: true, message: '请选择活动区域', trigger: 'change' }
], ],
duration: [ duration: [
{ required: true, validator: duration, trigger: 'blur' } { required: true, validator: duration, trigger: 'blur' }
], ],
fullMark: [ fullMark: [
{ required: true, validator: fullMark, trigger: 'blur' } { required: true, validator: fullMark, trigger: 'blur' }
], ],
trial: [ trial: [
{ required: true, message: '请选择是否试用', trigger: 'blur' } { required: true, message: '请选择是否试用', trigger: 'blur' }
], ],
passMark: [ passMark: [
{ required: true, validator: passMark, trigger: 'blur' } { required: true, validator: passMark, trigger: 'blur' }
] ]
} }
} };
}, },
computed: { computed: {
isEdit() { isEdit() {
return this.$route.params.mode == 'edit'; return this.$route.params.mode == 'edit';
}, }
}, },
watch: { watch: {
'form.startDate': function (val) { 'form.startDate': function (val) {
if (val) { if (val) {
this.form.endDate = val + Number(this.form.duration * 60000); this.form.endDate = val + Number(this.form.duration * 60000);
} else { } else {
this.form.endDate = ''; this.form.endDate = '';
} }
}, },
'form.duration': function (val) { 'form.duration': function (val) {
if (this.form.startDate) { if (this.form.startDate) {
this.form.endDate = this.form.startDate + Number(val * 60000); this.form.endDate = this.form.startDate + Number(val * 60000);
} else { } else {
this.form.endDate = ''; this.form.endDate = '';
} }
} }
}, },
created() { created() {
this.refresh(); this.refresh();
}, },
mounted() { mounted() {
let user = this.$store.state.user; const user = this.$store.state.user;
let roles = user.roles; const roles = user.roles;
this.trialShow = roles.indexOf('04') != -1 ? true : false; this.trialShow = roles.indexOf('04') != -1;
this.init(); this.init();
}, },
methods: { methods: {
setData(data) { setData(data) {
this.form = { this.form = {
name: data.name, name: data.name,
region: data.region, region: data.region,
startDate: Date.parse(new Date(data.startDate)), startDate: Date.parse(new Date(data.startDate)),
endDate: Date.parse(new Date(data.endDate)), endDate: Date.parse(new Date(data.endDate)),
desc: data.desc, desc: data.desc,
type: data.type, type: data.type,
duration: Number(data.duration), duration: Number(data.duration),
fullMark: data.fullMark, fullMark: data.fullMark,
passMark: data.passMark, passMark: data.passMark
}; };
}, },
init() { init() {
if (this.$route.params.ruleId != 0) { if (this.$route.params.ruleId != 0) {
getExamLessonDetail(this.$route.params.ruleId).then(res => { getExamLessonDetail(this.$route.params.ruleId).then(res => {
this.$nextTick(() => { this.$nextTick(() => {
this.formDetail = { this.formDetail = {
name: res.data.name, name: res.data.name,
region: `${res.data.lessonId}`, region: `${res.data.lessonId}`,
startDate: Date.parse(new Date(res.data.startTime)), startDate: Date.parse(new Date(res.data.startTime)),
endDate: Date.parse(new Date(res.data.endTime)), endDate: Date.parse(new Date(res.data.endTime)),
desc: res.data.remarks, desc: res.data.remarks,
type: res.data.type, type: res.data.type,
duration: Number(res.data.duration) / 60, duration: Number(res.data.duration) / 60,
fullMark: res.data.fullPoint, fullMark: res.data.fullPoint,
passMark: res.data.passingPoint, passMark: res.data.passingPoint
}; };
if (!this.form.name) { if (!this.form.name) {
this.$store.dispatch('app/handleCourseDetail', this.formDetail); this.$store.dispatch('app/handleCourseDetail', this.formDetail);
this.form = this.formDetail; this.form = this.formDetail;
} else { } else {
this.$store.dispatch('app/handleCourseDetail', this.form); this.$store.dispatch('app/handleCourseDetail', this.form);
} }
}) });
}); });
} }
}, },
submitForm() { submitForm() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
this.form['trial'] = this.trial; this.form['trial'] = this.trial;
this.$store.dispatch('app/handleCourseDetail', this.form); this.$store.dispatch('app/handleCourseDetail', this.form);
this.$emit('definition', this.form); this.$emit('definition', this.form);
} }
}); });
}, },
updateForm() { updateForm() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let model = { const model = {
id: this.$route.params.ruleId, id: this.$route.params.ruleId,
name: this.form.name, name: this.form.name,
trial: this.trial == 2 ? true : false, trial: this.trial == 2
} };
updateExamRules(model).then(response => { updateExamRules(model).then(response => {
this.$store.dispatch('app/handleCourseDetail', this.form); this.$store.dispatch('app/handleCourseDetail', this.form);
this.$message.success('更新考试规则成功'); this.$message.success('更新考试规则成功');
}).catch(error => { }).catch(() => {
this.$messageBox('更新考试规则失败'); this.$messageBox('更新考试规则失败');
}) });
} }
}); });
}, },
refresh() { refresh() {
getPublishLessonTree({ mapId: '' }).then(response => { getPublishLessonTree({ mapId: '' }).then(response => {
this.options = response.data; this.options = response.data;
if (parseInt(this.$route.params.lessonId)) { if (parseInt(this.$route.params.lessonId)) {
this.form.region = this.$route.params.lessonId; this.form.region = this.$route.params.lessonId;
this.selectDisable = true; this.selectDisable = true;
} }
}).catch(error => { }).catch(() => {
this.$messageBox('刷新失败') this.$messageBox('刷新失败');
}); });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.exam-rule { .exam-rule {

View File

@ -1,131 +1,130 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;" v-if="lessonName"> <div v-if="lessonName" slot="header" style="text-align: center;">
<b>课程名称 {{lessonName}}</b> <b>课程名称 {{ lessonName }}</b>
</div>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<div class="exam-box" :style="{ height: height +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper" style="">
<el-steps class="steps" :active="display">
<el-step title="试题定义制定" icon="el-icon-edit" />
<el-step title="考试规则制定" icon="el-icon-setting" />
</el-steps>
<el-card class="forms">
<template v-if="display == 1" class="definition">
<exam-from ref="exam" :height="height-260" @definition="definition" />
</template>
<template v-else class="rule">
<rule-from ref="rule" :course="course" :height="height-300" @regulation="regulation" />
</template>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isPrevStep" type="primary" @click="prevStep">上一步</el-button>
<el-button v-if="isNextStep" type="primary" @click="nextStep">下一步</el-button>
<el-button v-if="isUpdate" type="warning" @click="update">修改</el-button>
<el-button v-if="isCreate" type="primary" @click="create">创建</el-button>
<el-button type="primary" @click="turnback">返回</el-button>
</el-button-group>
</div> </div>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> --> </el-scrollbar>
<div class="exam-box" :style="{ height: height +'px' }"> </div>
<el-scrollbar wrapClass="scrollbar-wrapper" style=""> </el-card>
<el-steps class="steps" :active="display">
<el-step title="试题定义制定" icon="el-icon-edit"></el-step>
<el-step title="考试规则制定" icon="el-icon-setting"></el-step>
</el-steps>
<el-card class="forms">
<template class="definition" v-if="display == 1">
<exam-from ref="exam" :height="height-260" @definition="definition"></exam-from>
</template>
<template class="rule" v-else>
<rule-from ref="rule" :course="course" :height="height-300" @regulation="regulation">
</rule-from>
</template>
</el-card>
<div class="draft">
<el-button-group>
<el-button type="primary" @click="prevStep" v-if="isPrevStep">上一步</el-button>
<el-button type="primary" @click="nextStep" v-if="isNextStep">下一步</el-button>
<el-button type="warning" @click="update" v-if="isUpdate">修改</el-button>
<el-button type="primary" @click="create" v-if="isCreate">创建</el-button>
<el-button type="primary" @click="turnback">返回</el-button>
</el-button-group>
</div>
</el-scrollbar>
</div>
</el-card>
</template> </template>
<script> <script>
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonTree } from '@/api/jmap/lesson';
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import RuleFrom from './rule'; import RuleFrom from './rule';
import ExamFrom from './examFrom'; import ExamFrom from './examFrom';
export default { export default {
name: 'examRule', name: 'ExamRule',
components: { components: {
ExamFrom, ExamFrom,
RuleFrom RuleFrom
}, },
mixins: [ mixins: [
WindowResizeHandler WindowResizeHandler
], ],
data() { data() {
return { return {
display: 1, display: 1,
course: {}, course: {},
height: 0, height: 0,
lessonName: '', lessonName: '',
formData: {}, formData: {}
} };
}, },
computed: { computed: {
// turnbackBarTitle() { // turnbackBarTitle() {
// return ''; // return '';
// }, // },
isPrevStep() { isPrevStep() {
return this.display == 2; return this.display == 2;
}, },
isNextStep() { isNextStep() {
return this.display == 1 && this.$route.params.mode != 'edit'; return this.display == 1 && this.$route.params.mode != 'edit';
}, },
isUpdate() { isUpdate() {
return this.display == 1 && this.$route.params.mode == 'edit'; return this.display == 1 && this.$route.params.mode == 'edit';
}, },
isCreate() { isCreate() {
return this.display == 2; return this.display == 2;
}, }
}, },
mounted() { mounted() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
resizeHandler: function () { resizeHandler: function () {
if (/\/exam\//.test(`${this.$route.path}`)) { if (/\/exam\//.test(`${this.$route.path}`)) {
this.height = this._clientHeight - 50; this.height = this._clientHeight - 50;
} else { } else {
this.height = this._clientHeight - 65; this.height = this._clientHeight - 65;
} }
}, },
loadInitData() { loadInitData() {
getPublishLessonTree({ mapId: '' }).then(response => { getPublishLessonTree({ mapId: '' }).then(response => {
this.OrganizationList = response.data; this.OrganizationList = response.data;
this.OrganizationList.forEach(elem => { this.OrganizationList.forEach(elem => {
if (elem.id == this.$route.params.lessonId) { if (elem.id == this.$route.params.lessonId) {
this.lessonName = elem.name; this.lessonName = elem.name;
} }
}); });
}); });
}, },
definition(data) { definition(data) {
this.course = data; this.course = data;
this.formData = {}; this.formData = {};
this.display = 2; this.display = 2;
}, },
regulation(data) { regulation(data) {
this.formData = data; this.formData = data;
this.display = 1; this.display = 1;
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.exam) { if (this.$refs.exam) {
this.$refs.exam.setData(this.formData); this.$refs.exam.setData(this.formData);
} }
}) });
}, },
prevStep() { prevStep() {
this.$refs.rule.regulation(); this.$refs.rule.regulation();
}, },
nextStep() { nextStep() {
this.$refs.exam.submitForm(); this.$refs.exam.submitForm();
}, },
update() { update() {
this.$refs.exam.updateForm(); this.$refs.exam.updateForm();
}, },
create() { create() {
this.$refs.rule.creatOk(); this.$refs.rule.creatOk();
}, },
turnback() { turnback() {
this.$router.go(-1) this.$router.go(-1);
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.exam-box { .exam-box {
@ -156,7 +155,6 @@
height: 10px; height: 10px;
} }
.draft { .draft {
width: 500px; width: 500px;
text-align: center; text-align: center;

View File

@ -1,269 +1,279 @@
<template> <template>
<div class="exam-rule"> <div class="exam-rule">
<span>满分为 {{course.fullMark}}</span> <span>满分为 {{ course.fullMark }}</span>
<el-button class="addList" @click="handleAdd" size="small">添加规则</el-button> <el-button class="addList" size="small" @click="handleAdd">添加规则</el-button>
<el-table :data="ruleList" border show-summary style="width: 100%" :height="height"> <el-table :data="ruleList" border show-summary style="width: 100%" :height="height">
<el-table-column prop="name" label="实训类型"> <el-table-column prop="name" label="实训类型" />
</el-table-column> <el-table-column prop="num" label="题数" width="100" />
<el-table-column prop="num" label="题数" width="100"> <el-table-column prop="point" label="每题分值" width="100" />
</el-table-column> <el-table-column prop="chapterIdLong" label="总分" width="100" />
<el-table-column prop="point" label="每题分值" width="100"> <el-table-column label="操作" width="100">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="chapterIdLong" label="总分" width="100"> <el-button type="text" size="small" @click="handleForm(scope)">修改</el-button>
</el-table-column> <el-button type="text" size="small" @click="deleteForm(scope)">删除</el-button>
<el-table-column label="操作" width="100"> </template>
<template slot-scope="scope"> </el-table-column>
<el-button type="text" size="small" @click="handleForm(scope)">修改</el-button> </el-table>
<el-button type="text" size="small" @click="deleteForm(scope)">删除</el-button> <!-- <div class="btn-footer">
</template>
</el-table-column>
</el-table>
<!-- <div class="btn-footer">
<el-button @click="regulation">上一步</el-button> <el-button @click="regulation">上一步</el-button>
<el-button type="primary" @click="creatOk">新增</el-button> <el-button type="primary" @click="creatOk">新增</el-button>
</div> --> </div> -->
<edit-rule ref="addRule" @addRuleList="addRuleList" @editRuleList="editRuleList" :courseId="courseId" <edit-rule
:editCourse="editCourse"></edit-rule> ref="addRule"
</div> :course-id="courseId"
:edit-course="editCourse"
@addRuleList="addRuleList"
@editRuleList="editRuleList"
/>
</div>
</template> </template>
<script> <script>
import { getExamLessonDetail, setCourseList } from '@/api/management/exam'; import { getExamLessonDetail, setCourseList } from '@/api/management/exam';
import { getDetailList } from '@/api/management/dictionary'; import { getDetailList } from '@/api/management/dictionary';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import editRule from './editRule'; import editRule from './editRule';
export default { export default {
name: 'rule', name: 'Rule',
components: { components: {
editRule editRule
}, },
props: { props: {
course: { course: {
type: Object, type: Object,
default: null default: null
}, },
height: { height: {
type: Number, type: Number,
default: 800 default: 800
} }
}, },
data() { data() {
return { return {
ruleList: this.$store.state.app.ruleList, ruleList: this.$store.state.app.ruleList,
courseId: this.course.region, courseId: this.course.region,
editCourse: {}, editCourse: {},
formDetail: { formDetail: {
name: '', name: '',
region: '', region: '',
startDate: '', startDate: '',
endDate: '', endDate: '',
desc: '', desc: '',
type: '', type: '',
duration: '', duration: '',
fullMark: '', fullMark: '',
passMark: '', passMark: ''
}, },
form: { form: {
course: '', course: '',
number: '', number: '',
mark: '', mark: ''
}, },
typeList: [], typeList: [],
trainingOperateTypeMap: {}, trainingOperateTypeMap: {}
} };
}, },
watch: { watch: {
}, },
async mounted() { async mounted() {
this.trainingOperateTypeMap = {}; this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => { this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; // this.trainingOperateTypeMap['01'] = list; //
}); });
this.$Dictionary.signalOperation().then(list => { this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; // this.trainingOperateTypeMap['02'] = list; //
}); });
this.$Dictionary.switchOperation().then(list => { this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; // this.trainingOperateTypeMap['03'] = list; //
}); });
this.$Dictionary.sectionOperation().then(list => { this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; // this.trainingOperateTypeMap['04'] = list; //
}); });
this.$Dictionary.stationStandOperation().then(list => { this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; // this.trainingOperateTypeMap['05'] = list; //
}); });
this.$Dictionary.trainPlanOperation().then(list => { this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; // this.trainingOperateTypeMap['06'] = list; //
}); });
this.$Dictionary.trainOperation().then(list => { this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; // this.trainingOperateTypeMap['07'] = list; //
}); });
await this.getList(); await this.getList();
await this.init(); await this.init();
}, },
methods: { methods: {
async getList() { async getList() {
this.typeList = []; this.typeList = [];
await getDetailList('training_type').then(res => { await getDetailList('training_type').then(res => {
this.typeList = res.data; this.typeList = res.data;
}).catch(error => { }).catch(error => {
reject(error); console.error(error);
}); });
}, },
async init() { async init() {
if (this.$route.params.ruleId != 0 && this.ruleList.length == 0) { if (this.$route.params.ruleId != 0 && this.ruleList.length == 0) {
await getExamLessonDetail(this.$route.params.ruleId).then(res => { await getExamLessonDetail(this.$route.params.ruleId).then(res => {
if (res.code == 200) { if (res.code == 200) {
let arr = res.data.examDefinitionRulesVOList; const arr = res.data.examDefinitionRulesVOList;
arr.forEach((ele, index) => { arr.forEach((ele, index) => {
this.typeList.forEach(v => { this.typeList.forEach(v => {
if (ele.trainingType == v.code) { if (ele.trainingType == v.code) {
arr[index].name = v.name; arr[index].name = v.name;
if (ele.operateType) { if (ele.operateType) {
this.trainingOperateTypeMap[ele.trainingType].forEach(item => { this.trainingOperateTypeMap[ele.trainingType].forEach(item => {
if (item.code == ele.operateType) { if (item.code == ele.operateType) {
arr[index].name = `${v.name}-${item.name}`; arr[index].name = `${v.name}-${item.name}`;
return; return;
} }
}) });
} }
} }
}); });
}) });
this.ruleList = arr; this.ruleList = arr;
this.$store.dispatch('app/handleRuleList', this.ruleList); this.$store.dispatch('app/handleRuleList', this.ruleList);
this.ruleList.forEach(res => { this.ruleList.forEach(res => {
res.chapterIdLong = Number(res.num) * Number(res.point) res.chapterIdLong = Number(res.num) * Number(res.point);
}) });
this.changeCourseDisable(); this.changeCourseDisable();
}; }
}); });
} }
}, },
handleAdd() { handleAdd() {
this.$refs.addRule.show(); this.$refs.addRule.show();
}, },
async creatOk() { async creatOk() {
if (this.ruleList.length) { if (this.ruleList.length) {
let flag = 0; let flag = 0;
this.ruleList.forEach(res => { this.ruleList.forEach(res => {
flag += Number(res.chapterIdLong); flag += Number(res.chapterIdLong);
}); });
if (flag == this.course.fullMark) { if (flag == this.course.fullMark) {
let result = { const result = {
duration: Number(this.course.duration) * 60, // duration: Number(this.course.duration) * 60, //
examDefinitionRulesVOList: this.ruleList, // examDefinitionRulesVOList: this.ruleList, //
fullPoint: Number(this.course.fullMark), // fullPoint: Number(this.course.fullMark), //
lessonId: this.course.region, // id lessonId: this.course.region, // id
name: this.course.name, // name: this.course.name, //
passingPoint: Number(this.course.passMark),// passingPoint: Number(this.course.passMark), //
remarks: this.course.desc, // remarks: this.course.desc, //
endTime: this.course.endDate, endTime: this.course.endDate,
startTime: this.course.startDate, startTime: this.course.startDate,
type: this.course.type, // type: this.course.type, //
trial: this.course.trial == 2 ? true : false, // trial: this.course.trial == 2 //
} };
await this.save(result); await this.save(result);
} else { } else {
this.$messageBox('添加规则不匹配满分'); this.$messageBox('添加规则不匹配满分');
} }
} else { } else {
this.$messageBox('请添加考试规则!'); this.$messageBox('请添加考试规则!');
} }
}, },
save(data) { save(data) {
setCourseList(data).then(res => { setCourseList(data).then(res => {
this.$message.success({ message: res.message }); this.$message.success({ message: res.message });
this.$store.dispatch('app/handleCourseDetail', this.formDetail); // form this.$store.dispatch('app/handleCourseDetail', this.formDetail); // form
this.$store.dispatch('app/handleRuleList', []); // this.$store.dispatch('app/handleRuleList', []); //
let path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`;
let lessonId = this.$route.params.lessonId; const lessonId = this.$route.params.lessonId;
if (parseInt(lessonId)) { if (parseInt(lessonId)) {
this.$router.push({ path: `${path}`, query: { lessonId: lessonId } }); this.$router.push({ path: `${path}`, query: { lessonId: lessonId } });
} else { } else {
this.$router.push({ path: `${path}` }); this.$router.push({ path: `${path}` });
} }
}).catch(res => { }).catch(res => {
this.$messageBox('保存规则失败'); this.$messageBox('保存规则失败');
}) });
}, },
addRuleList(data) { addRuleList(data) {
var arr = this.$store.state.app.course; var arr = this.$store.state.app.course;
let value; let value;
arr.forEach(res => { arr.forEach(res => {
if (res.code == data.course) return value = res if (res.code == data.course) {
}); value = res;
let titleName = value.name; return value;
if (data.name) { }
titleName = `${value.name}-${data.name}` });
} let titleName = value.name;
let element = { if (data.name) {
trainingType: data.course, titleName = `${value.name}-${data.name}`;
operateType: data.operateType, }
num: Number(data.number), const element = {
point: Number(data.mark), trainingType: data.course,
name: titleName, operateType: data.operateType,
chapterIdLong: Number(data.number) * Number(data.mark), num: Number(data.number),
} point: Number(data.mark),
this.ruleList.push(element); name: titleName,
this.$store.dispatch('app/handleRuleList', this.ruleList); chapterIdLong: Number(data.number) * Number(data.mark)
this.changeCourseDisable(); };
}, this.ruleList.push(element);
// this.$store.dispatch('app/handleRuleList', this.ruleList);
changeCourseDisable() { this.changeCourseDisable();
let arr = this.$store.state.app.course; },
this.ruleList.forEach(ele => { //
arr.forEach(res => { changeCourseDisable() {
if (ele.trainingType == res.code && !ele.operateType) { const arr = this.$store.state.app.course;
res.disabled = true; this.ruleList.forEach(ele => {
} arr.forEach(res => {
}); if (ele.trainingType == res.code && !ele.operateType) {
}) res.disabled = true;
}, }
editRuleList(data) { });
var arr = this.$store.state.app.course; });
let value; },
arr.forEach(res => { editRuleList(data) {
if (res.code == data.course) return value = res var arr = this.$store.state.app.course;
}); let value;
let titleName = value.name; arr.forEach(res => {
if (data.name) { if (res.code == data.course) {
titleName = `${value.name}-${data.name}` value = res;
} return value;
let element = { }
trainingType: data.course, });
operateType: data.operateType, let titleName = value.name;
num: Number(data.number), if (data.name) {
point: Number(data.mark), titleName = `${value.name}-${data.name}`;
name: titleName, }
chapterIdLong: data.number * data.mark, const element = {
} trainingType: data.course,
this.ruleList.splice(this.indexCourse, 1, element) operateType: data.operateType,
}, num: Number(data.number),
handleForm(data) { point: Number(data.mark),
// editCourse name: titleName,
this.indexCourse = data.$index; chapterIdLong: data.number * data.mark
let list = JSON.stringify(data.row); };
let detail = JSON.parse(list); this.ruleList.splice(this.indexCourse, 1, element);
var arr = this.$store.state.app.course; },
arr.forEach(res => { handleForm(data) {
if (res.name == detail.name) return detail.name = res.id // editCourse
}); this.indexCourse = data.$index;
this.editCourse = detail; const list = JSON.stringify(data.row);
this.handleAdd(); const detail = JSON.parse(list);
}, var arr = this.$store.state.app.course;
deleteForm(data) { arr.forEach(res => {
let index = data.$index; if (res.name == detail.name) {
this.ruleList.splice(index, 1); detail.name = res.id;
this.$refs.addRule.changeListDisabled(data.row.trainingType); return detail.name;
this.$store.dispatch('app/handleRuleList', this.ruleList); }
}, });
regulation() { this.editCourse = detail;
this.$store.dispatch('app/handleRuleList', this.ruleList); this.handleAdd();
this.$emit('regulation', this.course); },
} deleteForm(data) {
} const index = data.$index;
} this.ruleList.splice(index, 1);
this.$refs.addRule.changeListDisabled(data.row.trainingType);
this.$store.dispatch('app/handleRuleList', this.ruleList);
},
regulation() {
this.$store.dispatch('app/handleRuleList', this.ruleList);
this.$emit('regulation', this.course);
}
}
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.exam-rule { .exam-rule {

View File

@ -1,315 +1,320 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;" v-if="lessonName"> <div v-if="lessonName" slot="header" style="text-align: center;">
<b>课程名称 {{lessonName}}</b> <b>课程名称 {{ lessonName }}</b>
</div> </div>
<div :style="{ height: height +'px' }"> <div :style="{ height: height +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper" style=""> <el-scrollbar wrap-class="scrollbar-wrapper" style="">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" <QueryListPage
:query-list="queryList" style="height: 100%;"></QueryListPage> ref="queryListPage"
</el-scrollbar> :pager-config="pagerConfig"
</div> :query-form="queryForm"
</el-card> :query-list="queryList"
style="height: 100%;"
/>
</el-scrollbar>
</div>
</el-card>
</template> </template>
<script> <script>
import { getExamList, deleteExam, setExamEfficacy, setExamEffectivey } from '@/api/management/exam'; import { getExamList, deleteExam, setExamEfficacy, setExamEffectivey } from '@/api/management/exam';
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonTree } from '@/api/jmap/lesson';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default { export default {
name: 'List', name: 'List',
mixins: [ mixins: [
WindowResizeHandler WindowResizeHandler
], ],
data() { data() {
return { return {
BizTypeList: [], BizTypeList: [],
OrderTypeList: [], OrderTypeList: [],
PayTypeList: [], PayTypeList: [],
PayStatusList: [], PayStatusList: [],
OrganizationList: [], OrganizationList: [],
EffectiveTypeList: [], EffectiveTypeList: [],
userId: this.$store.state.user.id, userId: this.$store.state.user.id,
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
lessonName: '', lessonName: '',
height: '', height: '',
queryForm: { queryForm: {
labelWidth: '120px', labelWidth: '120px',
queryObject: { queryObject: {
'lessonId': { 'lessonId': {
type: this.$route.query.lessonId ? '' : 'select', type: this.$route.query.lessonId ? '' : 'select',
label: '课程', label: '课程',
config: { config: {
data: [] data: []
} }
}, },
'name': { 'name': {
type: 'text', type: 'text',
label: '试卷名称' label: '试卷名称'
}, },
'creatorName': { 'creatorName': {
type: 'text', type: 'text',
label: '创建人' label: '创建人'
} }
}, },
reset: this.$route.query.lessonId ? false : true, reset: !this.$route.query.lessonId
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '课程名称', title: '课程名称',
prop: 'lessonId', prop: 'lessonId',
type: 'tag', type: 'tag',
show: this.$route.query.lessonId ? false : true, show: !this.$route.query.lessonId,
columnValue: (row) => { return this.convertField(row.lessonId, this.OrganizationList, ['id', 'name']) }, columnValue: (row) => { return this.convertField(row.lessonId, this.OrganizationList, ['id', 'name']); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '试卷名称', title: '试卷名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '创建人', title: '创建人',
prop: 'creatorName', prop: 'creatorName'
}, },
{ {
title: '是否试用', title: '是否试用',
prop: 'trial', prop: 'trial',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.trial, 'Whether') }, columnValue: (row) => { return this.$ConstSelect.translate(row.trial, 'Whether'); },
tagType: (row) => { tagType: (row) => {
switch (row.trial) { switch (row.trial) {
case true: return 'success'; case true: return 'success';
case false: return 'danger'; case false: return 'danger';
} }
} }
}, },
{ {
title: '时长', title: '时长',
prop: 'duration', prop: 'duration',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.durationField(row.duration) }, columnValue: (row) => { return this.durationField(row.duration); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '考试时间', title: '考试时间',
prop: 'startTime', prop: 'startTime',
type: 'formatter', type: 'formatter',
format: 'yyyy-MM-dd hh:ss' format: 'yyyy-MM-dd hh:ss'
}, },
{ {
title: '满分', title: '满分',
prop: 'fullPoint' prop: 'fullPoint'
}, },
{ {
title: '及格分', title: '及格分',
prop: 'passingPoint' prop: 'passingPoint'
}, },
{ {
title: '状态', title: '状态',
prop: 'status', prop: 'status',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => { tagType: (row) => {
switch (row.status) { switch (row.status) {
case '1': return 'success'; case '1': return 'success';
default: return 'danger'; default: return 'danger';
} }
} }
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '300', width: '300',
buttons: [ buttons: [
{ {
name: '快速创建', name: '快速创建',
type: "primary", type: 'primary',
handleClick: this.handleDistribute, handleClick: this.handleDistribute,
showControl: (row) => { return row.bizType !== '02' } showControl: (row) => { return row.bizType !== '02'; }
}, },
{ {
name: '修改', name: '修改',
type: "primary", type: 'primary',
showControl: (row) => { return row.creatorId == this.userId }, showControl: (row) => { return row.creatorId == this.userId; },
handleClick: this.handleUpdate handleClick: this.handleUpdate
}, },
{ {
name: '下架', name: '下架',
type: "warning", type: 'warning',
handleClick: this.handleEfficacy, handleClick: this.handleEfficacy,
showControl: (row) => { showControl: (row) => {
return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status == 1 return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status == 1;
} }
}, },
{ {
name: '上架', name: '上架',
type: "primary", type: 'primary',
handleClick: this.handleEffective, handleClick: this.handleEffective,
showControl: (row) => { showControl: (row) => {
return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status != 1 return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status != 1;
} }
}, },
{ {
name: '删除', name: '删除',
type: "danger", type: 'danger',
handleClick: this.deleteList, handleClick: this.deleteList,
showControl: (row) => { return row.creatorId == this.userId } showControl: (row) => { return row.creatorId == this.userId; }
}, }
] ]
}, }
], ],
actions: [ actions: [
{ text: '新增', btnCode: 'employee_insert', handler: this.handleNormalAdd }, { text: '新增', btnCode: 'employee_insert', handler: this.handleNormalAdd }
] ]
} }
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
mounted() { mounted() {
this.$store.dispatch('app/handleCourseDetail', {}); this.$store.dispatch('app/handleCourseDetail', {});
this.$store.dispatch('app/handleRuleList', []); this.$store.dispatch('app/handleRuleList', []);
}, },
methods: { methods: {
convertList(FromList, ToList, ChecktypeFunction) { convertList(FromList, ToList, ChecktypeFunction) {
if (FromList) { if (FromList) {
ToList.length = 0; ToList.length = 0;
FromList.forEach(elem => { FromList.forEach(elem => {
if (ChecktypeFunction(elem)) { if (ChecktypeFunction(elem)) {
ToList.push({ value: elem.code, label: elem.name }); ToList.push({ value: elem.code, label: elem.name });
} }
}); });
} }
}, },
resizeHandler: function () { resizeHandler: function () {
if (/\/exam\//.test(`${this.$route.path}`)) { if (/\/exam\//.test(`${this.$route.path}`)) {
this.height = this._clientHeight - 50; this.height = this._clientHeight - 50;
} }
}, },
loadInitData() { loadInitData() {
this.queryForm.queryObject.lessonId.config.data.length = 0; this.queryForm.queryObject.lessonId.config.data.length = 0;
getPublishLessonTree({ mapId: '' }).then(response => { getPublishLessonTree({ mapId: '' }).then(response => {
this.OrganizationList = response.data; this.OrganizationList = response.data;
this.OrganizationList.forEach(elem => { this.OrganizationList.forEach(elem => {
if (elem.id == this.$route.query.lessonId) { if (elem.id == this.$route.query.lessonId) {
this.lessonName = elem.name; this.lessonName = elem.name;
} }
this.queryForm.queryObject.lessonId.config.data.push({ value: elem.id, label: elem.name }); this.queryForm.queryObject.lessonId.config.data.push({ value: elem.id, label: elem.name });
}); });
}); });
this.$Dictionary.effectiveType().then(list => { this.$Dictionary.effectiveType().then(list => {
this.convertList(list, this.EffectiveTypeList, elem => { this.convertList(list, this.EffectiveTypeList, elem => {
return true; return true;
}); });
}); });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; enumList && i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
durationField(fieldValue) { durationField(fieldValue) {
if (fieldValue) { if (fieldValue) {
let time = Number(fieldValue) / 60; const time = Number(fieldValue) / 60;
return `${time}分钟`; return `${time}分钟`;
} }
}, },
queryFunction(params) { queryFunction(params) {
if (this.$route.query.lessonId) { if (this.$route.query.lessonId) {
params.lessonId = this.$route.query.lessonId; params.lessonId = this.$route.query.lessonId;
} }
return getExamList(params); return getExamList(params);
}, },
handleNormalAdd() { handleNormalAdd() {
let path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`;
let lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0; const lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0;
this.$router.push({ path: `${path}/add/0/${lessonId}` }); this.$router.push({ path: `${path}/add/0/${lessonId}` });
}, },
handleUpdate(index, data) { handleUpdate(index, data) {
let path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`;
let lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0; const lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0;
this.$router.push({ path: `${path}/edit/${data.id}/${lessonId}` }); this.$router.push({ path: `${path}/edit/${data.id}/${lessonId}` });
}, },
handleDistribute(index, data) { handleDistribute(index, data) {
let path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`;
let lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0; const lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0;
this.$router.push({ path: `${path}/add/${data.id}/${lessonId}` }); this.$router.push({ path: `${path}/add/${data.id}/${lessonId}` });
}, },
// //
deleteList(index, data) { deleteList(index, data) {
this.$confirm('此操作将删除该试卷, 是否继续?', '提示', { this.$confirm('此操作将删除该试卷, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteExam(data).then(res => { deleteExam(data).then(res => {
this.queryList.reload(); this.queryList.reload();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}); });
}).catch(res => { }).catch(res => {
if (res.code == '500009') { if (res.code == '500009') {
this.$message({ type: 'warning', message: '该试卷已被使用,不能删除' }); this.$message({ type: 'warning', message: '该试卷已被使用,不能删除' });
} else { } else {
this.$message({ type: 'error', message: '删除异常,请联系管理员' }); this.$message({ type: 'error', message: '删除异常,请联系管理员' });
} }
}) });
}).catch(() => { }); }).catch(() => { });
}, },
handleEfficacy(index, data) { handleEfficacy(index, data) {
this.$confirm('此操作将此试卷下架?', '提示', { this.$confirm('此操作将此试卷下架?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
setExamEfficacy(data).then(res => { setExamEfficacy(data).then(res => {
this.queryList.reload(); this.queryList.reload();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '设置成功!' message: '设置成功!'
}); });
}).catch(res => { }).catch(res => {
this.$message({ type: 'warning', message: '设置失败,' + res.message }); this.$message({ type: 'warning', message: '设置失败,' + res.message });
}) });
}).catch(() => { }); }).catch(() => { });
}, },
handleEffective(index, data) { handleEffective(index, data) {
this.$confirm('此操作将此试卷上架?', '提示', { this.$confirm('此操作将此试卷上架?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
setExamEffectivey(data).then(res => { setExamEffectivey(data).then(res => {
this.queryList.reload(); this.queryList.reload();
this.$message({ this.$message({
type: 'success', type: 'success',
message: '设置成功!' message: '设置成功!'
}); });
}).catch(res => { }).catch(res => {
this.$message({ type: 'warning', message: '设置失败,' + res.message }); this.$message({ type: 'warning', message: '设置失败,' + res.message });
}) });
}).catch(() => { }); }).catch(() => { });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
/deep/ { /deep/ {

View File

@ -1,180 +1,178 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage> </div>
</div>
</template> </template>
<script> <script>
import { getProductList, putMapProductOnLine, putMapProductOffLine } from '@/api/management/mapprd'; import { getProductList, putMapProductOnLine, putMapProductOffLine } from '@/api/management/mapprd';
import { delTrainingList } from '@/api/management/userexam'; import { delTrainingList } from '@/api/management/userexam';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import localStore from 'storejs';
export default { export default {
name: 'PublishExam', name: 'PublishExam',
data() { data() {
return { return {
prdTypeList: [], prdTypeList: [],
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '80px', labelWidth: '80px',
reset: true, reset: true,
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '产品名称' label: '产品名称'
}, },
code: { code: {
type: 'text', type: 'text',
label: 'code' label: 'code'
} }
} }
}, },
queryList: { queryList: {
query: getProductList, query: getProductList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '产品名称', title: '产品名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '产品code', title: '产品code',
prop: 'code' prop: 'code'
}, },
{ {
title: '产品类型', title: '产品类型',
prop: 'prdType', prop: 'prdType',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.prdType, this.prdTypeList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.prdType, this.prdTypeList, ['code', 'name']); },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
}, },
// { // {
// title: '', // title: '',
// prop: 'remarks' // prop: 'remarks'
// }, // },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '250', width: '250',
buttons: [ buttons: [
// { // {
// name: '', // name: '',
// handleClick: this.handleDelete, // handleClick: this.handleDelete,
// type: 'danger' // type: 'danger'
// }, // },
{ {
name: '上架', name: '上架',
handleClick: this.handlePutaway, handleClick: this.handlePutaway,
type: '', type: '',
showControl: (row) => { return row.status != 1 } showControl: (row) => { return row.status != 1; }
}, },
{ {
name: '下架', name: '下架',
handleClick: this.handleSoldOut, handleClick: this.handleSoldOut,
type: 'warning', type: 'warning',
showControl: (row) => { return row.status == 1 } showControl: (row) => { return row.status == 1; }
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.prdTypeList = []; this.prdTypeList = [];
this.$Dictionary.productPostType().then(list => { this.$Dictionary.productPostType().then(list => {
this.prdTypeList = list; this.prdTypeList = list;
}); });
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除此考试结果, 是否继续?', '提示', { this.$confirm('此操作将删除此考试结果, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delTrainingList(row.id).then(response => { delTrainingList(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handlePutaway(index, row) { handlePutaway(index, row) {
this.$confirm('此操作将上架此产品, 是否继续?', '提示', { this.$confirm('此操作将上架此产品, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putMapProductOnLine(row.id).then(response => { putMapProductOnLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleSoldOut(index, row) { handleSoldOut(index, row) {
this.$confirm('此操作将下架此产品, 是否继续?', '提示', { this.$confirm('此操作将下架此产品, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putMapProductOffLine(row.id).then(response => { putMapProductOffLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>

View File

@ -1,187 +1,186 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage> </div>
</div>
</template> </template>
<script> <script>
import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine } from '@/api/jmap/lesson'; import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine } from '@/api/jmap/lesson';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'PublishMap', name: 'PublishMap',
data() { data() {
return { return {
cityList: [], cityList: [],
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '80px', labelWidth: '80px',
reset: true, reset: true,
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '名称' label: '名称'
}, },
cityCode: { cityCode: {
type: 'select', type: 'select',
label: '所属城市', label: '所属城市',
config: { config: {
data: [] data: []
} }
} }
} }
}, },
queryList: { queryList: {
query: publishLessonList, query: publishLessonList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '名称', title: '名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '所属城市', title: '所属城市',
prop: 'cityCode', prop: 'cityCode',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
}, },
{ {
title: '课程简介', title: '课程简介',
prop: 'remarks' prop: 'remarks'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '250', width: '250',
buttons: [ buttons: [
{ {
name: '上架', name: '上架',
handleClick: this.handlePutaway, handleClick: this.handlePutaway,
type: '', type: '',
showControl: (row) => { return row.status != 1 } showControl: (row) => { return row.status != 1; }
}, },
{ {
name: '下架', name: '下架',
handleClick: this.handleSoldOut, handleClick: this.handleSoldOut,
type: 'warning', type: 'warning',
showControl: (row) => { return row.status == 1 } showControl: (row) => { return row.status == 1; }
}, },
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger',
showControl: () => { return this.isShow != -1 } showControl: () => { return this.isShow != -1; }
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { computed: {
this.loadInitData(); isShow() {
}, return this.$store.getters['roles'].indexOf('05');
computed: { }
isShow() { },
return this.$store.getters['roles'].indexOf('05'); created() {
} this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.cityList = []; this.cityList = [];
this.$Dictionary.cityType().then(list => { this.$Dictionary.cityType().then(list => {
this.cityList = list; this.cityList = list;
this.cityList.forEach(elem => { this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
}); });
}).catch(error => { }).catch(() => {
this.$messageBox('加载城市列表失败'); this.$messageBox('加载城市列表失败');
}); });
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
// //
handleEdit(index, row) { handleEdit(index, row) {
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除该类型, 是否继续?', '提示', { this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delPublishLesson(row.id).then(response => { delPublishLesson(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
localStore.remove('mapId') localStore.remove('mapId');
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败'); this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handlePutaway(index, row) { handlePutaway(index, row) {
this.$confirm('此操作将上架此实训, 是否继续?', '提示', { this.$confirm('此操作将上架此实训, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putLessonOnLine(row.id).then(response => { putLessonOnLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleSoldOut(index, row) { handleSoldOut(index, row) {
this.$confirm('此操作将下架此实训, 是否继续?', '提示', { this.$confirm('此操作将下架此实训, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putLessonOffLine(row.id).then(response => { putLessonOffLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>

View File

@ -1,120 +1,118 @@
<template> <template>
<div class="card-box"> <div class="card-box">
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> --> <!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<el-steps class="steps" :active="display"> <el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step> <el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload"></el-step> <el-step title="" icon="el-icon-upload" />
</el-steps> </el-steps>
<el-card class="forms"> <el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -120 + 'px'}" style="padding-top: 40px"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -120 + 'px'}" style="padding-top: 40px">
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</el-scrollbar> </el-scrollbar>
</el-card> </el-card>
<div class="draft"> <div class="draft">
<el-button-group> <el-button-group>
<el-button type="warning" v-if="isEdit" @click="update">更新</el-button> <el-button v-if="isEdit" type="warning" @click="update">更新</el-button>
<el-button type="primary" @click="turnback">返回</el-button> <el-button type="primary" @click="turnback">返回</el-button>
</el-button-group> </el-button-group>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import { updatePublishMapName } from '@/api/jmap/map'; import { updatePublishMapName } from '@/api/jmap/map';
export default { export default {
name: 'PublishMapDraft', name: 'PublishMapDraft',
mixins: [ mixins: [
WindowResizeHandler WindowResizeHandler
], ],
data() { data() {
return { return {
title: '更新地图名称', title: '更新地图名称',
height: '', height: '',
display: 1, display: 1,
UserLoading: false, UserLoading: false,
formModel: { formModel: {
mapId: '', mapId: '',
name: '', name: ''
} }
} };
}, },
computed: { computed: {
// turnbackBarTitle() { // turnbackBarTitle() {
// return ''; // return '';
// }, // },
isEdit() { isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase(); return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
}, },
form() { form() {
let form = { const form = {
labelWidth: '140px', labelWidth: '140px',
items: [ items: [
{ prop: 'name', label: '地图名称', type: 'text', required: false } { prop: 'name', label: '地图名称', type: 'text', required: false }
] ]
} };
return form return form;
}, },
rules() { rules() {
let baseRules = { const baseRules = {
name: [ name: [
{ required: true, message: '请输入地图的新名称', trigger: 'blur' } { required: true, message: '请输入地图的新名称', trigger: 'blur' }
] ]
} };
// //
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.dataform.clearValidate(); this.$refs.dataform.clearValidate();
}); });
return baseRules; return baseRules;
} }
}, },
mounted() { mounted() {
this.initLoadPage(); this.initLoadPage();
}, },
methods: { methods: {
resizeHandler: function () { resizeHandler: function () {
this.height = this._clientHeight - 130; this.height = this._clientHeight - 130;
}, },
initLoadPage() { initLoadPage() {
// //
this.display = 1; this.display = 1;
// //
if (this.isEdit) { if (this.isEdit) {
this.formModel.mapId = this.$route.params.mapId; this.formModel.mapId = this.$route.params.mapId;
this.formModel.name = this.$route.query.name; this.formModel.name = this.$route.query.name;
} else { } else {
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.dataform.resetForm(); this.$refs.dataform.resetForm();
}); });
} }
}, },
update() { update() {
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
updatePublishMapName(this.formModel).then(response => { updatePublishMapName(this.formModel).then(response => {
this.display = 2; this.display = 2;
this.turnback(); this.turnback();
this.$message.success('更新成功'); this.$message.success('更新成功');
}).catch(error => { }).catch(() => {
this.$messageBox("更新失败"); this.$messageBox('更新失败');
}); });
}); });
}, },
turnback() { turnback() {
this.$router.go(-1) this.$router.go(-1);
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.card-box {}
.steps { .steps {
width: 940px; width: 940px;
margin: 0 auto; margin: 0 auto;
@ -151,7 +149,6 @@
} }
} }
.draft { .draft {
width: 400px; width: 400px;
text-align: center; text-align: center;

View File

@ -1,258 +1,254 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage> </div>
</div>
</template> </template>
<script> <script>
import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine } from '@/api/jmap/map'; import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine } from '@/api/jmap/map';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'PublishMap', name: 'PublishMap',
data() { data() {
return { return {
cityList: [], cityList: [],
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '80px', labelWidth: '80px',
reset: true, reset: true,
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '名称' label: '名称'
}, },
cityCode: { cityCode: {
type: 'select', type: 'select',
label: '所属城市', label: '所属城市',
config: { config: {
data: [] data: []
} }
} }
} }
}, },
queryList: { queryList: {
query: getPublishMapList, query: getPublishMapList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '名称', title: '名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '所属城市', title: '所属城市',
prop: 'cityCode', prop: 'cityCode',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '更新时间', title: '更新时间',
prop: 'updateTime' prop: 'updateTime'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '380', width: '380',
buttons: [ buttons: [
{ {
name: '上架', name: '上架',
handleClick: this.handlePutaway, handleClick: this.handlePutaway,
type: '', type: '',
showControl: (row) => { return row.status != 1 } showControl: (row) => { return row.status != 1; }
}, },
{ {
name: '下架', name: '下架',
handleClick: this.handleSoldOut, handleClick: this.handleSoldOut,
type: 'warning', type: 'warning',
showControl: (row) => { return row.status == 1 } showControl: (row) => { return row.status == 1; }
}, },
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger',
showControl: () => { return this.isShow != -1 } showControl: () => { return this.isShow != -1; }
}, },
{ {
name: '更新地图名称', name: '更新地图名称',
handleClick: this.handleUpdate, handleClick: this.handleUpdate
}, },
{ {
name: '导出地图', name: '导出地图',
handleClick: this.handleExportMap, handleClick: this.handleExportMap
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { computed: {
this.loadInitData(); isShow() {
}, return this.$store.getters['roles'].indexOf('05');
computed: { }
isShow() { },
return this.$store.getters['roles'].indexOf('05'); created() {
} this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.cityList = []; this.cityList = [];
this.$Dictionary.cityType().then(list => { this.$Dictionary.cityType().then(list => {
this.cityList = list; this.cityList = list;
this.cityList.forEach(elem => { this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
}); });
}).catch(error => { }).catch(() => {
this.$messageBox('加载城市列表失败'); this.$messageBox('加载城市列表失败');
}); });
this.skinStyleList = [];
getSkinStyleList().then(response => {
this.skinStyleList = response.data;
});
},
convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) {
const value = converFormat[0];
const label = converFormat[1];
for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label];
}
}
}
},
//
handleUpdate(index, row) {
this.$router.push({ path: `${UrlConfig.publish.mapDraft}/edit/${row.id}`, query: { name: row.name } });
},
this.skinStyleList = []; //
getSkinStyleList().then(response => { handleDelete(index, row) {
this.skinStyleList = response.data; this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
}) confirmButtonText: '确定',
}, cancelButtonText: '取消',
convertField(fieldValue, enumList, converFormat) { type: 'warning'
if (converFormat && converFormat.length >= 2) { }).then(() => {
let value = converFormat[0]; delPublishMap(row.id).then(response => {
let label = converFormat[1]; this.$message.success('删除成功');
for (let i = 0; enumList && i < enumList.length; i++) { this.reloadTable();
if ('' + fieldValue === '' + enumList[i][value]) { localStore.remove('mapId');
return enumList[i][label]; }).catch(() => {
} this.reloadTable();
} this.$messageBox('删除失败');
} });
}, }).catch(() => { });
// },
handleUpdate(index, row) {
this.$router.push({ path: `${UrlConfig.publish.mapDraft}/edit/${row.id}`, query: { name: row.name } });
},
// reloadTable() {
handleDelete(index, row) { this.queryList.reload();
this.$confirm('此操作将删除该类型, 是否继续?', '提示', { },
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPublishMap(row.id).then(response => {
this.$message.success('删除成功')
this.reloadTable()
localStore.remove('mapId')
}).catch(error => {
this.reloadTable()
this.$messageBox('删除失败');
})
}).catch(() => { })
},
reloadTable() { handlePutaway(index, row) {
this.queryList.reload() this.$confirm('此操作将上架此地图, 是否继续?', '提示', {
}, confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
putMapOnLine(row.id).then(response => {
this.$message.success('操作成功');
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('操作失败');
});
}).catch(() => { });
},
handlePutaway(index, row) { handleSoldOut(index, row) {
this.$confirm('此操作将上架此地图, 是否继续?', '提示', { this.$confirm('此操作将下架此地图, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putMapOnLine(row.id).then(response => { putMapOffLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { localStore.remove('mapId');
this.reloadTable() }).catch(() => {
this.$messageBox('操作失败') this.reloadTable();
}) this.$messageBox('操作失败');
}).catch(() => { }) });
}, }).catch(() => { });
},
handleSoldOut(index, row) { //
this.$confirm('此操作将下架此地图, 是否继续?', '提示', { async handleExportMap(index, row) {
confirmButtonText: '确定', const res = await getPublishMapExport(row.id);
cancelButtonText: '取消', const resultData = res.data;
type: 'warning' if (resultData === false) {
}).then(() => { return;
putMapOffLine(row.id).then(response => { }
this.$message.success('操作成功') const self = this;
this.reloadTable(); import('@/utils/Export2Excel').then(excel => {
localStore.remove('mapId'); self.queryExportData(resultData).then(data => {
}).catch(error => { excel.export_json_excel(data, resultData.name);
this.reloadTable() }).catch(error => {
this.$messageBox('操作失败') self.$message.error('导出执行异常:' + error.message);
}) });
}).catch(() => { }) });
}, },
// formatJson(filterVal, jsonData) {
async handleExportMap(index, row) { return jsonData.map(v => filterVal.map(j => v[j]));
let res = await getPublishMapExport(row.id); },
let resultData = res.data; //
if (resultData === false) { queryExportData(data) {
return; return new Promise((resolve, reject) => {
} const result = {
let self = this; base: []
import('@/utils/Export2Excel').then(excel => { };
self.queryExportData(resultData).then(data => { const obj = {};
excel.export_json_excel(data, resultData.name); for (const i in data) {
if (i == 'devices') {
for (const v in data[i]) {
if (data[i][v].length) {
result[v] = [...data[i][v]];
} else if (v == 'skinVO') {
result[v] = [data[i][v]];
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {
obj[i] = data[i];
} else if (data[i] instanceof Array) {
if (data[i].length) {
obj[i] = [...data[i]];
}
}
}
}).catch(error => { result.base.push(obj);
self.$message.error('导出执行异常:' + error.message); resolve(result);
}); });
}); }
}, }
};
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]))
},
//
queryExportData(data) {
return new Promise((resolve, reject) => {
let result = {
base: [],
};
let obj = {};
for (let i in data) {
if (i == 'devices') {
for (let v in data[i]) {
if (data[i][v].length) {
result[v] = [...data[i][v]];
}
else if (v == 'skinVO') {
result[v] = [data[i][v]];
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {
obj[i] = data[i];
} else if (data[i] instanceof Array) {
if (data[i].length) {
obj[i] = [...data[i]];
}
}
}
result.base.push(obj);
resolve(result);
});
}
}
}
</script> </script>

View File

@ -1,118 +1,123 @@
<template> <template>
<el-dialog :title="title" :visible.sync="dialogShow" width="80%" :before-close="doClose" :modal="false" <el-dialog
:close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> :title="title"
</QueryListPage> :visible.sync="dialogShow"
<el-row type="flex" justify="center" class="button-group"> width="80%"
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button> :before-close="doClose"
<el-button @click="dialogShow = false"> </el-button> :modal="false"
</el-row> :close-on-click-modal="false"
</el-dialog> >
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-row type="flex" justify="center" class="button-group">
<el-button type="primary" :loading="loading" @click="handleConfirm"> </el-button>
<el-button @click="dialogShow = false"> </el-button>
</el-row>
</el-dialog>
</template> </template>
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getSkinStyleList } from '@/api/management/mapskin' import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'ChooseTemplatePlan', name: 'ChooseTemplatePlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinStyleList: [], skinStyleList: [],
model: {}, model: {},
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '100px', labelWidth: '100px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '选择模板运行图' return '选择模板运行图';
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
doShow(model) { doShow(model) {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.model = model; this.model = model;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
params['skinStyle'] = this.model.skinStyle || ''; params['skinStyle'] = this.model.skinStyle || '';
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
handleConfirm() { handleConfirm() {
this.doClose(); this.doClose();
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose) { if (choose) {
this.$emit('chooseConfirm', choose); this.$emit('chooseConfirm', choose);
} else { } else {
this.$messageBox(`请选择模板运行图`); this.$messageBox(`请选择模板运行图`);
} }
} }
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,142 +1,139 @@
<template> <template>
<div class="card-box"> <div class="card-box">
<el-steps class="steps" :active="display"> <el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step> <el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload"></el-step> <el-step title="" icon="el-icon-upload" />
</el-steps> </el-steps>
<el-card class="forms"> <el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -120 + 'px'}" style="padding-top: 40px"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -120 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="选择地图:" prop="mapId"> <el-form-item label="选择地图:" prop="mapId">
<el-select v-model="model.mapId" filterable> <el-select v-model="model.mapId" filterable>
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-option> </el-select>
</el-select> </el-form-item>
</el-form-item> <el-form-item label="运行图名称:" prop="planId">
<el-form-item label="运行图名称:" prop="planId"> <el-row>
<el-row> <el-col :span="19">
<el-col :span="19"> <el-input v-model="model.planName" :readonly="true" />
<el-input v-model="model.planName" :readonly="true"></el-input> </el-col>
</el-col> <el-col :span="4" :offset="1">
<el-col :span="4" :offset="1"> <el-button @click="handleChoose">选择 </el-button>
<el-button @click="handleChoose">选择 </el-button> </el-col>
</el-col> </el-row>
</el-row> </el-form-item>
</el-form-item> </el-form>
</el-form> </el-scrollbar>
</el-scrollbar> </el-card>
</el-card> <div class="draft">
<div class="draft"> <el-button-group>
<el-button-group> <el-button v-if="isAdd" type="primary" @click="create">创建</el-button>
<el-button type="primary" v-if="isAdd" @click="create">创建</el-button> <el-button type="primary" @click="turnback">返回</el-button>
<el-button type="primary" @click="turnback">返回</el-button> </el-button-group>
</el-button-group>
</div>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
</div> </div>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</div>
</template> </template>
<script> <script>
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { createRunPlanCommon } from '@/api/runplan'; import { createRunPlanCommon } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan'; import ChooseTemplatePlan from './chooseTemplatePlan';
export default { export default {
name: 'CommonPlanDraft', name: 'CommonPlanDraft',
mixins: [ components: {
WindowResizeHandler ChooseTemplatePlan
], },
components: { mixins: [
ChooseTemplatePlan WindowResizeHandler
}, ],
data() { data() {
return { return {
height: '', height: '',
display: 1, display: 1,
loading: false, loading: false,
mapList: [], mapList: [],
model: { model: {
mapId: '', mapId: '',
planId: '', planId: '',
planName: '', planName: ''
} }
} };
}, },
computed: { computed: {
title() { title() {
return '创建通用运行图' return '创建通用运行图';
}, },
isAdd() { isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase(); return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
}, },
rules() { rules() {
let rules = { const rules = {
mapId: [ mapId: [
{ required: true, message: '请选择地图', trigger: 'blur' } { required: true, message: '请选择地图', trigger: 'blur' }
], ],
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'change' } { required: true, message: '请选择模板运行图', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
}, },
mounted() { mounted() {
this.initLoadPage(); this.initLoadPage();
}, },
methods: { methods: {
resizeHandler: function () { resizeHandler: function () {
this.height = this._clientHeight - 130; this.height = this._clientHeight - 130;
}, },
initLoadPage() { initLoadPage() {
listPublishMap().then(resp => { listPublishMap().then(resp => {
this.mapList = resp.data; this.mapList = resp.data;
}) });
}, },
handleChoose() { handleChoose() {
let model = {}; let model = {};
let index = this.mapList.findIndex(elem => { return elem.id == this.model.mapId }); const index = this.mapList.findIndex(elem => { return elem.id == this.model.mapId; });
if (index >= 0) { if (index >= 0) {
model = this.mapList[index]; model = this.mapList[index];
} }
this.$refs.choose.doShow(model); this.$refs.choose.doShow(model);
}, },
chooseConfirm(choose) { chooseConfirm(choose) {
if (choose) { if (choose) {
this.model.planId = choose.id; this.model.planId = choose.id;
this.model.planName = choose.name; this.model.planName = choose.name;
} }
}, },
buildModel() { buildModel() {
return { return {
mapId: this.model.mapId, mapId: this.model.mapId,
templatePlanId: this.model.planId templatePlanId: this.model.planId
} };
}, },
create() { create() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
createRunPlanCommon(this.buildModel()).then(response => { createRunPlanCommon(this.buildModel()).then(response => {
this.$message.success('创建通用运行图成功'); this.$message.success('创建通用运行图成功');
this.$router.go(-1); this.$router.go(-1);
}).catch(error => { }).catch(() => {
this.$messageBox('创建通用运行图失败'); this.$messageBox('创建通用运行图失败');
}) });
} }
}); });
}, },
turnback() { turnback() {
this.$router.go(-1) this.$router.go(-1);
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.card-box {}
.steps { .steps {
width: 940px; width: 940px;
margin: 0 auto; margin: 0 auto;
@ -173,7 +170,6 @@
} }
} }
.draft { .draft {
width: 400px; width: 400px;
text-align: center; text-align: center;

View File

@ -1,121 +1,119 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage> </div>
</div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { getSkinStyleList } from '@/api/management/mapskin' import { getRunPlanLoadList, runPlanTemplateList } from '@/api/runplan';
import { getRunPlanLoadList, createRunPlanCommon, runPlanTemplateList } from '@/api/runplan'; import { UrlConfig } from '@/router/index';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'RunPlanCommon', name: 'RunPlanCommon',
data() { data() {
return { return {
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true,
queryObject: { queryObject: {
mapName: { mapName: {
type: 'text', type: 'text',
label: '地图名称' label: '地图名称'
}, },
runPlanName: { runPlanName: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '地图名称', title: '地图名称',
prop: 'mapName' prop: 'mapName'
}, },
{ {
title: '运行图名称', title: '运行图名称',
prop: 'runPlanName' prop: 'runPlanName'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '350', width: '350',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; }, hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [ buttons: [
// { // {
// name: '', // name: '',
// handleClick: this.handleDelete, // handleClick: this.handleDelete,
// type: 'danger', // type: 'danger',
// }, // },
{ {
name: '预览', name: '预览',
handleClick: this.handleView, handleClick: this.handleView,
type: '', type: ''
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateCommonPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateCommonPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
methods: { methods: {
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
queryFunction(params) { queryFunction(params) {
params['userId'] = ''; params['userId'] = '';
return getRunPlanLoadList(params); return getRunPlanLoadList(params);
}, },
handleCreateCommonPlan() { handleCreateCommonPlan() {
this.$router.push({ path: `${UrlConfig.publish.runPlanCommon}/add` }); this.$router.push({ path: `${UrlConfig.publish.runPlanCommon}/add` });
}, },
// //
// handleDelete(index, row) { // handleDelete(index, row) {
// this.$confirm(', ?', '', { // this.$confirm(', ?', '', {
// confirmButtonText: '', // confirmButtonText: '',
// cancelButtonText: '', // cancelButtonText: '',
// type: 'warning' // type: 'warning'
// }).then(() => { // }).then(() => {
// }).catch(() => { }) // }).catch(() => { })
// }, // },
// //
handleView(index, row) { handleView(index, row) {
runPlanTemplateList({ pageSize: 10000 }).then(resp => { runPlanTemplateList({ pageSize: 10000 }).then(resp => {
let list = resp.data.list || []; const list = resp.data.list || [];
let index = list.findIndex(elem => { return list.id == row.templateId; }); const index = list.findIndex(elem => { return list.id == row.templateId; });
if (index >= 0) { if (index >= 0) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/common`, query: { skinStyle: list[index].skinStyle, planId: list[index].id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/common`, query: { skinStyle: list[index].skinStyle, planId: list[index].id } });
} }
}) });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>

View File

@ -1,139 +1,137 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage> </div>
</div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft'; import { getSkinStyleList } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin' import { runPlanEveryDayList, deleteRunPlanEveryDay } from '@/api/runplan';
import { runPlanEveryDayList, deleteRunPlanEveryDay } from '@/api/runplan'; import { UrlConfig } from '@/router/index';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'RunPlanEveryDay', name: 'RunPlanEveryDay',
data() { data() {
return { return {
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true,
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
}, },
skinStyle: { skinStyle: {
type: 'select', type: 'select',
label: '皮肤类型', label: '皮肤类型',
config: { config: {
data: [] data: []
} }
} }
} }
}, },
queryList: { queryList: {
query: runPlanEveryDayList, query: runPlanEveryDayList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '每日运行时间', title: '每日运行时间',
prop: 'runDate' prop: 'runDate'
}, },
{ {
title: '用户Id', title: '用户Id',
prop: 'creatorId' prop: 'creatorId'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '250', width: '250',
hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; }, hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [ buttons: [
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
}, },
{ {
name: '预览', name: '预览',
handleClick: this.handleView, handleClick: this.handleView,
type: '', type: ''
} }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name });
}) });
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除每日运行图, 是否继续?', '提示', { this.$confirm('此操作将删除每日运行图, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanEveryDay(row.id).then(response => { deleteRunPlanEveryDay(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
handleView(index, row) { handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/everyDay`, query: { skinStyle: row.skinStyle, planId: row.id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/everyDay`, query: { skinStyle: row.skinStyle, planId: row.id } });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>

View File

@ -1,161 +1,159 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage> </div>
</div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft'; import { getSkinStyleList } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin' import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan'; import { UrlConfig } from '@/router/index';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'RunPlanTemplate', name: 'RunPlanTemplate',
data() { data() {
return { return {
skinStyleList: [], skinStyleList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true,
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
}, },
skinStyle: { skinStyle: {
type: 'select', type: 'select',
label: '皮肤类型', label: '皮肤类型',
config: { config: {
data: [] data: []
} }
} }
} }
}, },
queryList: { queryList: {
query: runPlanTemplateList, query: runPlanTemplateList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '创建时间', title: '创建时间',
prop: 'createTime' prop: 'createTime'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '350', width: '350',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; }, hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [ buttons: [
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger'
}, },
{ {
name: '生成每日运行图', name: '生成每日运行图',
handleClick: this.handleGenerateEveryDay, handleClick: this.handleGenerateEveryDay,
type: '', type: ''
}, },
{ {
name: '预览', name: '预览',
handleClick: this.handleView, handleClick: this.handleView,
type: '', type: ''
} }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name });
}) });
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除此运行图模板, 是否继续?', '提示', { this.$confirm('此操作将删除此运行图模板, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanTemplate(row.id).then(response => { deleteRunPlanTemplate(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(error => {
this.reloadTable() this.reloadTable();
if (error.code == 500) { if (error.code == 500) {
this.$messageBox('删除失败') this.$messageBox('删除失败');
} else if (error.code == 500009) { } else if (error.code == 500009) {
this.$messageBox('该模板已被加载计划使用,无法删除') this.$messageBox('该模板已被加载计划使用,无法删除');
} }
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
handleGenerateEveryDay(index, row) { handleGenerateEveryDay(index, row) {
this.$confirm('此操作将生成每日运行图, 是否继续?', '提示', { this.$confirm('此操作将生成每日运行图, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
generateCommonRunPlanEveryDay(row.id).then(response => { generateCommonRunPlanEveryDay(row.id).then(response => {
this.reloadTable() this.reloadTable();
this.$message.success('生成通用每日运行图成功。') this.$message.success('生成通用每日运行图成功。');
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('生成通用每日运行图失败!') this.$messageBox('生成通用每日运行图失败!');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
handleView(index, row) { handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinStyle: row.skinStyle, planId: row.id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinStyle: row.skinStyle, planId: row.id } });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>

View File

@ -1,141 +1,137 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage> </div>
</div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft'; import { getSkinStyleList } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin' import { getQuestPageList, deleteQuest } from '@/api/quest';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
import { getQuestPageList, deleteQuest } from '@/api/quest';
export default { export default {
name: 'RunPlanTemplate', name: 'RunPlanTemplate',
data() { data() {
return { return {
skinCodeList: [], skinCodeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true,
queryObject: { queryObject: {
skinCode: { skinCode: {
type: 'select', type: 'select',
label: '皮肤类型', label: '皮肤类型',
config: { config: {
data: [] data: []
} }
} }
} }
}, },
queryList: { queryList: {
query: getQuestPageList, query: getQuestPageList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '任务名称', title: '任务名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']) return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '创建时间', title: '创建时间',
prop: 'createTime' prop: 'createTime'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '350', width: '350',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; }, hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [ buttons: [
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger'
}, },
{ {
name: '查看详情', name: '查看详情',
handleClick: this.handleDetail, handleClick: this.handleDetail,
type: '', type: ''
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.skinCodeList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
}) });
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
} }
} }
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除此仿真脚本, 是否继续?', '提示', { this.$confirm('此操作将删除此仿真脚本, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteQuest(row.id).then(response => { deleteQuest(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(error => {
this.reloadTable() this.reloadTable();
if (error.code == 500) { if (error.code == 500) {
this.$messageBox('删除失败') this.$messageBox('删除失败');
} else if (error.code == 500009) { } else if (error.code == 500009) {
this.$messageBox('该模板已被加载计划使用,无法删除') this.$messageBox('该模板已被加载计划使用,无法删除');
} }
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
handleDetail(index, row) { handleDetail(index, row) {
console.log(index, row); console.log(index, row);
this.$messageBox('该功能暂时未开启'); this.$messageBox('该功能暂时未开启');
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>