This commit is contained in:
zyy 2019-08-08 14:47:39 +08:00
commit 837ba489b6
66 changed files with 4306 additions and 4523 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -44,7 +44,6 @@ export function sendTrainingNextStep(data, group) {
});
}
/** 获取实训树*/
export function getTrainingTree() {
return request({
@ -153,7 +152,7 @@ export function deleteAutoTraining(params) {
});
}
/**获取用户实训列表*/
/** 获取用户实训列表*/
export function getTrainingList(data) {
return request({
url: `/api/training/list`,
@ -202,6 +201,6 @@ export function putUserTraining(data) {
export function deleteUserTraining(statsId) {
return request({
url: `/api/training/userTraining/${statsId}`,
method: 'delete',
method: 'delete'
});
}
}

View File

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

View File

@ -1,15 +1,13 @@
import request from '@/utils/request';
/** 分页获取课程权限数据*/
export function getLessonPermissonPageList(params) {
return request({
url: '/api/permission',
method: 'get',
params: params
});
return request({
url: '/api/permission',
method: 'get',
params: params
});
}
// 根据ID获取权限数据
@ -22,45 +20,45 @@ export function getLessonPermissonPageList(params) {
/** 创建课程权限*/
export function createLessonPermisson(data) {
return request({
url: '/api/permission',
method: 'post',
data: data
});
return request({
url: '/api/permission',
method: 'post',
data: data
});
}
/**获取用户某课程某段时间内可用的权限数量*/
/** 获取用户某课程某段时间内可用的权限数量*/
export function getTotalRemains(params) {
return request({
url: '/api/permission/totalRemains',
method: 'get',
params: params
});
return request({
url: '/api/permission/totalRemains',
method: 'get',
params: params
});
}
/**设置权限失效或有效*/
/** 设置权限失效或有效*/
export function setLessonPermisson(data) {
return request({
url: `/api/permission/${data.id}/status`,
method: 'put',
data: data
});
return request({
url: `/api/permission/${data.id}/status`,
method: 'put',
data: data
});
}
/**
* 查询仿真权限列表
*/
export function queryPermissionSimulation(data) {
return request({
url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`,
method: 'get'
});
return request({
url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`,
method: 'get'
});
}
/**获取大屏权限列表*/
/** 获取大屏权限列表*/
export function queryPermissionScreen() {
return request({
url: `/api/permission/bigScreen`,
method: 'get'
});
return request({
url: `/api/permission/bigScreen`,
method: 'get'
});
}
/** 更新课程权限*/
@ -84,31 +82,30 @@ export function deleteLessonPermisson(id) {
}
*/
/**
* 用户权限列表
*/
export function listUserPermision(params) {
return request({
url: `/api/permission/my`,
method: 'get',
params: params
});
return request({
url: `/api/permission/my`,
method: 'get',
params: params
});
}
/** 用户权限列表 */
export function getDistribute(id) {
return request({
url: `/api/distribute/${id}`,
method: 'get',
});
return request({
url: `/api/distribute/${id}`,
method: 'get'
});
}
/** 用户权限列表 */
export function putPermissionOwner(data) {
return request({
url: `/api/permission/${data.id}/owner`,
method: 'put',
data: data.owner
});
}
return request({
url: `/api/permission/${data.id}/owner`,
method: 'put',
data: data.owner
});
}

View File

@ -1,63 +1,63 @@
import request from '@/utils/request';
export function list(params) {
return request({
url: '/api/dictionary/list',
method: 'get',
params: params
});
return request({
url: '/api/dictionary/list',
method: 'get',
params: params
});
}
export function checkDicCodeExist(code) {
return request({
url: '/api/dictionary/checkExistByCode',
method: 'get',
params: {
code: code
}
});
return request({
url: '/api/dictionary/checkExistByCode',
method: 'get',
params: {
code: code
}
});
}
export function getData(id) {
return request({
url: `/api/dictionary/${id}`,
method: 'get'
});
return request({
url: `/api/dictionary/${id}`,
method: 'get'
});
}
export function create(data) {
return request({
url: '/api/dictionary/create',
method: 'post',
data: data
});
return request({
url: '/api/dictionary/create',
method: 'post',
data: data
});
}
export function del(id) {
return request({
url: `/api/dictionary/delete/${id}`,
method: 'delete'
});
return request({
url: `/api/dictionary/delete/${id}`,
method: 'delete'
});
}
export function update(data) {
return request({
url: `/api/dictionary/update/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/dictionary/update/${data.id}`,
method: 'put',
data: data
});
}
/**
* 根据字典code获取明细列表
* @param {*} code
* @param {*} code
*/
export function getDetailList(code) {
return request({
url: '/api/dictionary/getDetailListByCode',
method: 'get',
params: {
code: code
}
});
return request({
url: '/api/dictionary/getDetailListByCode',
method: 'get',
params: {
code: code
}
});
}

View File

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

View File

@ -2,106 +2,106 @@ import request from '@/utils/request';
/** 上课权限获取*/
export function getLessons(data) {
return request({
url: '/api/distribute/getLessons',
method: 'get',
data: data
});
return request({
url: '/api/distribute/getLessons',
method: 'get',
data: data
});
}
/** 上课权限分发*/
export function giveLessons(data) {
return request({
url: '/api/distribute/givePermission',
method: 'post',
data: data
});
return request({
url: '/api/distribute/givePermission',
method: 'post',
data: data
});
}
/** 接收课程权限*/
export function receiveLessons(data) {
return request({
url: '/api/distribute/receiveLessons',
method: 'get',
data: data
});
return request({
url: '/api/distribute/receiveLessons',
method: 'get',
data: data
});
}
/** 考试权限分发*/
export function giveExams(data) {
return request({
url: `/api/distribute/giveExams`,
method: 'post',
data: data
});
return request({
url: `/api/distribute/giveExams`,
method: 'post',
data: data
});
}
/** 权限打包分页查询*/
export function listPackagePermission(params) {
return request({
url: '/api/distribute',
method: 'get',
params: params
});
return request({
url: '/api/distribute',
method: 'get',
params: params
});
}
/** 打包权限*/
export function packagePermissionDistribute(data) {
return request({
url: `/api/distribute/givePermission/package`,
method: 'post',
data: data
});
return request({
url: `/api/distribute/givePermission/package`,
method: 'post',
data: data
});
}
/** 权限回收*/
export function restorePackagePermission(id) {
return request({
url: `/api/distribute/${id}/restore`,
method: 'put',
});
return request({
url: `/api/distribute/${id}/restore`,
method: 'put'
});
}
/** 生成打包权限二维码*/
export function getPackageQrCode(params) {
return request({
url: `/api/distribute/package/qrCode`,
method: 'get',
params: params
});
return request({
url: `/api/distribute/package/qrCode`,
method: 'get',
params: params
});
}
/** 权限分发打包详情*/
export function getPermissionPackageDetail(id, params) {
return request({
url: `/api/distribute/package/${id}/detail`,
method: 'get',
params: params
});
return request({
url: `/api/distribute/package/${id}/detail`,
method: 'get',
params: params
});
}
/** 权限分发打包*/
export function permissionDistributePackage(data) {
return request({
url: `/api/distribute/package`,
method: 'post',
data: data
});
return request({
url: `/api/distribute/package`,
method: 'post',
data: data
});
}
/** 权限分发解包*/
export function permissionDistributeUnPackage(permissionId) {
return request({
url: `/api/distribute/${permissionId}/unPackage`,
method: 'delete'
});
return request({
url: `/api/distribute/${permissionId}/unPackage`,
method: 'delete'
});
}
/** 查询可打包的权限分发*/
export function listCanPackagePermission(params) {
return request({
url: `/api/distribute/package`,
method: 'get',
params: params
});
return request({
url: `/api/distribute/package`,
method: 'get',
params: params
});
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,104 +3,103 @@ import request from '@/utils/request';
/** 分页获取订单数据*/
export function getOrderPageList(params) {
return request({
url: '/api/order',
method: 'get',
params: params
});
return request({
url: '/api/order',
method: 'get',
params: params
});
}
/** 根据ID获取订单数据*/
export function getOrderDetail(id, params) {
return request({
url: `/api/order/${id}`,
method: 'get',
params: params
});
return request({
url: `/api/order/${id}`,
method: 'get',
params: params
});
}
/** 创建一个订单*/
export function createOrder(data) {
return request({
url: '/api/order',
method: 'post',
data: data
});
return request({
url: '/api/order',
method: 'post',
data: data
});
}
/** 更新订单*/
export function updateOrder(data) {
return request({
url: '/api/order',
method: 'put',
data: data
});
return request({
url: '/api/order',
method: 'put',
data: data
});
}
export function deleteOrder(id) {
return request({
url: `/api/order/${id}`,
method: 'delete'
});
return request({
url: `/api/order/${id}`,
method: 'delete'
});
}
/** 订单权限领取*/
export function getOrder(params) {
return request({
url: '/api/order/getOrder',
method: 'get',
params: params
});
return request({
url: '/api/order/getOrder',
method: 'get',
params: params
});
}
/** 订单权限分发*/
export function giveOrder(data) {
return request({
url: '/api/order/giveOrder',
method: 'post',
data: data
});
return request({
url: '/api/order/giveOrder',
method: 'post',
data: data
});
}
/** 订单续费*/
export function getOrderCharge(id) {
return request({
url: `/api/order/${id}/charge`,
method: 'get'
});
return request({
url: `/api/order/${id}/charge`,
method: 'get'
});
}
/** 计算总价*/
export function calcuteOrderSumPrice(args) {
return request({
url: `/api/order/price`,
method: 'get',
params: args
});
return request({
url: `/api/order/price`,
method: 'get',
params: args
});
}
/** 提交订单*/
export function commitOrder(data) {
return request({
url: '/api/order/submit',
method: 'post',
data: data
});
return request({
url: '/api/order/submit',
method: 'post',
data: data
});
}
/** 确认订单*/
export function confirmOrder(data) {
return request({
url: `/api/order/${data.orderId}/${data.type}/pay`,
method: 'get'
});
return request({
url: `/api/order/${data.orderId}/${data.type}/pay`,
method: 'get'
});
}
/** 取消订单*/
export function cancalOrder(orderId) {
return request({
url: `/api/order/${orderId}/cancelPay`,
method: 'put'
});
}
return request({
url: `/api/order/${orderId}/cancelPay`,
method: 'put'
});
}

View File

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

View File

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

View File

@ -1,97 +1,95 @@
import request from '@/utils/request';
/** 注册用户*/
export function createUserInfo(data) {
return request({
url: '/api/userinfo/create',
method: 'put',
data: data
});
return request({
url: '/api/userinfo/create',
method: 'put',
data: data
});
}
/** 根据用户Id获取用户信息*/
export function getUserInfoByOpenId(params) {
return request({
url: '/api/userinfo/getByOpenId',
method: 'get',
params: params
});
return request({
url: '/api/userinfo/getByOpenId',
method: 'get',
params: params
});
}
/** 根据姓名或者手机号查询用户*/
export function getUserInfoByNameOrMobile(params) {
return request({
url: '/api/userinfo/nameOrMobile',
method: 'get',
params: params
});
return request({
url: '/api/userinfo/nameOrMobile',
method: 'get',
params: params
});
}
/** 查询用户参数*/
export function getUserConfigInfo() {
return request({
url: '/api/user/config',
method: 'get'
});
return request({
url: '/api/user/config',
method: 'get'
});
}
/** 设置用户参数*/
export function setUserConfigInfo(data) {
return request({
url: '/api/user/config',
method: 'post',
data: data
});
return request({
url: '/api/user/config',
method: 'post',
data: data
});
}
/** 获取销售列表*/
export function getSellerList() {
return request({
url: `/api/user/seller`,
method: 'get'
});
return request({
url: `/api/user/seller`,
method: 'get'
});
}
/** 查询用户列表*/
export function getUserList(params) {
return request({
url: `/api/user`,
method: 'get',
params: params
});
return request({
url: `/api/user`,
method: 'get',
params: params
});
}
/** 模糊查询用户 昵称、名称、手机号*/
export function getDimUserList(params) {
return request({
url: `/api/user/fuzzy`,
method: 'get',
params: params
});
return request({
url: `/api/user/fuzzy`,
method: 'get',
params: params
});
}
/** 获取用户订阅地图列表*/
export function getUserSubscribe(userId) {
return request({
url: `/api/user/subscribe/${userId}`,
method: 'get'
});
return request({
url: `/api/user/subscribe/${userId}`,
method: 'get'
});
}
/** 保存用户订阅地图列表*/
export function saveUserSubscribe(data) {
return request({
url: '/api/user/subscribe',
method: 'post',
data: data
});
return request({
url: '/api/user/subscribe',
method: 'post',
data: data
});
}
// 修改用户权限
export function putRoles(data) {
return request({
url: `/api/user/${data.id}/role`,
method: 'put',
data: data
});
return request({
url: `/api/user/${data.id}/role`,
method: 'put',
data: data
});
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@
v-show="show"
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'">
<div class="separator">&ensp;</div>
</template>

View File

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

View File

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

View File

@ -44,6 +44,16 @@
show-overflow-tooltip
:sortable="column.sortable"
/>
<el-table-column
v-else-if="checkColumnTyep(column, 'basicText')"
:label="column.title"
:key="index"
:width="column.width"
:sortable="column.sortable">
<template slot-scope="scope">
<span class="hideOutContent">{{column.columnValue(scope.row, scope.$index)}}</span>
</template>
</el-table-column>
<el-table-column
v-else-if="checkColumnTyep(column, 'tag')"
:key="index"
@ -313,10 +323,10 @@ export default {
queryExportData() {
},
/**
* 翻页方法
* pageIndex: 翻页后是第几页
* params: 查询条件
**/
* 翻页方法
* pageIndex: 翻页后是第几页
* params: 查询条件
**/
changePage(pageIndex, params) {
this.pageIndex = pageIndex;
this.pageOffset = (this.pageIndex - 1) * this.pageSize;
@ -334,8 +344,8 @@ export default {
this.queryList.reload();
},
/**
* 改变分页大小回调函数执行完毕后iview会自动触发changePage事件去查第一页数据
*/
* 改变分页大小回调函数执行完毕后iview会自动触发changePage事件去查第一页数据
*/
pageSizeChange(newPageSize) {
if (newPageSize) {
this.pageSize = newPageSize;
@ -343,8 +353,8 @@ export default {
}
},
/**
* 把分页信息混合到this.queryData里
*/
* 把分页信息混合到this.queryData里
*/
mixinBackPageInfoToQueryData() {
//
const pagerParams = {

View File

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

View File

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

View File

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

View File

@ -406,20 +406,6 @@ class SkinStyle extends defaultStyle {
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 0.1, // 车身line宽
trainBodyOnMouseOver: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标悬浮事件
trainBodyOnMouseOut: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标移出事件
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔

View File

@ -368,20 +368,6 @@ class SkinStyle extends defaultStyle {
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 1, // 车身line宽
trainBodyOnMouseOver: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标悬浮事件
trainBodyOnMouseOut: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标移出事件
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔
@ -440,12 +426,11 @@ class SkinStyle extends defaultStyle {
},
trainStatusStyle: {
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
destinationStatusSetText: 'trainTarget', // 目的地状态设置的对应哪个text的颜色
destinationStatusSetText: 'trainWindowBorder', // 目的地状态设置的对应哪个颜色
destinationStatus: [
{status: '01', showColor: '#FFFFFF'},
{status: '02', showColor: '#00FF00'},
{status: '03', showColor: '#A0522D'},
{status: '04', showColor: '#FFFF00'}
{status: '03', showColor: '#A0522D'}
], // 目的地状态 01准点 02早点 03晚点 04头码车
serverNoType: [
{type: '01', showColor: '#FFFFFF'},
@ -494,13 +479,13 @@ class SkinStyle extends defaultStyle {
runModeStatus: [
{
status: '01',
trainLColor: '#FFFFFF',
trainRColor: '#FFFFFF'
trainLColor: '#00FF00',
trainRColor: '#00FF00'
},
{
status: '02',
trainLColor: '#00FF00',
trainRColor: '#00FF00'
trainLColor: '#FF8000',
trainRColor: '#FF8000'
},
{
status: '03',

View File

@ -365,20 +365,6 @@ class SkinStyle extends defaultStyle {
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 1, // 车身line宽
trainBodyOnMouseOver: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标悬浮事件
trainBodyOnMouseOut: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标移出事件
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [], // 特殊列车类型需设置显示格式
lrPadding: 4, // 两边间隔

View File

@ -314,20 +314,6 @@ class SkinStyle extends defaultStyle {
this[deviceType.Train] = {
trainBody: {
trainBodyLineWidth: 0, // 车身line宽
trainBodyOnMouseOver: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标悬浮事件
trainBodyOnMouseOut: {
train: true,
textTrainNumber: false,
textTrainServer: false,
textTrainTarget: false,
textTrainTargetNumber: false
}, // 车身鼠标移出事件
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
specialTrainType: [
{

View File

@ -24,7 +24,7 @@ class EMouse extends Group {
style: {
x: this.device.model.point.x + 50,
y: this.device.model.point.y + 25,
text: `列车类型: 计划车\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.trackName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`,
text: `列车类型: 计划车\n\0\0\0\0号: ${this.device.model.serviceNumber}\n\0\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n\0\0号: ${this.device.model.groupNumber}\n\0\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`,
textFill: '#000',
textAlign: 'letf',
textFont: 10 + 'px consolas',

View File

@ -39,18 +39,8 @@ export default class TrainBody extends Group {
this.trainBodyBox = new TrainBodyBox({
zlevel: model.zlevel,
z: model.z,
shape: {
x: model.point.x,
y: model.point.y,
width: style.Train.common.trainWidth,
height: style.Train.common.trainHeight
},
style: {
lineWidth: style.Train.trainBody.trainBodyLineWidth,
stroke: style.trainSidelineColor,
fill: style.Train.trainBody.trainBodyFillColor
},
cursor: 'pointer'
point: model.point,
style: style
});
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
@ -220,6 +210,9 @@ export default class TrainBody extends Group {
isShow ? this.textA.show() : this.textA.hide();
}
}
setBodyBoxShape(key, color) {
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
}
formatChangePosition(model, style) {
if (style.Train.trainBody.trainNameFormat) {
const arr = style.Train.trainBody.trainNameFormat.split(':');

View File

@ -1,7 +1,7 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class Train extends Group {
export default class TrainBodyBox extends Group {
constructor(model) {
super();
this.model = model;
@ -9,16 +9,23 @@ export default class Train extends Group {
}
create() {
const model = this.model;
this.train = new Rect({
this.trainBodyBox = new Rect({
zlevel: model.zlevel,
z: model.z,
shape: model.shape,
style: model.style,
cursor: model.cursor,
onmouseover: model.onmouseover,
onmouseout: model.onmouseout
shape: {
x: model.point.x,
y: model.point.y,
width: model.style.Train.common.trainWidth,
height: model.style.Train.common.trainHeight
},
style: {
lineWidth: model.style.Train.trainBody.trainBodyLineWidth,
stroke: model.style.trainSidelineColor,
fill: model.style.Train.trainBody.trainBodyFillColor
},
cursor: 'pointer'
});
this.add(this.train);
this.add(this.trainBodyBox);
}
setColor(key, color) {
this.train.setStyle(key, color);

View File

@ -58,9 +58,4 @@ export default class TrainHead extends Group {
setArrowShow(isShow) {
isShow ? this.arrow.show() : this.arrow.hide();
}
setInvisible(invisible) {
this.eachChild((child) => {
child.attr('invisible', invisible);
});
}
}

View File

@ -107,10 +107,6 @@ export default class Train extends Group {
// 获取设备提示坐标
getShapeTipPoint() {
return {
x: (this.train.shape.x),
y: (this.train.shape.y)
};
}
// 恢复颜色状态
@ -152,6 +148,9 @@ export default class Train extends Group {
case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
break;
case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor);
break;
default:
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
}
@ -166,6 +165,9 @@ export default class Train extends Group {
case 'trainServer':
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
case 'trainWindowBorder':
this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor);
break;
default:
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
}

View File

@ -548,7 +548,7 @@ export const asyncRouter = [
component: resolve => require(['@/views/screenMonitor/index'], resolve),
name: '大屏系统',
meta: {
roles: [admin, userScreen]
roles: [admin, userScreen, user]
},
children: [
{

View File

@ -1,4 +1,4 @@
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin } from '@/router';
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin } from '@/router';
import { PermissionType } from '@/utils/PermissionType';
import { UrlConfig } from '@/router/index';
@ -63,6 +63,9 @@ function convertRouterRoles({ roles, permissionType }) {
*/
function filterAsyncRouter(asyncRouter, roles, parentsRoles) {
return asyncRouter.filter(route => {
if (route.name === '大屏系统' && roles.indexOf(admin)===-1 && roles.indexOf(userScreen) ===-1){
route.hidden = true;
}
if (hasPermission(roles, route, parentsRoles)) {
if (route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, roles, route.meta ? route.meta.roles : undefined);

View File

@ -29,7 +29,7 @@
:key="item.id"
:label="item.name"
:value="item.id"
:disabled="item.role != 'Dispatcher'"
:disabled="checkDisabled(item.role)"
/>
</el-select>
</el-form-item>
@ -205,7 +205,19 @@ export default {
roleDoClose() {
this.$refs['ruleForm'].resetFields();
this.roleShow = false;
}
},
checkDisabled(role) {
if(this.$route.query.prdType == '01'){
return role != 'Attendant';
} else if (this.$route.query.prdType == '02'){
return role != 'Dispatcher';
}else if (this.$route.query.prdType == '04'){
return role !== 'Driver';
}else {
return false;
}
}
}
};
</script>

View File

@ -82,6 +82,7 @@ import { checkLoginLine } from '@/api/login';
import { loadMapData } from '@/utils/loaddata';
// import { handleToken } from '@/utils/auth';
import { EventBus } from '@/scripts/event-bus';
import Vue from 'vue';
//
import ThreeTest from '@/views/jlmap3d/index';
@ -445,6 +446,11 @@ export default {
const res = await loadQuest(row.id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
/*if(res.data && res.data.mapLocation) {
let mapLocation={"offsetX":res.data.mapLocation.x,"offsetY":res.data.mapLocation.y,"scaleRate":res.data.mapLocation.scale};
Vue.prototype.$jlmap.setDataZoom(mapLocation)
}*/
console.log('-----------------------------',this);
}
if (this.$refs.menuDemon) {

View File

@ -19,7 +19,6 @@
</el-button-group>
</div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
<tip-quest-detail v-show="questId" ref="questTip" :quest-id="questId" />
</div>
</template>
@ -27,7 +26,6 @@
<script>
// import ChartView from './demon/chartView';
import SetTime from './demon/setTime';
import TipQuestDetail from './tipQuestDetail';
import { Notification } from 'element-ui';
import { getGoodsTryUse } from '@/api/management/goods';
import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
@ -43,7 +41,6 @@ export default {
components: {
// ChartView,
SetTime,
TipQuestDetail
},
props: {
group: {

View File

@ -1,203 +0,0 @@
<template>
<div v-drag class="reminder-drag">
<div ref="drapBox" class="reminder-box">
<div class="tip-title">
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
<p v-if="isShrink" style="color: #fff;">
<span>{{ formModel.name }}</span>
</p>
</div>
<div ref="dragBody" class="tip-body-box">
<div class="tip-body">
<el-scrollbar wrap-class="scrollbar-wrapper">
<p class="list-item">
<span class="list-label">任务描述</span>
<span class="list-elem">{{ formModel.description }}</span>
</p>
</el-scrollbar>
</div>
<div class="drag-right" />
<div class="drag-left" />
<div class="drag-bottom" />
<div class="drag-top" />
</div>
</div>
</div>
</template>
<script>
import { getQuestById } from '@/api/quest';
export default {
name: 'TipQuestDetail',
props: {
questId: {
type: Number,
required: true
}
},
data() {
return {
isShrink: true,
formModel: {
name: '',
description: ''
}
};
},
computed: {
},
watch: {
'questId': function (val) {
this.loadInitData(val);
}
},
mounted() { },
methods: {
loadInitData(questId) {
if (questId) {
getQuestById(questId).then(resp => {
this.formModel = resp.data;
}).catch(() => {
this.$messageBox('获取任务信息失败');
});
}
},
shrink() {
const height = this.$refs.dragBody.offsetHeight + 40;
const top = this.$refs.drapBox.style.top;
if (this.isShrink) {
this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = '';
this.isShrink = false;
} else {
this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top;
this.isShrink = true;
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.tip-body-box {
position: relative;
height: 260px;
}
.reminder-box {
position: absolute;
float: left;
left: 15x;
bottom: 15px;
width: 500px;
height: 300px;
background-color: #fff;
border-radius: 5px;
overflow: hidden;
z-index: 10;
font-size: 18px;
.tip-title {
width: 100%;
overflow: hidden;
height: 40px;
display: flex;
align-items: center;
flex-direction: row-reverse;
background-color: #409EFF;
border-radius: 5px 5px 0 0;
justify-content: space-between;
padding: 0 10px;
}
.drag-right,
.drag-left {
width: 10px;
cursor: e-resize;
background-color: yellow;
height: 100%;
position: absolute;
right: 0;
top: 0;
opacity: 0;
}
.drag-left {
left: 0;
}
.drag-bottom {
position: absolute;
bottom: 0;
width: 100%;
height: 10px;
cursor: s-resize;
background-color: yellow;
opacity: 0;
}
.drag-top {
position: absolute;
top: -45px;
left: 0;
width: 100%;
height: 10px;
cursor: s-resize;
background-color: yellow;
opacity: 0;
}
.tip-body {
height: 366px;
padding: 10px;
.list-label {
width: 90px;
}
}
.tip-foot {
width: 100%;
position: absolute;
right: 0px;
bottom: 0px;
background-color: #fff;
padding: 10px 0 10px 10px;
.foot-detail {
height: 100%;
float: right;
margin-top: 9px;
padding-right: 15px;
}
.foot-submit {
float: right;
margin-top: 9px;
padding-right: 15px;
}
}
.icon {
float: right;
margin-right: 10px;
cursor: pointer;
background-color: #f3f3f3;
border-radius: 50%;
}
/deep/ {
.el-tree-node__content {
margin-bottom: 4px;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background-color: #d6e5f7;
}
}
}
</style>

View File

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

View File

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

View File

@ -1,131 +1,130 @@
<template>
<el-card>
<div slot="header" style="text-align: center;" v-if="lessonName">
<b>课程名称 {{lessonName}}</b>
<el-card>
<div v-if="lessonName" slot="header" style="text-align: center;">
<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>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<div class="exam-box" :style="{ height: height +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper" style="">
<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>
</el-scrollbar>
</div>
</el-card>
</template>
<script>
import { getPublishLessonTree } from '@/api/jmap/lesson';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import RuleFrom from './rule';
import ExamFrom from './examFrom';
import { getPublishLessonTree } from '@/api/jmap/lesson';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import RuleFrom from './rule';
import ExamFrom from './examFrom';
export default {
name: 'examRule',
components: {
ExamFrom,
RuleFrom
},
mixins: [
WindowResizeHandler
],
data() {
return {
display: 1,
course: {},
height: 0,
lessonName: '',
formData: {},
}
},
computed: {
// turnbackBarTitle() {
// return '';
// },
isPrevStep() {
return this.display == 2;
},
isNextStep() {
return this.display == 1 && this.$route.params.mode != 'edit';
},
isUpdate() {
return this.display == 1 && this.$route.params.mode == 'edit';
},
isCreate() {
return this.display == 2;
},
},
mounted() {
this.loadInitData();
},
methods: {
resizeHandler: function () {
if (/\/exam\//.test(`${this.$route.path}`)) {
this.height = this._clientHeight - 50;
} else {
this.height = this._clientHeight - 65;
}
},
loadInitData() {
getPublishLessonTree({ mapId: '' }).then(response => {
this.OrganizationList = response.data;
this.OrganizationList.forEach(elem => {
if (elem.id == this.$route.params.lessonId) {
this.lessonName = elem.name;
}
});
});
},
definition(data) {
this.course = data;
this.formData = {};
this.display = 2;
},
regulation(data) {
this.formData = data;
this.display = 1;
this.$nextTick(() => {
if (this.$refs.exam) {
this.$refs.exam.setData(this.formData);
}
})
},
prevStep() {
this.$refs.rule.regulation();
},
nextStep() {
this.$refs.exam.submitForm();
},
update() {
this.$refs.exam.updateForm();
},
create() {
this.$refs.rule.creatOk();
},
turnback() {
this.$router.go(-1)
}
}
}
export default {
name: 'ExamRule',
components: {
ExamFrom,
RuleFrom
},
mixins: [
WindowResizeHandler
],
data() {
return {
display: 1,
course: {},
height: 0,
lessonName: '',
formData: {}
};
},
computed: {
// turnbackBarTitle() {
// return '';
// },
isPrevStep() {
return this.display == 2;
},
isNextStep() {
return this.display == 1 && this.$route.params.mode != 'edit';
},
isUpdate() {
return this.display == 1 && this.$route.params.mode == 'edit';
},
isCreate() {
return this.display == 2;
}
},
mounted() {
this.loadInitData();
},
methods: {
resizeHandler: function () {
if (/\/exam\//.test(`${this.$route.path}`)) {
this.height = this._clientHeight - 50;
} else {
this.height = this._clientHeight - 65;
}
},
loadInitData() {
getPublishLessonTree({ mapId: '' }).then(response => {
this.OrganizationList = response.data;
this.OrganizationList.forEach(elem => {
if (elem.id == this.$route.params.lessonId) {
this.lessonName = elem.name;
}
});
});
},
definition(data) {
this.course = data;
this.formData = {};
this.display = 2;
},
regulation(data) {
this.formData = data;
this.display = 1;
this.$nextTick(() => {
if (this.$refs.exam) {
this.$refs.exam.setData(this.formData);
}
});
},
prevStep() {
this.$refs.rule.regulation();
},
nextStep() {
this.$refs.exam.submitForm();
},
update() {
this.$refs.exam.updateForm();
},
create() {
this.$refs.rule.creatOk();
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.exam-box {
@ -156,10 +155,9 @@
height: 10px;
}
.draft {
width: 500px;
text-align: center;
margin: 20px auto;
}
</style>
</style>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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