This commit is contained in:
zyy 2019-11-07 18:46:23 +08:00
commit 5a2ff68b15
44 changed files with 1551 additions and 1525 deletions

View File

@ -59,9 +59,9 @@ export function putLessonOffLine(id) {
/** /**
* 获取地图产品下的课程列表 * 获取地图产品下的课程列表
*/ */
export function getCommodityProductLesson(prdCode) { export function getCommodityProductLesson(prdId) {
return request({ return request({
url: `/api/lesson/${prdCode}/list`, url: `/api/lesson/${prdId}/list`,
method: 'get' method: 'get'
}); });
} }

View File

@ -3,125 +3,115 @@ import request from '@/utils/request';
/** 分页获取课程权限数据*/ /** 分页获取课程权限数据*/
export function getLessonPermissonPageList(params) { export function getLessonPermissonPageList(params) {
return request({ return request({
url: '/api/permission', url: '/api/permission',
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 创建课程权限*/ /** 创建课程权限*/
export function createLessonPermisson(data) { export function createLessonPermisson(data) {
return request({ return request({
url: '/api/permission', url: '/api/permission',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 获取权限详情*/ /** 获取权限详情*/
export function getPermissonDetail(id) { export function getPermissonDetail(id) {
return request({ return request({
url: `/api/permission/${id}/package`, url: `/api/permission/${id}/package`,
method: 'get' method: 'get'
}); });
} }
/** 修改权限*/ /** 修改权限*/
export function putPermissonDetail(data) { export function putPermissonDetail(data) {
return request({ return request({
url: `/api/permission/${data.id}`, url: `/api/permission/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 一键生成所有权限*/ /** 一键生成所有权限*/
export function postPermissonList(mapId) { export function postPermissonList(mapId) {
return request({ return request({
url: `/api/permission/${mapId}/generate`, url: `/api/permission/${mapId}/generate`,
method: 'post' method: 'post'
}); });
} }
/** 获取用户某课程某段时间内可用的权限数量*/ /** 获取用户某课程某段时间内可用的权限数量*/
export function getTotalRemains(params) { export function getTotalRemains(params) {
return request({ return request({
url: '/api/userPermission/totalRemains', url: '/api/userPermission/totalRemains',
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 设置权限失效或有效*/ /** 设置权限失效或有效*/
export function setLessonPermisson(data) { export function setLessonPermisson(data) {
return request({ return request({
url: `/api/userPermission/${data.id}/status`, url: `/api/userPermission/${data.id}/status`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 设置权限失效或有效*/ /** 设置权限失效或有效*/
export function getPermissionList(id) { export function getPermissionList(id) {
return request({ return request({
url: `/api/permission/${id}`, url: `/api/permission/${id}`,
method: 'get' method: 'get'
}); });
}
/**
* 查询仿真权限列表
*/
export function queryPermissionSimulation(data) {
return request({
url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
method: 'get'
});
} }
/** 获取大屏权限列表*/ /** 获取大屏权限列表*/
export function queryPermissionScreen() { export function queryPermissionScreen() {
return request({ return request({
url: `/api/userPermission/bigScreen`, url: `/api/userPermission/bigScreen`,
method: 'get' method: 'get'
}); });
} }
/** /**
* 用户权限列表 * 用户权限列表
*/ */
export function listPermision(params) { export function listPermision(params) {
return request({ return request({
url: `/api/userPermission`, url: `/api/userPermission`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** /**
* 个人权限列表 * 个人权限列表
*/ */
export function listUserPermision(params) { export function listUserPermision(params) {
return request({ return request({
url: `/api/userPermission/my`, url: `/api/userPermission/my`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 用户权限列表 */ /** 用户权限列表 */
export function getDistribute(id) { export function getDistribute(id) {
return request({ return request({
url: `/api/distribute/${id}`, url: `/api/distribute/${id}`,
method: 'get' method: 'get'
}); });
} }
/** 设置权限所有者 */ /** 设置权限所有者 */
export function putPermissionOwner(data) { export function putPermissionOwner(data) {
return request({ return request({
url: `/api/userPermission/${data.id}/owner`, url: `/api/userPermission/${data.id}/owner`,
method: 'put', method: 'put',
data: data.owner data: data.owner
}); });
} }

View File

@ -9,9 +9,9 @@ export function getPublishMapTree(cityCode) {
} }
/** 获取产品详细内容*/ /** 获取产品详细内容*/
export function getProductDetail(prdCode) { export function getProductDetail(prdId) {
return request({ return request({
url: `/api/mapPrd/${prdCode}`, url: `/api/mapPrd/${prdId}`,
method: 'get' method: 'get'
}); });
} }
@ -72,9 +72,9 @@ export function getCommodityMapProduct(mapId) {
/** /**
* 获取地图下的产品详情 * 获取地图下的产品详情
*/ */
export function getMapProductDetail(prdCode) { export function getMapProductDetail(prdId) {
return request({ return request({
url: `/api/mapPrd/${prdCode}`, url: `/api/mapPrd/${prdId}`,
method: 'get' method: 'get'
}); });
} }

View File

@ -2,78 +2,78 @@ import request from '@/utils/request';
/** 获取故障规则列表*/ /** 获取故障规则列表*/
export function getFailureGenerateRules(params) { export function getFailureGenerateRules(params) {
return request({ return request({
url: `/api/simulation/failureGenerateRules`, url: `/api/simulation/failureGenerateRules`,
method: 'get', method: 'get',
params: params params: params
}); });
} }
/** 设置自动故障*/ /** 设置自动故障*/
export function setFailureMode(data, group) { export function setFailureMode(data, group) {
return request({ return request({
url: `/api/simulation/${group}/failureMode`, url: `/api/simulation/${group}/failureMode`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** /**
* 仿真系统按计划行车 * 仿真系统按计划行车
*/ */
export function runDiagramStart(params, group) { export function runDiagramStart(params, group) {
return request({ return request({
url: `/api/simulation/${group}/start`, url: `/api/simulation/${group}/start`,
method: 'put', method: 'put',
params: params params: params
}); });
} }
/** /**
* 仿真系统结束计划行车 * 仿真系统结束计划行车
*/ */
export function runDiagramOver(group) { export function runDiagramOver(group) {
return request({ return request({
url: `/api/simulation/${group}/over`, url: `/api/simulation/${group}/over`,
method: 'put' method: 'put'
}); });
} }
/** /**
* 退出仿真系统 * 退出仿真系统
*/ */
export function runDiagramQuit(group) { export function runDiagramQuit(group) {
return request({ return request({
url: `/api/simulation/${group}/quit`, url: `/api/simulation/${group}/quit`,
method: 'put' method: 'put'
}); });
} }
/** 获取仿真系统时间*/ /** 获取仿真系统时间*/
export function runDiagramGetTime(group) { export function runDiagramGetTime(group) {
return request({ return request({
url: `/api/simulation/${group}/systemTime`, url: `/api/simulation/${group}/systemTime`,
method: 'get' method: 'get'
}); });
} }
// 查看是否开始按计划行车 // 查看是否开始按计划行车
export function runDiagramIsStart(group) { export function runDiagramIsStart(group) {
return request({ return request({
url: `/api/simulation/${group}/isRunPlanStart`, url: `/api/simulation/${group}/isRunPlanStart`,
method: 'get' method: 'get'
}); });
} }
/** /**
* 仿真系统CBTC * 仿真系统CBTC
* @param {*} mapId * @param {*} mapId
*/ */
export function simulationNotify({ mapId, code }) { export function simulationNotify({ mapId, mapPrdId }) {
return request({ return request({
url: `/api/simulation/${mapId}/${code}`, url: `/api/simulation/${mapId}/${mapPrdId}`,
method: 'get' method: 'get'
}); });
} }
/** /**
@ -81,10 +81,10 @@ export function simulationNotify({ mapId, code }) {
* @param {*} mapId * @param {*} mapId
*/ */
export function bitScreenNotify({ mapId }) { export function bitScreenNotify({ mapId }) {
return request({ return request({
url: `/api/simulation/bigScreen/${mapId}`, url: `/api/simulation/bigScreen/${mapId}`,
method: 'get' method: 'get'
}); });
} }
/** /**
@ -92,10 +92,10 @@ export function bitScreenNotify({ mapId }) {
* @param {*} data * @param {*} data
*/ */
export function trainingNotify({ trainingId }) { export function trainingNotify({ trainingId }) {
return request({ return request({
url: `/api/simulation/training/${trainingId}`, url: `/api/simulation/training/${trainingId}`,
method: 'get' method: 'get'
}); });
} }
/** /**
@ -103,334 +103,334 @@ export function trainingNotify({ trainingId }) {
* @param {*} data * @param {*} data
*/ */
export function examNotify({ examId }) { export function examNotify({ examId }) {
return request({ return request({
url: `/api/simulation/exam/${examId}`, url: `/api/simulation/exam/${examId}`,
method: 'get' method: 'get'
}); });
} }
/** 获取用户实训列表*/ /** 获取用户实训列表*/
export function getSimulationList(data) { export function getSimulationList(data) {
return request({ return request({
url: `/api/simulation/stats`, url: `/api/simulation/stats`,
method: 'get', method: 'get',
params: data params: data
}); });
} }
/** 添加用户仿真数据*/ /** 添加用户仿真数据*/
export function postSimulationStats(data) { export function postSimulationStats(data) {
return request({ return request({
url: `/api/simulation/stats`, url: `/api/simulation/stats`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 更新用户仿真数据*/ /** 更新用户仿真数据*/
export function putSimulationStats(data) { export function putSimulationStats(data) {
return request({ return request({
url: `/api/simulation/${data.id}/stats`, url: `/api/simulation/${data.id}/stats`,
method: 'put', method: 'put',
data: data data: data
}); });
} }
/** 删除用户仿真数据*/ /** 删除用户仿真数据*/
export function deleteSimulationStats(statsId) { export function deleteSimulationStats(statsId) {
return request({ return request({
url: `/api/simulation/${statsId}`, url: `/api/simulation/${statsId}`,
method: 'delete' method: 'delete'
}); });
} }
/** 获取用户鼠标左键选中的设备信息*/ /** 获取用户鼠标左键选中的设备信息*/
export function letfMouseSelectDevice(deviceCode, group) { export function letfMouseSelectDevice(deviceCode, group) {
return request({ return request({
url: `/api/simulation/${group}/device/${deviceCode}`, url: `/api/simulation/${group}/device/${deviceCode}`,
method: 'get' method: 'get'
}); });
} }
/** 获取每日运行图*/ /** 获取每日运行图*/
export function getEveryDayRunPlanData(group) { export function getEveryDayRunPlanData(group) {
return request({ return request({
url: `/api/simulation/${group}/runPlan`, url: `/api/simulation/${group}/runPlan`,
method: 'get' method: 'get'
}); });
} }
/** 录制脚本仿真*/ /** 录制脚本仿真*/
export function scriptRecordNotify(scriptId) { export function scriptRecordNotify(scriptId) {
return request({ return request({
url: `/api/simulation/scriptWrite/${scriptId}`, url: `/api/simulation/scriptWrite/${scriptId}`,
method: 'get' method: 'get'
}); });
} }
/** 保存剧本背景*/ /** 保存剧本背景*/
export function saveScriptScenes(group) { export function saveScriptScenes(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/scenes`, url: `/api/simulation/${group}/scriptWrite/scenes`,
method: 'put' method: 'put'
}); });
} }
/** 保存录制任务数据*/ /** 保存录制任务数据*/
export function saveScriptData(group) { export function saveScriptData(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/saveData`, url: `/api/simulation/${group}/scriptWrite/saveData`,
method: 'put' method: 'put'
}); });
} }
/** 更新任务地图定位信息*/ /** 更新任务地图定位信息*/
export function updateMapLocation(group, data) { export function updateMapLocation(group, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/mapLocation`, url: `/api/simulation/${group}/scriptWrite/mapLocation`,
method: 'put', method: 'put',
data data
}); });
} }
/** 获取剧本编制的所有成员角色*/ /** 获取剧本编制的所有成员角色*/
export function getScriptMemberData(group) { export function getScriptMemberData(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/members`, url: `/api/simulation/${group}/scriptWrite/members`,
method: 'get' method: 'get'
}); });
} }
/** 获取剧本出演成员角色 */ /** 获取剧本出演成员角色 */
export function getScriptPlayMember(group) { export function getScriptPlayMember(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/players`, url: `/api/simulation/${group}/scriptWrite/players`,
method: 'get' method: 'get'
}); });
} }
/** 取消剧本演出成员角色 */ /** 取消剧本演出成员角色 */
export function cancleScriptMembers(group, data) { export function cancleScriptMembers(group, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/removePlayers`, url: `/api/simulation/${group}/scriptWrite/removePlayers`,
method: 'put', method: 'put',
data data
}); });
} }
/** 选择剧本演出成员角色 */ /** 选择剧本演出成员角色 */
export function selectScriptMembers(group, data) { export function selectScriptMembers(group, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/choosePlayers`, url: `/api/simulation/${group}/scriptWrite/choosePlayers`,
method: 'put', method: 'put',
data data
}); });
} }
/** 修改剧本演出成员性别 */ /** 修改剧本演出成员性别 */
export function modifyScriptMemberSex(group, playerId, data) { export function modifyScriptMemberSex(group, playerId, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`, url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
method: 'put' method: 'put'
}); });
} }
/** 清除仿真剧本数据*/ /** 清除仿真剧本数据*/
export function dumpScriptData(group) { export function dumpScriptData(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/saveData`, url: `/api/simulation/${group}/scriptWrite/saveData`,
method: 'delete' method: 'delete'
}); });
} }
/** 查询录制剧本步骤*/ /** 查询录制剧本步骤*/
export function queryScriptStep(group) { export function queryScriptStep(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptRecordStage`, url: `/api/simulation/${group}/scriptRecordStage`,
method: 'get' method: 'get'
}); });
} }
/** 获取指定时间里可加载列车的个数*/ /** 获取指定时间里可加载列车的个数*/
export function getDesignatedTimeTrainNum(params, group) { export function getDesignatedTimeTrainNum(params, group) {
return request({ return request({
url: `/api/simulation/${group}/plan/trainNum`, url: `/api/simulation/${group}/plan/trainNum`,
method: 'get', method: 'get',
params params
}); });
} }
/** 添加剧本动作 */ /** 添加剧本动作 */
export function addScriptAction(group, data) { export function addScriptAction(group, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/action`, url: `/api/simulation/${group}/scriptWrite/action`,
method: 'post', method: 'post',
data data
}); });
} }
/** 删除剧本动作 */ /** 删除剧本动作 */
export function deleteScriptAction(group, actionId) { export function deleteScriptAction(group, actionId) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`, url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
method: 'delete' method: 'delete'
}); });
} }
/** 修改剧本动作 */ /** 修改剧本动作 */
export function modifyScriptAction(group, actionId, data) { export function modifyScriptAction(group, actionId, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`, url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
method: 'put', method: 'put',
data data
}); });
} }
/** 分页查询存在的仿真 */ /** 分页查询存在的仿真 */
export function getExistingSimulation(params) { export function getExistingSimulation(params) {
return request({ return request({
url: `/api/simulation/manage/page`, url: `/api/simulation/manage/page`,
method: 'get', method: 'get',
params params
}); });
} }
/** 删除存在的仿真 */ /** 删除存在的仿真 */
export function deleteExistingSimulation(group) { export function deleteExistingSimulation(group) {
return request({ return request({
url: `/api/simulation/manage/${group}`, url: `/api/simulation/manage/${group}`,
method: 'delete' method: 'delete'
}); });
} }
/** 根据设备类型获取设备列表 */ /** 根据设备类型获取设备列表 */
export function getDeviceCodeByDeviceType(group, params) { export function getDeviceCodeByDeviceType(group, params) {
return request({ return request({
url: `/api/simulation/${group}/deviceType/devices`, url: `/api/simulation/${group}/deviceType/devices`,
method: 'get', method: 'get',
params params
}); });
} }
/** 获取任务录制的数据 */ /** 获取任务录制的数据 */
export function getScriptRecord(group) { export function getScriptRecord(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite`, url: `/api/simulation/${group}/scriptWrite`,
method: 'get' method: 'get'
}); });
} }
/** 加载任务*/ /** 加载任务*/
export function loadQuest(questId, memberId, group) { export function loadQuest(questId, memberId, group) {
return request({ return request({
url: `/api/simulation/${group}/quest/${questId}?memberId=${memberId}`, url: `/api/simulation/${group}/quest/${questId}?memberId=${memberId}`,
method: 'post' method: 'post'
}); });
} }
/** 加载剧本 */ /** 加载剧本 */
export function loadScript(scriptId, memberId, group) { export function loadScript(scriptId, memberId, group) {
return request({ return request({
url: `api/simulation/${group}/script/${scriptId}?memberId=${memberId}`, url: `api/simulation/${group}/script/${scriptId}?memberId=${memberId}`,
method: 'post' method: 'post'
}); });
} }
/** 退出剧本*/ /** 退出剧本*/
export function quitScript(group) { export function quitScript(group) {
return request({ return request({
url: `/api/simulation/${group}/script`, url: `/api/simulation/${group}/script`,
method: 'delete' method: 'delete'
}); });
} }
/** 退出任务*/ /** 退出任务*/
export function quitQuest(group) { export function quitQuest(group) {
return request({ return request({
url: `/api/simulation/${group}/quest`, url: `/api/simulation/${group}/quest`,
method: 'put' method: 'put'
}); });
} }
/** 根据group获取仿真对象*/ /** 根据group获取仿真对象*/
export function getSimulationInfo(group) { export function getSimulationInfo(group) {
return request({ return request({
url: `/api/simulation/${group}`, url: `/api/simulation/${group}`,
method: 'get' method: 'get'
}); });
} }
/** 获取可用的设备指令*/ /** 获取可用的设备指令*/
export function getAvailableDeviceCommand(params) { export function getAvailableDeviceCommand(params) {
return request({ return request({
url: `/api/simulation/deviceCommand/available`, url: `/api/simulation/deviceCommand/available`,
method: 'get', method: 'get',
params params
}); });
} }
/** 保存/修改任务剧本*/ /** 保存/修改任务剧本*/
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
}); });
} }
/** 暂停剧本编制的仿真 */ /** 暂停剧本编制的仿真 */
export function scriptPause(group) { export function scriptPause(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/pause`, url: `/api/simulation/${group}/scriptWrite/pause`,
method: 'post' method: 'post'
}); });
} }
/** 恢复仿真运行并执行刚编辑的剧本动作 */ /** 恢复仿真运行并执行刚编辑的剧本动作 */
export function executeScript(group) { export function executeScript(group) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/execute`, url: `/api/simulation/${group}/scriptWrite/execute`,
method: 'post' method: 'post'
}); });
} }
/** 生成用户自己的当日运行图*/ /** 生成用户自己的当日运行图*/
export function generateDayRunPlan(planId, group) { export function generateDayRunPlan(planId, group) {
return request({ return request({
url: `/api/simulation/${group}/loadRunPlan/${planId}`, url: `/api/simulation/${group}/loadRunPlan/${planId}`,
method: 'post' method: 'post'
}); });
} }
/** 创建派班计划仿真*/ /** 创建派班计划仿真*/
export function schedulingNotify(params) { export function schedulingNotify(params) {
return request({ return request({
url: `/api/scheduling/simulation`, url: `/api/scheduling/simulation`,
method: 'post', method: 'post',
params params
}); });
} }
/** 获取PLC网关 */ /** 获取PLC网关 */
export function getPlcGateway(group) { export function getPlcGateway(group) {
return request({ return request({
url: `/api/simulation/${group}/plcGateway`, url: `/api/simulation/${group}/plcGateway`,
method: 'get' method: 'get'
}); });
} }
/** 处理ibp盘事件 */ /** 处理ibp盘事件 */
export function handlerIbpEvent(group, data) { export function handlerIbpEvent(group, data) {
return request({ return request({
url: `/api/simulation/${group}/ibp/event`, url: `/api/simulation/${group}/ibp/event`,
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 预览脚本仿真*/ /** 预览脚本仿真*/
export function scriptDraftRecordNotify(scriptId) { export function scriptDraftRecordNotify(scriptId) {
return request({ return request({
url: `/api/simulation/scriptDraft/${scriptId}`, url: `/api/simulation/scriptDraft/${scriptId}`,
method: 'get' method: 'get'
}); });
} }

View File

@ -9,15 +9,6 @@ export function getTrainingSystemList(cityCode, params) {
}); });
} }
export function querySystemByTypeAndPrdCode(params, prodCode) {
/** 根据系统类型和地图产品code查询系统的内容课程、章节、考试*/
return request({
url: `/api/mapSystem/queryByTypeAndPrdCode/${prodCode}`,
method: 'get',
params
});
}
export function getTrainingSystemListByMapId(mapId) { export function getTrainingSystemListByMapId(mapId) {
/** 根据mapId去获取其子系统 */ /** 根据mapId去获取其子系统 */
return request({ return request({

View File

@ -4,107 +4,113 @@ const deviceRender = {};
/** IbpText渲染配置*/ /** IbpText渲染配置*/
deviceRender[deviceType.IbpText] = { deviceRender[deviceType.IbpText] = {
_type: deviceType.IbpText, _type: deviceType.IbpText,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** SquareButton渲染配置*/ /** SquareButton渲染配置*/
deviceRender[deviceType.SquareButton] = { deviceRender[deviceType.SquareButton] = {
_type: deviceType.SquareButton, _type: deviceType.SquareButton,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** WarnButton渲染配置*/ /** WarnButton渲染配置*/
deviceRender[deviceType.WarnButton] = { deviceRender[deviceType.WarnButton] = {
_type: deviceType.WarnButton, _type: deviceType.WarnButton,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** Arrow渲染配置*/ /** Arrow渲染配置*/
deviceRender[deviceType.Arrow] = { deviceRender[deviceType.Arrow] = {
_type: deviceType.Arrow, _type: deviceType.Arrow,
zlevel: 1, zlevel: 1,
z: 2 z: 2
}; };
/** TipBox渲染配置*/ /** TipBox渲染配置*/
deviceRender[deviceType.TipBox] = { deviceRender[deviceType.TipBox] = {
_type: deviceType.TipBox, _type: deviceType.TipBox,
zlevel: 1, zlevel: 1,
z: 3 z: 3
}; };
/** BackGround渲染配置*/ /** BackGround渲染配置*/
deviceRender[deviceType.Background] = { deviceRender[deviceType.Background] = {
_type: deviceType.Background, _type: deviceType.Background,
zlevel: 1, zlevel: 1,
z: 0 z: 0
}; };
/** CircularLamp渲染配置 */ /** CircularLamp渲染配置 */
deviceRender[deviceType.CircularLamp] = { deviceRender[deviceType.CircularLamp] = {
_type: deviceType.CircularLamp, _type: deviceType.CircularLamp,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** AppendageBox渲染配置 */ /** AppendageBox渲染配置 */
deviceRender[deviceType.AppendageBox] = { deviceRender[deviceType.AppendageBox] = {
_type: deviceType.AppendageBox, _type: deviceType.AppendageBox,
zlevel: 1, zlevel: 1,
z: 1 z: 1
}; };
/** IbpLine渲染配置 */ /** IbpLine渲染配置 */
deviceRender[deviceType.IbpLine] = { deviceRender[deviceType.IbpLine] = {
_type: deviceType.IbpLine, _type: deviceType.IbpLine,
zlevel: 1, zlevel: 1,
z: 1 z: 1
}; };
/** Elevator 渲染配置 */ /** Elevator 渲染配置 */
deviceRender[deviceType.Elevator] = { deviceRender[deviceType.Elevator] = {
_type: deviceType.Elevator, _type: deviceType.Elevator,
zlevel: 1, zlevel: 1,
z: 2 z: 2
}; };
/** Key 渲染配置 */ /** Key 渲染配置 */
deviceRender[deviceType.Key] = { deviceRender[deviceType.Key] = {
_type: deviceType.Key, _type: deviceType.Key,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** TeleTerminal 渲染配置 */ /** TeleTerminal 渲染配置 */
deviceRender[deviceType.TeleTerminal] = { deviceRender[deviceType.TeleTerminal] = {
_type: deviceType.TeleTerminal, _type: deviceType.TeleTerminal,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** Clock 渲染配置*/ /** Clock 渲染配置*/
deviceRender[deviceType.Clock] = { deviceRender[deviceType.Clock] = {
_type: deviceType.Clock, _type: deviceType.Clock,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** RotateTip 渲染配置 */ /** RotateTip 渲染配置 */
deviceRender[deviceType.RotateTip] = { deviceRender[deviceType.RotateTip] = {
_type: deviceType.RotateTip, _type: deviceType.RotateTip,
zlevel: 1, zlevel: 1,
z: 4 z: 4
}; };
/** Alarm */ /** Alarm */
deviceRender[deviceType.Alarm] = { deviceRender[deviceType.Alarm] = {
_type: deviceType.Alarm, _type: deviceType.Alarm,
zlevel: 1, zlevel: 1,
z: 4 z: 4
};
deviceRender[deviceType.CheckBox] = {
_type: deviceType.CheckBox,
zlevel: 10,
z: 0
}; };
export default deviceRender; export default deviceRender;

View File

@ -1,18 +1,19 @@
const deviceType = { const deviceType = {
IbpText: 'IbpText', IbpText: 'IbpText',
SquareButton: 'SquareButton', SquareButton: 'SquareButton',
Arrow: 'Arrow', Arrow: 'Arrow',
TipBox: 'TipBox', TipBox: 'TipBox',
Background: 'Background', Background: 'Background',
CircularLamp: 'CircularLamp', CircularLamp: 'CircularLamp',
IbpLine: 'IbpLine', IbpLine: 'IbpLine',
AppendageBox: 'AppendageBox', AppendageBox: 'AppendageBox',
Alarm: 'Alarm', Alarm: 'Alarm',
Elevator: 'Elevator', Elevator: 'Elevator',
Key: 'Key', Key: 'Key',
TeleTerminal: 'TeleTerminal', TeleTerminal: 'TeleTerminal',
Clock: 'Clock', Clock: 'Clock',
RotateTip: 'RotateTip' RotateTip: 'RotateTip',
CheckBox: 'CheckBox'
}; };
export default deviceType; export default deviceType;

View File

@ -303,5 +303,25 @@ class IbpPan {
} }
} }
} }
renderCheckBox(model) {
const type = model._type;
const code = model.code;
const oDevice = this.ibpDevice[code] || deviceFactory(type, model);
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, model));
delete this.ibpDevice[code];
this.$painter.delete(oDevice);
if (!model._dispose) {
this.ibpDevice[code] = nDevice;
this.$painter.add(nDevice);
}
}
deleteCheckBox(code) {
const oDevice = this.ibpDevice[code];
if (oDevice) {
delete this.ibpDevice[code];
this.$painter.delete(oDevice);
}
}
} }
export default IbpPan; export default IbpPan;

View File

@ -4,193 +4,284 @@ import * as eventTool from 'zrender/src/core/event';
import store from '@/store'; import store from '@/store';
class EventModel { class EventModel {
constructor(e) { constructor(e) {
this.clientX = e.event.clientX; this.clientX = e.event.clientX;
this.clientY = e.event.clientY; this.clientY = e.event.clientY;
let view = e.target; let view = e.target;
while (view) { while (view) {
if (Object.values(deviceType).includes(view._type)) { if (Object.values(deviceType).includes(view._type)) {
this.deviceCode = view._code; this.deviceCode = view._code;
this.deviceType = view._type; this.deviceType = view._type;
this.deviceModel = view.model; this.deviceModel = view.model;
this.eventTarget = view; this.eventTarget = view;
break; break;
} }
view = view.parent; view = view.parent;
} }
} }
} }
class MouseController extends Eventful { class MouseController extends Eventful {
constructor(ibp) { constructor(ibp) {
super(); super();
this.$ibp = ibp; this.$ibp = ibp;
this.$zr = ibp.getZr(); this.$zr = ibp.getZr();
this.isAllowDragging=ibp.isAllowDragging||false; this.isAllowDragging = ibp.isAllowDragging || false; // 是否在绘图中,仅绘图状态下可拖拽
this.events = ibp.getEvents(); this.events = ibp.getEvents();
this._dragging = false; this._dragging = false; // 是否在拖拽状态
this.initHandler(this.$zr); this.deviceList = [];
} this.rightClickPoint = {
x: 0,
y: 0
}; // 右键点击坐标
this.initHandler(this.$zr);
}
initHandler(zr) { initHandler(zr) {
if (zr) { if (zr) {
zr.on('contextmenu', this.contextmenu, this); zr.on('contextmenu', this.contextmenu, this);
zr.on('mousemove', this.moveEvent, this); zr.on('mousemove', this.moveEvent, this);
zr.on('click', this.click, this); zr.on('click', this.click, this);
this.enable = function (opts) { this.enable = function (opts) {
opts = opts || {}; opts = opts || {};
this._moveOnMouseMove = opts.moveOnMouseMove || true; this._moveOnMouseMove = opts.moveOnMouseMove || true;
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true; this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
this.disable(); this.disable();
zr.on('mousedown', this.mousedown, this); zr.on('mousedown', this.mousedown, this);
zr.on('mousemove', this.mousemove, this); zr.on('mousemove', this.mousemove, this);
zr.on('mouseup', this.mouseup, this); zr.on('mouseup', this.mouseup, this);
zr.on('touchstart', this.mousedown, this); zr.on('touchstart', this.mousedown, this);
zr.on('touchmove', this.mousemove, this); zr.on('touchmove', this.mousemove, this);
zr.on('touchend', this.mouseup, this); zr.on('touchend', this.mouseup, this);
}; };
this.disable = function () { this.disable = function () {
zr.off('mousedown', this.mousedown); zr.off('mousedown', this.mousedown);
zr.off('mousemove', this.mousemove); zr.off('mousemove', this.mousemove);
zr.off('mouseup', this.mouseup); zr.off('mouseup', this.mouseup);
zr.off('touchstart', this.mousedown); zr.off('touchstart', this.mousedown);
zr.off('touchmove', this.mousemove); zr.off('touchmove', this.mousemove);
zr.off('touchend', this.mouseup); zr.off('touchend', this.mouseup);
}; };
this.dispose = function () { this.dispose = function () {
zr.off('click', this.click); zr.off('click', this.click);
zr.off('contextmenu', this.contextmenu); zr.off('contextmenu', this.contextmenu);
zr.off('mousemove', this.moveEvent); zr.off('mousemove', this.moveEvent);
this.disable(); this.disable();
}; };
this.isDragging = function () { return this._dragging; }; this.isDragging = function () { return this._dragging; };
} }
} }
setAllowDragging(data) { setAllowDragging(data) {
this.isAllowDragging=data; this.isAllowDragging = data;
} }
mousedown(e) { mousedown(e) {
if (eventTool.notLeftMouse(e)) { e.event.preventDefault();
return; e.event.stopPropagation();
} const em = new EventModel(e);
e.event.preventDefault(); this.eventTarget = em.eventTarget;
e.event.stopPropagation(); this._offsetX = e.offsetX;
const em = new EventModel(e); this._offsetY = e.offsetY;
this.eventTarget = em.eventTarget; this._x = e.offsetX;
if (this.eventTarget && this.eventTarget._type === deviceType.Background) { this._y = e.offsetY;
this.eventTarget.setCursor('pointer'); this._dragging = true;
} if (e.which === 3) {
this._offsetX=e.offsetX; this.handleMouseDownRight(e);
this._offsetY=e.offsetY; } else if (e.which === 1) {
this._x = e.offsetX; this.handleMouseDownLeft(e);
this._y = e.offsetY; } else if (e.which === 2) {
this._dragging = true; this.handleMouseDownWheel(e);
} }
}
mousemove(e) { mousemove(e) {
if (eventTool.notLeftMouse(e) || const oldX = this._x;
!this._moveOnMouseMove || const oldY = this._y;
!this._dragging || !this.isAllowDragging
) {
return;
}
const oldX = this._x; const dx = e.offsetX - oldX;
const oldY = this._y; const dy = e.offsetY - oldY;
const dx = e.offsetX - oldX; this._x = e.offsetX;
const dy = e.offsetY - oldY; this._y = e.offsetY;
if (e.which === 3) {
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
} else if (e.which === 1) {
this.handleMouseMoveLeft(e, dx, dy, oldX, oldY);
}
}
this._x = e.offsetX; mouseup(e) {
this._y = e.offsetY; if (eventTool.notLeftMouse(e) || !this.eventTarget ) {
if (this._dragging) { return;
if ((this.eventTarget && this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) { }
this._preventDefaultMouseMove && eventTool.stop(e.event); if (this.deviceList.length) {
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); this.deviceList.forEach(item => {
return true; item.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
} else if (this.isAllowDragging && this.eventTarget) { });
this.eventTarget.grouper.drift(dx, dy, e); this.deviceList = [];
} this.$ibp.deleteCheckBox('check_box');
} else { this.eventTarget = '';
return true; this._dragging = false;
} this.deviceList = [];
return;
}
if (this.isAllowDragging) {
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
this.eventTarget.dirty();
}
if (this.eventTarget._type === deviceType.Background) {
this.eventTarget.setCursor('default');
}
this.eventTarget = '';
this._dragging = false;
this.deviceList = [];
}
} contextmenu(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Contextmenu, em);
}
click(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Selected, em);
}
moveEvent(e) {
const newEm = new EventModel(e);
const trainDetails = store.state.map.trainDetails;
if (trainDetails) {
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
var instance = (this.$ibp.getDeviceByCode(trainDetails.code) || {} ).instance;
instance && instance.removeTrainDetail && instance.removeTrainDetail();
}
}
}
mouseup(e) { checkEvent(e) {
if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) { var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY); var newEm = new EventModel(e);
this.eventTarget.dirty(); if ([1, 3].includes(e.which)) {
} // 查找之前和当前鼠标选中的实例
// debugger; var oldDevice = this.$ibp.getDeviceByCode(oldEm.deviceCode) || {};
if (this.eventTarget && this.eventTarget._type === deviceType.Background) { var newDevice = this.$ibp.getDeviceByCode(newEm.deviceCode) || {};
// console.log('111-------'); var oldInstance = (this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
this.eventTarget.setCursor('default'); var newInstance = (this.$ibp.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
}
this.eventTarget = '';
this._dragging = false;
}
contextmenu(e) { // 如果之前和当前选中的实例不一致
var em = this.checkEvent(e); if (oldInstance != newInstance) {
this.trigger(this.events.Contextmenu, em); // 如果实例有取消选择函数并且被点击,则执行取消选中函数
} if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
click(e) { // 视图数据设置点击标志,同步执行
var em = this.checkEvent(e); oldDevice['down'] = false;
this.trigger(this.events.Selected, em); oldInstance.mouseEvent['mouseout'](e);
} }
moveEvent(e) {
const newEm = new EventModel(e);
const trainDetails = store.state.map.trainDetails;
if (trainDetails) {
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
var instance = (this.$ibp.getDeviceByCode(trainDetails.code) || {} ).instance;
instance && instance.removeTrainDetail && instance.removeTrainDetail();
}
}
}
checkEvent(e) { // 如果实例有选中函数并且被点击,则执行选中函数
var oldEm = new EventModel(this.$zr.curEvent || { event: {} }); if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
var newEm = new EventModel(e); newDevice['down'] = true;
if ([1, 3].includes(e.which)) { newInstance.mouseEvent['mouseover'](e);
// 查找之前和当前鼠标选中的实例 }
var oldDevice = this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}; }
var newDevice = this.$ibp.getDeviceByCode(newEm.deviceCode) || {};
var oldInstance = (this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
var newInstance = (this.$ibp.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
// 如果之前和当前选中的实例不一致 // 保存当前实例到全局
if (oldInstance != newInstance) { this.$zr.curEvent = e;
// 如果实例有取消选择函数并且被点击,则执行取消选中函数 }
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
// 视图数据设置点击标志,同步执行
oldDevice['down'] = false;
oldInstance.mouseEvent['mouseout'](e);
}
// 如果实例有选中函数并且被点击,则执行选中函数 return newEm;
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) { }
newDevice['down'] = true; /** 处理鼠标右键按下事件 */
newInstance.mouseEvent['mouseover'](e); handleMouseDownRight(e) {
} this.rightClickPoint.x = e.offsetX;
} this.rightClickPoint.y = e.offsetY;
}
// 保存当前实例到全局 /** 处理鼠标左键按下事件 */
this.$zr.curEvent = e; handleMouseDownLeft(e) {
} if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
this.eventTarget.setCursor('pointer');
return newEm; this.$ibp.deleteCheckBox('check_box');
} } else if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
this.handleBoundingRect(this.eventTarget);
} else {
this.$ibp.deleteCheckBox('check_box');
}
}
/** 处理滚轮按下事件 */
handleMouseDownWheel(e) {
this.deviceList = [];
Object.values(this.$ibp.ibpDevice).forEach(item => {
if (item.instance._type !== deviceType.Background) {
this.deviceList.push(item.instance);
}
});
}
/** 处理右键拖动事件--- 改变选中区域大小 */
handleMouseMoveRight(point2) {
const point1 = this.rightClickPoint;
const x = Math.min(point1.x, point2.x) + this.$ibp.$options.offsetX;
const y = Math.min(point1.y, point2.y) + this.$ibp.$options.offsetY;
const width = Math.abs(point1.x - point2.x);
const height = Math.abs(point1.y - point2.y);
this.$ibp.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height });
}
/** 处理左键拖动事件--- 图形移动 */
handleMouseMoveLeft(e, dx, dy, oldX, oldY) {
if (!this._moveOnMouseMove || !this._dragging || !this.isAllowDragging) {
return;
}
if (this.deviceList.length) {
this.deviceList.forEach(item => {
item.grouper.drift(dx, dy, e);
});
return;
}
if (this._dragging) {
if ((this.eventTarget && this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
this._preventDefaultMouseMove && eventTool.stop(e.event);
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
return true;
} else if (this.isAllowDragging && this.eventTarget) {
this.eventTarget.grouper.drift(dx, dy, e);
}
}
}
/** 通过包围盒筛选选中区域的元素 */
handleBoundingRect(eventTarget) {
this.deviceList = [];
let boundingRect = eventTarget.grouper.getBoundingRect();
boundingRect = this.createFakeBoundingRect(eventTarget, boundingRect);
const deviceList = Object.values(this.$ibp.ibpDevice);
const includeDeviceList = [];
deviceList.forEach( item =>{
if (item.instance._type !== deviceType.Background) {
let deviceBoundingRect = item.instance.grouper.getBoundingRect();
deviceBoundingRect = this.createFakeBoundingRect(item.instance, deviceBoundingRect);
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
includeDeviceList.push(item.instance);
}
}
});
this.deviceList = includeDeviceList;
}
/** 创建假包围盒对象 */
createFakeBoundingRect(instance, boundingRect) {
return {
x1: instance.model.point.x + boundingRect.x,
y1: instance.model.point.y + boundingRect.y,
x2: instance.model.point.x + boundingRect.width,
y2: instance.model.point.y + boundingRect.height
};
}
/** 判断元素包围盒是否在选中区域 */
whetherInclude(boundingRect1, boundingRect2) {
return boundingRect1.x1 <= boundingRect2.x1 && boundingRect1.y1 <= boundingRect2.y1 && boundingRect1.x2 >= boundingRect2.x2 && boundingRect1.y2 >= boundingRect2.y2;
}
} }
export default MouseController; export default MouseController;

46
src/ibp/shape/checkBox.js Normal file
View File

@ -0,0 +1,46 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
export default class checkBox extends Group {
constructor(device) {
super();
this.model = device.model;
this._type = device.model._type;
this._code = device.model.code;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this.create();
}
create() {
const model = this.model;
this.grouper = new Group({
id: model.code,
position: [model.point.x, model.point.y]
});
this.box = new Rect({
zlevel: model.zlevel,
z: model.z,
draggable: false,
shape: {
x: 0,
y: 0,
width: this.model.width,
height: this.model.height
},
style: {
fill: 'rgb(135,206,250,0.2)'
}
});
this.grouper.add(this.box);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
setSize(width, height) {
this.model.width = width;
this.model.height = height;
}
}

View File

@ -13,6 +13,7 @@ import Key from './key';
import TeleTerminal from './teleTerminal'; import TeleTerminal from './teleTerminal';
import Clock from './clock'; import Clock from './clock';
import RotateTip from './rotateTip'; import RotateTip from './rotateTip';
import CheckBox from './checkBox';
const ibpShape = {}; const ibpShape = {};
ibpShape[deviceType.Arrow] = Arrow; ibpShape[deviceType.Arrow] = Arrow;
@ -29,14 +30,15 @@ ibpShape[deviceType.Key] = Key;
ibpShape[deviceType.TeleTerminal] = TeleTerminal; ibpShape[deviceType.TeleTerminal] = TeleTerminal;
ibpShape[deviceType.Clock] = Clock; ibpShape[deviceType.Clock] = Clock;
ibpShape[deviceType.RotateTip] = RotateTip; ibpShape[deviceType.RotateTip] = RotateTip;
ibpShape[deviceType.CheckBox] = CheckBox;
function shapefactory(device, ibp) { function shapefactory(device, ibp) {
const type = device.model._type; const type = device.model._type;
const shape = ibpShape[type]; const shape = ibpShape[type];
if (shape instanceof Function) { if (shape instanceof Function) {
// eslint-disable-next-line // eslint-disable-next-line
return new shape(device, ibp.style); return new shape(device, ibp.style);
} }
} }
export default shapefactory; export default shapefactory;

View File

@ -2,43 +2,44 @@ import Group from 'zrender/src/container/Group';
import Line from 'zrender/src/graphic/shape/Line'; import Line from 'zrender/src/graphic/shape/Line';
export default class ibpLine extends Group { export default class ibpLine extends Group {
constructor(device) { constructor(device) {
super(); super();
this.model = device.model; this.model = device.model;
this._type = device.model._type; this._type = device.model._type;
this._code = device.model.code; this._code = device.model.code;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.z = device.model.z; this.model.point = this.model.point1;
this.create(); this.z = device.model.z;
} this.create();
create() { }
const model = this.model; create() {
this.grouper=new Group({ const model = this.model;
id: model.code, this.grouper = new Group({
position: [model.point1.x, model.point1.y] id: model.code,
}); position: [model.point1.x, model.point1.y]
this.ibpLine = new Line({ });
zlevel: model.zlevel, this.ibpLine = new Line({
z: model.z, zlevel: model.zlevel,
draggable: false, z: model.z,
shape: { draggable: false,
x1: 0, shape: {
y1: 0, x1: 0,
x2: model.point2.x-model.point1.x, y1: 0,
y2: model.point2.y-model.point1.y x2: model.point2.x - model.point1.x,
}, y2: model.point2.y - model.point1.y
style: { },
lineWidth: this.model.lineWidth, style: {
stroke: this.model.fillColor lineWidth: this.model.lineWidth,
} stroke: this.model.fillColor
}); }
this.grouper.add(this.ibpLine); });
this.add(this.grouper); this.grouper.add(this.ibpLine);
} this.add(this.grouper);
setModel(dx, dy) { }
this.model.point1.x += dx; setModel(dx, dy) {
this.model.point1.y += dy; this.model.point1.x += dx;
this.model.point2.x += dx; this.model.point1.y += dy;
this.model.point2.y += dy; this.model.point2.x += dx;
} this.model.point2.y += dy;
}
} }

View File

@ -124,270 +124,271 @@ import { getUserinfoName, getUserinfoNickname, getUserinfoMobile, getUserinfoMob
import { setInterval, clearInterval } from 'timers'; import { setInterval, clearInterval } from 'timers';
export default { export default {
data() { data() {
return { return {
visible: false, visible: false,
userInfo: { userInfo: {
name: '', name: '',
nickname: '', nickname: '',
mobile: '', mobile: '',
email: '', email: '',
passWord: '' passWord: ''
}, },
editInfo: { editInfo: {
name: '', name: '',
nickname: '', nickname: '',
mobile: '', mobile: '',
email: '', email: '',
passWord: '' passWord: ''
}, },
nationCode: '86', nationCode: '86',
nameShow: true, nameShow: true,
nickNameShow: true, nickNameShow: true,
mobileShow: true, mobileShow: true,
emailShow: true, emailShow: true,
passwordShow: true, passwordShow: true,
mobileCode: null, mobileCode: null,
emailCode: null, emailCode: null,
passWordCode: null, passWordCode: null,
oldPassWord: null, oldPassWord: null,
newPassWord1: null, newPassWord1: null,
mobileCodeTime: 0, mobileCodeTime: 0,
emailCodeTime: 0, emailCodeTime: 0,
passWordCodeTime: 0, passWordCodeTime: 0,
emailTime: null, emailTime: null,
mobileTime: null, mobileTime: null,
passWordTime: null, passWordTime: null,
countryList: [ countryList: [
{ name: this.$t('global.china'), value: '86' }, { name: this.$t('global.china'), value: '86' },
{ name: this.$t('global.australia'), value: '61' }, { name: this.$t('global.australia'), value: '61' },
{ name: this.$t('global.england'), value: '44' }, { name: this.$t('global.england'), value: '44' },
{ name: this.$t('global.hongKong'), value: '852' }, { name: this.$t('global.hongKong'), value: '852' },
{ name: this.$t('global.Japanese'), value: '81' }, { name: this.$t('global.Japanese'), value: '81' },
{ name: this.$t('global.macao'), value: '853' }, { name: this.$t('global.macao'), value: '853' },
{ name: this.$t('global.singapore'), value: '65' }, { name: this.$t('global.singapore'), value: '65' },
{ name: this.$t('global.taiwan'), value: '886' }, { name: this.$t('global.taiwan'), value: '886' },
{ name: this.$t('global.america'), value: '1' } { name: this.$t('global.america'), value: '1' }
], ],
nationCodeInit: '86' // nationCodeInit: '86' //
}; };
}, },
computed: { computed: {
info() { info() {
return this.$store.state.user; return this.$store.state.user;
} }
}, },
methods: { methods: {
geTel(tel) { geTel(tel) {
const reg = /^(\d{3})\d{4}(\d{4})$/; const reg = /^(\d{3})\d{4}(\d{4})$/;
return tel.replace(reg, '$1****$2'); return tel.replace(reg, '$1****$2');
}, },
doShow() { doShow() {
this.visible = true; this.visible = true;
const token = getToken() || getDesignToken(); const token = getToken() || getDesignToken();
getInfo(token).then(response => { getInfo(token).then(response => {
const user = response.data; debugger;
this.userInfo = { const user = response.data;
name: user.name, this.userInfo = {
nickname: user.nickname, name: user.name,
mobile: user.mobile, nickname: user.nickname,
email: user.email, mobile: user.mobile,
passWord: '' email: user.email,
}; passWord: ''
this.oldPassWord = user.password; };
this.nationCode = user.nationCode ? user.nationCode : '86'; this.oldPassWord = user.password;
this.nationCodeInit = user.nationCode ? user.nationCode : '86'; this.nationCode = user.nationCode ? user.nationCode : '86';
}).catch(error => { this.nationCodeInit = user.nationCode ? user.nationCode : '86';
console.log(error, '请求个人信息失败'); }).catch(error => {
}); console.log(error, '请求个人信息失败');
}, });
doClose() { },
this.visible = false; doClose() {
}, this.visible = false;
switcherName() { },
this.editInfo.name = this.userInfo.name; switcherName() {
this.nameShow = !this.nameShow; this.editInfo.name = this.userInfo.name;
}, this.nameShow = !this.nameShow;
async saveName() { },
if (this.editInfo.name) { async saveName() {
try { if (this.editInfo.name) {
await getUserinfoName(this.info.id, this.editInfo.name); try {
this.userInfo.name = this.editInfo.name; await getUserinfoName(this.info.id, this.editInfo.name);
this.nameShow = !this.nameShow; this.userInfo.name = this.editInfo.name;
this.$store.commit('SET_NAME', this.editInfo.name); this.nameShow = !this.nameShow;
} catch (error) { this.$store.commit('SET_NAME', this.editInfo.name);
console.log(error, '错误'); } catch (error) {
} console.log(error, '错误');
} }
}, }
},
switcherNickname() { switcherNickname() {
this.editInfo.nickname = this.userInfo.nickname; this.editInfo.nickname = this.userInfo.nickname;
this.nickNameShow = !this.nickNameShow; this.nickNameShow = !this.nickNameShow;
}, },
async saveNickName() { async saveNickName() {
if (this.editInfo.nickname) { if (this.editInfo.nickname) {
try { try {
await getUserinfoNickname(this.info.id, this.editInfo.nickname); await getUserinfoNickname(this.info.id, this.editInfo.nickname);
this.userInfo.nickname = this.editInfo.nickname; this.userInfo.nickname = this.editInfo.nickname;
this.nickNameShow = !this.nickNameShow; this.nickNameShow = !this.nickNameShow;
this.$store.commit('SET_NICKNAME', this.editInfo.nickname); this.$store.commit('SET_NICKNAME', this.editInfo.nickname);
} catch (error) { } catch (error) {
console.log(error, '错误'); console.log(error, '错误');
} }
} }
}, },
switcherMobile() { switcherMobile() {
// this.editInfo.mobile = this.userInfo.mobile; // this.editInfo.mobile = this.userInfo.mobile;
this.mobileShow = !this.mobileShow; this.mobileShow = !this.mobileShow;
}, },
async saveMobile() { async saveMobile() {
if (this.editInfo.mobile && this.mobileCode) { if (this.editInfo.mobile && this.mobileCode) {
try { try {
const params = { const params = {
mobile: this.editInfo.mobile, mobile: this.editInfo.mobile,
nationCode: this.nationCode, nationCode: this.nationCode,
validCode: this.mobileCode validCode: this.mobileCode
}; };
await getUserinfoMobile(this.info.id, params); await getUserinfoMobile(this.info.id, params);
this.userInfo.mobile = this.editInfo.mobile; this.userInfo.mobile = this.editInfo.mobile;
this.nationCodeInit = this.nationCode; this.nationCodeInit = this.nationCode;
this.mobileShow = !this.mobileShow; this.mobileShow = !this.mobileShow;
this.mobileCode = null; this.mobileCode = null;
} catch (error) { } catch (error) {
this.$message.info(this.$t('global.codeError')); this.$message.info(this.$t('global.codeError'));
} }
} }
}, },
async sendMobileCode() { async sendMobileCode() {
const random = Math.floor((Math.random()*10000)+1); const random = Math.floor((Math.random() * 10000) + 1);
const timeCount = Date.parse(new Date()) / 1000; const timeCount = Date.parse(new Date()) / 1000;
const pass = `${timeCount}${this.nationCode}${this.editInfo.mobile}${random}`; const pass = `${timeCount}${this.nationCode}${this.editInfo.mobile}${random}`;
const param = { const param = {
mobile: this.editInfo.mobile, mobile: this.editInfo.mobile,
nationCode: this.nationCode, nationCode: this.nationCode,
rd: random, rd: random,
time: timeCount, time: timeCount,
token: md5(pass) token: md5(pass)
}; };
try { try {
this.mobileCodeTime = 30; this.mobileCodeTime = 30;
this.mobileTime = setInterval(() => { this.mobileTime = setInterval(() => {
this.mobileCodeTime--; this.mobileCodeTime--;
if (this.mobileCodeTime <= 0) { if (this.mobileCodeTime <= 0) {
this.mobileCodeTime = 0; this.mobileCodeTime = 0;
clearInterval(this.mobileTime); clearInterval(this.mobileTime);
this.mobileTime = null; this.mobileTime = null;
} }
}, 1000); }, 1000);
await getUserinfoMobileCode(param); await getUserinfoMobileCode(param);
} catch (error) { } catch (error) {
this.$message.info(this.$t('global.codeFaile')); this.$message.info(this.$t('global.codeFaile'));
} }
}, },
switcherEmail() { switcherEmail() {
// this.editInfo.email = this.userInfo.email; // this.editInfo.email = this.userInfo.email;
this.emailShow = !this.emailShow; this.emailShow = !this.emailShow;
}, },
async saveEmail() { async saveEmail() {
if (this.editInfo.email && this.emailCode) { if (this.editInfo.email && this.emailCode) {
try { try {
const params = { const params = {
email: this.editInfo.email, email: this.editInfo.email,
validCode: this.emailCode validCode: this.emailCode
}; };
await getUserinfoEmail(this.info.id, params); await getUserinfoEmail(this.info.id, params);
this.userInfo.email = this.editInfo.email; this.userInfo.email = this.editInfo.email;
this.emailShow = !this.emailShow; this.emailShow = !this.emailShow;
this.emailCode = null; this.emailCode = null;
} catch (error) { } catch (error) {
this.$message.info(this.$t('global.codeError')); this.$message.info(this.$t('global.codeError'));
} }
} }
}, },
async sendEmailCode() { async sendEmailCode() {
try { try {
this.emailCodeTime = 30; this.emailCodeTime = 30;
this.emailTime = setInterval(() => { this.emailTime = setInterval(() => {
this.emailCodeTime--; this.emailCodeTime--;
if (this.emailCodeTime <= 0) { if (this.emailCodeTime <= 0) {
this.emailCodeTime = 0; this.emailCodeTime = 0;
clearInterval(this.emailTime); clearInterval(this.emailTime);
this.emailTime = null; this.emailTime = null;
} }
}, 1000); }, 1000);
await getUserinfoEmailCode(this.editInfo.email); await getUserinfoEmailCode(this.editInfo.email);
} catch (error) { } catch (error) {
this.$message.info(this.$t('global.codeFaile')); this.$message.info(this.$t('global.codeFaile'));
} }
}, },
switcherPassWord() { switcherPassWord() {
this.passwordShow = !this.passwordShow; this.passwordShow = !this.passwordShow;
}, },
async savePassWord() { async savePassWord() {
if (this.newPassWord1.length <= 5) { if (this.newPassWord1.length <= 5) {
this.$message.info(this.$t('global.passWordLength')); this.$message.info(this.$t('global.passWordLength'));
} else { } else {
this.uploadPassword(); this.uploadPassword();
} }
}, },
async uploadPassword() { async uploadPassword() {
if (this.newPassWord1) { if (this.newPassWord1) {
// //
const param = { const param = {
password: md5(this.newPassWord1), password: md5(this.newPassWord1),
vfCode: this.passWordCode vfCode: this.passWordCode
}; };
try { try {
await getUserinfoPassword(this.info.id, param); await getUserinfoPassword(this.info.id, param);
this.passwordShow = !this.passwordShow; this.passwordShow = !this.passwordShow;
this.newPassWord1 = ''; this.newPassWord1 = '';
this.passWordCode = null; this.passWordCode = null;
} catch (error) { } catch (error) {
console.log(error, 11); console.log(error, 11);
} }
} else { } else {
this.$message.info(this.$t('global.passWordSome')); this.$message.info(this.$t('global.passWordSome'));
} }
}, },
async sendPassWordCode() { async sendPassWordCode() {
if (this.userInfo.mobile) { if (this.userInfo.mobile) {
const random = Math.floor((Math.random()*10000)+1); const random = Math.floor((Math.random() * 10000) + 1);
const timeCount = Date.parse(new Date()) / 1000; const timeCount = Date.parse(new Date()) / 1000;
const pass = `${timeCount}${this.nationCodeInit}${this.userInfo.mobile}${random}`; const pass = `${timeCount}${this.nationCodeInit}${this.userInfo.mobile}${random}`;
const param = { const param = {
mobile: this.userInfo.mobile, mobile: this.userInfo.mobile,
nationCode: this.nationCodeInit, nationCode: this.nationCodeInit,
rd: random, rd: random,
time: timeCount, time: timeCount,
token: md5(pass) token: md5(pass)
}; };
try { try {
this.passWordCodeTime = 30; this.passWordCodeTime = 30;
this.passWordTime = setInterval(() => { this.passWordTime = setInterval(() => {
this.passWordCodeTime--; this.passWordCodeTime--;
if (this.passWordCodeTime <= 0) { if (this.passWordCodeTime <= 0) {
this.passWordCodeTime = 0; this.passWordCodeTime = 0;
clearInterval(this.mobileTime); clearInterval(this.mobileTime);
this.passWordTime = null; this.passWordTime = null;
} }
}, 1000); }, 1000);
await getUserinfoMobileCode(param); await getUserinfoMobileCode(param);
} catch (error) { } catch (error) {
this.$message.info(this.$t('global.codeFaile')); this.$message.info(this.$t('global.codeFaile'));
} }
} else { } else {
this.passwordShow = !this.passwordShow; this.passwordShow = !this.passwordShow;
this.$message.info(this.$t('global.enterMobileNumber')); this.$message.info(this.$t('global.enterMobileNumber'));
} }
} }
} }
}; };
</script> </script>

View File

@ -218,6 +218,7 @@ function handleOperation(state, models) {
state.stepData.pop(); state.stepData.pop();
} }
state.stepData.unshift(list); state.stepData.unshift(list);
state.recoverStepData = [];
} }
} }

View File

@ -143,7 +143,7 @@ export default {
cityCode: row.cityCode, cityCode: row.cityCode,
mapId: row.mapId, mapId: row.mapId,
name: row.name, name: row.name,
prdCode: row.prdCode prdId: row.prdId
}; };
adminPublishLesson(params, row.id).then(response => { adminPublishLesson(params, row.id).then(response => {
this.loading = false; this.loading = false;

View File

@ -13,8 +13,7 @@
export default { export default {
name: 'ScriptOperate', name: 'ScriptOperate',
props: { props: {
title:{type:String, required:true}, title:{type:String, required:true}
type:{type:String, required:true}
}, },
data() { data() {
return { return {

View File

@ -87,7 +87,7 @@ export default {
endTime: '', endTime: '',
date: '' date: ''
}, },
prdCode: '', prdId: '',
mapId: '', mapId: '',
numberMessage: '', numberMessage: '',
PermissionType: '', PermissionType: '',
@ -149,7 +149,7 @@ export default {
changeSelectDate() { changeSelectDate() {
if (this.formModel.date) { if (this.formModel.date) {
this.isLoading = true; this.isLoading = true;
const data = {mapId:this.mapId, proCode:this.prdCode, startTime:this.formModel.date[0], endTime:this.formModel.date[1], type:this.PermissionType}; const data = {mapId:this.mapId, prdId:this.prdId, startTime:this.formModel.date[0], endTime:this.formModel.date[1], type:this.PermissionType};
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) { if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
data.lessonId = this.formModel.lessonId; data.lessonId = this.formModel.lessonId;
} }
@ -175,7 +175,7 @@ export default {
if (data) { if (data) {
this.formModel.lessonId = data.id; this.formModel.lessonId = data.id;
this.formModel.lessonName = data.name; this.formModel.lessonName = data.name;
this.prdCode = data.prdCode; this.prdId = data.prdId;
this.mapId = data.mapId; this.mapId = data.mapId;
this.PermissionType = data.PermissionType; this.PermissionType = data.PermissionType;
this.setTotalMax(); this.setTotalMax();

View File

@ -87,7 +87,7 @@ export default {
endTime: '', endTime: '',
date: '' date: ''
}, },
prdCode: '', prdId: '',
mapId: '', mapId: '',
numberMessage: '', numberMessage: '',
PermissionType: '', PermissionType: '',
@ -149,7 +149,7 @@ export default {
changeSelectDate() { changeSelectDate() {
if (this.formModel.date) { if (this.formModel.date) {
this.isLoading = true; this.isLoading = true;
const data = {mapId:this.mapId, proCode:this.prdCode, startTime:`${this.formModel.date[0]} 00:00:00`, endTime:`${this.formModel.date[1]} 23:59:59`, type:this.PermissionType}; const data = {mapId:this.mapId, prdId:this.prdId, startTime:`${this.formModel.date[0]} 00:00:00`, endTime:`${this.formModel.date[1]} 23:59:59`, type:this.PermissionType};
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) { if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
data.lessonId = this.formModel.lessonId; data.lessonId = this.formModel.lessonId;
} }
@ -175,7 +175,7 @@ export default {
if (data) { if (data) {
this.formModel.lessonId = data.id; this.formModel.lessonId = data.id;
this.formModel.lessonName = data.name; this.formModel.lessonName = data.name;
this.prdCode = data.prdCode; this.prdId = data.prdId;
this.mapId = data.mapId; this.mapId = data.mapId;
this.PermissionType = data.PermissionType; this.PermissionType = data.PermissionType;
this.setTotalMax(); this.setTotalMax();
@ -219,35 +219,6 @@ export default {
}); });
} }
}); });
// this.$refs.dataform.validateForm(() => {
// const model = {
// startTime: `${this.formModel.date[0]} 00:00:00`,
// endTime: `${this.formModel.date[1]} 23:59:59`,
// amount: this.formModel.total,
// permissionType: this.PermissionType
// };
// if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
// model['lessonId'] = this.formModel.lessonId;
// model['mapId'] = this.mapId;
// model['prdCode'] = this.prdCode;
// } else if (this.PermissionType == PermissionType.SIMULATION) {
// model['mapId'] = this.mapId;
// model['prdCode'] = this.prdCode;
// }
// //
// permissionTurnAdd(model).then(response => {
// const url = response.data;
// this.$emit('QrCodeShow', {
// url: url,
// title: this.$t('global.transferQrcode')
// });
// this.dialogVisible = false;
// this.$emit('initLoadPage');
// this.handleClose();
// }).catch(() => {
// this.$messageBox(this.$t('error.getTransferQrcodeFailed'));
// });
// });
}, },
close() { close() {
this.dialogVisible = false; this.dialogVisible = false;

View File

@ -46,98 +46,98 @@ import ConfirmDraft from './confirm';
import FinishDraft from './finish'; import FinishDraft from './finish';
export default { export default {
name: 'LessonDetail', name: 'LessonDetail',
components: { components: {
CommitDraft, CommitDraft,
ConfirmDraft, ConfirmDraft,
FinishDraft FinishDraft
}, },
data() { data() {
return { return {
active: -1, active: -1,
order: {}, order: {},
title: '', title: '',
finishStatus: '02', finishStatus: '02',
orderData: {}, orderData: {},
routeDict: { routeDict: {
0: 'commit', 0: 'commit',
1: 'confirm', 1: 'confirm',
2: 'finish' 2: 'finish'
} }
}; };
}, },
computed: { computed: {
systemName() { systemName() {
switch (this.$route.query.permissionType) { switch (this.$route.query.permissionType) {
case PermissionType.LESSON: return this.$t('global.coursePrice'); case PermissionType.LESSON: return this.$t('global.coursePrice');
case PermissionType.EXAM: return this.$t('global.testPrice'); case PermissionType.EXAM: return this.$t('global.testPrice');
case PermissionType.SIMULATION: return this.$t('global.simulationPrice'); case PermissionType.SIMULATION: return this.$t('global.simulationPrice');
case PermissionType.SCREEN: return this.$t('global.timeUnitPrice'); case PermissionType.SCREEN: return this.$t('global.timeUnitPrice');
} }
return ''; return '';
}, },
height() { height() {
if (/\/dp\//.test(this.$route.path) || if (/\/dp\//.test(this.$route.path) ||
/\/plan\//.test(this.$route.path)) { /\/plan\//.test(this.$route.path)) {
return this.$store.state.app.height; return this.$store.state.app.height;
} }
return this.$store.state.app.height - 61; return this.$store.state.app.height - 61;
} }
}, },
watch: { watch: {
$route(newVal) { $route(newVal) {
this.initLoadPage(); this.initLoadPage();
} }
}, },
mounted() { mounted() {
this.initLoadPage(); this.initLoadPage();
}, },
methods: { methods: {
// //
initLoadPage() { initLoadPage() {
const data = { const data = {
permissionType: this.$route.query.permissionType permissionType: this.$route.query.permissionType
}; };
if (this.$route.query.permissionType != '04') { if (this.$route.query.permissionType != '04') {
data['mapId'] = this.$route.query.mapId; data['mapId'] = this.$route.query.mapId;
data['prdCode'] = this.$route.query.prdCode; data['prdId'] = this.$route.query.prdId;
data['lessonId'] = this.$route.query.lessonId; data['lessonId'] = this.$route.query.lessonId;
} }
getCommodityDetailByParams(data).then(response => { getCommodityDetailByParams(data).then(response => {
this.active = 0; this.active = 0;
this.orderData = response.data; this.orderData = response.data;
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.failedCourse')); this.$messageBox(this.$t('tip.failedCourse'));
}); });
}, },
// //
commit(data) { commit(data) {
this.active = 1; this.active = 1;
this.order = data; this.order = data;
}, },
// //
confirm(data) { confirm(data) {
this.active = 2; this.active = 2;
this.finishStatus = data; this.finishStatus = data;
this.$refs.finish.createCountTimer(); this.$refs.finish.createCountTimer();
}, },
// //
finish(data) { finish(data) {
this.active = 0; this.active = 0;
const type = this.$route.query.permissionType; const type = this.$route.query.permissionType;
if (type === PermissionType.LESSON) { if (type === PermissionType.LESSON) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`, query: {lessonId: this.$route.query.lessonId, mapId: this.$route.query.mapId, prdCode: this.$route.query.prdCode}}); this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`, query: {lessonId: this.$route.query.lessonId, mapId: this.$route.query.mapId, prdId: this.$route.query.prdId}});
} else if (type === PermissionType.EXAM) { } else if (type === PermissionType.EXAM) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`}); this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
} else if (type === PermissionType.SCREEN) { } else if (type === PermissionType.SCREEN) {
this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` }); this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` });
} else if (type === PermissionType.SIMULATION) { } else if (type === PermissionType.SIMULATION) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.$route.query.subSystem}`, query: { mapId: this.$route.query.mapId} }); this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.$route.query.subSystem}`, query: { mapId: this.$route.query.mapId} });
} else { } else {
this.$router.replace({ path: `/` }); this.$router.replace({ path: `/` });
} }
} }
} }
}; };
</script> </script>

View File

@ -48,7 +48,7 @@ export default {
loading: true, loading: true,
buttonLoading: false, buttonLoading: false,
currentLessonId: '', currentLessonId: '',
currentPrdCode: '', currentPrdId: '',
productList: [], productList: [],
courseModel: { courseModel: {
id: '', id: '',
@ -57,7 +57,7 @@ export default {
skinCode: '', skinCode: '',
remarks: '', remarks: '',
prdType: '', prdType: '',
prdCode: '', prdId: '',
pmsList: [] pmsList: []
}, },
jointShow: false, jointShow: false,
@ -108,11 +108,11 @@ export default {
skinCode: resp.data.mapPrd.skinCode, skinCode: resp.data.mapPrd.skinCode,
remarks: resp.data.mapPrd.remarks, remarks: resp.data.mapPrd.remarks,
prdType: resp.data.mapPrd.prdType, prdType: resp.data.mapPrd.prdType,
prdCode: resp.data.mapPrd.code, prdId: resp.data.mapPrd.id,
pmsList: resp.data.permissionList || [], pmsList: resp.data.permissionList || [],
PermissionType: PermissionType.SIMULATION PermissionType: PermissionType.SIMULATION
}; };
this.currentPrdCode = resp.data.mapPrd.code; this.currentPrdId = resp.data.mapPrd.id;
if (resp.data.mapPrd.prdType === '03') { if (resp.data.mapPrd.prdType === '03') {
this.getJointTrainingList(); this.getJointTrainingList();
} }
@ -121,7 +121,7 @@ export default {
this.tryUser = 1; this.tryUser = 1;
const paras = { const paras = {
mapId: this.mapId, mapId: this.mapId,
prdCode: this.courseModel.prdCode, prdId: this.courseModel.prdId,
permissionType: PermissionType.SIMULATION permissionType: PermissionType.SIMULATION
}; };
@ -166,7 +166,7 @@ export default {
this.buttonLoading = true; this.buttonLoading = true;
const param = { const param = {
mapId: Number(this.mapId), mapId: Number(this.mapId),
prdCode: this.courseModel.prdCode prdId: this.courseModel.prdId
}; };
const res = await postCreateRoom(param); const res = await postCreateRoom(param);
if (res && res.code == 200) { if (res && res.code == 200) {
@ -212,9 +212,9 @@ export default {
}, },
jumpScheduling() { jumpScheduling() {
this.buttonLoading = true; this.buttonLoading = true;
const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode }; const data = { mapId: this.courseModel.mapId, prdId: this.currentPrdId };
schedulingNotify(data).then(resp => { schedulingNotify(data).then(resp => {
const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser }; const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdId, goodsId: this.goodsId, try: this.tryUser };
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query }); this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
@ -223,10 +223,10 @@ export default {
}); });
}, },
jump() { jump() {
const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode }; const data = { mapId: this.courseModel.mapId, mapPrdId: this.currentPrdId };
this.buttonLoading = true; this.buttonLoading = true;
simulationNotify(data).then(resp => { simulationNotify(data).then(resp => {
const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser }; const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdId, goodsId: this.goodsId, try: this.tryUser };
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query }); this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
@ -238,7 +238,7 @@ export default {
this.buttonLoading = true; this.buttonLoading = true;
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem } query: { permissionType: PermissionType.SIMULATION, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
}); });
}, },
transfer() { transfer() {

View File

@ -396,7 +396,7 @@ export default {
const resp = await getTrainingDetail(this.trainingId); const resp = await getTrainingDetail(this.trainingId);
if (resp && resp.code == 200) { if (resp && resp.code == 200) {
const detail = resp.data; const detail = resp.data;
const rest = await getProductDetail(detail.prdCode); const rest = await getProductDetail(detail.prdId);
if (rest && rest.code == 200) { if (rest && rest.code == 200) {
const data = rest.data; const data = rest.data;
await this.$store.dispatch('training/setPrdType', data.prdType); await this.$store.dispatch('training/setPrdType', data.prdType);

View File

@ -388,7 +388,7 @@ export default {
const resp = await getTrainingDetail(this.trainingId); const resp = await getTrainingDetail(this.trainingId);
if (resp && resp.code == 200) { if (resp && resp.code == 200) {
const detail = resp.data; const detail = resp.data;
const rest = await getProductDetail(detail.prdCode); const rest = await getProductDetail(detail.prdId);
if (rest && rest.code == 200) { if (rest && rest.code == 200) {
const data = rest.data; const data = rest.data;
await this.$store.dispatch('training/setPrdType', data.prdType); await this.$store.dispatch('training/setPrdType', data.prdType);

View File

@ -130,7 +130,7 @@ export default {
loadInitData() { loadInitData() {
const data = { const data = {
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
prdCode: this.$route.query.code, prdId: this.$route.query.code,
permissionType: PermissionType.SIMULATION permissionType: PermissionType.SIMULATION
}; };
getGoodsTryUse(data).then(res => { getGoodsTryUse(data).then(res => {

View File

@ -122,7 +122,7 @@ export default {
id: resp.data.id, id: resp.data.id,
name: resp.data.name, name: resp.data.name,
pmsList: resp.data.permissionList || [], pmsList: resp.data.permissionList || [],
prdCode: resp.data.prdCode, prdId: resp.data.prdId,
mapId: resp.data.mapId, mapId: resp.data.mapId,
PermissionType: PermissionType.EXAM, PermissionType: PermissionType.EXAM,
treeList: resp.data.examDefinitionList treeList: resp.data.examDefinitionList
@ -140,7 +140,7 @@ export default {
this.loading = true; this.loading = true;
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem } query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
}); });
}, },
checkCourse() { checkCourse() {

View File

@ -183,7 +183,7 @@ export default {
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => { getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`, path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdCode: res.data.prdCode, mapId: res.data.mapId } query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdId: res.data.prdId, mapId: res.data.mapId }
}); });
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.obtainCourseDetailsFailed')); this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));

View File

@ -98,7 +98,7 @@ export default {
}, },
detail: { detail: {
mapId: '', mapId: '',
prdCode: '' prdId: ''
} }
}; };
}, },
@ -175,7 +175,7 @@ export default {
loadTrainingList(data) { loadTrainingList(data) {
getLessonDetail({ id: data.lessonId }).then(resp => { getLessonDetail({ id: data.lessonId }).then(resp => {
this.detail.mapId = resp.data.mapId; this.detail.mapId = resp.data.mapId;
this.detail.prdCode = resp.data.prdCode; this.detail.prdId = resp.data.prdId;
this.chapterModel.lessonId = resp.data.id; this.chapterModel.lessonId = resp.data.id;
this.chapterModel.lessonName = resp.data.name; this.chapterModel.lessonName = resp.data.name;
if (data.type === 'Chapter') { if (data.type === 'Chapter') {

View File

@ -92,9 +92,9 @@ export default {
}, },
{ {
title: this.$t('lesson.product'), title: this.$t('lesson.product'),
prop: 'prdCode', prop: 'prdId',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); }, columnValue: (row) => { return this.$convertField(row.prdId, this.prdTypeList, ['code', 'name']); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
@ -147,7 +147,7 @@ export default {
}, },
async queryFunction(params) { async queryFunction(params) {
params['mapId'] = this.detail.mapId; params['mapId'] = this.detail.mapId;
params['prdCode'] = this.detail.prdCode; params['prdId'] = this.detail.prdId;
const res = await pageQueryTraining(params); const res = await pageQueryTraining(params);
this.trainings.forEach(ele => { this.trainings.forEach(ele => {
res.data.list.forEach(item => { res.data.list.forEach(item => {

View File

@ -20,13 +20,13 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.associatedProducts')" prop="prdCode"> <el-form-item :label="this.$t('lesson.associatedProducts')" prop="prdId">
<el-select v-model="courseModel.prdCode" :placeholder="$t('rules.pleaseSelect')" :disabled="isEdit"> <el-select v-model="courseModel.prdId" :placeholder="$t('rules.pleaseSelect')" :disabled="isEdit">
<el-option <el-option
v-for="(item,index) in productList" v-for="(item,index) in productList"
:key="index" :key="index"
:label="item.name" :label="item.name"
:value="item.code" :value="item.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -74,7 +74,7 @@ export default {
mapIdList: [], mapIdList: [],
courseModel: { courseModel: {
id: '', id: '',
prdCode: '', prdId: '',
product: [], product: [],
mapId: '', mapId: '',
name: '', name: '',
@ -94,7 +94,7 @@ export default {
mapId: [ mapId: [
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' } { required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
], ],
prdCode: [ prdId: [
{ required: true, message: this.$t('rules.selectAssociatedProduct'), trigger: 'change' } { required: true, message: this.$t('rules.selectAssociatedProduct'), trigger: 'change' }
], ],
remarks: [ remarks: [
@ -133,7 +133,7 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const model = { const model = {
prdCode: this.courseModel.prdCode, prdId: this.courseModel.prdId,
name: this.courseModel.name, name: this.courseModel.name,
mapId: this.courseModel.mapId, mapId: this.courseModel.mapId,
remarks: this.courseModel.remarks remarks: this.courseModel.remarks
@ -153,7 +153,7 @@ export default {
if (valid) { if (valid) {
const model = { const model = {
id: this.courseModel.id, id: this.courseModel.id,
prdCode: this.courseModel.prdCode, prdId: this.courseModel.prdId,
name: this.courseModel.name, name: this.courseModel.name,
mapId: this.courseModel.mapId, mapId: this.courseModel.mapId,
remarks: this.courseModel.remarks remarks: this.courseModel.remarks
@ -174,7 +174,7 @@ export default {
this.courseModel = { this.courseModel = {
id: data.id, id: data.id,
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
prdCode: data.prdCode, prdId: data.prdId,
name: data.name, name: data.name,
remarks: data.remarks remarks: data.remarks
}; };

View File

@ -35,7 +35,7 @@ export default {
id: '', id: '',
name: '', name: '',
mapId: '', mapId: '',
prdCode: '', prdId: '',
cityCode: '' cityCode: ''
} }
}; };
@ -68,7 +68,7 @@ export default {
id: model.id, id: model.id,
name: model.name, name: model.name,
mapId: this.$route.params.mapId, mapId: this.$route.params.mapId,
prdCode: model.prdCode, prdId: model.prdId,
cityCode: model.cityCode cityCode: model.cityCode
}; };
this.dialogShow = true; this.dialogShow = true;

View File

@ -15,13 +15,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode"> <el-form-item :label="this.$t('lesson.productType')" prop="prdId">
<el-select v-model="operateModel.prdCode" style="width: 300px" @change="prdChange"> <el-select v-model="operateModel.prdId" style="width: 300px" @change="prdChange">
<el-option <el-option
v-for="option in productList" v-for="option in productList"
:key="option.code" :key="option.id"
:label="option.name" :label="option.name"
:value="option.code" :value="option.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -147,7 +147,7 @@ export default {
name: '', name: '',
type: '', type: '',
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
prdCode: '', prdId: '',
operateType: [], operateType: [],
maxDuration: 0, maxDuration: 0,
minDuration: 0, minDuration: 0,
@ -167,7 +167,7 @@ export default {
mapId: [ mapId: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
], ],
prdCode: [ prdId: [
{ required: true, message: this.$t('rules.enterProductType'), trigger: 'change' } { required: true, message: this.$t('rules.enterProductType'), trigger: 'change' }
], ],
type: [ type: [
@ -212,7 +212,7 @@ export default {
this.loading = false; this.loading = false;
}, },
mapIdChoose(mapId) { mapIdChoose(mapId) {
this.operateModel.prdCode = ''; this.operateModel.prdId = '';
this.productList = []; this.productList = [];
if (mapId) { if (mapId) {
getCommodityMapProduct(mapId).then((response) => { getCommodityMapProduct(mapId).then((response) => {
@ -221,12 +221,12 @@ export default {
}); });
} }
}, },
async prdChange(prdCode) { async prdChange(prdId) {
this.trainingTypeMap = {}; this.trainingTypeMap = {};
this.operateModel.operateType = []; this.operateModel.operateType = [];
const mapIdObj = this.mapIdList.find(elem => { return elem.id === this.operateModel.mapId; }) || {}; const mapIdObj = this.mapIdList.find(elem => { return elem.id === this.operateModel.mapId; }) || {};
const prdTypeObj = this.productList.find(elem => { return elem.code === prdCode; }) || {}; const prdTypeObj = this.productList.find(elem => { return elem.id === prdId; }) || {};
const res = await getOperateTrainingList({ mapId: mapIdObj.id, productType: prdTypeObj.prdType }); const res = await getOperateTrainingList({ mapId: mapIdObj.id, productType: prdTypeObj.prdType });
if (res && res.code == 200) { if (res && res.code == 200) {
this.trainingTypeLists = res.data; this.trainingTypeLists = res.data;
@ -280,7 +280,7 @@ export default {
const data = { const data = {
mapId: this.operateModel.mapId, mapId: this.operateModel.mapId,
name: this.operateModel.name, name: this.operateModel.name,
prdCode: this.operateModel.prdCode, prdId: this.operateModel.prdId,
trainingType: this.operateModel.type, trainingType: this.operateModel.type,
operateType: this.operateModel.operateType operateType: this.operateModel.operateType
}; };
@ -298,7 +298,7 @@ export default {
const data = { const data = {
mapId: this.operateModel.mapId, mapId: this.operateModel.mapId,
name: this.operateModel.name, name: this.operateModel.name,
prdCode: this.operateModel.prdCode, prdId: this.operateModel.prdId,
trainingType: this.operateModel.type, trainingType: this.operateModel.type,
operateType: this.operateModel.operateType, operateType: this.operateModel.operateType,
remarks: this.operateModel.remarks, remarks: this.operateModel.remarks,
@ -319,7 +319,7 @@ export default {
const data = { const data = {
mapId: this.operateModel.mapId, mapId: this.operateModel.mapId,
name: this.operateModel.name, name: this.operateModel.name,
prdCode: this.operateModel.prdCode, prdId: this.operateModel.prdId,
trainingType: `${this.operateModel.type}`, trainingType: `${this.operateModel.type}`,
operateType: `${this.operateModel.operateType.join(',')}` operateType: `${this.operateModel.operateType.join(',')}`
}; };
@ -336,7 +336,7 @@ export default {
const data = { const data = {
name: this.operateModel.name, name: this.operateModel.name,
type: this.operateModel.type, type: this.operateModel.type,
prdCode: this.operateModel.prdCode, prdId: this.operateModel.prdId,
mapId: this.operateModel.mapId, mapId: this.operateModel.mapId,
operateType: this.operateModel.operateType[0], operateType: this.operateModel.operateType[0],
minDuration: this.operateModel.minDuration, minDuration: this.operateModel.minDuration,

View File

@ -44,7 +44,7 @@ export default {
queryForm: { queryForm: {
labelWidth: '120px', labelWidth: '120px',
queryObject: { queryObject: {
prdCode: { prdId: {
type: 'select', type: 'select',
label: this.$t('lesson.product'), label: this.$t('lesson.product'),
change: this.prdChoose, change: this.prdChoose,
@ -91,9 +91,9 @@ export default {
}, },
{ {
title: this.$t('lesson.product'), title: this.$t('lesson.product'),
prop: 'prdCode', prop: 'prdId',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); }, columnValue: (row) => { return this.$convertField(row.prdId, this.prdTypeList, ['code', 'name']); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
@ -155,13 +155,13 @@ export default {
await this.loadInitData(); await this.loadInitData();
const json = localStore.get(this.$route.path); const json = localStore.get(this.$route.path);
json.type = ''; json.type = '';
json.prdCode = ''; json.prdId = '';
json.operateType = ''; json.operateType = '';
}, },
methods: { methods: {
async loadInitData() { async loadInitData() {
this.mapIdList = []; this.mapIdList = [];
this.queryForm.queryObject.prdCode.config.data = []; this.queryForm.queryObject.prdId.config.data = [];
listPublishMap().then(response => { listPublishMap().then(response => {
this.mapIdList = response.data; this.mapIdList = response.data;
}); });
@ -171,7 +171,7 @@ export default {
productList.forEach(elem => { productList.forEach(elem => {
// //
if (elem.prdType != '03') { if (elem.prdType != '03') {
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.prdId.config.data.push({ value: elem.code, label: elem.name });
} }
}); });
} }

View File

@ -42,7 +42,7 @@ export default {
permissionType: '', permissionType: '',
mapId: '', mapId: '',
lessonId: '', lessonId: '',
prdCode: '', prdId: '',
date: '', date: '',
amount: 0, amount: 0,
ownerId: '', ownerId: '',
@ -67,7 +67,7 @@ export default {
items: [ items: [
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange }, { prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange },
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange }, { prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange },
{ prop: 'prdCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange }, { prop: 'prdId', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList }, { prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' }, { prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' }, { prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
@ -85,7 +85,7 @@ export default {
mapId: [ mapId: [
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' } { required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
], ],
prdCode: [ prdId: [
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' } { required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
], ],
lessonId: [ lessonId: [
@ -158,9 +158,9 @@ export default {
} }
var validator = {}; var validator = {};
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; }; validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdId; };
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; }; validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdId; };
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdCode; }; validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdId; };
validator[PermissionType.SCREEN] = () => { return true; }; validator[PermissionType.SCREEN] = () => { return true; };
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) { if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
@ -175,10 +175,10 @@ export default {
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) { if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode; model['prdId'] = this.formModel.prdId;
} else if (this.formModel.permissionType == PermissionType.SIMULATION) { } else if (this.formModel.permissionType == PermissionType.SIMULATION) {
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode; model['prdId'] = this.formModel.prdId;
} }
getTotalRemains(model).then(response => { getTotalRemains(model).then(response => {
@ -200,23 +200,23 @@ export default {
}, },
permissionTypeChange() { permissionTypeChange() {
this.formModel.mapId = ''; this.formModel.mapId = '';
this.formModel.prdCode = ''; this.formModel.prdId = '';
this.formModel.lessonId = ''; this.formModel.lessonId = '';
}, },
mapChange(mapId) { mapChange(mapId) {
this.formModel.prdCode = ''; this.formModel.prdId = '';
this.formModel.lessonId = ''; this.formModel.lessonId = '';
this.mapProductList = []; this.mapProductList = [];
getCommodityMapProduct(mapId).then(rest => { getCommodityMapProduct(mapId).then(rest => {
const list = rest.data || []; const list = rest.data || [];
this.mapProductList = list.map(elem => { this.mapProductList = list.map(elem => {
return { value: elem.code, label: elem.name }; return { value: elem.id, label: elem.name };
}); });
}); });
}, },
mapProductChange(prdCode) { mapProductChange(prdId) {
this.formModel.lessonId = ''; this.formModel.lessonId = '';
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.prdCode; }); this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdId == this.formModel.prdId; });
}, },
// input // input
async querySearchAsync(queryString, cb) { async querySearchAsync(queryString, cb) {
@ -256,7 +256,7 @@ export default {
permissionType: model.permissionType, permissionType: model.permissionType,
mapId: model.mapId, mapId: model.mapId,
lessonId: model.lessonId, lessonId: model.lessonId,
prdCode: model.prdCode, prdId: model.prdId,
date: [model.startTime, model.endTime], date: [model.startTime, model.endTime],
amount: model.amount, amount: model.amount,
ownerId: this.formModel.ownerId, ownerId: this.formModel.ownerId,
@ -278,7 +278,7 @@ export default {
permissionType: this.formModel.permissionType, permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '', mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '', lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '', prdId: this.isShowMapProduct ? this.formModel.prdId : '',
startTime: this.formModel.date[0], startTime: this.formModel.date[0],
endTime: this.formModel.date[1], endTime: this.formModel.date[1],
amount: this.formModel.amount, amount: this.formModel.amount,
@ -291,7 +291,7 @@ export default {
permissionType: this.formModel.permissionType, permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '', mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '', lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '', prdId: this.isShowMapProduct ? this.formModel.prdId : '',
startTime: this.formModel.date[0], startTime: this.formModel.date[0],
endTime: this.formModel.date[1], endTime: this.formModel.date[1],
amount: this.formModel.amount, amount: this.formModel.amount,

View File

@ -26,7 +26,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="mapProductCode" :label="$t('permission.mapProductName')" width="100"> <el-table-column prop="mapProductCode" :label="$t('permission.mapProductName')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ computedName(mapProductList, scope.row.prdCode) }} {{ computedName(mapProductList, scope.row.prdId) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lessonId" :label="$t('permission.lessonName')"> <el-table-column prop="lessonId" :label="$t('permission.lessonName')">
@ -171,7 +171,7 @@ export default {
getPublishLessonList().then(response => { getPublishLessonList().then(response => {
const list = response.data || []; const list = response.data || [];
this.PublisLessonList = list.map(elem => { this.PublisLessonList = list.map(elem => {
return { value: elem.id, label: elem.name, mapId: elem.mapId, prdCode: elem.prdCode }; return { value: elem.id, label: elem.name, mapId: elem.mapId, prdId: elem.prdId };
}); });
}); });
}, },
@ -194,7 +194,7 @@ export default {
const index = this.ruleList.findIndex(elem => { const index = this.ruleList.findIndex(elem => {
return item.mapId == elem.mapId && return item.mapId == elem.mapId &&
item.lessonId == elem.lessonId && item.lessonId == elem.lessonId &&
item.prdCode == elem.prdCode && item.prdId == elem.prdId &&
item.permissionType == elem.permissionType; item.permissionType == elem.permissionType;
}); });
getCommodityMapProduct(item.mapId).then(rest => { getCommodityMapProduct(item.mapId).then(rest => {

View File

@ -1,7 +1,6 @@
<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" />
<map-select ref="map" @confirm="handleGenerateEveryDay" />
<copy-plan ref="copyPlan" @confirm="handleCopyRunPlan" /> <copy-plan ref="copyPlan" @confirm="handleCopyRunPlan" />
</div> </div>
</template> </template>
@ -11,13 +10,11 @@ import { superAdmin } from '@/router';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate } from '@/api/runplan'; import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate } from '@/api/runplan';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import MapSelect from './mapSelect';
import CopyPlan from './copyPlan.vue'; import CopyPlan from './copyPlan.vue';
export default { export default {
name: 'RunPlanTemplate', name: 'RunPlanTemplate',
components: { components: {
MapSelect,
CopyPlan CopyPlan
}, },
data() { data() {
@ -132,16 +129,16 @@ export default {
}); });
}).catch(() => { }); }).catch(() => { });
}, },
// //
handleMapSelect(index, row) { handleMapSelect(index, row) {
this.$refs.map.doShow(row); this.handleGenerateEveryDay(row.id, row.mapId);
}, },
// //
handleCopyPlan(index, row) { handleCopyPlan(index, row) {
this.$refs.copyPlan.doShow(row); this.$refs.copyPlan.doShow(row);
}, },
// //
handleGenerateEveryDay({planId, mapId}) { handleGenerateEveryDay(planId, mapId) {
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), { this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
@ -149,7 +146,6 @@ export default {
}).then(() => { }).then(() => {
generateCommonRunPlanEveryDay(planId, {mapId}).then(response => { generateCommonRunPlanEveryDay(planId, {mapId}).then(response => {
this.reloadTable(); this.reloadTable();
this.$refs.map.doClose();
this.$message.success(this.$t('publish.createCommonSuccess')); this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => { }).catch(() => {
this.reloadTable(); this.reloadTable();

View File

@ -1,69 +0,0 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="30%" :before-close="doClose">
<el-form ref="form" :model="formMdoel" :rules="rules" label-width="140px">
<el-form-item :label="$t('publish.selectMap')" prop="mapId">
<el-select v-model="formMdoel.mapId">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="handleCofirm">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getPublishMapListByLineCode } from '@/api/jmap/map';
export default {
data() {
return {
show: false,
mapList: [],
formMdoel: {
planId: 0,
mapId: ''
}
};
},
computed: {
title() {
return this.$t('publish.selectMap');
},
rules() {
return {
mapId: [
{ required: true, message: this.$t('rules.mapInput'), trigger: 'blur' }
]
};
}
},
methods: {
doShow(row) {
this.formMdoel.planId = row.id;
this.formMdoel.mapId = '';
this.show = true;
getPublishMapListByLineCode(row.skinCode).then(resp => {
this.mapList = resp.data;
});
},
doClose(done) {
this.show = false;
},
handleCofirm() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$emit('confirm', this.formMdoel);
}
});
}
}
};
</script>

View File

@ -16,13 +16,6 @@
</template> </template>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item
:label="$t('map.productCode') + ':'"
prop="code"
:rules="node && node.data.type ==='Map' ? baseRules.code:{}"
>
<el-input v-model="addModel.code" :disabled="codeDisabled" />
</el-form-item>
<el-form-item :label="$t('map.productName') + ':'" prop="name" :rules="baseRules.name"> <el-form-item :label="$t('map.productName') + ':'" prop="name" :rules="baseRules.name">
<el-input v-model="addModel.name" /> <el-input v-model="addModel.name" />
</el-form-item> </el-form-item>
@ -79,7 +72,6 @@ export default {
skinCode: '', skinCode: '',
name: '', name: '',
remarks: '', remarks: '',
code: '',
prdType: '01', prdType: '01',
trainTypes: [] trainTypes: []
} }
@ -111,9 +103,6 @@ export default {
}, },
baseRules() { baseRules() {
return { return {
code: [
{ required: true, message: this.$t('rules.productCodeEnter'), trigger: 'change' }
],
name: [ name: [
{ required: true, message: this.$t('rules.productNameEnter'), trigger: 'change' } { required: true, message: this.$t('rules.productNameEnter'), trigger: 'change' }
], ],
@ -161,7 +150,6 @@ export default {
this.addModel.name = response.data.name; this.addModel.name = response.data.name;
this.addModel.remarks = response.data.remarks; this.addModel.remarks = response.data.remarks;
this.addModel.prdType = response.data.prdType; this.addModel.prdType = response.data.prdType;
this.addModel.code = response.data.code;
this.addModel.skinCode = response.data.skinCode; this.addModel.skinCode = response.data.skinCode;
this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes; this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes;
this.addModel.id = response.data.id; this.addModel.id = response.data.id;
@ -191,23 +179,14 @@ export default {
name: this.addModel.name, name: this.addModel.name,
remarks: this.addModel.remarks, remarks: this.addModel.remarks,
prdType: this.addModel.prdType, prdType: this.addModel.prdType,
code: this.addModel.code,
trainTypes: this.isShowTrainTypes ? this.addModel.trainTypes : [] trainTypes: this.isShowTrainTypes ? this.addModel.trainTypes : []
}; };
checkMapProductCodeExist({ code: this.addModel.code }).then(response => { createTrainingCategory(data).then(response => {
if (!response.data) { this.initTrainTypes = this.addModel.trainTypes;
createTrainingCategory(data).then(response => { this.$emit('refresh');
this.initTrainTypes = this.addModel.trainTypes; this.$message.success(this.$t('tip.productCreationSuccessfully'));
this.$emit('refresh'); }).catch((error) => {
this.$message.success(this.$t('tip.productCreationSuccessfully')); this.$message.error(`${this.$t('tip.productCreationFailed')}, ${error.message}`);
}).catch((error) => {
this.$message.error(`${this.$t('tip.productCreationFailed')}, ${error.message}`);
});
} else {
this.$message(this.$t('tip.productCodeExists'));
}
}).catch(() => {
this.$message(this.$t('tip.productCodeExists'));
}); });
} }
}); });

View File

@ -34,7 +34,7 @@ export default {
formModel:{ formModel:{
mapId:'', mapId:'',
name: '', name: '',
prdCode: '', prdId: '',
type: '', type: '',
id:null id:null
} }
@ -49,7 +49,7 @@ export default {
items: [ items: [
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true, options: this.projectList}, { prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true, options: this.projectList},
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList, change:true, onChange:this.changeMap}, { prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList, change:true, onChange:this.changeMap},
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true, options:this.productList}, { prop: 'prdId', label: this.$t('systemGenerate.prdName'), type: 'select', required: true, options:this.productList},
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true}, { prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true, options: this.typeList} { prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true, options: this.typeList}
] ]
@ -80,7 +80,7 @@ export default {
type:[ type:[
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'} { required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'}
], ],
prdCode:[ prdId:[
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'} { required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'}
] ]
}; };
@ -109,8 +109,8 @@ export default {
changeMap(index) { changeMap(index) {
this.productList = []; this.productList = [];
getCommodityMapProduct(index).then((response) => { getCommodityMapProduct(index).then((response) => {
this.productList = response.data.map(elem => { return { value: elem.code, label: elem.name }; }); this.productList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.formModel.prdCode = ''; this.formModel.prdId = '';
}); });
}, },
doShow(data) { doShow(data) {

View File

@ -4,8 +4,8 @@
<el-form-item :label="this.$t('lesson.trainingName')+':'" prop="name"> <el-form-item :label="this.$t('lesson.trainingName')+':'" prop="name">
<el-input v-model="operateModel.name" /> <el-input v-model="operateModel.name" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode"> <el-form-item :label="this.$t('lesson.productType')" prop="prdId">
<el-select v-model="operateModel.prdCode" placeholder="" :disabled="true"> <el-select v-model="operateModel.prdId" placeholder="" :disabled="true">
<el-option <el-option
v-for="option in productTypesList" v-for="option in productTypesList"
:key="option.code" :key="option.code"
@ -61,248 +61,248 @@ import { addTraining, updateTraining, getTrainingDetail } from '@/api/jmap/train
import localStore from 'storejs'; import localStore from 'storejs';
export default { export default {
name: 'TreeDraft', name: 'TreeDraft',
props: { props: {
node: { node: {
type: Object, type: Object,
required: true required: true
} }
}, },
data() { data() {
var minDurations = (rule, value, callback) => { var minDurations = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error(this.$t('rules.enterStandardTime'))); return callback(new Error(this.$t('rules.enterStandardTime')));
} }
setTimeout(() => { setTimeout(() => {
if (!Number.isInteger(value)) { if (!Number.isInteger(value)) {
callback(new Error(this.$t('rules.enterNumericValue'))); callback(new Error(this.$t('rules.enterNumericValue')));
} else { } else {
callback(); callback();
} }
}, 100); }, 100);
}; };
var maxDurations = (rule, value, callback) => { var maxDurations = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error(this.$t('rules.enterStandardTime'))); return callback(new Error(this.$t('rules.enterStandardTime')));
} }
setTimeout(() => { setTimeout(() => {
if (!Number.isInteger(value)) { if (!Number.isInteger(value)) {
callback(new Error(this.$t('rules.enterNumericValue'))); callback(new Error(this.$t('rules.enterNumericValue')));
} else { } else {
if (value < this.operateModel.minDuration) { if (value < this.operateModel.minDuration) {
callback(new Error(this.$t('rules.greaterThanMinTime'))); callback(new Error(this.$t('rules.greaterThanMinTime')));
} else { } else {
callback(); callback();
} }
} }
}, 100); }, 100);
}; };
return { return {
dialogShow: false, dialogShow: false,
productTypesList: [], productTypesList: [],
trainTypesList: [], trainTypesList: [],
operationList: [], operationList: [],
trainingOperateTypeMap: {}, trainingOperateTypeMap: {},
operation: { operation: {
title: '', title: '',
event: '' event: ''
}, },
operateModel: { operateModel: {
id: '', id: '',
name: '', name: '',
type: '', type: '',
prdCode: '', prdId: '',
skinCode: '', skinCode: '',
operateType: '', operateType: '',
maxDuration: 0, maxDuration: 0,
minDuration: 0, minDuration: 0,
remarks: '' remarks: ''
}, },
rules: { rules: {
name: [ name: [
{ required: true, message: this.$t('rules.inputTrainingName'), trigger: 'change' } { required: true, message: this.$t('rules.inputTrainingName'), trigger: 'change' }
], ],
minDuration: [ minDuration: [
{ required: true, validator: minDurations, trigger: 'blur' } { required: true, validator: minDurations, trigger: 'blur' }
], ],
maxDuration: [ maxDuration: [
{ required: true, validator: maxDurations, trigger: 'blur' } { required: true, validator: maxDurations, trigger: 'blur' }
], ],
remarks: [ remarks: [
{ required: true, message: this.$t('rules.inputTrainingRemark'), trigger: 'change' } { required: true, message: this.$t('rules.inputTrainingRemark'), trigger: 'change' }
] ]
} }
}; };
}, },
computed: { computed: {
}, },
watch: { watch: {
node: function (val, old) { node: function (val, old) {
this.initLoadData(); this.initLoadData();
} }
}, },
mounted() { mounted() {
this.$Dictionary.trainingType().then(list => { this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list; this.trainTypesList = list;
}); });
this.operationList = []; this.operationList = [];
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: {
initLoadData() { initLoadData() {
const node = this.node; const node = this.node;
if (this.$refs && this.$refs.form) { if (this.$refs && this.$refs.form) {
this.$refs['form'].resetFields(); this.$refs['form'].resetFields();
} }
if (node && node.data) { if (node && node.data) {
switch (node.data.type) { switch (node.data.type) {
case 'TrainingType': case 'TrainingType':
if (node.parent) { if (node.parent) {
this.operateModel.type = node.data.id; this.operateModel.type = node.data.id;
this.operateModel.prdCode = node.parent.data.id; this.operateModel.prdId = node.parent.data.id;
this.operateModel.skinCode = node.parent.parent.data.id; this.operateModel.skinCode = node.parent.parent.data.id;
this.productTypesList = [{ this.productTypesList = [{
code: node.parent.data.id, code: node.parent.data.id,
name: node.parent.data.name name: node.parent.data.name
}]; }];
} }
this.operateModel.id = ''; this.operateModel.id = '';
this.operateModel.name = ''; this.operateModel.name = '';
this.operateModel.minDuration = ''; this.operateModel.minDuration = '';
this.operateModel.maxDuration = ''; this.operateModel.maxDuration = '';
this.operateModel.remarks = ''; this.operateModel.remarks = '';
this.operateModel.operateType = ''; this.operateModel.operateType = '';
this.operationList = this.trainingOperateTypeMap[node.data.id] || []; this.operationList = this.trainingOperateTypeMap[node.data.id] || [];
break; break;
case 'Training': case 'Training':
if (node.parent && node.parent.parent) { if (node.parent && node.parent.parent) {
this.operateModel.type = node.parent.data.id; this.operateModel.type = node.parent.data.id;
this.operateModel.prdCode = node.parent.parent.data.id; this.operateModel.prdId = node.parent.parent.data.id;
this.operateModel.skinCode = node.parent.parent.parent.data.id; this.operateModel.skinCode = node.parent.parent.parent.data.id;
this.operationList = this.trainingOperateTypeMap[node.parent.data.id] || []; this.operationList = this.trainingOperateTypeMap[node.parent.data.id] || [];
this.productTypesList = [{ this.productTypesList = [{
code: node.parent.parent.data.id, code: node.parent.parent.data.id,
name: node.parent.parent.data.name name: node.parent.parent.data.name
}]; }];
} }
this.operateModel.id = node.data.id; this.operateModel.id = node.data.id;
this.operateModel.name = node.data.name; this.operateModel.name = node.data.name;
getTrainingDetail(node.data.id).then(response => { getTrainingDetail(node.data.id).then(response => {
this.operateModel.minDuration = response.data.minDuration; this.operateModel.minDuration = response.data.minDuration;
this.operateModel.maxDuration = response.data.maxDuration; this.operateModel.maxDuration = response.data.maxDuration;
this.operateModel.operateType = response.data.operateType; this.operateModel.operateType = response.data.operateType;
this.operateModel.remarks = response.data.remarks; this.operateModel.remarks = response.data.remarks;
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('error.obtainStepDataFailed')); this.$messageBox(this.$t('error.obtainStepDataFailed'));
}); });
break; break;
} }
} }
}, },
show(data) { show(data) {
this.operation = data; this.operation = data;
this.initLoadData(); this.initLoadData();
this.dialogShow = true; this.dialogShow = true;
}, },
close() { close() {
this.dialogShow = false; this.dialogShow = false;
}, },
handleDeal() { handleDeal() {
const operation = this.operation; const operation = this.operation;
if (operation) { if (operation) {
const event = operation.event; const event = operation.event;
switch (event) { switch (event) {
case '01': this.addTraining(); break; case '01': this.addTraining(); break;
case '02': this.edtTraining(); break; case '02': this.edtTraining(); break;
} }
} }
}, },
handleClose() { handleClose() {
this.dialogShow = false; this.dialogShow = false;
this.operateModel = { this.operateModel = {
id: '', id: '',
name: '', name: '',
type: '', type: '',
prdCode: '', prdId: '',
skinCode: '', skinCode: '',
operateType: '', operateType: '',
maxDuration: 0, maxDuration: 0,
minDuration: 0, minDuration: 0,
remarks: '' remarks: ''
}; };
this.$refs['form'].resetFields(); this.$refs['form'].resetFields();
}, },
addTraining() { addTraining() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const data = { const data = {
name: this.operateModel.name, name: this.operateModel.name,
type: this.operateModel.type, type: this.operateModel.type,
prdCode: this.operateModel.prdCode, prdId: this.operateModel.prdId,
skinCode: this.operateModel.skinCode, skinCode: this.operateModel.skinCode,
operateType: this.operateModel.operateType, operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration, minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration, maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks remarks: this.operateModel.remarks
}; };
addTraining(data).then(response => { addTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']); this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close(); this.close();
this.$message.success(this.$t('tip.addTrainingSuccessfully')); this.$message.success(this.$t('tip.addTrainingSuccessfully'));
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.addTrainingFailed')); this.$messageBox(this.$t('tip.addTrainingFailed'));
}); });
} }
}); });
}, },
edtTraining() { edtTraining() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const data = { const data = {
id: this.operateModel.id, id: this.operateModel.id,
name: this.operateModel.name, name: this.operateModel.name,
type: this.operateModel.type, type: this.operateModel.type,
prdCode: this.operateModel.prdCode, prdId: this.operateModel.prdId,
skinCode: this.operateModel.skinCode, skinCode: this.operateModel.skinCode,
operateType: this.operateModel.operateType, operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration, minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration, maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks remarks: this.operateModel.remarks
}; };
updateTraining(data).then(response => { updateTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']); this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close(); this.close();
this.$message.success(this.$t('tip.updateTrainingSuccessfully')); this.$message.success(this.$t('tip.updateTrainingSuccessfully'));
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.updateTrainingFailed')); this.$messageBox(this.$t('tip.updateTrainingFailed'));
}); });
} }
}); });
} }
} }
}; };
</script> </script>

View File

@ -94,7 +94,7 @@ export default {
// //
getTrainingDetail(this.trainingId).then(resp => { getTrainingDetail(this.trainingId).then(resp => {
const detail = resp.data; const detail = resp.data;
getProductDetail(detail.prdCode).then(rest => { getProductDetail(detail.prdId).then(rest => {
const data = rest.data; const data = rest.data;
debugger; debugger;
loadMapData(detail.skinCode).then(() => { loadMapData(detail.skinCode).then(() => {

View File

@ -27,7 +27,7 @@ export default {
dialogVisible: false, dialogVisible: false,
formModel: { formModel: {
mapId: '', mapId: '',
mapPrdCode: '', mapPrdId: '',
userId: '', userId: '',
userName: '', userName: '',
duration: '' duration: ''
@ -44,7 +44,7 @@ export default {
labelWidth: '120px', labelWidth: '120px',
items: [ items: [
{ prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') }, { prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') },
{ prop: 'mapPrdCode', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') }, { prop: 'mapPrdId', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') },
{ prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') }, { prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') },
{ prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' } { prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' }
] ]
@ -59,7 +59,7 @@ export default {
userName: [ userName: [
{ required: true, message: this.$t('rules.chooseUser'), trigger: 'change' } { required: true, message: this.$t('rules.chooseUser'), trigger: 'change' }
], ],
mapPrdCode: [ mapPrdId: [
{ required: true, message: this.$t('rules.productInput'), trigger: 'change' } { required: true, message: this.$t('rules.productInput'), trigger: 'change' }
], ],
duration: [ duration: [
@ -125,13 +125,13 @@ export default {
}, },
async mapChange(val) { async mapChange(val) {
this.mapPrdList = []; this.mapPrdList = [];
this.formModel.mapPrdCode = ''; this.formModel.mapPrdId = '';
try { try {
const res = await getCommodityMapProduct(val); const res = await getCommodityMapProduct(val);
const data = res.data; const data = res.data;
if (data && data.length) { if (data && data.length) {
data.forEach(elem => { data.forEach(elem => {
this.mapPrdList.push({ value: elem.code, label: elem.name }); this.mapPrdList.push({ value: elem.id, label: elem.name });
}); });
} }
} catch (error) { } catch (error) {
@ -151,7 +151,7 @@ export default {
const self = this; const self = this;
const params = { const params = {
mapId: this.formModel.mapId, mapId: this.formModel.mapId,
mapPrdCode: this.formModel.mapPrdCode, mapPrdId: this.formModel.mapPrdId,
userId: this.formModel.userId, userId: this.formModel.userId,
duration: parseInt(this.formModel.duration) duration: parseInt(this.formModel.duration)
}; };
@ -170,7 +170,7 @@ export default {
handleClose(done) { handleClose(done) {
this.formModel = { this.formModel = {
mapId: '', mapId: '',
mapPrdCode: '', mapPrdId: '',
userId: '', userId: '',
userName: '', userName: '',
duration: '' duration: ''

View File

@ -14,145 +14,145 @@ import { getPublishLessonList } from '@/api/jmap/lesson';
import UsersTrainingEdit from './edit'; import UsersTrainingEdit from './edit';
import UsersTrainingAdd from './add'; import UsersTrainingAdd from './add';
export default { export default {
name: 'UserTrainingEdit', name: 'UserTrainingEdit',
components: { components: {
UsersTrainingEdit, UsersTrainingEdit,
UsersTrainingAdd UsersTrainingAdd
}, },
data() { data() {
return { return {
examResultList: [], examResultList: [],
LessonList: [], LessonList: [],
mapList: [], mapList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '120px', labelWidth: '120px',
reset: true, reset: true,
queryObject: { queryObject: {
trainingName: { trainingName: {
type: 'text', type: 'text',
label: this.$t('system.trainingName') label: this.$t('system.trainingName')
}, },
userName: { userName: {
type: 'text', type: 'text',
label: this.$t('system.userName') label: this.$t('system.userName')
} }
} }
}, },
queryList: { queryList: {
query: getSimulationList, query: getSimulationList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: this.$t('system.userName'), title: this.$t('system.userName'),
prop: 'userName' prop: 'userName'
}, },
{ {
title: this.$t('global.mobile'), title: this.$t('global.mobile'),
prop: 'userMobile' prop: 'userMobile'
}, },
{ {
title: this.$t('system.mapName'), title: this.$t('system.mapName'),
prop: 'mapName' prop: 'mapName'
}, },
{ {
title: this.$t('system.trainingUseTime'), title: this.$t('system.trainingUseTime'),
prop: 'duration', prop: 'duration',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.computation(row.duration); }, columnValue: (row) => { return this.computation(row.duration); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: this.$t('system.productName'), title: this.$t('system.productName'),
prop: 'mapPrdName' prop: 'mapPrdName'
}, },
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '250', width: '250',
hide: (row) => { return !row.fake; }, hide: (row) => { return !row.fake; },
buttons: [ buttons: [
{ {
name: this.$t('global.edit'), name: this.$t('global.edit'),
handleClick: this.edit, handleClick: this.edit,
showControl: (row) => { return row.fake; } showControl: (row) => { return row.fake; }
}, },
{ {
name: this.$t('global.delete'), name: this.$t('global.delete'),
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger', type: 'danger',
showControl: (row) => { return row.fake; } showControl: (row) => { return row.fake; }
} }
] ]
} }
], ],
actions: [ actions: [
{ text: this.$t('global.add'), handler: this.createTraining } { text: this.$t('global.add'), handler: this.createTraining }
] ]
}, },
currentModel: {} currentModel: {}
}; };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
async loadInitData() { async loadInitData() {
const res = await listPublishMap(); const res = await listPublishMap();
this.mapList = res.data; this.mapList = res.data;
const response = await getPublishLessonList(); const response = await getPublishLessonList();
const data = response.data; const data = response.data;
if (data && data.length) { if (data && data.length) {
data.forEach(elem => { data.forEach(elem => {
this.LessonList.push({ value: elem.prdCode, name: elem.name }); this.LessonList.push({ value: elem.prdId, name: elem.name });
}); });
} }
}, },
createTraining() { createTraining() {
this.$refs.add.show(); this.$refs.add.show();
}, },
computation(fieldValue) { computation(fieldValue) {
if (fieldValue) { if (fieldValue) {
const f = parseInt(fieldValue / 60); const f = parseInt(fieldValue / 60);
const s = fieldValue % 60; const s = fieldValue % 60;
if (f > 0) { if (f > 0) {
return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`; return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`;
} else { } else {
return `${s} ${this.$t('system.second')}`; return `${s} ${this.$t('system.second')}`;
} }
} }
}, },
// //
edit(index, row) { edit(index, row) {
this.$refs.edit.show(row); this.$refs.edit.show(row);
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), { this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteSimulationStats(row.id).then(response => { deleteSimulationStats(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess')); this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable(); this.reloadTable();
}).catch(() => { }).catch(() => {
this.reloadTable(); this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed')); this.$messageBox(this.$t('error.deleteFailed'));
}); });
}); });
}, },
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();
} }
} }
}; };
</script> </script>

View File

@ -104,7 +104,7 @@ export default {
name: response.data.tree[0].name, name: response.data.tree[0].name,
pmsList: response.data.permissionList || [], pmsList: response.data.permissionList || [],
treeList: response.data.tree, treeList: response.data.tree,
prdCode: this.$route.query.prdCode, prdId: this.$route.query.prdId,
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
PermissionType: PermissionType.LESSON PermissionType: PermissionType.LESSON
}; };
@ -159,7 +159,7 @@ export default {
buy() { buy() {
this.$router.push({ this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query: path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
{ permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdCode: this.$route.query.prdCode, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem } { permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdId: this.$route.query.prdId, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
}); });
}, },
nodeExpand(obj, node, ele) { nodeExpand(obj, node, ele) {

View File

@ -57,8 +57,8 @@ export default {
} }
}, },
goLesson(row) { goLesson(row) {
localStore.set('teachDetail' + this.$route.params.subSystem, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdCode=${row.prdCode}`); localStore.set('teachDetail' + this.$route.params.subSystem, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdId=${row.prdId}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdCode: row.prdCode}}); this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdId: row.prdId}});
} }
} }
}; };

View File

@ -622,7 +622,7 @@ export default {
this.starting = res.data.state == '02'; this.starting = res.data.state == '02';
this.mapId = res.data.mapId; this.mapId = res.data.mapId;
this.prodId = res.data.mapPrdCode; this.prodId = res.data.mapPrdId;
this.roomInfo = { this.roomInfo = {
creatorId: res.data.creatorId, creatorId: res.data.creatorId,
totalNum: Number(res.data.permissionNum) + Number(res.data.audiencePermissionNum), totalNum: Number(res.data.permissionNum) + Number(res.data.audiencePermissionNum),