pull
@ -10,14 +10,6 @@ export function getLessonPermissonPageList(params) {
|
||||
});
|
||||
}
|
||||
|
||||
// 根据ID获取权限数据
|
||||
// export function getLessonPermissonDetail(id) {
|
||||
// return request({
|
||||
// url: `/api/permission/${id}`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 创建课程权限*/
|
||||
export function createLessonPermisson(data) {
|
||||
return request({
|
||||
@ -26,10 +18,19 @@ export function createLessonPermisson(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取权限详情*/
|
||||
export function getPermissonDetail(id) {
|
||||
return request({
|
||||
url: `/api/permission/${id}/package`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户某课程某段时间内可用的权限数量*/
|
||||
export function getTotalRemains(params) {
|
||||
return request({
|
||||
url: '/api/permission/totalRemains',
|
||||
url: '/api/userPermission/totalRemains',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
@ -37,7 +38,7 @@ export function getTotalRemains(params) {
|
||||
/** 设置权限失效或有效*/
|
||||
export function setLessonPermisson(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.id}/status`,
|
||||
url: `/api/userPermission/${data.id}/status`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -48,7 +49,7 @@ export function setLessonPermisson(data) {
|
||||
*/
|
||||
export function queryPermissionSimulation(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`,
|
||||
url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -56,38 +57,28 @@ export function queryPermissionSimulation(data) {
|
||||
/** 获取大屏权限列表*/
|
||||
export function queryPermissionScreen() {
|
||||
return request({
|
||||
url: `/api/permission/bigScreen`,
|
||||
url: `/api/userPermission/bigScreen`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新课程权限*/
|
||||
/*
|
||||
export function updateLessonPermisson(data) {
|
||||
return request({
|
||||
url: '/api/permission',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/** 删除课程权限*/
|
||||
/*
|
||||
export function deleteLessonPermisson(id) {
|
||||
return request({
|
||||
url: '/api/permission/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* 用户权限列表
|
||||
*/
|
||||
export function listPermision(params) {
|
||||
return request({
|
||||
url: `/api/userPermission`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人权限列表
|
||||
*/
|
||||
export function listUserPermision(params) {
|
||||
return request({
|
||||
url: `/api/permission/my`,
|
||||
url: `/api/userPermission/my`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
@ -101,10 +92,10 @@ export function getDistribute(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户权限列表 */
|
||||
/** 设置权限所有者 */
|
||||
export function putPermissionOwner(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.id}/owner`,
|
||||
url: `/api/userPermission/${data.id}/owner`,
|
||||
method: 'put',
|
||||
data: data.owner
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 上课权限获取*/
|
||||
/** 权限转增*/
|
||||
export function getLessons(data) {
|
||||
return request({
|
||||
url: '/api/distribute/getLessons',
|
||||
@ -9,15 +9,41 @@ export function getLessons(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 上课权限分发*/
|
||||
/** 权限分发*/
|
||||
export function giveLessons(data) {
|
||||
return request({
|
||||
url: '/api/distribute/givePermission',
|
||||
url: '/api/distribute/distribute',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限转增*/
|
||||
export function permissionTurnAdd(data) {
|
||||
return request({
|
||||
url: '/api/distribute/transfer',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 从订单分发权限(获取二维码)*/
|
||||
export function postDistribute(data) {
|
||||
return request({
|
||||
url: `/api/distribute/${data.code}/distribute`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限获取*/
|
||||
export function getPermission(state) {
|
||||
return request({
|
||||
url: `/api/distribute/getPermission?state=${state}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 接收课程权限*/
|
||||
export function receiveLessons(data) {
|
||||
return request({
|
||||
|
@ -66,7 +66,7 @@ export function getCommodityDetailById(id) {
|
||||
*/
|
||||
export function updataCommodityList(data) {
|
||||
return request({
|
||||
url: `/api/goods`,
|
||||
url: `/api/goods/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
|
@ -277,20 +277,14 @@ export function deleteRunPlanTemplate(planId) {
|
||||
}
|
||||
|
||||
/** 生成通用每日运行图*/
|
||||
export function generateCommonRunPlanEveryDay(planId) {
|
||||
export function generateCommonRunPlanEveryDay(planId, params) {
|
||||
return request({
|
||||
url: `/api/runPlan/template/generate/${planId}`,
|
||||
method: 'post'
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成用户每日运行图*/
|
||||
export function generateUserRunPlanEveryDay(planId, group) {
|
||||
return request({
|
||||
url: `/api/runPlan/daily/privilege/${planId}?group=${group}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 获取运行计划每日列表*/
|
||||
export function runPlanEveryDayList(params) {
|
||||
return request({
|
||||
@ -309,20 +303,12 @@ export function deleteRunPlanEveryDay(planId) {
|
||||
}
|
||||
|
||||
/** 获取地图运行图的车次号*/
|
||||
export function getPublishMapTrainNos(skinCode) {
|
||||
return request({
|
||||
url: `/api/runPlan/daily/${skinCode}/trainNos`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取服务号、车组号*/
|
||||
export function getPublishMapTrainServerNos(skinCode) {
|
||||
return request({
|
||||
url: `/api/runPlan/daily/${skinCode}/serverNos`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// export function getPublishMapTrainNos(skinCode) {
|
||||
// return request({
|
||||
// url: `/api/runPlan/daily/${skinCode}/trainNos`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 分页查询加载计划*/
|
||||
export function getRunPlanLoadList(params) {
|
||||
@ -374,3 +360,11 @@ export function queryRunPlanDaily(planId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取模板运行图列表*/
|
||||
export function listAllTempLateRunPlan() {
|
||||
return request({
|
||||
url: `/api/runPlan/template/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
46
src/api/scheduling.js
Normal file
@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function querySecheduling(group, params) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/day`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function generateScheduling(group, params) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/generate`,
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function getSchedulingAllTrains(group) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/train/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function checkScheduling(group) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/check`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
export function saveScheduling(group, data) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/save`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function generateSchedulingAgain(group) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/rebuild`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
@ -160,14 +160,6 @@ export function getEveryDayRunPlanData(group) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成手机同步仿真二维码*/
|
||||
// export function getSimulationQrCodeUrl(group) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/qrCode`,
|
||||
// method: 'post'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 录制脚本仿真*/
|
||||
export function scriptRecordNotify(scriptId) {
|
||||
return request({
|
||||
@ -239,7 +231,7 @@ export function selectScriptMembers(group, data) {
|
||||
export function modifyScriptMemberSex(group, playerId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
|
||||
method: 'put',
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
@ -293,85 +285,6 @@ export function modifyScriptAction(group, actionId, data) {
|
||||
});
|
||||
}
|
||||
|
||||
// /** 根据成员角色查询设备列表*/
|
||||
// export function getDevicesByRole(group, params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/role/devices`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
// /** 获取任务录制的成员角色列表 */
|
||||
// export function getMembersByGroup(group) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/members`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 添加任务角色成员 */
|
||||
// export function postQuestMember(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 删除任务角色成员 */
|
||||
// export function deleteQuestMember(group, memberId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member/${memberId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
// // /** 添加/修改任务角色行为 */
|
||||
// export function postMemberBehavior(group, memberId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为 */
|
||||
// export function deleteMemberBehavior(group, memberId, behaviorId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为动作 */
|
||||
// export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务角色行为动作 */
|
||||
// export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务目标条件*/
|
||||
// export function postTargetConditionAction(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务目标条件*/
|
||||
// export function deleteTargetConditionAction(group, tcId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 分页查询存在的仿真 */
|
||||
export function getExistingSimulation(params) {
|
||||
return request({
|
||||
@ -396,14 +309,6 @@ export function getDeviceCodeByDeviceType(group, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
// /** 根据设备类型获取设备条件列表 */
|
||||
// export function getDeviceCoditionByDeviceType(params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/deviceType/conditions`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 获取任务录制的数据 */
|
||||
export function getScriptRecord(group) {
|
||||
@ -486,3 +391,20 @@ export function executeScript(group) {
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成用户自己的当日运行图*/
|
||||
export function generateDayRunPlan(planId, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建排班计划仿真*/
|
||||
export function schedulingNotify(params) {
|
||||
return request({
|
||||
url: `/api/scheduling/simulation`,
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
BIN
src/assets/ibp_images/appendage_box.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 5.0 MiB After Width: | Height: | Size: 13 MiB |
BIN
src/assets/ibp_images/key.png
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
src/assets/ibp_images/key_on.png
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
src/assets/ibp_images/keyhole.png
Normal file
After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 13 KiB |
@ -63,8 +63,7 @@
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="column.tagType(scope.row, scope.$index)">{{ column.columnValue(scope.row,
|
||||
scope.$index) }}</el-tag>
|
||||
<el-tag v-if="column.columnValue(scope.row, scope.$index)" :type="column.tagType(scope.row, scope.$index)">{{ column.columnValue(scope.row, scope.$index) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
@ -13,7 +13,7 @@ export default {
|
||||
trainingRule: 'Training rules',
|
||||
trainingManage: 'Training management',
|
||||
taskManage: 'Task management',
|
||||
scriptManage: 'Script management',
|
||||
scriptManage: 'Script',
|
||||
|
||||
teachSystem: 'Teaching',
|
||||
|
||||
@ -28,13 +28,14 @@ export default {
|
||||
replayManage: 'Playback',
|
||||
|
||||
permissionManage: 'Permission',
|
||||
selfPermission: 'My Permission',
|
||||
|
||||
pulishManage: 'Publication',
|
||||
publishMapManage: 'Publishing map management',
|
||||
productStateManage: 'Product state management',
|
||||
publishLessonManage: 'Publishing lesson management',
|
||||
runPlanTemplateManage: 'Template plan management',
|
||||
runPlanCommonManage: 'General plan management',
|
||||
runPlanCommonManage: 'Loading Plan Managemen',
|
||||
runPlanEveryDayManage: 'Daily plan Management',
|
||||
examRuleManage: 'Management of examination rules',
|
||||
|
||||
@ -43,6 +44,7 @@ export default {
|
||||
orderManage: 'Order management',
|
||||
authorityManage: 'authority management',
|
||||
authorityTransferManage: 'Privilege distribution management',
|
||||
userRulesManage: 'User Rights Statistics',
|
||||
addCommodity: 'Adding goods',
|
||||
addOrder: 'Adding orders',
|
||||
addCoursePermissions: 'Adding course permissions',
|
||||
|
@ -46,7 +46,7 @@ export default {
|
||||
renew: '续费',
|
||||
productName: '产品名称',
|
||||
recovery: '回收',
|
||||
permissionPack: '权限包',
|
||||
permissionPack: '包权限',
|
||||
privilegeTransferQRCode: '权限转赠二维码',
|
||||
generatingQRCode: '生成二维码',
|
||||
transferQRCode: '转赠二维码',
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
permissionStatus: '权限状态',
|
||||
permissionUseType: '公用/专用',
|
||||
permissionTotal: '权限总数',
|
||||
permissionRemains: '生于权限',
|
||||
permissionRemains: '剩余权限',
|
||||
isForever: '是否永久',
|
||||
startTime: '开始时间',
|
||||
endTime: '结束时间',
|
||||
|
@ -28,13 +28,14 @@ export default {
|
||||
replayManage: '回放管理',
|
||||
|
||||
permissionManage: '权限管理',
|
||||
selfPermission: '我的权限',
|
||||
|
||||
pulishManage: '发布内容管理',
|
||||
publishMapManage: '发布地图管理',
|
||||
productStateManage: '产品状态管理',
|
||||
publishLessonManage: '发布课程管理',
|
||||
runPlanTemplateManage: '模板运行图管理',
|
||||
runPlanCommonManage: '通用运行图管理',
|
||||
runPlanCommonManage: '加载计划运行图管理',
|
||||
runPlanEveryDayManage: '每日运行图管理',
|
||||
examRuleManage: '试题规则管理',
|
||||
|
||||
@ -43,6 +44,7 @@ export default {
|
||||
orderManage: '订单管理',
|
||||
authorityManage: '权限管理',
|
||||
authorityTransferManage: '权限分发管理',
|
||||
userRulesManage: '用户权限统计',
|
||||
addCommodity: '添加商品',
|
||||
addOrder: '添加订单',
|
||||
addCoursePermissions: '添加课程权限',
|
||||
@ -51,9 +53,9 @@ export default {
|
||||
dataDictionary: '数据字典',
|
||||
dataDictionaryDetails: '数据字典明细',
|
||||
userManage: '用户管理',
|
||||
userTrainingManage: '用户实训管理',
|
||||
userExamManage: '用户考试管理',
|
||||
userSimulationManage: '用户仿真管理',
|
||||
userTrainingManage: '用户实训统计',
|
||||
userExamManage: '用户考试统计',
|
||||
userSimulationManage: '用户仿真统计',
|
||||
existingSimulation: '存在仿真管理',
|
||||
|
||||
ibpDraw: 'Ibp盘绘制'
|
||||
|
@ -4,31 +4,31 @@ const deviceRender = {};
|
||||
|
||||
/** IbpText渲染配置*/
|
||||
deviceRender[deviceType.IbpText] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** SquareButton渲染配置*/
|
||||
deviceRender[deviceType.SquareButton] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** WarnButton渲染配置*/
|
||||
deviceRender[deviceType.WarnButton] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Arrow渲染配置*/
|
||||
deviceRender[deviceType.Arrow] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** RotatingButton渲染配置*/
|
||||
deviceRender[deviceType.RotatingButton] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Tip渲染配置*/
|
||||
deviceRender[deviceType.Tip] = {
|
||||
/** TipBox渲染配置*/
|
||||
deviceRender[deviceType.TipBox] = {
|
||||
zlevel: 1
|
||||
};
|
||||
|
||||
@ -39,6 +39,32 @@ deviceRender[deviceType.Background] = {
|
||||
|
||||
/** CircularLamp渲染配置 */
|
||||
deviceRender[deviceType.CircularLamp] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** AppendageBox渲染配置 */
|
||||
deviceRender[deviceType.AppendageBox] = {
|
||||
zlevel: 1
|
||||
};
|
||||
|
||||
/** IbpLine渲染配置 */
|
||||
deviceRender[deviceType.IbpLine] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Elevator 渲染配置 */
|
||||
deviceRender[deviceType.Elevator] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Key 渲染配置 */
|
||||
deviceRender[deviceType.Key] = {
|
||||
zlevel: 3
|
||||
};
|
||||
|
||||
/** TeleTerminal 渲染配置 */
|
||||
deviceRender[deviceType.TeleTerminal] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -1,12 +1,17 @@
|
||||
const deviceType = {
|
||||
IbpText: 'IbpText',
|
||||
SquareButton: 'SquareButton',
|
||||
WarnButton: 'WarnButton',
|
||||
Arrow: 'Arrow',
|
||||
RotatingButton: 'RotatingButton',
|
||||
Tip: 'Tip',
|
||||
TipBox: 'TipBox',
|
||||
Background: 'Background',
|
||||
CircularLamp: 'CircularLamp'
|
||||
CircularLamp: 'CircularLamp',
|
||||
IbpLine: 'IbpLine',
|
||||
AppendageBox: 'AppendageBox',
|
||||
Alarm: 'Alarm',
|
||||
Elevator: 'Elevator',
|
||||
Key: 'Key',
|
||||
TeleTerminal: 'TeleTerminal'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -7,6 +7,7 @@ import Painter from './painter';
|
||||
import deviceState from '../jmap/constant/deviceState';
|
||||
import deviceType from './constant/deviceType';
|
||||
import {calculateDCenter, createBoundingRect, modelFactory} from './utils/parser';
|
||||
import { updateIbpData } from './utils/parser';
|
||||
|
||||
const renderer = 'canvas';
|
||||
const devicePixelRatio = 1;
|
||||
@ -122,15 +123,16 @@ class IbpPan {
|
||||
}
|
||||
|
||||
render(list) {
|
||||
console.log('-*-*-*-*-', list);
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
updateIbpData(elem);
|
||||
const oDevice = this.ibpDevice[code] || {instance: null, event: null, model: modelFactory(type, elem)};
|
||||
const nDevice = Object.assign(oDevice.model || {}, elem);
|
||||
const nDevice = {instance: null, event: null, model: Object.assign(oDevice.model || {}, elem)};
|
||||
this.$painter.delete(oDevice);
|
||||
if (!elem._dispose) {
|
||||
this.ibpDevice[code] = nDevice;
|
||||
console.log('--3', nDevice);
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
});
|
||||
@ -221,6 +223,7 @@ class IbpPan {
|
||||
}
|
||||
|
||||
resize(opt) {
|
||||
console.log('----------',this.$ibpZr);
|
||||
this.$ibpZr.resize(opt);
|
||||
this.$painter.updateZrSize(opt);
|
||||
}
|
||||
|
@ -61,8 +61,10 @@ class Painter {
|
||||
add(device) {
|
||||
device = Object.assign(device, { event: this.$ibp.$mouseController });
|
||||
const instance = shapefactory(device, this.$ibp);
|
||||
console.log('--4', instance);
|
||||
if (instance) {
|
||||
device.instance = instance;
|
||||
instance.setDraggable();
|
||||
this.$transformHandle.transformView(instance);
|
||||
this.ibpInstanceLevel[device.model._type].add(instance);
|
||||
}
|
||||
|
@ -1,13 +1,18 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import alarmpic from '@/assets/ibp_images/alarm.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class alarm extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -20,14 +25,13 @@ export default class alarm extends Group {
|
||||
image: alarmpic,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 71,
|
||||
height: 74
|
||||
width: model.width,
|
||||
height: model.width/71*74
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
@ -36,7 +40,7 @@ export default class alarm extends Group {
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.imageBg.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
@ -47,6 +51,12 @@ export default class alarm extends Group {
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -54,7 +64,11 @@ export default class alarm extends Group {
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
this.draggable = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
63
src/ibp/shape/appendageBox.js
Normal file
@ -0,0 +1,63 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import AppendageBoxImage from '@/assets/ibp_images/appendage_box.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class AppendageBox extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
this.appendageBox = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: AppendageBoxImage,
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
}
|
||||
});
|
||||
this.add(this.appendageBox);
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.appendageBox.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -2,12 +2,16 @@ import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import {arrow} from '@/jmap/shape/utils/ShapePoints';
|
||||
// import { updateIbpData } from '@/ibp/utils/parser';
|
||||
import store from '@/store';
|
||||
|
||||
class Arrow extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -16,13 +20,12 @@ class Arrow extends Group {
|
||||
this.arrow = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: model.draggable || false,
|
||||
draggable: false,
|
||||
shape: {
|
||||
points: arrow(this.model.point.x, this.model.point.y, this.model.length, 10)
|
||||
points: arrow(this.model.point.x, this.model.point.y, this.model.length, this.model.width)
|
||||
},
|
||||
style: {
|
||||
stroke: model.stroke,
|
||||
lineWidth: model.lineWidth,
|
||||
fill: model.fill
|
||||
}
|
||||
});
|
||||
@ -36,6 +39,14 @@ class Arrow extends Group {
|
||||
this.transformRotation(0);
|
||||
break;
|
||||
}
|
||||
case 'top': {
|
||||
this.transformRotation(90);
|
||||
break;
|
||||
}
|
||||
case 'bottom': {
|
||||
this.transformRotation(270);
|
||||
break;
|
||||
}
|
||||
case 'right': {
|
||||
this.transformRotation(180);
|
||||
break;
|
||||
@ -63,18 +74,23 @@ class Arrow extends Group {
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
console.log('鼠标移动');
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
console.log('鼠标抬起', this.model);
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ export default class background extends Group {
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.imageBg = new Image({
|
||||
this.imageBg1 = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
@ -23,6 +23,17 @@ export default class background extends Group {
|
||||
height: 1024
|
||||
}
|
||||
});
|
||||
this.imageBg2 = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: 2048,
|
||||
y: 0,
|
||||
image: ibpBg,
|
||||
width: 2048,
|
||||
height: 1024
|
||||
}
|
||||
});
|
||||
this.tailorRect = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -37,15 +48,8 @@ export default class background extends Group {
|
||||
}
|
||||
tailorBgImage() {
|
||||
// this.imageBg.setClipPath(this.tailorRect);
|
||||
this.add(this.imageBg);
|
||||
}
|
||||
setInitialPosition(opt) {
|
||||
const x = this.imageBg.style.x;
|
||||
const y = this.imageBg.style.y;
|
||||
this.imageBg.setStyle('x', x-opt.offsetX);
|
||||
this.imageBg.setStyle('y', y-opt.offsetY);
|
||||
this.tailorRect.setShape('x', x-opt.offsetX);
|
||||
this.tailorRect.setShape('y', y-opt.offsetY);
|
||||
this.add(this.imageBg1);
|
||||
this.add(this.imageBg2);
|
||||
}
|
||||
setDraggable() {
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import yellowButtonPic from '@/assets/ibp_images/yellow_button.png';
|
||||
import yellowButtonPicOn from '@/assets/ibp_images/yellow_button_on.png';
|
||||
import grayButtonPic from '@/assets/ibp_images/gray_button.png';
|
||||
import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class button extends Group {
|
||||
static colors = new Map([
|
||||
@ -29,6 +30,10 @@ export default class button extends Group {
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -74,17 +79,17 @@ export default class button extends Group {
|
||||
setState(model) {
|
||||
switch (model.status) {
|
||||
case 'on': {
|
||||
// 关闭
|
||||
this.close();
|
||||
// 开放
|
||||
this.open();
|
||||
this.model.status='on';
|
||||
break;
|
||||
}
|
||||
case 'off': {
|
||||
// 开放
|
||||
this.open();
|
||||
// 关闭
|
||||
this.close();
|
||||
this.model.status='off';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,17 +110,24 @@ export default class button extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
console.log('鼠标抬起', this.model);
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
|
||||
}
|
||||
// 关闭
|
||||
close() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
import store from '@/store';
|
||||
|
||||
export default class CircularLamp extends Group {
|
||||
constructor(device) {
|
||||
@ -8,6 +9,9 @@ export default class CircularLamp extends Group {
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -15,7 +19,7 @@ export default class CircularLamp extends Group {
|
||||
this.lamp = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: this.model.draggable||false,
|
||||
draggable: false,
|
||||
shape: {
|
||||
cx: this.model.point.x,
|
||||
cy: this.model.point.y,
|
||||
@ -40,15 +44,22 @@ export default class CircularLamp extends Group {
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
console.log('鼠标移动');
|
||||
}
|
||||
mouseup() {
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
console.log('鼠标抬起');
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
128
src/ibp/shape/elevator.js
Normal file
@ -0,0 +1,128 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import ElevatorBack from './elevatorBack';
|
||||
import ElevatorArrow from './elevatorArrow';
|
||||
import store from '@/store';
|
||||
|
||||
export default class elevator extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
|
||||
this.grouper=new Group({
|
||||
id: '111',
|
||||
// width: model.width,
|
||||
// height: model.height,
|
||||
position: [model.point.x, model.point.y],
|
||||
draggable: model.draggable || false
|
||||
});
|
||||
|
||||
this.elevatorBack = new ElevatorBack({model: {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// model.draggable ||
|
||||
draggable: false,
|
||||
point: {
|
||||
x: model.point.x,
|
||||
y: model.point.y
|
||||
},
|
||||
width: model.width,
|
||||
height: model.height,
|
||||
fillColor: model.fillColor ||'#313131',
|
||||
stroke: model.fillColor ||'#313131',
|
||||
lineWidth: 0
|
||||
}
|
||||
});
|
||||
|
||||
this.elevatorArrowTop=new ElevatorArrow({model: {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
point: {
|
||||
x: model.width/6*4.7,
|
||||
y: model.height/8*0.1
|
||||
},
|
||||
width: model.width/6*0.8,
|
||||
status: this.getStatus('top'),
|
||||
orientation: 'top'
|
||||
}});
|
||||
|
||||
this.elevatorArrowBottom=new ElevatorArrow({model: {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
point: {
|
||||
x: model.width/6*1.3,
|
||||
y: model.height/8*7.9
|
||||
},
|
||||
width: model.width/6*0.8,
|
||||
status: this.getStatus('bottom'),
|
||||
orientation: 'bottom'
|
||||
}});
|
||||
|
||||
this.grouper.add(this.elevatorBack);
|
||||
this.grouper.add(this.elevatorArrowTop);
|
||||
this.grouper.add(this.elevatorArrowBottom);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
|
||||
getStatus(status) {
|
||||
if (this.model.direction=='none') {
|
||||
return 'off';
|
||||
} else {
|
||||
return status==this.model.direction? 'on':'off';
|
||||
}
|
||||
}
|
||||
|
||||
setStatus(model) {
|
||||
if (model.direction=='none') {
|
||||
this.elevatorArrowBottom.setStatus('off');
|
||||
this.elevatorArrowTop.setStatus('off');
|
||||
} else if (model.direction=='top') {
|
||||
this.elevatorArrowBottom.setStatus('off');
|
||||
this.elevatorArrowTop.setStatus('on');
|
||||
} else if (model.direction=='bottom') {
|
||||
this.elevatorArrowBottom.setStatus('on');
|
||||
this.elevatorArrowTop.setStatus('off');
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.grouper.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.draggroup =this.grouper;
|
||||
this.deltPostion =[e.event.zrX-this.draggroup.position[0], e.event.zrY-this.draggroup.position[1]];
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
if (this.draggroup !=null) {
|
||||
var new_pos =[e.event.zrX, e.event.zrY];
|
||||
this.draggroup.position=[new_pos[0]-this.deltPostion[0], new_pos[1]-this.deltPostion[1]];
|
||||
this.draggroup.dirty();
|
||||
}
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.draggroup=null;
|
||||
}
|
||||
}
|
@ -16,7 +16,8 @@ export default class elevatorArrow extends Group {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
draggable: model.draggable || false,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: this.getStatus(),
|
||||
x: model.point.x,
|
||||
@ -25,10 +26,12 @@ export default class elevatorArrow extends Group {
|
||||
height: 60
|
||||
}
|
||||
});
|
||||
// debugger;
|
||||
this.add(this.imageBg);
|
||||
this.getOrientate();
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
|
||||
getOrientate() {
|
||||
switch (this.model.orientation) {
|
||||
case 'top': {
|
||||
@ -49,13 +52,13 @@ export default class elevatorArrow extends Group {
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
// /** 缩放按钮 */
|
||||
// transformScale() {
|
||||
// this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
// this.imageBg.scale =[this.model.width/68, this.model.width/68];
|
||||
// this.imageBg.dirty();
|
||||
// }
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/31, this.model.width/31];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
getStatus() {
|
||||
if (this.model.status) {
|
||||
switch (this.model.status) {
|
||||
@ -71,26 +74,41 @@ export default class elevatorArrow extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
setStatus(data) {
|
||||
let imageBack;
|
||||
switch (data) {
|
||||
case 'on': {
|
||||
imageBack=elevatorArrowPicOn;
|
||||
break;
|
||||
}
|
||||
case 'off': {
|
||||
imageBack=elevatorArrowPic;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.imageBg.setStyle({image: imageBack});
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
}
|
||||
// setDraggable() {
|
||||
// this.arrow.attr('draggable', true);
|
||||
// this.createMouseEvent();
|
||||
// }
|
||||
// createMouseEvent() {
|
||||
// this.on('mousedown', this.mousedown, this);
|
||||
// this.on('mousemove', this.mousemove, this);
|
||||
// this.on('mouseup', this.mouseup, this);
|
||||
// }
|
||||
|
||||
mousemove(e) {
|
||||
}
|
||||
// mousedown(e) {
|
||||
// this.event.disable();
|
||||
// }
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
}
|
||||
// mousemove(e) {
|
||||
// }
|
||||
|
||||
// mouseup(e) {
|
||||
// this.event.enable();
|
||||
// this.model.point.x = this.model.point.x + e.offsetX;
|
||||
// this.model.point.y = this.model.point.y + e.offsetY;
|
||||
// }
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
import * as toolpath from 'zrender/src/tool/path';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
|
||||
export default class elevatorBack extends Group {
|
||||
@ -12,58 +11,24 @@ export default class elevatorBack extends Group {
|
||||
}
|
||||
|
||||
create() {
|
||||
// debugger;
|
||||
const model = this.model;
|
||||
this.arrowCircle = new Circle({
|
||||
const tempString='M'+model.width/6+' '+model.height/8*6+' L'+model.width/6*4+
|
||||
' 0 L'+model.width/6*5+' 0 A '+model.width/6+' '+model.width/6+' 0 0 1 '+
|
||||
model.width/6*5+' '+model.height/4+'L '+model.width/3+' '+model.height+' L'+model.width/6+
|
||||
' '+model.height+' '+'A'+model.width/6+' '+model.width/6+' 0 0 1 '+model.width/6+' '+model.height/8*6;
|
||||
this.elevatorBack = toolpath.createFromString(tempString, {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0',
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
cx: model.point.x + model.width/6*5,
|
||||
cy: model.point.y + model.height/8,
|
||||
r: model.width/6
|
||||
},
|
||||
draggable: false,
|
||||
style: {
|
||||
fill: this.model.fillColor || '#adadad'
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
brushType: 'fill',
|
||||
fill: this.model.fillColor || '#313131',
|
||||
lineWidth: 0
|
||||
}
|
||||
});
|
||||
|
||||
this.arrowPoly = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
points: [ [model.point.x+model.width/6, model.point.y + model.height], [model.point.x+model.width/6*2, model.point.y + model.height],
|
||||
[model.point.x+model.width/6*5, model.point.y + model.height/8*2],
|
||||
[model.point.x+model.width/6*5, model.point.y],
|
||||
[model.point.x+model.width/6*4, model.point.y],
|
||||
[model.point.x+model.width/6, model.point.y + model.height/8*6]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
stroke: model.stroke || '#adadad',
|
||||
lineWidth: model.lineWidth,
|
||||
fill: model.fill || '#adadad'
|
||||
}
|
||||
});
|
||||
|
||||
this.arrowCircleRight = new Circle({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0',
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
cx: model.point.x + model.width/6,
|
||||
cy: model.point.y + model.height/8*7,
|
||||
r: model.width/6
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor || '#adadad'
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.arrowPoly);
|
||||
this.add(this.arrowCircle);
|
||||
this.add(this.arrowCircleRight);
|
||||
this.add(this.elevatorBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,30 @@ import deviceType from '../constant/deviceType';
|
||||
import Background from './background';
|
||||
import CircularLamp from './circularLamp';
|
||||
import IbpText from './ibpText';
|
||||
import Alarm from './alarm';
|
||||
import IbpLine from './ibpLine';
|
||||
import Button from './button';
|
||||
import TipBox from './ibpTipBox';
|
||||
import AppendageBox from './appendageBox';
|
||||
import RotatingButton from './rotatingButton';
|
||||
import Elevator from './elevator';
|
||||
import Key from './key';
|
||||
import TeleTerminal from './teleTerminal';
|
||||
|
||||
const ibpShape = {};
|
||||
ibpShape[deviceType.Arrow] = Arrow;
|
||||
ibpShape[deviceType.Background] = Background;
|
||||
ibpShape[deviceType.CircularLamp] = CircularLamp;
|
||||
ibpShape[deviceType.IbpText] = IbpText;
|
||||
ibpShape[deviceType.Alarm] = Alarm;
|
||||
ibpShape[deviceType.IbpLine] = IbpLine;
|
||||
ibpShape[deviceType.SquareButton] = Button;
|
||||
ibpShape[deviceType.TipBox] = TipBox;
|
||||
ibpShape[deviceType.AppendageBox] = AppendageBox;
|
||||
ibpShape[deviceType.RotatingButton] = RotatingButton;
|
||||
ibpShape[deviceType.Elevator] = Elevator;
|
||||
ibpShape[deviceType.Key] = Key;
|
||||
ibpShape[deviceType.TeleTerminal] = TeleTerminal;
|
||||
|
||||
function shapefactory(device, ibp) {
|
||||
const type = device.model._type;
|
||||
|
65
src/ibp/shape/ibpLine.js
Normal file
@ -0,0 +1,65 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
import store from '@/store';
|
||||
|
||||
export default class ibpLine extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.ibpLine = new Line({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x1: this.model.point1.x,
|
||||
y1: this.model.point1.y,
|
||||
x2: this.model.point2.x,
|
||||
y2: this.model.point2.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: this.model.lineWidth,
|
||||
stroke: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.add(this.ibpLine);
|
||||
}
|
||||
setDraggable() {
|
||||
this.ibpLine.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point1.x = this.model.point1.x - this.offsetX + e.offsetX;
|
||||
this.model.point1.y = this.model.point1.y - this.offsetY + e.offsetY;
|
||||
this.model.point2.x = this.model.point2.x - this.offsetX + e.offsetX;
|
||||
this.model.point2.y = this.model.point2.y - this.offsetY + e.offsetY;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import { updateIbpData } from '@/ibp/utils/parser';
|
||||
import store from '@/store';
|
||||
|
||||
export default class button extends Group {
|
||||
export default class ibpText extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -19,8 +22,8 @@ export default class button extends Group {
|
||||
silent: model.silent || false,
|
||||
draggable: model.draggable || false,
|
||||
style: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: model.fontFamily,
|
||||
@ -29,7 +32,8 @@ export default class button extends Group {
|
||||
textFill: model.textFill,
|
||||
textAlign: model.textAlign,
|
||||
textPosition: model.textPosition || 'inside',
|
||||
textVerticalAlign: model.textVerticalAlign || null
|
||||
textVerticalAlign: model.textVerticalAlign || null,
|
||||
textLineHeight: model.fontSize
|
||||
}
|
||||
});
|
||||
this.add(this.textName);
|
||||
@ -43,18 +47,22 @@ export default class button extends Group {
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
console.log('鼠标移动');
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.x = this.model.x + e.offsetX;
|
||||
this.model.y = this.model.y + e.offsetY;
|
||||
console.log('鼠标抬起', this.model);
|
||||
updateIbpData(this.model, 'update');
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
62
src/ibp/shape/ibpTipBox.js
Normal file
@ -0,0 +1,62 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import store from '@/store';
|
||||
|
||||
export default class ibpTipBox extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.tipBox = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.add(this.tipBox);
|
||||
}
|
||||
setDraggable() {
|
||||
this.tipBox.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
103
src/ibp/shape/key.js
Normal file
@ -0,0 +1,103 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import keyPic from '@/assets/ibp_images/key.png';
|
||||
import keyPicOn from '@/assets/ibp_images/key_on.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class key extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: model.z,
|
||||
draggable: model.draggable || false,
|
||||
style: {
|
||||
image: this.getRotateColor(),
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 314,
|
||||
height: 932
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/314, this.model.width/314];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
getRotateColor() {
|
||||
if (this.model.status) {
|
||||
switch (this.model.status) {
|
||||
case 'on': {
|
||||
return keyPicOn;
|
||||
}
|
||||
case 'off': {
|
||||
return keyPic;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return keyPic;
|
||||
}
|
||||
}
|
||||
|
||||
setStatus(model) {
|
||||
switch (model.status) {
|
||||
case 'on': {
|
||||
// 开放
|
||||
this.imageBg.setStyle({image: keyPicOn});
|
||||
this.model.status='on';
|
||||
break;
|
||||
}
|
||||
case 'off': {
|
||||
// 关闭
|
||||
this.imageBg.setStyle({image: keyPic});
|
||||
this.model.status='off';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.imageBg.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import rotateBlack from '@/assets/ibp_images/rotate_black.png';
|
||||
import rotateRed from '@/assets/ibp_images/rotate_red.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class rotateTip extends Group {
|
||||
|
||||
@ -9,6 +10,10 @@ export default class rotateTip extends Group {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -35,7 +40,7 @@ export default class rotateTip extends Group {
|
||||
this.imageBg.scale =[this.model.width/68, this.model.width/68];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
|
||||
getRotateColor() {
|
||||
if (this.model.color) {
|
||||
switch (this.model.color) {
|
||||
@ -63,6 +68,12 @@ export default class rotateTip extends Group {
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -70,7 +81,9 @@ export default class rotateTip extends Group {
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
62
src/ibp/shape/rotatingButton.js
Normal file
@ -0,0 +1,62 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import Keyhole from '@/assets/ibp_images/keyhole.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class RotatingButton extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
this.rotatingButton = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: Keyhole,
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y,
|
||||
width: this.model.width,
|
||||
height: this.model.width/434*381
|
||||
}
|
||||
});
|
||||
this.add(this.rotatingButton);
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.rotatingButton.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +1,18 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import teleTerminalPic from '@/assets/ibp_images/telephone_terminal.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class alarm extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -20,8 +25,8 @@ export default class alarm extends Group {
|
||||
image: teleTerminalPic,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 64,
|
||||
height: 56
|
||||
width: 150,
|
||||
height: 150
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
@ -31,12 +36,12 @@ export default class alarm extends Group {
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/64, this.model.width/64];
|
||||
this.imageBg.scale =[this.model.width/150, this.model.width/150];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.imageBg.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
@ -47,6 +52,12 @@ export default class alarm extends Group {
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -54,7 +65,9 @@ export default class alarm extends Group {
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import * as zrUtil from 'zrender/src/core/util';
|
||||
import * as matrix from 'zrender/src/core/matrix';
|
||||
import deviceType from '../constant/deviceType';
|
||||
import deviceRender from '../constant/deviceRender';
|
||||
import store from '@/store';
|
||||
|
||||
export function createTransform(opts) {
|
||||
let transform = matrix.create();
|
||||
@ -57,8 +58,8 @@ export function parser(data, config) {
|
||||
ibpDevice[elem.code] = createModel(deviceType.CircularLamp, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.warnButtonList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.WarnButton, elem, propConvert);
|
||||
zrUtil.each(data.alarmList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Alarm, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.arrowList || [], elem => {
|
||||
@ -69,10 +70,246 @@ export function parser(data, config) {
|
||||
ibpDevice[elem.code] = createModel(deviceType.RotatingButton, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.tipList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Tip, elem, propConvert);
|
||||
zrUtil.each(data.tipBoxList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.TipBox, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.ibpLineList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.IbpLine, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.appendageBoxList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.AppendageBox, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.elevatorList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Elevator, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.keyList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Key, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.teleTerminalList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.TeleTerminal, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
}
|
||||
|
||||
return ibpDevice;
|
||||
}
|
||||
export function updateIbpData(device) {
|
||||
const ibpData = store.getters['ibp/ibp'];
|
||||
switch (device._type) {
|
||||
case deviceType.Background : {
|
||||
ibpData.background = device;
|
||||
break;
|
||||
}
|
||||
case deviceType.IbpText : {
|
||||
if (ibpData.textList && ibpData.textList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.textList.length; i++) {
|
||||
if (device.code === ibpData.textList[i].code) {
|
||||
device.dispose ? ibpData.textList.splice(i, 1) :ibpData.textList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.textList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.textList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.SquareButton : {
|
||||
if (ibpData.squareButtonList && ibpData.squareButtonList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.squareButtonList.length; i++) {
|
||||
if (device.code === ibpData.squareButtonList[i].code) {
|
||||
device.dispose ? ibpData.squareButtonList.splice(i, 1):ibpData.squareButtonList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.squareButtonList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.squareButtonList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Arrow : {
|
||||
if (ibpData.arrowList && ibpData.arrowList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.arrowList.length; i++) {
|
||||
if (device.code === ibpData.arrowList[i].code) {
|
||||
device.dispose ? ibpData.arrowList.splice(i, 1):ibpData.arrowList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.arrowList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.arrowList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.RotatingButton : {
|
||||
if (ibpData.rotatingButtonList && ibpData.rotatingButtonList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.rotatingButtonList.length; i++) {
|
||||
if (device.code === ibpData.rotatingButtonList[i].code) {
|
||||
device.dispose ? ibpData.rotatingButtonList.splice(i, 1):ibpData.rotatingButtonList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.rotatingButtonList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.rotatingButtonList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.TipBox : {
|
||||
if (ibpData.tipBoxList && ibpData.tipBoxList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.tipBoxList.length; i++) {
|
||||
if (device.code === ibpData.tipBoxList[i].code) {
|
||||
device.dispose ? ibpData.tipBoxList.splice(i, 1):ibpData.tipBoxList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.tipBoxList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.tipBoxList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.CircularLamp : {
|
||||
if (ibpData.circularLampList && ibpData.circularLampList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.circularLampList.length; i++) {
|
||||
if (device.code === ibpData.circularLampList[i].code) {
|
||||
device.dispose ? ibpData.circularLampList.splice(i, 1):ibpData.circularLampList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.circularLampList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.circularLampList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.IbpLine : {
|
||||
if (ibpData.ibpLineList && ibpData.ibpLineList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.ibpLineList.length; i++) {
|
||||
if (device.code === ibpData.ibpLineList[i].code) {
|
||||
device.dispose ? ibpData.ibpLineList.splice(i, 1):ibpData.ibpLineList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.ibpLineList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.ibpLineList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.AppendageBox : {
|
||||
if (ibpData.appendageBoxList && ibpData.appendageBoxList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.appendageBoxList.length; i++) {
|
||||
if (device.code === ibpData.appendageBoxList[i].code) {
|
||||
device.dispose ? ibpData.appendageBoxList.splice(i, 1):ibpData.appendageBoxList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.appendageBoxList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.appendageBoxList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Alarm : {
|
||||
if (ibpData.alarmList && ibpData.alarmList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.alarmList.length; i++) {
|
||||
if (device.code === ibpData.alarmList[i].code) {
|
||||
device.dispose ? ibpData.alarmList.splice(i, 1):ibpData.alarmList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.alarmList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.alarmList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Elevator : {
|
||||
if (ibpData.elevatorList && ibpData.elevatorList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.elevatorList.length; i++) {
|
||||
if (device.code === ibpData.elevatorList[i].code) {
|
||||
device.dispose ? ibpData.elevatorList.splice(i, 1):ibpData.elevatorList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.elevatorList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.elevatorList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Key : {
|
||||
if (ibpData.keyList && ibpData.keyList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.keyList.length; i++) {
|
||||
if (device.code === ibpData.keyList[i].code) {
|
||||
device.dispose ? ibpData.keyList.splice(i, 1):ibpData.keyList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.keyList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.keyList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.TeleTerminal : {
|
||||
if (ibpData.teleTerminalList && ibpData.teleTerminalList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.teleTerminalList.length; i++) {
|
||||
if (device.code === ibpData.teleTerminalList[i].code) {
|
||||
device.dispose ? ibpData.teleTerminalList.splice(i, 1):ibpData.teleTerminalList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.teleTerminalList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.teleTerminalList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
store.dispatch('ibp/setIbpData', ibpData);
|
||||
}
|
||||
|
@ -50,18 +50,21 @@ export function JLmapDriving(dom, data, skinCode) {
|
||||
renderer.domElement.style.top = '0';
|
||||
|
||||
var renderercctv = new THREE.WebGLRenderer();
|
||||
renderercctv.setSize(dom.offsetWidth*0.2, dom.offsetHeight*0.2);
|
||||
renderercctv.setSize(dom.offsetWidth*0.2, dom.offsetHeight*0.2);
|
||||
renderercctv.domElement.style.position = 'absolute';
|
||||
renderercctv.domElement.style.top = '0';
|
||||
|
||||
document.getElementById('jlsimulation').appendChild(renderer.domElement);
|
||||
document.getElementById('jlcctv').appendChild(renderercctv.domElement);
|
||||
// 定义相机
|
||||
<<<<<<< HEAD
|
||||
//let camera = SetCamera(dom);
|
||||
=======
|
||||
// let camera = SetCamera(dom);
|
||||
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
|
||||
// 定义场景(渲染容器)
|
||||
const scene = SetScene();
|
||||
|
||||
|
||||
const speed = 0;
|
||||
|
||||
let drivingcode = null;
|
||||
@ -104,8 +107,13 @@ export function JLmapDriving(dom, data, skinCode) {
|
||||
controls3.enabled = true;
|
||||
scene.add(controls3.getObject());
|
||||
|
||||
<<<<<<< HEAD
|
||||
let cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 150);
|
||||
cameracctv.position.set( 5, -3,27 );
|
||||
=======
|
||||
const cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 150);
|
||||
cameracctv.position.set( 5, -3, 27 );
|
||||
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
|
||||
|
||||
cameracctv.rotation.y = Math.PI/5*3;
|
||||
camera.add(cameracctv);
|
||||
@ -136,7 +144,11 @@ export function JLmapDriving(dom, data, skinCode) {
|
||||
if (scope.animateswitch == true) {
|
||||
// 根据相机渲染场景
|
||||
renderer.render(scene, camera);
|
||||
<<<<<<< HEAD
|
||||
renderercctv.render(scene,cameracctv);
|
||||
=======
|
||||
renderercctv.render(scene, cameracctv);
|
||||
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
|
||||
// updatcontrols();
|
||||
// renderercctv
|
||||
controls3.update();
|
||||
@ -192,7 +204,7 @@ export function JLmapDriving(dom, data, skinCode) {
|
||||
this.updatestoptime = function(stime) {
|
||||
scope.stime = stime;
|
||||
};
|
||||
this.updatedrivedata = function(drivedata){
|
||||
this.updatedrivedata = function(drivedata) {
|
||||
scope.drivecount += 1;
|
||||
scope.drivedata = drivedata;
|
||||
};
|
||||
|
@ -18,7 +18,7 @@ let defaulttrain = {
|
||||
deviceType:"train",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/train/train.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/train/train.FBX"
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ let defaultsuidao = {
|
||||
deviceType:"suidao",
|
||||
type:"suidao",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/suidao/suidao.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/suidao/suidao.FBX"
|
||||
}//https://joylink.club/oss/models/suidao/suidao.FBX
|
||||
//../../static/model/
|
||||
|
||||
|
@ -551,7 +551,15 @@ THREE.FBXLoader = ( function () {
|
||||
|
||||
if ( materialNode.EmissiveFactor ) {
|
||||
|
||||
parameters.emissiveIntensity = parseFloat( materialNode.EmissiveFactor.value );
|
||||
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
||||
parameters.side = THREE.DoubleSide;
|
||||
parameters.transparent = true;
|
||||
parameters.alphaTest = 0.7;
|
||||
parameters.opacity = 1;
|
||||
|
||||
}else{
|
||||
parameters.opacity = parseFloat( materialNode.Opacity.value );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -304,9 +304,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
kilometerPosition: 'down', // 公里标位置
|
||||
fontWeight: 'bold' // 文字错细
|
||||
|
@ -300,9 +300,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: false, // 公里标显示
|
||||
kilometerPosition: 'up' // 公里标朝向
|
||||
};
|
||||
|
@ -297,9 +297,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: false, // 公里标显示
|
||||
kilometerPosition: 'up' // 公里标朝向
|
||||
};
|
||||
|
@ -279,9 +279,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
kilometerPosition: 'up' // 公里标朝向
|
||||
};
|
||||
|
@ -20,9 +20,6 @@ class Jlmap {
|
||||
// 鼠标事件
|
||||
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom'};
|
||||
|
||||
// 原始数据
|
||||
this.data = {};
|
||||
|
||||
// 皮肤参数
|
||||
this.skinCode = '';
|
||||
|
||||
@ -83,12 +80,10 @@ class Jlmap {
|
||||
this.$options.scaleRate = map.skinVO.scaling || 1;
|
||||
this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0;
|
||||
this.$options.offsetY = map.skinVO.origin ? map.skinVO.origin.y : 0;
|
||||
// 更新视图大小
|
||||
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
||||
}
|
||||
|
||||
// 保存原始数据
|
||||
this.data = map;
|
||||
|
||||
// 解析地图数据
|
||||
this.mapDevice = mapDevice;
|
||||
|
||||
@ -103,7 +98,6 @@ class Jlmap {
|
||||
|
||||
// 视图加载完成 回调
|
||||
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); }
|
||||
|
||||
}
|
||||
|
||||
setDefaultState() {
|
||||
@ -158,7 +152,6 @@ class Jlmap {
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
const nDevice = Object.assign(oDevice || {}, elem);
|
||||
this.dataSync(nDevice);
|
||||
this.$painter.delete(oDevice);
|
||||
if (!elem._dispose) {
|
||||
this.mapDevice[code] = nDevice;
|
||||
@ -275,52 +268,6 @@ class Jlmap {
|
||||
return payload || {};
|
||||
}
|
||||
|
||||
dataSync(model) {
|
||||
var prop = null;
|
||||
var type = model._type;
|
||||
var code = model.code;
|
||||
|
||||
switch (type) {
|
||||
case deviceType.Link: prop = 'linkList'; break;
|
||||
case deviceType.Section: prop = 'sectionList'; break;
|
||||
case deviceType.Switch: prop = 'switchList'; break;
|
||||
case deviceType.Signal: prop = 'signalList'; break;
|
||||
case deviceType.Station: prop = 'stationList'; break;
|
||||
case deviceType.StationStand: prop = 'stationStandList'; break;
|
||||
case deviceType.StationControl: prop = 'stationControlList'; break;
|
||||
case deviceType.StationCounter: prop = 'stationCounterList'; break;
|
||||
case deviceType.ZcControl: prop = 'zcControlList'; break;
|
||||
case deviceType.StationDelayUnlock: prop = 'stationDelayUnlockList'; break;
|
||||
case deviceType.LcControl: prop = 'lcControlList'; break;
|
||||
case deviceType.ButtonControl: prop = 'buttonList'; break;
|
||||
case deviceType.LimitControl: prop = 'tempSpeedLimitList'; break;
|
||||
case deviceType.ImageControl: prop = 'imageControl'; break;
|
||||
case deviceType.Train: prop = 'trainList'; break;
|
||||
case deviceType.TrainWindow: prop = 'trainWindowList'; break;
|
||||
case deviceType.Line: prop = 'lineList'; break;
|
||||
case deviceType.Text: prop = 'textList'; break;
|
||||
}
|
||||
|
||||
const list = this.data[prop] || [];
|
||||
const idex = list.findIndex(elem => { return elem.code == code; });
|
||||
if (list) {
|
||||
if (model._dispose) {
|
||||
idex >= 0 && list.splice(idex, 1);
|
||||
} else {
|
||||
const elem = list[idex];
|
||||
if (elem) {
|
||||
Object.keys(model).forEach(key => {
|
||||
if (key != 'instance') {
|
||||
elem[key] = model[key];
|
||||
}
|
||||
});
|
||||
} else {
|
||||
list.push(Object.assign({}, model));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getZr() {
|
||||
return this.$zr;
|
||||
}
|
||||
|
@ -99,8 +99,8 @@ class EMouse extends Group {
|
||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseEnter) {
|
||||
instance.mouseEnter(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -118,8 +118,8 @@ class EMouse extends Group {
|
||||
this.sectionTextBorder && this.sectionTextBorder.hide();
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseLeave) {
|
||||
instance.mouseLeave(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export default class Station extends Group {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
|
||||
if (style.Station.text.show) {
|
||||
if (model.visible) {
|
||||
// 公里标名称是否显示
|
||||
this.stationText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
@ -38,29 +38,29 @@ export default class Station extends Group {
|
||||
textFill: model.nameFontColor
|
||||
});
|
||||
this.add(this.stationText);
|
||||
}
|
||||
|
||||
if (style.Station.kmPostShow) {
|
||||
const path = window.location.href;
|
||||
if (style.Station.kmPostShow || path.includes('/map/draw')) {
|
||||
// 公里标是否显示
|
||||
let direction = 1;
|
||||
if (this.style.Station.kilometerPosition == 'up') {
|
||||
direction = -1;
|
||||
let direction = 1;
|
||||
if (this.style.Station.kilometerPosition == 'up') {
|
||||
direction = -1;
|
||||
}
|
||||
this.mileageText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: [0, 0],
|
||||
x: model.position.x,
|
||||
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction),
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.kmPostFont || 18,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.kmPost,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFill: model.kmPostFontColor
|
||||
});
|
||||
this.add(this.mileageText);
|
||||
}
|
||||
this.mileageText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: [0, 0],
|
||||
x: model.position.x,
|
||||
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction),
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.kmPostFont || 18,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.kmPost,
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFill: model.kmPostFontColor
|
||||
});
|
||||
this.add(this.mileageText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,9 +42,9 @@ class EMouse extends Group {
|
||||
|
||||
// 创建道岔边框
|
||||
craeteSwitchBorder() {
|
||||
const sectionA = this.device.model.sectionAInstance.instance;
|
||||
const sectionB = this.device.model.sectionBInstance.instance;
|
||||
const sectionC = this.device.model.sectionCInstance.instance;
|
||||
const sectionA = this.getInstanceByCode(this.device.model.sectionACode);
|
||||
const sectionB = this.getInstanceByCode(this.device.model.sectionBCode);
|
||||
const sectionC = this.getInstanceByCode(this.device.model.sectionCCode);
|
||||
const rect = this.device.getBoundingRect();
|
||||
|
||||
sectionA && rect.union(sectionA.getBoundingRect());
|
||||
@ -83,8 +83,8 @@ class EMouse extends Group {
|
||||
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
||||
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
||||
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
|
||||
if (instance && instance.mouseLeave) {
|
||||
instance.mouseLeave(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -101,8 +101,8 @@ class EMouse extends Group {
|
||||
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
||||
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
||||
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
|
||||
if (instance && instance.mouseEnter) {
|
||||
instance.mouseEnter(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
37
src/jmap/shape/TrainWindow/EMouse.js
Normal file
@ -0,0 +1,37 @@
|
||||
export default class EMouse {
|
||||
constructor(device) {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
mouseover(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(true);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(false || this.device.model.trainWindowShow);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
mouseLeave(e) {
|
||||
if (this.device.prdType ) {
|
||||
this.device.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
/* 车次窗*/
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import EMouse from './EMouse';
|
||||
import store from '@/store';
|
||||
|
||||
class TrainWindow extends Group {
|
||||
@ -14,6 +15,7 @@ class TrainWindow extends Group {
|
||||
this.z = 9;
|
||||
this.prdType = store.state.training.prdType;
|
||||
this.create(model);
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
create(model) {
|
||||
@ -22,6 +24,12 @@ class TrainWindow extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
|
||||
/** 创建车次窗*/
|
||||
createTrainWindow() {
|
||||
const model = this.model;
|
||||
@ -44,9 +52,7 @@ class TrainWindow extends Group {
|
||||
lineWidth: this.style.TrainWindow.lineWidth,
|
||||
stroke: this.style.TrainWindow.lineColor,
|
||||
fill: this.style.transparentColor
|
||||
},
|
||||
onmouseover: (e) => { this.mouseover(e); },
|
||||
onmouseout: (e) => { this.mouseout(e); }
|
||||
}
|
||||
});
|
||||
this.add(this.trainRect);
|
||||
}
|
||||
@ -72,38 +78,6 @@ class TrainWindow extends Group {
|
||||
getInstanceByCode(code) {
|
||||
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (this.prdType) {
|
||||
this.setVisible(false);
|
||||
const instance = this.getInstanceByCode(this.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseover(e) {
|
||||
if (this.prdType) {
|
||||
this.setVisible(true);
|
||||
const instance = this.getInstanceByCode(this.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
if (this.prdType) {
|
||||
this.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
mouseLeave(e) {
|
||||
if (this.prdType ) {
|
||||
this.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default TrainWindow;
|
||||
|
@ -1,423 +1,464 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou_01 train-control" :title="title" :visible.sync="show" width="320px" :before-close="doClose"
|
||||
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-form-item label="车 组 号:" prop="trainNumber">
|
||||
<el-select v-model="formModel.trainNumber" :id="domIdTrainNumber" filterable
|
||||
:disabled="trainNumberIsDisabled" @change="trainNumberChange">
|
||||
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber"
|
||||
:value="train.groupNumber">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width='0px'>
|
||||
<el-radio-group v-model="formModel.trainType" :id="domIdTrainType" style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled" @change="trainTypeChange">
|
||||
<el-radio :label="'01'">计划车</el-radio>
|
||||
<el-radio :label="'02'">头码车</el-radio>
|
||||
<el-radio :label="'03'">人工车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="serverNo">
|
||||
<span slot="label">表  号</span>
|
||||
<el-input v-model="formModel.serverNo" :id="domIdServerNo" :disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="车 次 号:" prop="trainNo">
|
||||
<el-input v-model="formModel.trainNo" :id="domIdTrainNo" :disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的地号:" prop="targetCode">
|
||||
<el-input v-model="formModel.targetCode" :id="domIdTargetCode" :disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-train ref="confirmTrain"></confirm-train>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou_01 train-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="trainNumber">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.trainNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.trainType"
|
||||
style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'01'">计划车</el-radio>
|
||||
<el-radio :label="'02'">头码车</el-radio>
|
||||
<el-radio :label="'03'">人工车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="serverNo">
|
||||
<span slot="label">表  号</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serverNo"
|
||||
:disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车 次 号:" prop="trainNo">
|
||||
<el-input
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.trainNo"
|
||||
:disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的地号:" prop="targetCode">
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.targetCode"
|
||||
:disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-train ref="confirmTrain" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishTrainList } from '@/api/jmap/map';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishTrainList } from '@/api/jmap/map';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
components: {
|
||||
ConfirmTrain,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainList: [],
|
||||
formModel: {
|
||||
trainNo: '',
|
||||
trainNumber: '',
|
||||
trainType: '01',
|
||||
serverNo: '',
|
||||
targetCode: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
components: {
|
||||
ConfirmTrain,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainList: [],
|
||||
formModel: {
|
||||
trainNo: '',
|
||||
trainNumber: '',
|
||||
trainType: '01',
|
||||
serverNo: '',
|
||||
targetCode: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
trainNumber: [
|
||||
{ required: true, message: '请选择车组号', trigger: 'change' }
|
||||
],
|
||||
trainType: [
|
||||
{ required: true, message: '请选择一个列车类型', trigger: 'change' }
|
||||
],
|
||||
serverNo: [
|
||||
{ required: true, message: '请输入表号', trigger: 'blur' }
|
||||
],
|
||||
trainNo: [
|
||||
{ required: true, message: '请输入车次号', trigger: 'blur' }
|
||||
],
|
||||
targetCode: [
|
||||
{ required: true, message: '请输入目的地号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
direction: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
trainNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
targetCodeIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
trainNumberIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
trainTypeIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.serverNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.menu.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return '添加列车识别号';
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishTrainList(map.skinCode).then(resp => {
|
||||
this.trainList = resp.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
rules: {
|
||||
trainNumber: [
|
||||
{ required: true, message: '请选择车组号', trigger: 'change' }
|
||||
],
|
||||
trainType: [
|
||||
{ required: true, message: '请选择一个列车类型', trigger: 'change' }
|
||||
],
|
||||
serverNo: [
|
||||
{ required: true, message: '请输入表号', trigger: 'blur' }
|
||||
],
|
||||
trainNo: [
|
||||
{ required: true, message: '请输入车次号', trigger: 'blur' }
|
||||
],
|
||||
targetCode: [
|
||||
{ required: true, message: '请输入目的地号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
direction: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
trainNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
targetCodeIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
trainNumberIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
trainTypeIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.serverNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.menu.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return '添加列车识别号';
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishTrainList(map.skinCode).then(resp => {
|
||||
this.trainList = resp.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.formModel = {
|
||||
trainNumber: selected.trainNumber,
|
||||
trainNo: selected.trainNo,
|
||||
trainType: '01',
|
||||
serverNo: selected.serverNo,
|
||||
targetCode: selected.targetCode,
|
||||
};
|
||||
this.formModel = {
|
||||
trainNumber: selected.trainNumber,
|
||||
trainNo: selected.trainNo,
|
||||
trainType: '01',
|
||||
serverNo: selected.serverNo,
|
||||
targetCode: selected.targetCode
|
||||
};
|
||||
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange(trainNumber) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange(trainNumber) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNumber}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainType}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainType}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
serverNoChange(serverNo) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${serverNo}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
serverNoChange(serverNo) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${serverNo}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
trainNoChange(trainNo) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNo}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainNoChange(trainNo) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNo}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
targetCodeChange(targetCode) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${targetCode}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
targetCodeChange(targetCode) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${targetCode}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 增加列车识别号*/
|
||||
this.addTrainId();
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
this.editTrainId();
|
||||
}
|
||||
},
|
||||
//增加列车识别号
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let model = this.formModel;
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
messages: [`添加列车识别号:成功`],
|
||||
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 增加列车识别号*/
|
||||
this.addTrainId();
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
this.editTrainId();
|
||||
}
|
||||
},
|
||||
// 增加列车识别号
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const model = this.formModel;
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
messages: [`添加列车识别号:成功`],
|
||||
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改列车识别号
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
messages: [`修改列车识别号:成功`],
|
||||
val: this.formModel.trainNo,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
messages: [`修改列车识别号:成功`],
|
||||
val: this.formModel.trainNo
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,156 +1,165 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-form-item label="车 组 号:" prop="trainNumber">
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou_01 stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="trainNumber">
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
formModel: {
|
||||
trainNumber: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
formModel: {
|
||||
trainNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
trainNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNumber}`,
|
||||
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
|
||||
}
|
||||
rules: {
|
||||
trainNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${this.formModel.trainNumber}`,
|
||||
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.formModel.trainNumber
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.formModel.trainNumber
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,318 +1,321 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<train-control ref="trainControl"></train-control>
|
||||
<train-delete ref="trainDelete"></train-delete>
|
||||
<train-move ref="trainMove"></train-move>
|
||||
<train-switch ref="trainSwitch"></train-switch>
|
||||
<train-edit-number ref="trainEditNumber"></train-edit-number>
|
||||
</div>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-control ref="trainControl" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<train-move ref="trainMove" />
|
||||
<train-switch ref="trainSwitch" />
|
||||
<train-edit-number ref="trainEditNumber" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
|
||||
export default {
|
||||
name: 'menuTrain',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
TrainControl,
|
||||
TrainDelete,
|
||||
TrainMove,
|
||||
TrainSwitch,
|
||||
TrainEditNumber
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [],
|
||||
central: [
|
||||
{
|
||||
label: '添加列车识别号',
|
||||
handler: this.addTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除列车识别号',
|
||||
handler: this.delTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.delTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改列车识别号',
|
||||
handler: this.editTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动列车识别号',
|
||||
handler: this.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '交换列车识别号',
|
||||
handler: this.switchTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.switchTrainId,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置通信故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消通信故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.cancelStoppage
|
||||
}
|
||||
],
|
||||
menuSpeed: [
|
||||
{
|
||||
label: '确认运行至前方站',
|
||||
handler: this.limitSpeed,
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
//编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]
|
||||
}
|
||||
export default {
|
||||
name: 'MenuTrain',
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
TrainControl,
|
||||
TrainDelete,
|
||||
TrainMove,
|
||||
TrainSwitch,
|
||||
TrainEditNumber
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [],
|
||||
central: [
|
||||
{
|
||||
label: '添加列车识别号',
|
||||
handler: this.addTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除列车识别号',
|
||||
handler: this.delTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.delTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改列车识别号',
|
||||
handler: this.editTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动列车识别号',
|
||||
handler: this.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '交换列车识别号',
|
||||
handler: this.switchTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.switchTrainId,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置通信故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消通信故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.cancelStoppage
|
||||
}
|
||||
],
|
||||
menuSpeed: [
|
||||
{
|
||||
label: '确认运行至前方站',
|
||||
handler: this.limitSpeed,
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
//故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed]
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//限速行驶
|
||||
limitSpeed() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.limitSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//添加列车识别号
|
||||
addTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除列车识别号
|
||||
delTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改列车识别号
|
||||
editTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改车组号
|
||||
editTrainNo() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainEditNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//移动列车识别号
|
||||
moveTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMove.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//交换列车识别号
|
||||
switchTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.switchTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainSwitch.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 限速行驶
|
||||
limitSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.limitSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 添加列车识别号
|
||||
addTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除列车识别号
|
||||
delTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改车组号
|
||||
editTrainNo() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainEditNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 移动列车识别号
|
||||
moveTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMove.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 交换列车识别号
|
||||
switchTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.switchTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainSwitch.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,160 +1,169 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" @change="inputGroupNumber" :id="domIdInput"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
selected: null,
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
selected: null,
|
||||
addModel: {
|
||||
groupNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdInput() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除车组号'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
inputGroupNumber() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.input.operation,
|
||||
val: this.addModel.groupNumber
|
||||
}
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdInput() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除车组号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
inputGroupNumber() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.input.operation,
|
||||
val: this.addModel.groupNumber
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.addModel.groupNumber
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.addModel.groupNumber
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -279,15 +279,6 @@ export default {
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
@ -297,6 +288,15 @@ export default {
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
|
@ -1,150 +1,162 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
@ -160,4 +172,4 @@
|
||||
line-height: 20px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -18,9 +18,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
@ -100,7 +100,7 @@ export default {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
|
@ -1,116 +1,126 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return {
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -124,4 +134,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,57 +1,66 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -61,4 +70,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,46 +1,55 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -50,4 +59,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,122 +1,143 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,143 +1,152 @@
|
||||
<template>
|
||||
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-03__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
selected: null,
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
selected: null,
|
||||
addModel: {
|
||||
groupNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
}
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -755,9 +755,11 @@ export default {
|
||||
},
|
||||
initMenu(menu) {
|
||||
this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
|
||||
this.menu[2].children = this.initStationList();
|
||||
this.clickEvent();
|
||||
this.closeMenu(true);
|
||||
if (this.menu.length) {
|
||||
this.menu[2].children = this.initStationList();
|
||||
this.clickEvent();
|
||||
this.closeMenu(true);
|
||||
}
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
|
@ -1,488 +1,491 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<train-control ref="trainControl"></train-control>
|
||||
<train-delete ref="trainDelete"></train-delete>
|
||||
<train-move ref="trainMove"></train-move>
|
||||
<train-switch ref="trainSwitch"></train-switch>
|
||||
<train-edit-number ref="trainEditNumber"></train-edit-number>
|
||||
<train-create-number ref="trainCreateNumber"></train-create-number>
|
||||
<train-move-number ref="trainMoveNumber"></train-move-number>
|
||||
<train-delete-number ref="trainDeleteNumber"></train-delete-number>
|
||||
<train-detail-info ref="trainDetailInfo"></train-detail-info>
|
||||
</div>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-control ref="trainControl" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<train-move ref="trainMove" />
|
||||
<train-switch ref="trainSwitch" />
|
||||
<train-edit-number ref="trainEditNumber" />
|
||||
<train-create-number ref="trainCreateNumber" />
|
||||
<train-move-number ref="trainMoveNumber" />
|
||||
<train-delete-number ref="trainDeleteNumber" />
|
||||
<train-detail-info ref="trainDetailInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
import TrainMoveNumber from './dialog/trainMoveNumber';
|
||||
import TrainCreateNumber from './dialog/trainCreateNumber';
|
||||
import TrainDeleteNumber from './dialog/trainDeleteNumber';
|
||||
import TrainDetailInfo from './dialog/trainDetailInfo';
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
import TrainMoveNumber from './dialog/trainMoveNumber';
|
||||
import TrainCreateNumber from './dialog/trainCreateNumber';
|
||||
import TrainDeleteNumber from './dialog/trainDeleteNumber';
|
||||
import TrainDetailInfo from './dialog/trainDetailInfo';
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'menuTrain',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
TrainControl,
|
||||
TrainDelete,
|
||||
TrainMove,
|
||||
TrainSwitch,
|
||||
TrainEditNumber,
|
||||
TrainMoveNumber,
|
||||
TrainCreateNumber,
|
||||
TrainDeleteNumber,
|
||||
TrainDetailInfo,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [],
|
||||
central: [
|
||||
{
|
||||
label: '新建车组号',
|
||||
handler: this.createTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.createTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动车组号',
|
||||
handler: this.moveTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除车组号',
|
||||
handler: this.deleteTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.deleteTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设计划车',
|
||||
handler: this.setPlanTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.setPlanTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设目的地',
|
||||
handler: this.destinationTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.destinationTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设人工车',
|
||||
handler: this.artificialTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.artificialTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设特殊人工车',
|
||||
handler: this.undeveloped,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true}
|
||||
},
|
||||
{
|
||||
label: '详细列车信息',
|
||||
handler: this.detailTrainInfo,
|
||||
disabledCallback: MenuDisabledState.Train.detailTrainInfo,
|
||||
auth: { station: true, center: true}
|
||||
},
|
||||
{
|
||||
label: '属性',
|
||||
handler: this.undeveloped,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true}
|
||||
}
|
||||
export default {
|
||||
name: 'MenuTrain',
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
TrainControl,
|
||||
TrainDelete,
|
||||
TrainMove,
|
||||
TrainSwitch,
|
||||
TrainEditNumber,
|
||||
TrainMoveNumber,
|
||||
TrainCreateNumber,
|
||||
TrainDeleteNumber,
|
||||
TrainDetailInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [],
|
||||
central: [
|
||||
{
|
||||
label: '新建车组号',
|
||||
handler: this.createTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.createTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动车组号',
|
||||
handler: this.moveTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除车组号',
|
||||
handler: this.deleteTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.deleteTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设计划车',
|
||||
handler: this.setPlanTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.setPlanTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设目的地',
|
||||
handler: this.destinationTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.destinationTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设人工车',
|
||||
handler: this.artificialTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.artificialTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设特殊人工车',
|
||||
handler: this.undeveloped,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true}
|
||||
},
|
||||
{
|
||||
label: '详细列车信息',
|
||||
handler: this.detailTrainInfo,
|
||||
disabledCallback: MenuDisabledState.Train.detailTrainInfo,
|
||||
auth: { station: true, center: true}
|
||||
},
|
||||
{
|
||||
label: '属性',
|
||||
handler: this.undeveloped,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置通信故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消通信故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.cancelStoppage
|
||||
}
|
||||
],
|
||||
menuSpeed: [
|
||||
{
|
||||
label: '确认运行至前方站',
|
||||
handler: this.limitSpeed,
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
//编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置通信故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消通信故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.cancelStoppage
|
||||
}
|
||||
],
|
||||
menuSpeed: [
|
||||
{
|
||||
label: '确认运行至前方站',
|
||||
handler: this.limitSpeed,
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
//故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed]
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.stoppage.menu.operation
|
||||
};
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.stoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.cancelStoppage.menu.operation
|
||||
};
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//限速行驶
|
||||
limitSpeed() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.limitSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//设计划车
|
||||
setPlanTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.setPlanTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
},
|
||||
//设目的地车
|
||||
destinationTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.destinationTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next',operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
},
|
||||
//设人工车
|
||||
artificialTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.artificialTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next',operate).then(({ valid }) => {
|
||||
if(valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
},
|
||||
//详细列车信息
|
||||
detailTrainInfo() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.detailTrainInfo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next',operate).then(({ valid }) => {
|
||||
if (valid){
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDetailInfo.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert('实现中......', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
//添加列车识别号
|
||||
addTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//创建车组号
|
||||
createTrainNo() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.createTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainCreateNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除列车识别号
|
||||
delTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除车组号
|
||||
deleteTrainNo() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.deleteTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDeleteNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改列车识别号
|
||||
editTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改车组号
|
||||
editTrainNo() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainEditNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//移动车组号
|
||||
moveTrainNo() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMoveNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//移动列车识别号
|
||||
moveTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMove.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//交换列车识别号
|
||||
switchTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.switchTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainSwitch.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 限速行驶
|
||||
limitSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.limitSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设计划车
|
||||
setPlanTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.setPlanTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设目的地车
|
||||
destinationTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.destinationTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设人工车
|
||||
artificialTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.artificialTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 详细列车信息
|
||||
detailTrainInfo() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.detailTrainInfo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDetailInfo.doShow(operate, this.selected);
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert('实现中......', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加列车识别号
|
||||
addTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 创建车组号
|
||||
createTrainNo() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.createTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainCreateNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除列车识别号
|
||||
delTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除车组号
|
||||
deleteTrainNo() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.deleteTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDeleteNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改车组号
|
||||
editTrainNo() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainEditNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 移动车组号
|
||||
moveTrainNo() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMoveNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 移动列车识别号
|
||||
moveTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMove.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 交换列车识别号
|
||||
switchTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.switchTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainSwitch.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,150 +1,162 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
@ -160,4 +172,4 @@
|
||||
line-height: 20px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
width="70%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
|
@ -18,10 +18,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { listPublishMap } from '@/api/jmap/mapdraft';
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
@ -101,7 +100,7 @@ export default {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
|
@ -1,116 +1,126 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return {
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -124,4 +134,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,57 +1,66 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -61,4 +70,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,46 +1,55 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -50,4 +59,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,122 +1,143 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,152 +1,152 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationStandCode" label="起点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终点站台">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleAddTask">加任务</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleReplace">替  换</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
|
||||
</el-row>
|
||||
<div class="view-box">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-radio-group v-model="storeInOut">
|
||||
<el-radio :label="1">进库</el-radio>
|
||||
<el-radio :label="2">出库</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="view-box">
|
||||
<el-col :span="9" style="padding-left: 10px">
|
||||
<el-input v-model="oldServiceNumber" size="small" :disabled="true"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="9" style="padding-left: 20px">
|
||||
<el-input v-model="newServiceNumber" size="small"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button @click="handleModifyingTripNumber" style="width: 150px;">改车次号</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceStartTime" size="small"></el-time-select>
|
||||
</el-col>
|
||||
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceEndTime" size="small"></el-time-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-col :offset="10">线路详细信息</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="tripData" border style="width: 100%" height="200">
|
||||
<el-table-column prop="arriveTime" label="到站时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationCode" label="车站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationStandCode" label="站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule edit-planning-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站" />
|
||||
<el-table-column prop="startStationStandCode" label="起点站台" />
|
||||
<el-table-column prop="endStationCode" label="终点站" />
|
||||
<el-table-column prop="endStationStandCode" label="终点站台" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleAddTask">加任务</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
<el-button class="view-button" @click="handleReplace">替  换</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
|
||||
</el-row>
|
||||
<div class="view-box">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-radio-group v-model="storeInOut">
|
||||
<el-radio :label="1">进库</el-radio>
|
||||
<el-radio :label="2">出库</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="view-box">
|
||||
<el-col :span="9" style="padding-left: 10px">
|
||||
<el-input v-model="oldServiceNumber" size="small" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="9" style="padding-left: 20px">
|
||||
<el-input v-model="newServiceNumber" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button style="width: 150px;" @click="handleModifyingTripNumber">改车次号</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceStartTime" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceEndTime" size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-col :offset="10">线路详细信息</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="tripData" border style="width: 100%" height="200">
|
||||
<el-table-column prop="arriveTime" label="到站时间" />
|
||||
<el-table-column prop="stationCode" label="车站" />
|
||||
<el-table-column prop="stationStandCode" label="站台" />
|
||||
<el-table-column prop="stopTime" label="停站时间" />
|
||||
<el-table-column prop="level" label="运行等级" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'modifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
effect: false,
|
||||
storeInOut: '1',
|
||||
oldServiceNumber: '',
|
||||
newServiceNumber: '',
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} })
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} })
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} })
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} })
|
||||
},
|
||||
// 确定修改
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'ModifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
effect: false,
|
||||
storeInOut: '1',
|
||||
oldServiceNumber: '',
|
||||
newServiceNumber: '',
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} });
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
|
||||
},
|
||||
// 确定修改
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -157,13 +157,11 @@
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
.view-label {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
|
||||
.view-box {
|
||||
padding: 10px 0px;
|
||||
border: 1px inset gray;
|
||||
@ -176,4 +174,4 @@
|
||||
margin: 5px 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,298 +1,309 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.trainManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择">
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="1000px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.trainManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.clearGuest">清客</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.clearGuest">清客</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>序列号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.serialNumber" placeholder="请选择">
|
||||
<el-option v-for="item in serialNumberList" :key="item.value" :label="item.label"
|
||||
:value="model.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.serialManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择">
|
||||
<el-option v-for="item in levelList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false">
|
||||
</el-time-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>序列号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in serialNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="model.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.serialManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.level" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in levelList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.inStock">入库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.inStock">入库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-checkbox v-model="model.outStock">出库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-checkbox v-model="model.outStock">出库</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="140">
|
||||
<el-table-column prop="beginStationCode" label="起始站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终到站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终到站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="describe" label="描述" :width="280">
|
||||
</el-table-column>
|
||||
<el-table-column :width="40">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="140">
|
||||
<el-table-column prop="stationCode" label="站台" :width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.stationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="到点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.startTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.stopTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="发点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.endTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
</el-table-column>
|
||||
<el-table-column width="280">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="140">
|
||||
<el-table-column prop="beginStationCode" label="起始站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台" />
|
||||
<el-table-column prop="endStationCode" label="终到站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终到站台" />
|
||||
<el-table-column prop="describe" label="描述" :width="280" />
|
||||
<el-table-column :width="40" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="140">
|
||||
<el-table-column prop="stationCode" label="站台" :width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.stationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="到点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.startTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.stopTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="发点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.endTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级" />
|
||||
<el-table-column width="280" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
tripNumber: '',
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false,
|
||||
startTime: '',
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
let editData = this.$store.state.runPlan.editData[params.serviceNumber]
|
||||
if (editData) {
|
||||
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex });
|
||||
let trainInfo = editData.trainMap[params.tripNumber];
|
||||
let lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
let taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
}
|
||||
this.model.route.push(taskObj);
|
||||
export default {
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
tripNumber: '',
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false,
|
||||
startTime: '',
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
const editData = this.$store.state.runPlan.editData[params.serviceNumber];
|
||||
if (editData) {
|
||||
const trainInfo = editData.trainMap[params.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
};
|
||||
this.model.route.push(taskObj);
|
||||
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
let stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: '',
|
||||
}
|
||||
this.model.detail.push(stationObj);
|
||||
})
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
}
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
const stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: ''
|
||||
};
|
||||
this.model.detail.push(stationObj);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
@ -312,4 +323,4 @@
|
||||
width: 110px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -12,7 +12,10 @@ export default {
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -1,150 +1,162 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
@ -160,4 +172,4 @@
|
||||
line-height: 20px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
v-dialogDrag
|
||||
width="80%"
|
||||
width="70%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
|
@ -1,140 +1,147 @@
|
||||
<template>
|
||||
<el-dialog :title="title" class="beijing-01__schedule reload-today-plan" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" @click="handleConfirm" :loading="loading">加 载</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule reload-today-plan"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">加 载</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin'
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '加载当天计划'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
})
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
// 生成每日运行图
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.loadRunData();
|
||||
this.doClose();
|
||||
this.$message.success(`生成用户每日运行图成功`);
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.$messageBox(`生成用户每日运行图失败`);
|
||||
})
|
||||
} else {
|
||||
this.$messageBox(`请选择需要加载的运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadRunData() {
|
||||
let skinCode = this.$route.query.skinCode;
|
||||
this.$store.dispatch('runPlan/clear');
|
||||
if (skinCode) {
|
||||
getStationListBySkinCode(skinCode).then(response => {
|
||||
let stations = response.data;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
|
||||
this.$store.dispatch('runPlan/setStations', stations).then(() => {
|
||||
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
}).catch(error => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(`获取运行图数据失败`);
|
||||
})
|
||||
})
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取车站列表失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '加载当天计划';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
// 生成每日运行图
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
this.doClose();
|
||||
this.$message.success(`生成用户每日运行图成功`);
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.$messageBox(`生成用户每日运行图失败`);
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(`请选择需要加载的运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadRunData() {
|
||||
const skinCode = this.$route.query.skinCode;
|
||||
this.$store.dispatch('runPlan/clear');
|
||||
if (skinCode) {
|
||||
getStationListBySkinCode(skinCode).then(response => {
|
||||
const stations = response.data;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
|
||||
this.$store.dispatch('runPlan/setStations', stations).then(() => {
|
||||
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(`获取运行图数据失败`);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取车站列表失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,116 +1,126 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return {
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -124,4 +134,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,57 +1,66 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -61,4 +70,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,46 +1,55 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -50,4 +59,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,122 +1,143 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,152 +1,152 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationStandCode" label="起点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终点站台">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleAddTask">加任务</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleReplace">替  换</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
|
||||
</el-row>
|
||||
<div class="view-box">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-radio-group v-model="storeInOut">
|
||||
<el-radio :label="1">进库</el-radio>
|
||||
<el-radio :label="2">出库</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="view-box">
|
||||
<el-col :span="9" style="padding-left: 10px">
|
||||
<el-input v-model="oldServiceNumber" size="small" :disabled="true"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="9" style="padding-left: 20px">
|
||||
<el-input v-model="newServiceNumber" size="small"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button @click="handleModifyingTripNumber" style="width: 150px;">改车次号</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceStartTime" size="small"></el-time-select>
|
||||
</el-col>
|
||||
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceEndTime" size="small"></el-time-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-col :offset="10">线路详细信息</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="tripData" border style="width: 100%" height="200">
|
||||
<el-table-column prop="arriveTime" label="到站时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationCode" label="车站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationStandCode" label="站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule edit-planning-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站" />
|
||||
<el-table-column prop="startStationStandCode" label="起点站台" />
|
||||
<el-table-column prop="endStationCode" label="终点站" />
|
||||
<el-table-column prop="endStationStandCode" label="终点站台" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleAddTask">加任务</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
<el-button class="view-button" @click="handleReplace">替  换</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
|
||||
</el-row>
|
||||
<div class="view-box">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-radio-group v-model="storeInOut">
|
||||
<el-radio :label="1">进库</el-radio>
|
||||
<el-radio :label="2">出库</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="view-box">
|
||||
<el-col :span="9" style="padding-left: 10px">
|
||||
<el-input v-model="oldServiceNumber" size="small" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="9" style="padding-left: 20px">
|
||||
<el-input v-model="newServiceNumber" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button style="width: 150px;" @click="handleModifyingTripNumber">改车次号</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceStartTime" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceEndTime" size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-col :offset="10">线路详细信息</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="tripData" border style="width: 100%" height="200">
|
||||
<el-table-column prop="arriveTime" label="到站时间" />
|
||||
<el-table-column prop="stationCode" label="车站" />
|
||||
<el-table-column prop="stationStandCode" label="站台" />
|
||||
<el-table-column prop="stopTime" label="停站时间" />
|
||||
<el-table-column prop="level" label="运行等级" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'modifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
effect: false,
|
||||
storeInOut: '1',
|
||||
oldServiceNumber: '',
|
||||
newServiceNumber: '',
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} })
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} })
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} })
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} })
|
||||
},
|
||||
// 确定修改
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'ModifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
effect: false,
|
||||
storeInOut: '1',
|
||||
oldServiceNumber: '',
|
||||
newServiceNumber: '',
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} });
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
|
||||
},
|
||||
// 确定修改
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -157,13 +157,11 @@
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
.view-label {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
|
||||
.view-box {
|
||||
padding: 10px 0px;
|
||||
border: 1px inset gray;
|
||||
@ -176,4 +174,4 @@
|
||||
margin: 5px 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,298 +1,309 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.trainManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择">
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="1000px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.trainManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.clearGuest">清客</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.clearGuest">清客</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>序列号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.serialNumber" placeholder="请选择">
|
||||
<el-option v-for="item in serialNumberList" :key="item.value" :label="item.label"
|
||||
:value="model.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.serialManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择">
|
||||
<el-option v-for="item in levelList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false">
|
||||
</el-time-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>序列号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in serialNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="model.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.serialManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.level" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in levelList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.inStock">入库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.inStock">入库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-checkbox v-model="model.outStock">出库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-checkbox v-model="model.outStock">出库</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="140">
|
||||
<el-table-column prop="beginStationCode" label="起始站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终到站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终到站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="describe" label="描述" :width="280">
|
||||
</el-table-column>
|
||||
<el-table-column :width="40">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="140">
|
||||
<el-table-column prop="stationCode" label="站台" :width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.stationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="到点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.startTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.stopTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="发点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.endTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
</el-table-column>
|
||||
<el-table-column width="280">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="140">
|
||||
<el-table-column prop="beginStationCode" label="起始站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台" />
|
||||
<el-table-column prop="endStationCode" label="终到站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终到站台" />
|
||||
<el-table-column prop="describe" label="描述" :width="280" />
|
||||
<el-table-column :width="40" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="140">
|
||||
<el-table-column prop="stationCode" label="站台" :width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.stationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="到点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.startTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.stopTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="发点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.endTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级" />
|
||||
<el-table-column width="280" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
tripNumber: '',
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false,
|
||||
startTime: '',
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
let editData = this.$store.state.runPlan.editData[params.serviceNumber]
|
||||
if (editData) {
|
||||
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex });
|
||||
let trainInfo = editData.trainMap[params.tripNumber];
|
||||
let lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
let taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
}
|
||||
this.model.route.push(taskObj);
|
||||
export default {
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
tripNumber: '',
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false,
|
||||
startTime: '',
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
const editData = this.$store.state.runPlan.editData[params.serviceNumber];
|
||||
if (editData) {
|
||||
const trainInfo = editData.trainMap[params.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
};
|
||||
this.model.route.push(taskObj);
|
||||
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
let stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: '',
|
||||
}
|
||||
this.model.detail.push(stationObj);
|
||||
})
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
}
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
const stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: ''
|
||||
};
|
||||
this.model.detail.push(stationObj);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
@ -312,4 +323,4 @@
|
||||
width: 110px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,423 +1,464 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm train-control" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-select v-model="formModel.groupNumber" :id="domIdTrainNumber" filterable
|
||||
:disabled="trainNumberIsDisabled" @change="trainNumberChange">
|
||||
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber"
|
||||
:value="train.groupNumber">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width='0px'>
|
||||
<el-radio-group v-model="formModel.trainType" :id="domIdTrainType" style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled" @change="trainTypeChange">
|
||||
<el-radio :label="'01'">计划车</el-radio>
|
||||
<el-radio :label="'02'">头码车</el-radio>
|
||||
<el-radio :label="'03'">人工车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="serviceNumber">
|
||||
<span slot="label">表  号</span>
|
||||
<el-input v-model="formModel.serviceNumber" :id="domIdServerNo" :disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="车 次 号:" prop="tripNumber">
|
||||
<el-input v-model="formModel.tripNumber" :id="domIdTrainNo" :disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的地号:" prop="targetCode">
|
||||
<el-input v-model="formModel.targetCode" :id="domIdTargetCode" :disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-train ref="confirmTrain"></confirm-train>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm train-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.groupNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.trainType"
|
||||
style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'01'">计划车</el-radio>
|
||||
<el-radio :label="'02'">头码车</el-radio>
|
||||
<el-radio :label="'03'">人工车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="serviceNumber">
|
||||
<span slot="label">表  号</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车 次 号:" prop="tripNumber">
|
||||
<el-input
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.tripNumber"
|
||||
:disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的地号:" prop="targetCode">
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.targetCode"
|
||||
:disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-train ref="confirmTrain" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishTrainList } from '@/api/jmap/map';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishTrainList } from '@/api/jmap/map';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
components: {
|
||||
ConfirmTrain,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainList: [],
|
||||
formModel: {
|
||||
tripNumber: '',
|
||||
groupNumber: '',
|
||||
trainType: '01',
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
components: {
|
||||
ConfirmTrain,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainList: [],
|
||||
formModel: {
|
||||
tripNumber: '',
|
||||
groupNumber: '',
|
||||
trainType: '01',
|
||||
serviceNumber: '',
|
||||
targetCode: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请选择车组号', trigger: 'change' }
|
||||
],
|
||||
trainType: [
|
||||
{ required: true, message: '请选择一个列车类型', trigger: 'change' }
|
||||
],
|
||||
serviceNumber: [
|
||||
{ required: true, message: '请输入表号', trigger: 'blur' }
|
||||
],
|
||||
tripNumber: [
|
||||
{ required: true, message: '请输入车次号', trigger: 'blur' }
|
||||
],
|
||||
targetCode: [
|
||||
{ required: true, message: '请输入目的地号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
direction: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
trainNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
targetCodeIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
trainNumberIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
trainTypeIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.serverNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.menu.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return '添加列车识别号';
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map.skinCode) {
|
||||
getPublishTrainList(map.skinCode).then(resp => {
|
||||
this.trainList = resp.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
let model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.formModel = {
|
||||
groupNumber: model.groupNumber,
|
||||
tripNumber: model.tripNumber,
|
||||
trainType: '01',
|
||||
serviceNumber: model.serviceNumber,
|
||||
targetCode: model.targetCode,
|
||||
};
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请选择车组号', trigger: 'change' }
|
||||
],
|
||||
trainType: [
|
||||
{ required: true, message: '请选择一个列车类型', trigger: 'change' }
|
||||
],
|
||||
serviceNumber: [
|
||||
{ required: true, message: '请输入表号', trigger: 'blur' }
|
||||
],
|
||||
tripNumber: [
|
||||
{ required: true, message: '请输入车次号', trigger: 'blur' }
|
||||
],
|
||||
targetCode: [
|
||||
{ required: true, message: '请输入目的地号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
direction: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
trainNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
targetCodeIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
trainNumberIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
trainTypeIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.serverNoChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.menu.domId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return '添加列车识别号';
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map.skinCode) {
|
||||
getPublishTrainList(map.skinCode).then(resp => {
|
||||
this.trainList = resp.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.formModel = {
|
||||
groupNumber: model.groupNumber,
|
||||
tripNumber: model.tripNumber,
|
||||
trainType: '01',
|
||||
serviceNumber: model.serviceNumber,
|
||||
targetCode: model.targetCode
|
||||
};
|
||||
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange(groupNumber) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${groupNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange(groupNumber) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${groupNumber}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainType}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainType}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
serverNoChange(serviceNumber) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${serviceNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
serverNoChange(serviceNumber) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${serviceNumber}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
trainNoChange(tripNumber) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${tripNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainNoChange(tripNumber) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${tripNumber}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
targetCodeChange(targetCode) {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${targetCode}`,
|
||||
operation: ''
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
targetCodeChange(targetCode) {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${targetCode}`,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 增加列车识别号*/
|
||||
this.addTrainId();
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
this.editTrainId();
|
||||
}
|
||||
},
|
||||
//增加列车识别号
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let model = this.formModel;
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
messages: [`添加列车识别号:成功`],
|
||||
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 增加列车识别号*/
|
||||
this.addTrainId();
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
this.editTrainId();
|
||||
}
|
||||
},
|
||||
// 增加列车识别号
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const model = this.formModel;
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
messages: [`添加列车识别号:成功`],
|
||||
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改列车识别号
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
messages: [`修改列车识别号:成功`],
|
||||
val: this.formModel.tripNumber,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
messages: [`修改列车识别号:成功`],
|
||||
val: this.formModel.tripNumber
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,156 +1,165 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
formModel: {
|
||||
groupNumber: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
formModel: {
|
||||
groupNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${groupNumber}`,
|
||||
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
|
||||
}
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
domIdTrainNumber() {
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${this.formModel.groupNumber}`,
|
||||
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.formModel.groupNumber
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.formModel.groupNumber
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,318 +1,321 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<train-control ref="trainControl"></train-control>
|
||||
<train-delete ref="trainDelete"></train-delete>
|
||||
<train-move ref="trainMove"></train-move>
|
||||
<train-switch ref="trainSwitch"></train-switch>
|
||||
<train-edit-number ref="trainEditNumber"></train-edit-number>
|
||||
</div>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-control ref="trainControl" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<train-move ref="trainMove" />
|
||||
<train-switch ref="trainSwitch" />
|
||||
<train-edit-number ref="trainEditNumber" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
|
||||
export default {
|
||||
name: 'menuTrain',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
TrainControl,
|
||||
TrainDelete,
|
||||
TrainMove,
|
||||
TrainSwitch,
|
||||
TrainEditNumber
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [],
|
||||
central: [
|
||||
{
|
||||
label: '添加列车识别号',
|
||||
handler: this.addTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除列车识别号',
|
||||
handler: this.delTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.delTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改列车识别号',
|
||||
handler: this.editTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动列车识别号',
|
||||
handler: this.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '交换列车识别号',
|
||||
handler: this.switchTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.switchTrainId,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置通信故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消通信故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.cancelStoppage
|
||||
}
|
||||
],
|
||||
menuSpeed: [
|
||||
{
|
||||
label: '确认运行至前方站',
|
||||
handler: this.limitSpeed,
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
//编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]
|
||||
}
|
||||
export default {
|
||||
name: 'MenuTrain',
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
TrainControl,
|
||||
TrainDelete,
|
||||
TrainMove,
|
||||
TrainSwitch,
|
||||
TrainEditNumber
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [],
|
||||
central: [
|
||||
{
|
||||
label: '添加列车识别号',
|
||||
handler: this.addTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除列车识别号',
|
||||
handler: this.delTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.delTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改列车识别号',
|
||||
handler: this.editTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainNo,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainNo,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动列车识别号',
|
||||
handler: this.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '交换列车识别号',
|
||||
handler: this.switchTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.switchTrainId,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置通信故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消通信故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Train.cancelStoppage
|
||||
}
|
||||
],
|
||||
menuSpeed: [
|
||||
{
|
||||
label: '确认运行至前方站',
|
||||
handler: this.limitSpeed,
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
//故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed]
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//限速行驶
|
||||
limitSpeed() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.limitSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//添加列车识别号
|
||||
addTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除列车识别号
|
||||
delTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改列车识别号
|
||||
editTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改车组号
|
||||
editTrainNo() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainEditNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//移动列车识别号
|
||||
moveTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMove.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//交换列车识别号
|
||||
switchTrainId() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.switchTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainSwitch.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 限速行驶
|
||||
limitSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.limitSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 添加列车识别号
|
||||
addTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除列车识别号
|
||||
delTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainDelete.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 修改车组号
|
||||
editTrainNo() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainEditNumber.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 移动列车识别号
|
||||
moveTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainMove.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 交换列车识别号
|
||||
switchTrainId() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.switchTrainId.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainSwitch.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,150 +1,162 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">加在最前</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">加在最后</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: '1',
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
startTime: '',
|
||||
default: false,
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
@ -160,4 +172,4 @@
|
||||
line-height: 20px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -4,7 +4,7 @@
|
||||
:title="title"
|
||||
class="fuzhou-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
width="70%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
@ -93,11 +93,11 @@ export default {
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
this.doClose();
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
|
@ -18,9 +18,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
@ -100,7 +100,7 @@ export default {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
|
@ -1,116 +1,126 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
import { createRunPlanLoad } from '@/api/runplan';
|
||||
import ChooseTemplatePlan from './chooseTemplatePlan';
|
||||
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
export default {
|
||||
name: 'CreateWeekPlan',
|
||||
components: {
|
||||
ChooseTemplatePlan
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleChoose() {
|
||||
this.$refs.choose.doShow();
|
||||
},
|
||||
chooseConfirm(choose) {
|
||||
if (choose) {
|
||||
this.model.planId = choose.id;
|
||||
this.model.planName = choose.name;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return {
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -124,4 +134,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,57 +1,66 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">删除以后所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -61,4 +70,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,46 +1,55 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'DeleteTodayPlan',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
// this.tripNumber
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -50,4 +59,4 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,122 +1,143 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,152 +1,152 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationStandCode" label="起点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终点站台">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleAddTask">加任务</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleReplace">替  换</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
|
||||
</el-row>
|
||||
<div class="view-box">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-radio-group v-model="storeInOut">
|
||||
<el-radio :label="1">进库</el-radio>
|
||||
<el-radio :label="2">出库</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="view-box">
|
||||
<el-col :span="9" style="padding-left: 10px">
|
||||
<el-input v-model="oldServiceNumber" size="small" :disabled="true"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="9" style="padding-left: 20px">
|
||||
<el-input v-model="newServiceNumber" size="small"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button @click="handleModifyingTripNumber" style="width: 150px;">改车次号</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceStartTime" size="small"></el-time-select>
|
||||
</el-col>
|
||||
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceEndTime" size="small"></el-time-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-col :offset="10">线路详细信息</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="tripData" border style="width: 100%" height="200">
|
||||
<el-table-column prop="arriveTime" label="到站时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationCode" label="车站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationStandCode" label="站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule edit-planning-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站" />
|
||||
<el-table-column prop="startStationStandCode" label="起点站台" />
|
||||
<el-table-column prop="endStationCode" label="终点站" />
|
||||
<el-table-column prop="endStationStandCode" label="终点站台" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleAddTask">加任务</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
<el-button class="view-button" @click="handleReplace">替  换</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleDeleteTask">删任务</el-button>
|
||||
</el-row>
|
||||
<div class="view-box">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-radio-group v-model="storeInOut">
|
||||
<el-radio :label="1">进库</el-radio>
|
||||
<el-radio :label="2">出库</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="view-box">
|
||||
<el-col :span="9" style="padding-left: 10px">
|
||||
<el-input v-model="oldServiceNumber" size="small" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="9" style="padding-left: 20px">
|
||||
<el-input v-model="newServiceNumber" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button style="width: 150px;" @click="handleModifyingTripNumber">改车次号</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-col :span="4"><span class="view-label">线路开始时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceStartTime" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="4"><span class="view-label">线路结束时间</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceEndTime" size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-col :offset="10">线路详细信息</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="tripData" border style="width: 100%" height="200">
|
||||
<el-table-column prop="arriveTime" label="到站时间" />
|
||||
<el-table-column prop="stationCode" label="车站" />
|
||||
<el-table-column prop="stationStandCode" label="站台" />
|
||||
<el-table-column prop="stopTime" label="停站时间" />
|
||||
<el-table-column prop="level" label="运行等级" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-checkbox v-model="effect">影响后续任务</el-checkbox>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'modifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
effect: false,
|
||||
storeInOut: '1',
|
||||
oldServiceNumber: '',
|
||||
newServiceNumber: '',
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} })
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} })
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} })
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} })
|
||||
},
|
||||
// 确定修改
|
||||
commit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'ModifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
effect: false,
|
||||
storeInOut: '1',
|
||||
oldServiceNumber: '',
|
||||
newServiceNumber: '',
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} });
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
|
||||
},
|
||||
// 确定修改
|
||||
commit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -157,13 +157,11 @@
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
.view-label {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
|
||||
.view-box {
|
||||
padding: 10px 0px;
|
||||
border: 1px inset gray;
|
||||
@ -176,4 +174,4 @@
|
||||
margin: 5px 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,298 +1,309 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.trainManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择">
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="1000px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.trainManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.clearGuest">清客</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.clearGuest">清客</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>序列号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.serialNumber" placeholder="请选择">
|
||||
<el-option v-for="item in serialNumberList" :key="item.value" :label="item.label"
|
||||
:value="model.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.serialManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择">
|
||||
<el-option v-for="item in levelList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false">
|
||||
</el-time-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>序列号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in serialNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="model.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.serialManual">手工</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.level" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in levelList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.inStock">入库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row>
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.inStock">入库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-checkbox v-model="model.outStock">出库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-checkbox v-model="model.outStock">出库</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="140">
|
||||
<el-table-column prop="beginStationCode" label="起始站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终到站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终到站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="describe" label="描述" :width="280">
|
||||
</el-table-column>
|
||||
<el-table-column :width="40">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="140">
|
||||
<el-table-column prop="stationCode" label="站台" :width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.stationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="到点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.startTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.stopTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="发点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.endTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级">
|
||||
</el-table-column>
|
||||
<el-table-column width="280">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
交路:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="140">
|
||||
<el-table-column prop="beginStationCode" label="起始站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台" />
|
||||
<el-table-column prop="endStationCode" label="终到站">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终到站台" />
|
||||
<el-table-column prop="describe" label="描述" :width="280" />
|
||||
<el-table-column :width="40" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
详情:
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="140">
|
||||
<el-table-column prop="stationCode" label="站台" :width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.stationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="到点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.startTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stopTime" label="停站时间">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.stopTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="发点">
|
||||
<template slot-scope="scope">
|
||||
{{ formatTime(scope.row.endTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="level" label="运行等级" />
|
||||
<el-table-column width="280" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
tripNumber: '',
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false,
|
||||
startTime: '',
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
let editData = this.$store.state.runPlan.editData[params.serviceNumber]
|
||||
if (editData) {
|
||||
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex });
|
||||
let trainInfo = editData.trainMap[params.tripNumber];
|
||||
let lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
let taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
}
|
||||
this.model.route.push(taskObj);
|
||||
export default {
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
tripNumber: '',
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false,
|
||||
startTime: '',
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
const editData = this.$store.state.runPlan.editData[params.serviceNumber];
|
||||
if (editData) {
|
||||
const trainInfo = editData.trainMap[params.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
};
|
||||
this.model.route.push(taskObj);
|
||||
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
let stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: '',
|
||||
}
|
||||
this.model.detail.push(stationObj);
|
||||
})
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
}
|
||||
}
|
||||
}
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
const stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: ''
|
||||
};
|
||||
this.model.detail.push(stationObj);
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
commit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
@ -312,4 +323,4 @@
|
||||
width: 110px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -160,9 +160,6 @@ export function parser(data, skinCode) {
|
||||
section['relSwitchCode'] = elem.code;
|
||||
}
|
||||
|
||||
mapDevice[elem.code]['sectionAInstance'] = cnodeSection;
|
||||
mapDevice[elem.code]['sectionBInstance'] = lnodeSection;
|
||||
mapDevice[elem.code]['sectionCInstance'] = rnodeSection;
|
||||
rnodeSection['layer'] = -1;
|
||||
}
|
||||
}, this);
|
||||
|
@ -3,6 +3,7 @@ import Vue from 'vue';
|
||||
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
|
||||
|
||||
import ElementUI from 'element-ui';
|
||||
import ElementLocale from 'element-ui/lib/locale';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
|
||||
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
|
||||
@ -31,6 +32,8 @@ export const i18n = new VueI18n({
|
||||
messages
|
||||
});
|
||||
|
||||
ElementLocale.i18n((key, value) => i18n.t(key, value));
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
|