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

View File

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

View File

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

View File

@ -41,19 +41,19 @@ export function delPublishLesson(lessonId) {
}); });
} }
/**发布课程上架*/ /** 发布课程上架*/
export function putLessonOnLine(id) { export function putLessonOnLine(id) {
return request({ return request({
url: `/api/lesson/${id}/onLine`, url: `/api/lesson/${id}/onLine`,
method: 'put', method: 'put'
}); });
} }
/**发布课程下架*/ /** 发布课程下架*/
export function putLessonOffLine(id) { export function putLessonOffLine(id) {
return request({ return request({
url: `/api/lesson/${id}/offLine`, url: `/api/lesson/${id}/offLine`,
method: 'put', method: 'put'
}); });
} }
@ -63,6 +63,6 @@ export function putLessonOffLine(id) {
export function getCommodityProductLesson(prdCode) { export function getCommodityProductLesson(prdCode) {
return request({ return request({
url: `/api/lesson/${prdCode}/list`, url: `/api/lesson/${prdCode}/list`,
method: 'get', method: 'get'
}); });
} }

View File

@ -43,7 +43,6 @@ export function updateLesson(data) {
}); });
} }
/** 删除课程*/ /** 删除课程*/
export function delLesson(data) { export function delLesson(data) {
return request({ return request({

View File

@ -73,23 +73,23 @@ export function delPublishMap(mapId) {
}); });
} }
/**发布地图上架*/ /** 发布地图上架*/
export function putMapOnLine(mapId) { export function putMapOnLine(mapId) {
return request({ return request({
url: `/api/map/${mapId}/onLine`, url: `/api/map/${mapId}/onLine`,
method: 'put', method: 'put'
}); });
} }
/**发布地图下架*/ /** 发布地图下架*/
export function putMapOffLine(mapId) { export function putMapOffLine(mapId) {
return request({ return request({
url: `/api/map/${mapId}/offLine`, url: `/api/map/${mapId}/offLine`,
method: 'put', method: 'put'
}); });
} }
/**修改发布地图名称*/ /** 修改发布地图名称*/
export function updatePublishMapName(data) { export function updatePublishMapName(data) {
return request({ return request({
url: `/api/map/${data.mapId}/updateName`, url: `/api/map/${data.mapId}/updateName`,

View File

@ -24,7 +24,6 @@ export function getMapDetail(id) {
}); });
} }
/** 新建草稿地图*/ /** 新建草稿地图*/
export function newMap(data) { export function newMap(data) {
return request({ return request({
@ -89,7 +88,6 @@ export function publishMap(data) {
}); });
} }
/** 草稿地图数据导入*/ /** 草稿地图数据导入*/
export function postBuildMapImport(data) { export function postBuildMapImport(data) {
return request({ return request({
@ -248,7 +246,7 @@ export function listLinkageSwitch(mapId, params) {
export function verifyMap(id) { export function verifyMap(id) {
return request({ return request({
url: `/api/mapBuild/${id}/checkData`, url: `/api/mapBuild/${id}/checkData`,
method: 'get', method: 'get'
}); });
} }

View File

@ -14,7 +14,7 @@ export function addRouteUnit(data) {
return request({ return request({
url: `/api/mapBuild/routeUnit`, url: `/api/mapBuild/routeUnit`,
method: 'post', method: 'post',
data: data, data: data
}); });
} }
@ -39,6 +39,6 @@ export function setRouteUnit(data) {
return request({ return request({
url: `/api/mapBuild/routeUnit/${data.id}`, url: `/api/mapBuild/routeUnit/${data.id}`,
method: 'put', method: 'put',
data: data, data: data
}); });
} }

View File

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

View File

@ -17,7 +17,6 @@ export function getLoginUrl(params) {
}); });
} }
// 获取登录信息 // 获取登录信息
export function getInfo(token) { export function getInfo(token) {
return request({ return request({
@ -63,6 +62,6 @@ export function checkLoginStatus(sessionId) {
export function checkLoginLine() { export function checkLoginLine() {
return request({ return request({
url: '/api/cache/heartBeat', url: '/api/cache/heartBeat',
method: 'get', method: 'get'
}); });
} }

View File

@ -1,8 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 分页获取课程权限数据*/ /** 分页获取课程权限数据*/
export function getLessonPermissonPageList(params) { export function getLessonPermissonPageList(params) {
return request({ return request({
@ -28,7 +26,7 @@ export function createLessonPermisson(data) {
data: data data: data
}); });
} }
/**获取用户某课程某段时间内可用的权限数量*/ /** 获取用户某课程某段时间内可用的权限数量*/
export function getTotalRemains(params) { export function getTotalRemains(params) {
return request({ return request({
url: '/api/permission/totalRemains', url: '/api/permission/totalRemains',
@ -36,7 +34,7 @@ export function getTotalRemains(params) {
params: params params: params
}); });
} }
/**设置权限失效或有效*/ /** 设置权限失效或有效*/
export function setLessonPermisson(data) { export function setLessonPermisson(data) {
return request({ return request({
url: `/api/permission/${data.id}/status`, url: `/api/permission/${data.id}/status`,
@ -55,7 +53,7 @@ export function queryPermissionSimulation(data) {
}); });
} }
/**获取大屏权限列表*/ /** 获取大屏权限列表*/
export function queryPermissionScreen() { export function queryPermissionScreen() {
return request({ return request({
url: `/api/permission/bigScreen`, url: `/api/permission/bigScreen`,
@ -84,7 +82,6 @@ export function deleteLessonPermisson(id) {
} }
*/ */
/** /**
* 用户权限列表 * 用户权限列表
*/ */
@ -100,7 +97,7 @@ export function listUserPermision(params) {
export function getDistribute(id) { export function getDistribute(id) {
return request({ return request({
url: `/api/distribute/${id}`, url: `/api/distribute/${id}`,
method: 'get', method: 'get'
}); });
} }

View File

@ -58,7 +58,7 @@ export function packagePermissionDistribute(data) {
export function restorePackagePermission(id) { export function restorePackagePermission(id) {
return request({ return request({
url: `/api/distribute/${id}/restore`, url: `/api/distribute/${id}/restore`,
method: 'put', method: 'put'
}); });
} }

View File

@ -22,7 +22,7 @@ export function setCourseList(data) {
export function getCourseTypeList(data) { export function getCourseTypeList(data) {
return request({ return request({
url: `/api/exam/${data.lessonId}/trainingTypes`, url: `/api/exam/${data.lessonId}/trainingTypes`,
method: 'get', method: 'get'
}); });
} }
@ -82,7 +82,7 @@ export function getLessonTypeNum(data) {
method: 'get', method: 'get',
params: { params: {
operateType: data.operateType operateType: data.operateType
}, }
}); });
} }

View File

@ -9,7 +9,6 @@ export function getCommodityDetailByParams(data) {
}); });
} }
/** /**
* 获取商品明细列表 * 获取商品明细列表
*/ */
@ -79,11 +78,11 @@ export function updataCommodityList(data) {
export function setCommodityStatus(id) { export function setCommodityStatus(id) {
return request({ return request({
url: `/api/goods/${id}/status`, url: `/api/goods/${id}/status`,
method: 'put', method: 'put'
}); });
} }
/**获取试用时长*/ /** 获取试用时长*/
export function getGoodsTryUse(data) { export function getGoodsTryUse(data) {
return request({ return request({
url: `/api/goods/tryUse`, url: `/api/goods/tryUse`,
@ -92,7 +91,7 @@ export function getGoodsTryUse(data) {
}); });
} }
/**设置试用时长*/ /** 设置试用时长*/
export function setGoodsTryUse(data) { export function setGoodsTryUse(data) {
return request({ return request({
url: `/api/goods/${data.goodsId}/tryUse`, url: `/api/goods/${data.goodsId}/tryUse`,

View File

@ -55,7 +55,7 @@ export function updateTrainingCategory(data) {
export function deleteTrainingCategory(data) { export function deleteTrainingCategory(data) {
return request({ return request({
url: `/api/mapPrd/${data.id}`, url: `/api/mapPrd/${data.id}`,
method: 'delete', method: 'delete'
}); });
} }
@ -65,7 +65,7 @@ export function deleteTrainingCategory(data) {
export function getCommodityMapProduct(skinStyle) { export function getCommodityMapProduct(skinStyle) {
return request({ return request({
url: `/api/mapPrd/${skinStyle}/list`, url: `/api/mapPrd/${skinStyle}/list`,
method: 'get', method: 'get'
}); });
} }
@ -75,11 +75,11 @@ export function getCommodityMapProduct(skinStyle) {
export function getMapProductDetail(prdCode) { export function getMapProductDetail(prdCode) {
return request({ return request({
url: `/api/mapPrd/${prdCode}`, url: `/api/mapPrd/${prdCode}`,
method: 'get', method: 'get'
}); });
} }
/**获取产品管理列表*/ /** 获取产品管理列表*/
export function getProductList(data) { export function getProductList(data) {
return request({ return request({
url: `/api/mapPrd/list`, url: `/api/mapPrd/list`,
@ -88,23 +88,23 @@ export function getProductList(data) {
}); });
} }
/**发布地图产品上架*/ /** 发布地图产品上架*/
export function putMapProductOnLine(id) { export function putMapProductOnLine(id) {
return request({ return request({
url: `/api/mapPrd/${id}/onLine`, url: `/api/mapPrd/${id}/onLine`,
method: 'put', method: 'put'
}); });
} }
/**发布地图产品下架*/ /** 发布地图产品下架*/
export function putMapProductOffLine(id) { export function putMapProductOffLine(id) {
return request({ return request({
url: `/api/mapPrd/${id}/offLine`, url: `/api/mapPrd/${id}/offLine`,
method: 'put', method: 'put'
}); });
} }
/**校验产品code是否已存在*/ /** 校验产品code是否已存在*/
export function checkMapProductCodeExist(params) { export function checkMapProductCodeExist(params) {
return request({ return request({
url: `/api/mapPrd/checkCodeExist`, url: `/api/mapPrd/checkCodeExist`,

View File

@ -23,7 +23,6 @@ export function postTrainingRulesData(data) {
}); });
} }
/** /**
* 修改考试定义规则 * 修改考试定义规则
*/ */
@ -108,7 +107,7 @@ export function getPlaceholderList(data) {
method: 'get', method: 'get',
params: { params: {
trainingType: data.trainingType, trainingType: data.trainingType,
skinStyle: data.skinStyle, skinStyle: data.skinStyle
} }
}); });
} }
@ -122,7 +121,7 @@ export function getOperateTrainingList(data) {
method: 'get', method: 'get',
params: { params: {
productType: data.productType, productType: data.productType,
skinStyle: data.skinStyle, skinStyle: data.skinStyle
} }
}); });
} }

View File

@ -19,7 +19,6 @@ export function getOrderDetail(id, params) {
}); });
} }
/** 创建一个订单*/ /** 创建一个订单*/
export function createOrder(data) { export function createOrder(data) {
return request({ return request({

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
/**获取组织/企业数据*/ /** 获取组织/企业数据*/
export function getOrganizationList() { export function getOrganizationList() {
return request({ return request({
url: '/api/organization', url: '/api/organization',

View File

@ -68,7 +68,6 @@ export function getDimUserList(params) {
}); });
} }
/** 获取用户订阅地图列表*/ /** 获取用户订阅地图列表*/
export function getUserSubscribe(userId) { export function getUserSubscribe(userId) {
return request({ return request({
@ -86,7 +85,6 @@ export function saveUserSubscribe(data) {
}); });
} }
// 修改用户权限 // 修改用户权限
export function putRoles(data) { export function putRoles(data) {
return request({ return request({

View File

@ -1,6 +1,5 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 获取考题列表*/ /** 获取考题列表*/
export function generateExamList(examId) { export function generateExamList(examId) {
return request({ return request({
@ -35,7 +34,7 @@ export function submitExam(examId) {
} }
/**获取用户考试列表*/ /** 获取用户考试列表*/
export function getPublishExam(data) { export function getPublishExam(data) {
return request({ return request({
url: `/api/userExam/list`, url: `/api/userExam/list`,
@ -44,7 +43,7 @@ export function getPublishExam(data) {
}); });
} }
/**删除用户考试*/ /** 删除用户考试*/
export function delPublishExam(id) { export function delPublishExam(id) {
return request({ return request({
url: `/api/userExam/${id}`, url: `/api/userExam/${id}`,
@ -52,7 +51,7 @@ export function delPublishExam(id) {
}); });
} }
/**删除用户实训*/ /** 删除用户实训*/
export function delTrainingList() { export function delTrainingList() {
return request({ return request({
url: `/api/userExam/list`, url: `/api/userExam/list`,

View File

@ -27,14 +27,14 @@ export function deleteQuest(id) {
export function getQuestById(id) { export function getQuestById(id) {
return request({ return request({
url: `/api/quest/${id}`, url: `/api/quest/${id}`,
method: 'get', method: 'get'
}); });
} }
/** 根据id查询任务基础信息 */ /** 根据id查询任务基础信息 */
export function getQuestByIdList(id) { export function getQuestByIdList(id) {
return request({ return request({
url: `/api/quest/${id}/detail`, url: `/api/quest/${id}/detail`,
method: 'get', method: 'get'
}); });
} }
/** 更新任务基本信息 */ /** 更新任务基本信息 */

View File

@ -14,11 +14,10 @@ export function setFailureMode(data, group) {
return request({ return request({
url: `/api/simulation/${group}/failureMode`, url: `/api/simulation/${group}/failureMode`,
method: 'post', method: 'post',
data: data, data: data
}); });
} }
/** /**
* 仿真系统按计划行车 * 仿真系统按计划行车
*/ */
@ -36,7 +35,7 @@ export function runDiagramStart(params, group) {
export function runDiagramOver(group) { export function runDiagramOver(group) {
return request({ return request({
url: `/api/simulation/${group}/over`, url: `/api/simulation/${group}/over`,
method: 'put', method: 'put'
}); });
} }
@ -46,7 +45,7 @@ export function runDiagramOver(group) {
export function runDiagramQuit(group) { export function runDiagramQuit(group) {
return request({ return request({
url: `/api/simulation/${group}/quit`, url: `/api/simulation/${group}/quit`,
method: 'put', method: 'put'
}); });
} }
@ -66,7 +65,6 @@ export function runDiagramIsStart(group) {
}); });
} }
/** /**
* 仿真系统CBTC * 仿真系统CBTC
* @param {*} mapId * @param {*} mapId
@ -111,8 +109,7 @@ export function examNotify({ examId }) {
}); });
} }
/** 获取用户实训列表*/
/**获取用户实训列表*/
export function getSimulationList(data) { export function getSimulationList(data) {
return request({ return request({
url: `/api/simulation/stats`, url: `/api/simulation/stats`,
@ -121,7 +118,7 @@ export function getSimulationList(data) {
}); });
} }
/**添加用户仿真数据*/ /** 添加用户仿真数据*/
export function postSimulationStats(data) { export function postSimulationStats(data) {
return request({ return request({
url: `/api/simulation/stats`, url: `/api/simulation/stats`,
@ -130,7 +127,7 @@ export function postSimulationStats(data) {
}); });
} }
/**更新用户仿真数据*/ /** 更新用户仿真数据*/
export function putSimulationStats(data) { export function putSimulationStats(data) {
return request({ return request({
url: `/api/simulation/${data.id}/stats`, url: `/api/simulation/${data.id}/stats`,
@ -139,20 +136,19 @@ export function putSimulationStats(data) {
}); });
} }
/**删除用户仿真数据*/ /** 删除用户仿真数据*/
export function deleteSimulationStats(statsId) { export function deleteSimulationStats(statsId) {
return request({ return request({
url: `/api/simulation/${statsId}`, url: `/api/simulation/${statsId}`,
method: 'delete', method: 'delete'
}); });
} }
/** 获取用户鼠标左键选中的设备信息*/ /** 获取用户鼠标左键选中的设备信息*/
export function letfMouseSelectDevice(deviceCode, group) { export function letfMouseSelectDevice(deviceCode, group) {
return request({ return request({
url: `/api/simulation/${group}/device/${deviceCode}`, url: `/api/simulation/${group}/device/${deviceCode}`,
method: 'get', method: 'get'
}); });
} }
@ -160,7 +156,7 @@ export function letfMouseSelectDevice(deviceCode, group) {
export function getEveryDayRunPlanData(group) { export function getEveryDayRunPlanData(group) {
return request({ return request({
url: `/api/simulation/${group}/runPlan`, url: `/api/simulation/${group}/runPlan`,
method: 'get', method: 'get'
}); });
} }
@ -177,7 +173,7 @@ export function scriptRecordNotify(questId) {
return request({ return request({
url: `/api/simulation/questRecord/${questId}`, url: `/api/simulation/questRecord/${questId}`,
method: 'get' method: 'get'
}) });
} }
/** 保存剧本背景*/ /** 保存剧本背景*/
@ -185,20 +181,17 @@ export function saveScriptScenes(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/scenes`, url: `/api/simulation/${group}/questRecord/scenes`,
method: 'post' method: 'post'
}) });
} }
/** 保存录制任务数据*/ /** 保存录制任务数据*/
export function saveScriptData(group) { export function saveScriptData(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord`, url: `/api/simulation/${group}/questRecord`,
method: 'post', method: 'post'
}); });
} }
/** 清除仿真剧本数据*/ /** 清除仿真剧本数据*/
export function dumpScriptData(scriptId) { export function dumpScriptData(scriptId) {
return request({ return request({
@ -207,7 +200,6 @@ export function dumpScriptData(scriptId) {
}); });
} }
/** 查询录制剧本步骤*/ /** 查询录制剧本步骤*/
export function queryScriptStep(group) { export function queryScriptStep(group) {
return request({ return request({
@ -222,7 +214,7 @@ export function getDesignatedTimeTrainNum(params, group) {
url: `/api/simulation/${group}/plan/trainNum`, url: `/api/simulation/${group}/plan/trainNum`,
method: 'get', method: 'get',
params params
}) });
} }
/** 根据成员角色查询设备列表*/ /** 根据成员角色查询设备列表*/
@ -231,14 +223,14 @@ export function getDevicesByRole(group, params) {
url: `/api/simulation/${group}/role/devices`, url: `/api/simulation/${group}/role/devices`,
method: 'get', method: 'get',
params params
}) });
} }
/** 获取任务录制的成员角色列表 */ /** 获取任务录制的成员角色列表 */
export function getMembersByGroup(group) { export function getMembersByGroup(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/members`, url: `/api/simulation/${group}/questRecord/members`,
method: 'get', method: 'get'
}) });
} }
/** 添加任务角色成员 */ /** 添加任务角色成员 */
@ -247,15 +239,15 @@ export function postQuestMember(group, data) {
url: `/api/simulation/${group}/questRecord/member`, url: `/api/simulation/${group}/questRecord/member`,
method: 'post', method: 'post',
data data
}) });
} }
/** 删除任务角色成员 */ /** 删除任务角色成员 */
export function deleteQuestMember(group, memberId) { export function deleteQuestMember(group, memberId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/member/${memberId}`, url: `/api/simulation/${group}/questRecord/member/${memberId}`,
method: 'delete', method: 'delete'
}) });
} }
// /** 添加/修改任务角色行为 */ // /** 添加/修改任务角色行为 */
@ -264,21 +256,21 @@ export function postMemberBehavior(group, memberId, data) {
url: `/api/simulation/${group}/questRecord/${memberId}/behavior`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
method: 'post', method: 'post',
data data
}) });
} }
/** 删除任务角色行为 */ /** 删除任务角色行为 */
export function deleteMemberBehavior(group, memberId, behaviorId) { export function deleteMemberBehavior(group, memberId, behaviorId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
method: 'delete' method: 'delete'
}) });
} }
/** 删除任务角色行为动作 */ /** 删除任务角色行为动作 */
export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) { export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
method: 'delete' method: 'delete'
}) });
} }
/** 添加/修改任务角色行为动作 */ /** 添加/修改任务角色行为动作 */
export function postMemberBehaviorAction(group, memberId, behaviorId, data) { export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
@ -286,7 +278,7 @@ export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`, url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
method: 'post', method: 'post',
data data
}) });
} }
/** 添加/修改任务目标条件*/ /** 添加/修改任务目标条件*/
export function postTargetConditionAction(group, data) { export function postTargetConditionAction(group, data) {
@ -294,14 +286,14 @@ export function postTargetConditionAction(group, data) {
url: `/api/simulation/${group}/questRecord/targetCondition`, url: `/api/simulation/${group}/questRecord/targetCondition`,
method: 'post', method: 'post',
data data
}) });
} }
/** 删除任务目标条件*/ /** 删除任务目标条件*/
export function deleteTargetConditionAction(group, tcId) { export function deleteTargetConditionAction(group, tcId) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`, url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
method: 'delete' method: 'delete'
}) });
} }
/** 分页查询存在的仿真 */ /** 分页查询存在的仿真 */
@ -309,7 +301,7 @@ export function getExistingSimulation(params) {
return request({ return request({
url: `/api/simulation/manage/page`, url: `/api/simulation/manage/page`,
method: 'get', method: 'get',
params, params
}); });
} }
@ -317,7 +309,7 @@ export function getExistingSimulation(params) {
export function deleteExistingSimulation(group) { export function deleteExistingSimulation(group) {
return request({ return request({
url: `/api/simulation/manage/${group}`, url: `/api/simulation/manage/${group}`,
method: 'delete', method: 'delete'
}); });
} }
/** 根据设备类型获取设备列表 */ /** 根据设备类型获取设备列表 */
@ -340,16 +332,15 @@ export function getDeviceCoditionByDeviceType(params) {
export function getQuestRecord(group) { export function getQuestRecord(group) {
return request({ return request({
url: `/api/simulation/${group}/questRecord`, url: `/api/simulation/${group}/questRecord`,
method: 'get', method: 'get'
}); });
} }
/** 加载任务*/ /** 加载任务*/
export function loadQuest(questId, group) { export function loadQuest(questId, group) {
return request({ return request({
url: `/api/simulation/${group}/quest/${questId}`, url: `/api/simulation/${group}/quest/${questId}`,
method: 'post', method: 'post'
}); });
} }
@ -358,7 +349,7 @@ export function quitQuest(group) {
return request({ return request({
url: `/api/simulation/${group}/quest`, url: `/api/simulation/${group}/quest`,
method: 'put' method: 'put'
}) });
} }
/** 根据group获取仿真对象*/ /** 根据group获取仿真对象*/
@ -366,7 +357,7 @@ export function getSimulationInfo(group) {
return request({ return request({
url: `/api/simulation/${group}`, url: `/api/simulation/${group}`,
method: 'get' method: 'get'
}) });
} }
/** 获取可用的设备指令*/ /** 获取可用的设备指令*/
@ -374,14 +365,14 @@ export function getAvailableDeviceCommand() {
return request({ return request({
url: `/api/simulation/deviceCommand/available`, url: `/api/simulation/deviceCommand/available`,
method: 'get' method: 'get'
}) });
} }
/** 保存/修改任务剧本*/ /** 保存/修改任务剧本*/
export function saveTaskScript(group,data) { export function saveTaskScript(group, data) {
return request({ return request({
url: `/api/simulation/${group}/questRecord/script`, url: `/api/simulation/${group}/questRecord/script`,
method: 'post', method: 'post',
data data
}) });
} }

View File

@ -14,7 +14,7 @@ export function getSimulationRelpayList(params) {
export function delSimulationRecord(replayId) { export function delSimulationRecord(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}`, url: `/api/simulationRecord/${replayId}`,
method: 'delete', method: 'delete'
}); });
} }
@ -30,7 +30,7 @@ export function simulationRelpay(replayId) {
export function putsSimulationRecord(replayId) { export function putsSimulationRecord(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/over`, url: `/api/simulationRecord/${replayId}/over`,
method: 'put', method: 'put'
}); });
} }
@ -38,7 +38,7 @@ export function putsSimulationRecord(replayId) {
export function putsSimulationRecordPause(replayId) { export function putsSimulationRecordPause(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/pause`, url: `/api/simulationRecord/${replayId}/pause`,
method: 'put', method: 'put'
}); });
} }
@ -46,7 +46,7 @@ export function putsSimulationRecordPause(replayId) {
export function putsSimulationRecordPlay(replayId) { export function putsSimulationRecordPlay(replayId) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/play`, url: `/api/simulationRecord/${replayId}/play`,
method: 'put', method: 'put'
}); });
} }
@ -54,7 +54,7 @@ export function putsSimulationRecordPlay(replayId) {
export function putsSimulationRecordPlaySpeed(replayId, speed) { export function putsSimulationRecordPlaySpeed(replayId, speed) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/playSpeed?playSpeed=${speed}`, url: `/api/simulationRecord/${replayId}/playSpeed?playSpeed=${speed}`,
method: 'put', method: 'put'
}); });
} }
@ -62,6 +62,6 @@ export function putsSimulationRecordPlaySpeed(replayId, speed) {
export function putsSimulationRecordplayTime(replayId, offsetSeconds) { export function putsSimulationRecordplayTime(replayId, offsetSeconds) {
return request({ return request({
url: `/api/simulationRecord/${replayId}/playTime?offsetSeconds=${offsetSeconds}`, url: `/api/simulationRecord/${replayId}/playTime?offsetSeconds=${offsetSeconds}`,
method: 'put', method: 'put'
}); });
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,27 +1,49 @@
<template> <template>
<el-dialog :title="title" :visible.sync="dialogShow" :before-close="handleCancel" :closeOnClickModal="false"> <el-dialog :title="title" :visible.sync="dialogShow" :before-close="handleCancel" :close-on-click-modal="false">
<el-form :model="form" ref="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="实训类型" prop="course"> <el-form-item label="实训类型" prop="course">
<el-select v-model="form.course" placeholder="请选择类型范围" v-bind:disabled="editOk" <el-select
@change="changeCourse(form.course)"> v-model="form.course"
<el-option :label="nor.name" :value="nor.code" v-for="nor in options" :key="nor.id" placeholder="请选择类型范围"
:disabled="nor.disabled"></el-option> :disabled="editOk"
@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-select>
</el-form-item> </el-form-item>
<el-form-item label="操作类型"> <el-form-item label="操作类型">
<el-select v-model="form.operateType" clearable placeholder="请选择范围" v-bind:disabled="editOk" <el-select
@change="changeOperation(form.operateType)"> v-model="form.operateType"
<el-option v-for="nor in operationTypeList" :label="nor.name" :value="nor.code" :key="nor.id" clearable
:disabled="nor.disabled"></el-option> 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-select>
</el-form-item> </el-form-item>
<el-form-item label="题数" prop="number"> <el-form-item label="题数" prop="number">
<el-input v-model="form.number" placeholder="" <el-input
style="width: calc(100% - 200px); float: left; margin-right: 10px;"></el-input> v-model="form.number"
<span style="width: 190px; float: left;">此类型有{{topicNum}}道题</span> 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>
<el-form-item label="每题分值" prop="mark"> <el-form-item label="每题分值" prop="mark">
<el-input v-model="form.mark" placeholder=""></el-input> <el-input v-model="form.mark" placeholder="" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -32,18 +54,20 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { getLessonTypeNum, getCourseTypeList } from '@/api/management/exam'; import { getLessonTypeNum, getCourseTypeList } from '@/api/management/exam';
import { getDetailList } from '@/api/management/dictionary'; import { getDetailList } from '@/api/management/dictionary';
export default { export default {
name: 'editRule', name: 'EditRule',
props: { props: {
courseId: { courseId: {
type: String, type: String,
required: true
}, },
editCourse: { editCourse: {
type: Object, type: Object,
required: true
} }
}, },
data() { data() {
@ -81,7 +105,7 @@
course: '', course: '',
operateType: '', operateType: '',
number: '', number: '',
mark: '', mark: ''
}, },
topicNum: 0, topicNum: 0,
dialogShow: false, dialogShow: false,
@ -100,13 +124,13 @@
options: this.course, options: this.course,
typeList: [], typeList: [],
operationTypeList: [], operationTypeList: [],
trainingOperateTypeMap: {}, trainingOperateTypeMap: {}
} };
}, },
computed: { computed: {
...mapState([ ...mapState([
'course', 'course'
]), ])
}, },
watch: { watch: {
editCourse: function (val) { editCourse: function (val) {
@ -116,7 +140,7 @@
course: val.trainingType, course: val.trainingType,
operateType: val.operateType, operateType: val.operateType,
number: val.num, number: val.num,
mark: val.point, mark: val.point
}; };
this.changeCourse(val.trainingType); this.changeCourse(val.trainingType);
this.changeOperation(val.operateType); this.changeOperation(val.operateType);
@ -127,25 +151,25 @@
await this.refresh(); await this.refresh();
this.trainingOperateTypeMap = {}; this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => { this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; // this.trainingOperateTypeMap['01'] = list; //
}); });
this.$Dictionary.signalOperation().then(list => { this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; // this.trainingOperateTypeMap['02'] = list; //
}); });
this.$Dictionary.switchOperation().then(list => { this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; // this.trainingOperateTypeMap['03'] = list; //
}); });
this.$Dictionary.sectionOperation().then(list => { this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; // this.trainingOperateTypeMap['04'] = list; //
}); });
this.$Dictionary.stationStandOperation().then(list => { this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; // this.trainingOperateTypeMap['05'] = list; //
}); });
this.$Dictionary.trainPlanOperation().then(list => { this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; // this.trainingOperateTypeMap['06'] = list; //
}); });
this.$Dictionary.trainOperation().then(list => { this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; // this.trainingOperateTypeMap['07'] = list; //
}); });
}, },
methods: { methods: {
@ -167,13 +191,13 @@
this.editOk = false; this.editOk = false;
setTimeout(() => { setTimeout(() => {
this.handleCancel(); this.handleCancel();
}, 300) }, 300);
} else { } else {
// //
this.$emit('addRuleList', this.form); this.$emit('addRuleList', this.form);
setTimeout(() => { setTimeout(() => {
this.handleCancel(); this.handleCancel();
}, 300) }, 300);
} }
this.topicNum = 0; this.topicNum = 0;
} else { } else {
@ -194,13 +218,13 @@
this.form = { this.form = {
course: '', course: '',
number: '', number: '',
mark: '', mark: ''
}; };
}, },
// //
async refresh() { async refresh() {
await getCourseTypeList({ lessonId: this.courseId }).then(res => { await getCourseTypeList({ lessonId: this.courseId }).then(res => {
let list = []; const list = [];
Array.sort(res.data); Array.sort(res.data);
res.data.forEach(ele => { res.data.forEach(ele => {
this.typeList.forEach(v => { this.typeList.forEach(v => {
@ -208,51 +232,56 @@
list.push(v); list.push(v);
} }
}); });
}) });
this.options = list; this.options = list;
this.changeCourseDisable(); this.changeCourseDisable();
this.$store.dispatch('app/handleCourse', this.options); this.$store.dispatch('app/handleCourse', this.options);
}).catch(error => { }).catch(() => {
this.$messageBox('刷新失败') this.$messageBox('刷新失败');
}); });
}, },
async getList() { async getList() {
this.typeList = []; this.typeList = [];
await getDetailList('training_type').then(res => { await getDetailList('training_type').then(res => {
this.typeList = res.data; this.typeList = res.data;
}).catch(error => { }).catch(() => {
// console.log('' + error.message); // console.log('' + error.message);
reject(error);
}); });
}, },
async changeCourse(val) { async changeCourse(val) {
let param = { const param = {
lessonId: this.courseId, lessonId: this.courseId,
trainingType: val, trainingType: val,
operateType: '', operateType: ''
}; };
this.operationTypeList = this.trainingOperateTypeMap[val]; this.operationTypeList = this.trainingOperateTypeMap[val];
this.operationTypeList.forEach(item => { this.operationTypeList.forEach(item => {
item.disabled = false; item.disabled = false;
}); });
this.changeOperationDisabled(); // this.changeOperationDisabled(); //
let res = await getLessonTypeNum(param); const resp = await getLessonTypeNum(param);
if (res.code == 200) return this.topicNum = res.data; if (resp.code == 200) {
this.topicNum = resp.data;
return this.topicNum;
}
this.$store.dispatch('app/handleCourse', this.options); this.$store.dispatch('app/handleCourse', this.options);
}, },
async changeOperation(val) { async changeOperation(val) {
let param = { const param = {
lessonId: this.courseId, lessonId: this.courseId,
trainingType: this.form.course, trainingType: this.form.course,
operateType: val, operateType: val
}; };
let res = await getLessonTypeNum(param); const resp = await getLessonTypeNum(param);
if (res.code == 200) return this.topicNum = res.data; if (resp.code == 200) {
this.topicNum = resp.data;
return this.topicNum;
}
this.$store.dispatch('app/handleCourse', this.options); this.$store.dispatch('app/handleCourse', this.options);
}, },
// //
changeCourseDisable() { changeCourseDisable() {
let arr = this.$store.state.app.ruleList; const arr = this.$store.state.app.ruleList;
arr.forEach(ele => { arr.forEach(ele => {
this.options.forEach(res => { this.options.forEach(res => {
// operateType // operateType
@ -261,17 +290,17 @@
} }
}); });
}) });
}, },
changeOperationDisabled() { changeOperationDisabled() {
let arr = this.$store.state.app.ruleList; const arr = this.$store.state.app.ruleList;
arr.forEach(ele => { arr.forEach(ele => {
this.operationTypeList.forEach(res => { this.operationTypeList.forEach(res => {
if (ele.operateType == res.code) { if (ele.operateType == res.code) {
res.disabled = true; res.disabled = true;
} }
}); });
}) });
}, },
changeListDisabled(val) { changeListDisabled(val) {
this.options.forEach(res => { this.options.forEach(res => {
@ -282,7 +311,7 @@
this.$store.dispatch('app/handleCourse', this.options); this.$store.dispatch('app/handleCourse', this.options);
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
/deep/ { /deep/ {

View File

@ -1,51 +1,70 @@
<template> <template>
<div class="exam-rule"> <div class="exam-rule">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height: height + 'px'}"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height + 'px'}">
<el-form :model="form" :rules="rules" ref="form" label-width="90px" class="demo-form"> <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="demo-form">
<el-form-item label="试题名称" prop="name"> <el-form-item label="试题名称" prop="name">
<el-input v-model="form.name" placeholder="请填写试题名称"></el-input> <el-input v-model="form.name" placeholder="请填写试题名称" />
</el-form-item> </el-form-item>
<el-form-item label="试题范围" prop="region"> <el-form-item label="试题范围" prop="region">
<el-select v-model="form.region" placeholder="请选择试题范围" style="width: 100%;" <el-select
v-bind:disabled="selectDisable" :disabled="isEdit"> v-model="form.region"
<el-option v-for="nor in options" :label="nor.name" :value="nor.id" :key="nor.id"></el-option> placeholder="请选择试题范围"
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-select>
</el-form-item> </el-form-item>
<el-form-item label="时长" prop="duration"> <el-form-item label="时长" prop="duration">
<el-input v-model="form.duration" placeholder="90" style="float: left; width: calc(100% - 40px);" <el-input
:disabled="isEdit"> v-model="form.duration"
</el-input> placeholder="90"
style="float: left; width: calc(100% - 40px);"
:disabled="isEdit"
/>
<span style="width: 40px; display: block;float: left; text-align: center;">分钟</span> <span style="width: 40px; display: block;float: left; text-align: center;">分钟</span>
</el-form-item> </el-form-item>
<el-form-item label="考试时间"> <el-form-item label="考试时间">
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="startDate"> <el-form-item prop="startDate">
<el-date-picker type="datetime" placeholder="开始考试时间" v-model="form.startDate" <el-date-picker
style="width: 100%;" value-format="timestamp" :disabled="isEdit"></el-date-picker> v-model="form.startDate"
type="datetime"
placeholder="开始考试时间"
style="width: 100%;"
value-format="timestamp"
:disabled="isEdit"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col class="line" :span="2">-</el-col> <el-col class="line" :span="2">-</el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="endDate"> <el-form-item prop="endDate">
<el-date-picker type="datetime" placeholder="结束考试时间" v-model="form.endDate" disabled <el-date-picker
style="width: 100%;" value-format="timestamp" :disabled="isEdit"></el-date-picker> v-model="form.endDate"
type="datetime"
placeholder="结束考试时间"
style="width: 100%;"
value-format="timestamp"
:disabled="isEdit"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="满分" prop="fullMark"> <el-form-item label="满分" prop="fullMark">
<el-input v-model="form.fullMark" placeholder="" :disabled="isEdit"></el-input> <el-input v-model="form.fullMark" placeholder="" :disabled="isEdit" />
</el-form-item> </el-form-item>
<el-form-item label="及格分" prop="passMark"> <el-form-item label="及格分" prop="passMark">
<el-input v-model="form.passMark" placeholder="" :disabled="isEdit"></el-input> <el-input v-model="form.passMark" placeholder="" :disabled="isEdit" />
</el-form-item> </el-form-item>
<el-form-item label="是否试用" required v-if="trialShow"> <el-form-item v-if="trialShow" label="是否试用" required>
<el-radio-group v-model="trial"> <el-radio-group v-model="trial">
<el-radio label="1"></el-radio> <el-radio label="1"></el-radio>
<el-radio label="2"></el-radio> <el-radio label="2"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="试题描述" prop="desc"> <el-form-item label="试题描述" prop="desc">
<el-input type="textarea" v-model="form.desc" placeholder="请填写试题描述" :disabled="isEdit"></el-input> <el-input v-model="form.desc" type="textarea" placeholder="请填写试题描述" :disabled="isEdit" />
</el-form-item> </el-form-item>
<!-- <el-form-item> <!-- <el-form-item>
<el-button type="primary" @click="updateForm" v-if="isEdit">修改</el-button> <el-button type="primary" @click="updateForm" v-if="isEdit">修改</el-button>
@ -57,12 +76,11 @@
</template> </template>
<script> <script>
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonTree } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules } from '@/api/management/exam'; import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
import { mapState } from 'vuex';
export default { export default {
name: 'examFrom', name: 'ExamFrom',
props: { props: {
height: { height: {
type: Number, type: Number,
@ -120,7 +138,7 @@
type: '', type: '',
duration: '', duration: '',
fullMark: '', fullMark: '',
passMark: '', passMark: ''
}, },
trial: '1', trial: '1',
trialShow: false, trialShow: false,
@ -147,12 +165,12 @@
{ required: true, validator: passMark, trigger: 'blur' } { required: true, validator: passMark, trigger: 'blur' }
] ]
} }
} };
}, },
computed: { computed: {
isEdit() { isEdit() {
return this.$route.params.mode == 'edit'; return this.$route.params.mode == 'edit';
}, }
}, },
watch: { watch: {
'form.startDate': function (val) { 'form.startDate': function (val) {
@ -174,9 +192,9 @@
this.refresh(); this.refresh();
}, },
mounted() { mounted() {
let user = this.$store.state.user; const user = this.$store.state.user;
let roles = user.roles; const roles = user.roles;
this.trialShow = roles.indexOf('04') != -1 ? true : false; this.trialShow = roles.indexOf('04') != -1;
this.init(); this.init();
}, },
methods: { methods: {
@ -190,7 +208,7 @@
type: data.type, type: data.type,
duration: Number(data.duration), duration: Number(data.duration),
fullMark: data.fullMark, fullMark: data.fullMark,
passMark: data.passMark, passMark: data.passMark
}; };
}, },
init() { init() {
@ -206,7 +224,7 @@
type: res.data.type, type: res.data.type,
duration: Number(res.data.duration) / 60, duration: Number(res.data.duration) / 60,
fullMark: res.data.fullPoint, fullMark: res.data.fullPoint,
passMark: res.data.passingPoint, passMark: res.data.passingPoint
}; };
if (!this.form.name) { if (!this.form.name) {
this.$store.dispatch('app/handleCourseDetail', this.formDetail); this.$store.dispatch('app/handleCourseDetail', this.formDetail);
@ -214,7 +232,7 @@
} else { } else {
this.$store.dispatch('app/handleCourseDetail', this.form); this.$store.dispatch('app/handleCourseDetail', this.form);
} }
}) });
}); });
} }
}, },
@ -230,18 +248,18 @@
updateForm() { updateForm() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let model = { const model = {
id: this.$route.params.ruleId, id: this.$route.params.ruleId,
name: this.form.name, name: this.form.name,
trial: this.trial == 2 ? true : false, trial: this.trial == 2
} };
updateExamRules(model).then(response => { updateExamRules(model).then(response => {
this.$store.dispatch('app/handleCourseDetail', this.form); this.$store.dispatch('app/handleCourseDetail', this.form);
this.$message.success('更新考试规则成功'); this.$message.success('更新考试规则成功');
}).catch(error => { }).catch(() => {
this.$messageBox('更新考试规则失败'); this.$messageBox('更新考试规则失败');
}) });
} }
}); });
@ -253,12 +271,12 @@
this.form.region = this.$route.params.lessonId; this.form.region = this.$route.params.lessonId;
this.selectDisable = true; this.selectDisable = true;
} }
}).catch(error => { }).catch(() => {
this.$messageBox('刷新失败') this.$messageBox('刷新失败');
}); });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.exam-rule { .exam-rule {

View File

@ -1,30 +1,29 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;" v-if="lessonName"> <div v-if="lessonName" slot="header" style="text-align: center;">
<b>课程名称 {{lessonName}}</b> <b>课程名称 {{ lessonName }}</b>
</div> </div>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> --> <!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<div class="exam-box" :style="{ height: height +'px' }"> <div class="exam-box" :style="{ height: height +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper" style=""> <el-scrollbar wrap-class="scrollbar-wrapper" style="">
<el-steps class="steps" :active="display"> <el-steps class="steps" :active="display">
<el-step title="试题定义制定" icon="el-icon-edit"></el-step> <el-step title="试题定义制定" icon="el-icon-edit" />
<el-step title="考试规则制定" icon="el-icon-setting"></el-step> <el-step title="考试规则制定" icon="el-icon-setting" />
</el-steps> </el-steps>
<el-card class="forms"> <el-card class="forms">
<template class="definition" v-if="display == 1"> <template v-if="display == 1" class="definition">
<exam-from ref="exam" :height="height-260" @definition="definition"></exam-from> <exam-from ref="exam" :height="height-260" @definition="definition" />
</template> </template>
<template class="rule" v-else> <template v-else class="rule">
<rule-from ref="rule" :course="course" :height="height-300" @regulation="regulation"> <rule-from ref="rule" :course="course" :height="height-300" @regulation="regulation" />
</rule-from>
</template> </template>
</el-card> </el-card>
<div class="draft"> <div class="draft">
<el-button-group> <el-button-group>
<el-button type="primary" @click="prevStep" v-if="isPrevStep">上一步</el-button> <el-button v-if="isPrevStep" type="primary" @click="prevStep">上一步</el-button>
<el-button type="primary" @click="nextStep" v-if="isNextStep">下一步</el-button> <el-button v-if="isNextStep" type="primary" @click="nextStep">下一步</el-button>
<el-button type="warning" @click="update" v-if="isUpdate">修改</el-button> <el-button v-if="isUpdate" type="warning" @click="update">修改</el-button>
<el-button type="primary" @click="create" v-if="isCreate">创建</el-button> <el-button v-if="isCreate" type="primary" @click="create">创建</el-button>
<el-button type="primary" @click="turnback">返回</el-button> <el-button type="primary" @click="turnback">返回</el-button>
</el-button-group> </el-button-group>
</div> </div>
@ -34,13 +33,13 @@
</template> </template>
<script> <script>
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonTree } from '@/api/jmap/lesson';
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import RuleFrom from './rule'; import RuleFrom from './rule';
import ExamFrom from './examFrom'; import ExamFrom from './examFrom';
export default { export default {
name: 'examRule', name: 'ExamRule',
components: { components: {
ExamFrom, ExamFrom,
RuleFrom RuleFrom
@ -54,8 +53,8 @@
course: {}, course: {},
height: 0, height: 0,
lessonName: '', lessonName: '',
formData: {}, formData: {}
} };
}, },
computed: { computed: {
// turnbackBarTitle() { // turnbackBarTitle() {
@ -72,7 +71,7 @@
}, },
isCreate() { isCreate() {
return this.display == 2; return this.display == 2;
}, }
}, },
mounted() { mounted() {
this.loadInitData(); this.loadInitData();
@ -107,7 +106,7 @@
if (this.$refs.exam) { if (this.$refs.exam) {
this.$refs.exam.setData(this.formData); this.$refs.exam.setData(this.formData);
} }
}) });
}, },
prevStep() { prevStep() {
this.$refs.rule.regulation(); this.$refs.rule.regulation();
@ -122,10 +121,10 @@
this.$refs.rule.creatOk(); this.$refs.rule.creatOk();
}, },
turnback() { turnback() {
this.$router.go(-1) this.$router.go(-1);
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.exam-box { .exam-box {
@ -156,7 +155,6 @@
height: 10px; height: 10px;
} }
.draft { .draft {
width: 500px; width: 500px;
text-align: center; text-align: center;

View File

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

View File

@ -1,24 +1,29 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;" v-if="lessonName"> <div v-if="lessonName" slot="header" style="text-align: center;">
<b>课程名称 {{lessonName}}</b> <b>课程名称 {{ lessonName }}</b>
</div> </div>
<div :style="{ height: height +'px' }"> <div :style="{ height: height +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper" style=""> <el-scrollbar wrap-class="scrollbar-wrapper" style="">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" <QueryListPage
:query-list="queryList" style="height: 100%;"></QueryListPage> ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
style="height: 100%;"
/>
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import { getExamList, deleteExam, setExamEfficacy, setExamEffectivey } from '@/api/management/exam'; import { getExamList, deleteExam, setExamEfficacy, setExamEffectivey } from '@/api/management/exam';
import { getPublishLessonTree } from '@/api/jmap/lesson'; import { getPublishLessonTree } from '@/api/jmap/lesson';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default { export default {
name: 'List', name: 'List',
mixins: [ mixins: [
WindowResizeHandler WindowResizeHandler
@ -57,7 +62,7 @@
label: '创建人' label: '创建人'
} }
}, },
reset: this.$route.query.lessonId ? false : true, reset: !this.$route.query.lessonId
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
@ -68,9 +73,9 @@
title: '课程名称', title: '课程名称',
prop: 'lessonId', prop: 'lessonId',
type: 'tag', type: 'tag',
show: this.$route.query.lessonId ? false : true, show: !this.$route.query.lessonId,
columnValue: (row) => { return this.convertField(row.lessonId, this.OrganizationList, ['id', 'name']) }, columnValue: (row) => { return this.convertField(row.lessonId, this.OrganizationList, ['id', 'name']); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '试卷名称', title: '试卷名称',
@ -78,13 +83,13 @@
}, },
{ {
title: '创建人', title: '创建人',
prop: 'creatorName', prop: 'creatorName'
}, },
{ {
title: '是否试用', title: '是否试用',
prop: 'trial', prop: 'trial',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.trial, 'Whether') }, columnValue: (row) => { return this.$ConstSelect.translate(row.trial, 'Whether'); },
tagType: (row) => { tagType: (row) => {
switch (row.trial) { switch (row.trial) {
case true: return 'success'; case true: return 'success';
@ -96,8 +101,8 @@
title: '时长', title: '时长',
prop: 'duration', prop: 'duration',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.durationField(row.duration) }, columnValue: (row) => { return this.durationField(row.duration); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '考试时间', title: '考试时间',
@ -117,7 +122,7 @@
title: '状态', title: '状态',
prop: 'status', prop: 'status',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => { tagType: (row) => {
switch (row.status) { switch (row.status) {
case '1': return 'success'; case '1': return 'success';
@ -132,46 +137,46 @@
buttons: [ buttons: [
{ {
name: '快速创建', name: '快速创建',
type: "primary", type: 'primary',
handleClick: this.handleDistribute, handleClick: this.handleDistribute,
showControl: (row) => { return row.bizType !== '02' } showControl: (row) => { return row.bizType !== '02'; }
}, },
{ {
name: '修改', name: '修改',
type: "primary", type: 'primary',
showControl: (row) => { return row.creatorId == this.userId }, showControl: (row) => { return row.creatorId == this.userId; },
handleClick: this.handleUpdate handleClick: this.handleUpdate
}, },
{ {
name: '下架', name: '下架',
type: "warning", type: 'warning',
handleClick: this.handleEfficacy, handleClick: this.handleEfficacy,
showControl: (row) => { showControl: (row) => {
return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status == 1 return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status == 1;
} }
}, },
{ {
name: '上架', name: '上架',
type: "primary", type: 'primary',
handleClick: this.handleEffective, handleClick: this.handleEffective,
showControl: (row) => { showControl: (row) => {
return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status != 1 return (this.$route.query.lessonId ? row.creatorId == this.userId : true) && row.status != 1;
} }
}, },
{ {
name: '删除', name: '删除',
type: "danger", type: 'danger',
handleClick: this.deleteList, handleClick: this.deleteList,
showControl: (row) => { return row.creatorId == this.userId } showControl: (row) => { return row.creatorId == this.userId; }
}, }
] ]
}, }
], ],
actions: [ actions: [
{ text: '新增', btnCode: 'employee_insert', handler: this.handleNormalAdd }, { text: '新增', btnCode: 'employee_insert', handler: this.handleNormalAdd }
] ]
} }
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
@ -216,8 +221,8 @@
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; enumList && i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
@ -227,7 +232,7 @@
}, },
durationField(fieldValue) { durationField(fieldValue) {
if (fieldValue) { if (fieldValue) {
let time = Number(fieldValue) / 60; const time = Number(fieldValue) / 60;
return `${time}分钟`; return `${time}分钟`;
} }
}, },
@ -238,18 +243,18 @@
return getExamList(params); return getExamList(params);
}, },
handleNormalAdd() { handleNormalAdd() {
let path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`;
let lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0; const lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0;
this.$router.push({ path: `${path}/add/0/${lessonId}` }); this.$router.push({ path: `${path}/add/0/${lessonId}` });
}, },
handleUpdate(index, data) { handleUpdate(index, data) {
let path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`;
let lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0; const lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0;
this.$router.push({ path: `${path}/edit/${data.id}/${lessonId}` }); this.$router.push({ path: `${path}/edit/${data.id}/${lessonId}` });
}, },
handleDistribute(index, data) { handleDistribute(index, data) {
let path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleDraft}`;
let lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0; const lessonId = this.$route.query.lessonId ? this.$route.query.lessonId : 0;
this.$router.push({ path: `${path}/add/${data.id}/${lessonId}` }); this.$router.push({ path: `${path}/add/${data.id}/${lessonId}` });
}, },
// //
@ -271,7 +276,7 @@
} else { } else {
this.$message({ type: 'error', message: '删除异常,请联系管理员' }); this.$message({ type: 'error', message: '删除异常,请联系管理员' });
} }
}) });
}).catch(() => { }); }).catch(() => { });
}, },
handleEfficacy(index, data) { handleEfficacy(index, data) {
@ -288,7 +293,7 @@
}); });
}).catch(res => { }).catch(res => {
this.$message({ type: 'warning', message: '设置失败,' + res.message }); this.$message({ type: 'warning', message: '设置失败,' + res.message });
}) });
}).catch(() => { }); }).catch(() => { });
}, },
handleEffective(index, data) { handleEffective(index, data) {
@ -305,11 +310,11 @@
}); });
}).catch(res => { }).catch(res => {
this.$message({ type: 'warning', message: '设置失败,' + res.message }); this.$message({ type: 'warning', message: '设置失败,' + res.message });
}) });
}).catch(() => { }); }).catch(() => { });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
/deep/ { /deep/ {

View File

@ -1,17 +1,15 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { getProductList, putMapProductOnLine, putMapProductOffLine } from '@/api/management/mapprd'; import { getProductList, putMapProductOnLine, putMapProductOffLine } from '@/api/management/mapprd';
import { delTrainingList } from '@/api/management/userexam'; import { delTrainingList } from '@/api/management/userexam';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import localStore from 'storejs';
export default { export default {
name: 'PublishExam', name: 'PublishExam',
data() { data() {
return { return {
@ -48,8 +46,8 @@
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '产品code', title: '产品code',
@ -59,8 +57,8 @@
title: '产品类型', title: '产品类型',
prop: 'prdType', prop: 'prdType',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.prdType, this.prdTypeList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.prdType, this.prdTypeList, ['code', 'name']); },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
}, },
// { // {
// title: '', // title: '',
@ -80,21 +78,21 @@
name: '上架', name: '上架',
handleClick: this.handlePutaway, handleClick: this.handlePutaway,
type: '', type: '',
showControl: (row) => { return row.status != 1 } showControl: (row) => { return row.status != 1; }
}, },
{ {
name: '下架', name: '下架',
handleClick: this.handleSoldOut, handleClick: this.handleSoldOut,
type: 'warning', type: 'warning',
showControl: (row) => { return row.status == 1 } showControl: (row) => { return row.status == 1; }
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
@ -109,13 +107,13 @@
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -131,13 +129,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delTrainingList(row.id).then(response => { delTrainingList(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handlePutaway(index, row) { handlePutaway(index, row) {
@ -147,13 +145,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putMapProductOnLine(row.id).then(response => { putMapProductOnLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleSoldOut(index, row) { handleSoldOut(index, row) {
@ -163,18 +161,18 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putMapProductOffLine(row.id).then(response => { putMapProductOffLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>

View File

@ -1,16 +1,15 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine } from '@/api/jmap/lesson'; import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine } from '@/api/jmap/lesson';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'PublishMap', name: 'PublishMap',
data() { data() {
return { return {
@ -51,8 +50,8 @@
title: '所属城市', title: '所属城市',
prop: 'cityCode', prop: 'cityCode',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
}, },
{ {
title: '课程简介', title: '课程简介',
@ -67,36 +66,36 @@
name: '上架', name: '上架',
handleClick: this.handlePutaway, handleClick: this.handlePutaway,
type: '', type: '',
showControl: (row) => { return row.status != 1 } showControl: (row) => { return row.status != 1; }
}, },
{ {
name: '下架', name: '下架',
handleClick: this.handleSoldOut, handleClick: this.handleSoldOut,
type: 'warning', type: 'warning',
showControl: (row) => { return row.status == 1 } showControl: (row) => { return row.status == 1; }
}, },
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger',
showControl: () => { return this.isShow != -1 } showControl: () => { return this.isShow != -1; }
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
},
created() {
this.loadInitData();
}, },
computed: { computed: {
isShow() { isShow() {
return this.$store.getters['roles'].indexOf('05'); return this.$store.getters['roles'].indexOf('05');
} }
}, },
created() {
this.loadInitData();
},
methods: { methods: {
loadInitData() { loadInitData() {
this.cityList = []; this.cityList = [];
@ -105,20 +104,20 @@
this.cityList.forEach(elem => { this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
}); });
}).catch(error => { }).catch(() => {
this.$messageBox('加载城市列表失败'); this.$messageBox('加载城市列表失败');
}); });
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -137,14 +136,14 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delPublishLesson(row.id).then(response => { delPublishLesson(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
localStore.remove('mapId') localStore.remove('mapId');
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败'); this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handlePutaway(index, row) { handlePutaway(index, row) {
@ -154,13 +153,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putLessonOnLine(row.id).then(response => { putLessonOnLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleSoldOut(index, row) { handleSoldOut(index, row) {
@ -170,18 +169,18 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putLessonOffLine(row.id).then(response => { putLessonOffLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>

View File

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

View File

@ -1,17 +1,16 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine } from '@/api/jmap/map'; import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine } from '@/api/jmap/map';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'PublishMap', name: 'PublishMap',
data() { data() {
return { return {
@ -52,15 +51,15 @@
title: '所属城市', title: '所属城市',
prop: 'cityCode', prop: 'cityCode',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '更新时间', title: '更新时间',
@ -75,44 +74,44 @@
name: '上架', name: '上架',
handleClick: this.handlePutaway, handleClick: this.handlePutaway,
type: '', type: '',
showControl: (row) => { return row.status != 1 } showControl: (row) => { return row.status != 1; }
}, },
{ {
name: '下架', name: '下架',
handleClick: this.handleSoldOut, handleClick: this.handleSoldOut,
type: 'warning', type: 'warning',
showControl: (row) => { return row.status == 1 } showControl: (row) => { return row.status == 1; }
}, },
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger',
showControl: () => { return this.isShow != -1 } showControl: () => { return this.isShow != -1; }
}, },
{ {
name: '更新地图名称', name: '更新地图名称',
handleClick: this.handleUpdate, handleClick: this.handleUpdate
}, },
{ {
name: '导出地图', name: '导出地图',
handleClick: this.handleExportMap, handleClick: this.handleExportMap
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
},
created() {
this.loadInitData();
}, },
computed: { computed: {
isShow() { isShow() {
return this.$store.getters['roles'].indexOf('05'); return this.$store.getters['roles'].indexOf('05');
} }
}, },
created() {
this.loadInitData();
},
methods: { methods: {
loadInitData() { loadInitData() {
this.cityList = []; this.cityList = [];
@ -121,21 +120,20 @@
this.cityList.forEach(elem => { this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
}); });
}).catch(error => { }).catch(() => {
this.$messageBox('加载城市列表失败'); this.$messageBox('加载城市列表失败');
}); });
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -155,18 +153,18 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delPublishMap(row.id).then(response => { delPublishMap(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
localStore.remove('mapId') localStore.remove('mapId');
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败'); this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}, },
handlePutaway(index, row) { handlePutaway(index, row) {
@ -176,13 +174,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putMapOnLine(row.id).then(response => { putMapOnLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleSoldOut(index, row) { handleSoldOut(index, row) {
@ -192,28 +190,27 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
putMapOffLine(row.id).then(response => { putMapOffLine(row.id).then(response => {
this.$message.success('操作成功') this.$message.success('操作成功');
this.reloadTable(); this.reloadTable();
localStore.remove('mapId'); localStore.remove('mapId');
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('操作失败') this.$messageBox('操作失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
async handleExportMap(index, row) { async handleExportMap(index, row) {
let res = await getPublishMapExport(row.id); const res = await getPublishMapExport(row.id);
let resultData = res.data; const resultData = res.data;
if (resultData === false) { if (resultData === false) {
return; return;
} }
let self = this; const self = this;
import('@/utils/Export2Excel').then(excel => { import('@/utils/Export2Excel').then(excel => {
self.queryExportData(resultData).then(data => { self.queryExportData(resultData).then(data => {
excel.export_json_excel(data, resultData.name); excel.export_json_excel(data, resultData.name);
}).catch(error => { }).catch(error => {
self.$message.error('导出执行异常:' + error.message); self.$message.error('导出执行异常:' + error.message);
}); });
@ -221,22 +218,21 @@
}, },
formatJson(filterVal, jsonData) { formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j])) return jsonData.map(v => filterVal.map(j => v[j]));
}, },
// //
queryExportData(data) { queryExportData(data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let result = { const result = {
base: [], base: []
}; };
let obj = {}; const obj = {};
for (let i in data) { for (const i in data) {
if (i == 'devices') { if (i == 'devices') {
for (let v in data[i]) { for (const v in data[i]) {
if (data[i][v].length) { if (data[i][v].length) {
result[v] = [...data[i][v]]; result[v] = [...data[i][v]];
} } else if (v == 'skinVO') {
else if (v == 'skinVO') {
result[v] = [data[i][v]]; result[v] = [data[i][v]];
} }
} }
@ -254,5 +250,5 @@
}); });
} }
} }
} };
</script> </script>

View File

@ -1,21 +1,26 @@
<template> <template>
<el-dialog :title="title" :visible.sync="dialogShow" width="80%" :before-close="doClose" :modal="false" <el-dialog
:close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> :title="title"
</QueryListPage> :visible.sync="dialogShow"
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-row type="flex" justify="center" class="button-group">
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button> <el-button type="primary" :loading="loading" @click="handleConfirm"> </el-button>
<el-button @click="dialogShow = false"> </el-button> <el-button @click="dialogShow = false"> </el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getSkinStyleList } from '@/api/management/mapskin' import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'ChooseTemplatePlan', name: 'ChooseTemplatePlan',
data() { data() {
return { return {
@ -51,19 +56,19 @@
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '选择模板运行图' return '选择模板运行图';
} }
}, },
methods: { methods: {
@ -71,7 +76,7 @@
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
doShow(model) { doShow(model) {
this.loading = false; this.loading = false;
@ -88,9 +93,9 @@
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -109,10 +114,10 @@
} }
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

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

View File

@ -1,17 +1,15 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { getSkinStyleList } from '@/api/management/mapskin' import { getRunPlanLoadList, runPlanTemplateList } from '@/api/runplan';
import { getRunPlanLoadList, createRunPlanCommon, runPlanTemplateList } from '@/api/runplan'; import { UrlConfig } from '@/router/index';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'RunPlanCommon', name: 'RunPlanCommon',
data() { data() {
return { return {
@ -61,25 +59,25 @@
{ {
name: '预览', name: '预览',
handleClick: this.handleView, handleClick: this.handleView,
type: '', type: ''
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateCommonPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateCommonPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
methods: { methods: {
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -106,16 +104,16 @@
// //
handleView(index, row) { handleView(index, row) {
runPlanTemplateList({ pageSize: 10000 }).then(resp => { runPlanTemplateList({ pageSize: 10000 }).then(resp => {
let list = resp.data.list || []; const list = resp.data.list || [];
let index = list.findIndex(elem => { return list.id == row.templateId; }); const index = list.findIndex(elem => { return list.id == row.templateId; });
if (index >= 0) { if (index >= 0) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/common`, query: { skinStyle: list[index].skinStyle, planId: list[index].id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/common`, query: { skinStyle: list[index].skinStyle, planId: list[index].id } });
} }
}) });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>

View File

@ -1,18 +1,16 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft'; import { getSkinStyleList } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin' import { runPlanEveryDayList, deleteRunPlanEveryDay } from '@/api/runplan';
import { runPlanEveryDayList, deleteRunPlanEveryDay } from '@/api/runplan'; import { UrlConfig } from '@/router/index';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'RunPlanEveryDay', name: 'RunPlanEveryDay',
data() { data() {
return { return {
@ -52,9 +50,9 @@
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '每日运行时间', title: '每日运行时间',
@ -78,7 +76,7 @@
{ {
name: '预览', name: '预览',
handleClick: this.handleView, handleClick: this.handleView,
type: '', type: ''
} }
] ]
} }
@ -86,7 +84,7 @@
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
@ -98,14 +96,14 @@
this.skinStyleList = response.data; this.skinStyleList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name });
}) });
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -119,21 +117,21 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanEveryDay(row.id).then(response => { deleteRunPlanEveryDay(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
handleView(index, row) { handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/everyDay`, query: { skinStyle: row.skinStyle, planId: row.id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/everyDay`, query: { skinStyle: row.skinStyle, planId: row.id } });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>

View File

@ -1,18 +1,16 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft'; import { getSkinStyleList } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin' import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan'; import { UrlConfig } from '@/router/index';
import { UrlConfig } from '@/router/index';
export default { export default {
name: 'RunPlanTemplate', name: 'RunPlanTemplate',
data() { data() {
return { return {
@ -52,9 +50,9 @@
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
}, },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '创建时间', title: '创建时间',
@ -69,17 +67,17 @@
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger'
}, },
{ {
name: '生成每日运行图', name: '生成每日运行图',
handleClick: this.handleGenerateEveryDay, handleClick: this.handleGenerateEveryDay,
type: '', type: ''
}, },
{ {
name: '预览', name: '预览',
handleClick: this.handleView, handleClick: this.handleView,
type: '', type: ''
} }
] ]
} }
@ -87,7 +85,7 @@
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
@ -99,14 +97,14 @@
this.skinStyleList = response.data; this.skinStyleList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name });
}) });
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -121,17 +119,17 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanTemplate(row.id).then(response => { deleteRunPlanTemplate(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(error => {
this.reloadTable() this.reloadTable();
if (error.code == 500) { if (error.code == 500) {
this.$messageBox('删除失败') this.$messageBox('删除失败');
} else if (error.code == 500009) { } else if (error.code == 500009) {
this.$messageBox('该模板已被加载计划使用,无法删除') this.$messageBox('该模板已被加载计划使用,无法删除');
} }
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
handleGenerateEveryDay(index, row) { handleGenerateEveryDay(index, row) {
@ -141,21 +139,21 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
generateCommonRunPlanEveryDay(row.id).then(response => { generateCommonRunPlanEveryDay(row.id).then(response => {
this.reloadTable() this.reloadTable();
this.$message.success('生成通用每日运行图成功。') this.$message.success('生成通用每日运行图成功。');
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('生成通用每日运行图失败!') this.$messageBox('生成通用每日运行图失败!');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
handleView(index, row) { handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinStyle: row.skinStyle, planId: row.id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinStyle: row.skinStyle, planId: row.id } });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>

View File

@ -1,19 +1,15 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/mapdraft'; import { getSkinStyleList } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin' import { getQuestPageList, deleteQuest } from '@/api/quest';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
import { getQuestPageList, deleteQuest } from '@/api/quest';
export default { export default {
name: 'RunPlanTemplate', name: 'RunPlanTemplate',
data() { data() {
return { return {
@ -49,9 +45,9 @@
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']) return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '创建时间', title: '创建时间',
@ -66,20 +62,20 @@
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger'
}, },
{ {
name: '查看详情', name: '查看详情',
handleClick: this.handleDetail, handleClick: this.handleDetail,
type: '', type: ''
}, }
] ]
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
@ -91,14 +87,14 @@
this.skinCodeList = response.data; this.skinCodeList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
}) });
}) });
}, },
convertField(fieldValue, enumList, converFormat) { convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) { if (converFormat && converFormat.length >= 2) {
let value = converFormat[0]; const value = converFormat[0];
let label = converFormat[1]; const label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) { for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) { if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label]; return enumList[i][label];
} }
@ -114,17 +110,17 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteQuest(row.id).then(response => { deleteQuest(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(error => {
this.reloadTable() this.reloadTable();
if (error.code == 500) { if (error.code == 500) {
this.$messageBox('删除失败') this.$messageBox('删除失败');
} else if (error.code == 500009) { } else if (error.code == 500009) {
this.$messageBox('该模板已被加载计划使用,无法删除') this.$messageBox('该模板已被加载计划使用,无法删除');
} }
}) });
}).catch(() => { }) }).catch(() => { });
}, },
// //
@ -134,8 +130,8 @@
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>