This commit is contained in:
sunzhenyu 2019-09-02 10:19:45 +08:00
commit ad5853498f
199 changed files with 12814 additions and 9145 deletions

View File

@ -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) { export function createLessonPermisson(data) {
return request({ return request({
@ -26,10 +18,19 @@ export function createLessonPermisson(data) {
data: data data: data
}); });
} }
/** 获取权限详情*/
export function getPermissonDetail(id) {
return request({
url: `/api/permission/${id}/package`,
method: 'get'
});
}
/** 获取用户某课程某段时间内可用的权限数量*/ /** 获取用户某课程某段时间内可用的权限数量*/
export function getTotalRemains(params) { export function getTotalRemains(params) {
return request({ return request({
url: '/api/permission/totalRemains', url: '/api/userPermission/totalRemains',
method: 'get', method: 'get',
params: params params: params
}); });
@ -37,7 +38,7 @@ export function getTotalRemains(params) {
/** 设置权限失效或有效*/ /** 设置权限失效或有效*/
export function setLessonPermisson(data) { export function setLessonPermisson(data) {
return request({ return request({
url: `/api/permission/${data.id}/status`, url: `/api/userPermission/${data.id}/status`,
method: 'put', method: 'put',
data: data data: data
}); });
@ -48,7 +49,7 @@ export function setLessonPermisson(data) {
*/ */
export function queryPermissionSimulation(data) { export function queryPermissionSimulation(data) {
return request({ return request({
url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`, url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
method: 'get' method: 'get'
}); });
} }
@ -56,38 +57,28 @@ export function queryPermissionSimulation(data) {
/** 获取大屏权限列表*/ /** 获取大屏权限列表*/
export function queryPermissionScreen() { export function queryPermissionScreen() {
return request({ return request({
url: `/api/permission/bigScreen`, url: `/api/userPermission/bigScreen`,
method: 'get' 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) { export function listUserPermision(params) {
return request({ return request({
url: `/api/permission/my`, url: `/api/userPermission/my`,
method: 'get', method: 'get',
params: params params: params
}); });
@ -101,10 +92,10 @@ export function getDistribute(id) {
}); });
} }
/** 用户权限列表 */ /** 设置权限所有者 */
export function putPermissionOwner(data) { export function putPermissionOwner(data) {
return request({ return request({
url: `/api/permission/${data.id}/owner`, url: `/api/userPermission/${data.id}/owner`,
method: 'put', method: 'put',
data: data.owner data: data.owner
}); });

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 上课权限获取*/ /** 权限转增*/
export function getLessons(data) { export function getLessons(data) {
return request({ return request({
url: '/api/distribute/getLessons', url: '/api/distribute/getLessons',
@ -9,15 +9,41 @@ export function getLessons(data) {
}); });
} }
/** 上课权限分发*/ /** 权限分发*/
export function giveLessons(data) { export function giveLessons(data) {
return request({ return request({
url: '/api/distribute/givePermission', url: '/api/distribute/distribute',
method: 'post', method: 'post',
data: data 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) { export function receiveLessons(data) {
return request({ return request({

View File

@ -66,7 +66,7 @@ export function getCommodityDetailById(id) {
*/ */
export function updataCommodityList(data) { export function updataCommodityList(data) {
return request({ return request({
url: `/api/goods`, url: `/api/goods/${data.id}`,
method: 'put', method: 'put',
data: data data: data
}); });

View File

@ -277,20 +277,14 @@ export function deleteRunPlanTemplate(planId) {
} }
/** 生成通用每日运行图*/ /** 生成通用每日运行图*/
export function generateCommonRunPlanEveryDay(planId) { export function generateCommonRunPlanEveryDay(planId, params) {
return request({ return request({
url: `/api/runPlan/template/generate/${planId}`, 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) { export function runPlanEveryDayList(params) {
return request({ return request({
@ -309,20 +303,12 @@ export function deleteRunPlanEveryDay(planId) {
} }
/** 获取地图运行图的车次号*/ /** 获取地图运行图的车次号*/
export function getPublishMapTrainNos(skinCode) { // export function getPublishMapTrainNos(skinCode) {
return request({ // return request({
url: `/api/runPlan/daily/${skinCode}/trainNos`, // url: `/api/runPlan/daily/${skinCode}/trainNos`,
method: 'get' // method: 'get'
}); // });
} // }
/** 获取服务号、车组号*/
export function getPublishMapTrainServerNos(skinCode) {
return request({
url: `/api/runPlan/daily/${skinCode}/serverNos`,
method: 'get'
});
}
/** 分页查询加载计划*/ /** 分页查询加载计划*/
export function getRunPlanLoadList(params) { export function getRunPlanLoadList(params) {
@ -374,3 +360,11 @@ export function queryRunPlanDaily(planId) {
method: 'get' method: 'get'
}); });
} }
/** 获取模板运行图列表*/
export function listAllTempLateRunPlan() {
return request({
url: `/api/runPlan/template/all`,
method: 'get'
});
}

46
src/api/scheduling.js Normal file
View 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'
});
}

View File

@ -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) { export function scriptRecordNotify(scriptId) {
return request({ return request({
@ -239,7 +231,7 @@ export function selectScriptMembers(group, data) {
export function modifyScriptMemberSex(group, playerId, data) { export function modifyScriptMemberSex(group, playerId, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`, url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
method: 'put', method: 'put'
}); });
} }
@ -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) { export function getExistingSimulation(params) {
return request({ return request({
@ -396,14 +309,6 @@ export function getDeviceCodeByDeviceType(group, params) {
params params
}); });
} }
// /** 根据设备类型获取设备条件列表 */
// export function getDeviceCoditionByDeviceType(params) {
// return request({
// url: `/api/simulation/deviceType/conditions`,
// method: 'get',
// params
// });
// }
/** 获取任务录制的数据 */ /** 获取任务录制的数据 */
export function getScriptRecord(group) { export function getScriptRecord(group) {
@ -486,3 +391,20 @@ export function executeScript(group) {
method: 'post' 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
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 MiB

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -63,8 +63,7 @@
:sortable="column.sortable" :sortable="column.sortable"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="column.tagType(scope.row, scope.$index)">{{ column.columnValue(scope.row, <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>
scope.$index) }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

@ -13,7 +13,7 @@ export default {
trainingRule: 'Training rules', trainingRule: 'Training rules',
trainingManage: 'Training management', trainingManage: 'Training management',
taskManage: 'Task management', taskManage: 'Task management',
scriptManage: 'Script management', scriptManage: 'Script',
teachSystem: 'Teaching', teachSystem: 'Teaching',
@ -28,13 +28,14 @@ export default {
replayManage: 'Playback', replayManage: 'Playback',
permissionManage: 'Permission', permissionManage: 'Permission',
selfPermission: 'My Permission',
pulishManage: 'Publication', pulishManage: 'Publication',
publishMapManage: 'Publishing map management', publishMapManage: 'Publishing map management',
productStateManage: 'Product state management', productStateManage: 'Product state management',
publishLessonManage: 'Publishing lesson management', publishLessonManage: 'Publishing lesson management',
runPlanTemplateManage: 'Template plan management', runPlanTemplateManage: 'Template plan management',
runPlanCommonManage: 'General plan management', runPlanCommonManage: 'Loading Plan Managemen',
runPlanEveryDayManage: 'Daily plan Management', runPlanEveryDayManage: 'Daily plan Management',
examRuleManage: 'Management of examination rules', examRuleManage: 'Management of examination rules',
@ -43,6 +44,7 @@ export default {
orderManage: 'Order management', orderManage: 'Order management',
authorityManage: 'authority management', authorityManage: 'authority management',
authorityTransferManage: 'Privilege distribution management', authorityTransferManage: 'Privilege distribution management',
userRulesManage: 'User Rights Statistics',
addCommodity: 'Adding goods', addCommodity: 'Adding goods',
addOrder: 'Adding orders', addOrder: 'Adding orders',
addCoursePermissions: 'Adding course permissions', addCoursePermissions: 'Adding course permissions',

View File

@ -46,7 +46,7 @@ export default {
renew: '续费', renew: '续费',
productName: '产品名称', productName: '产品名称',
recovery: '回收', recovery: '回收',
permissionPack: '权限', permissionPack: '权限',
privilegeTransferQRCode: '权限转赠二维码', privilegeTransferQRCode: '权限转赠二维码',
generatingQRCode: '生成二维码', generatingQRCode: '生成二维码',
transferQRCode: '转赠二维码', transferQRCode: '转赠二维码',

View File

@ -10,7 +10,7 @@ export default {
permissionStatus: '权限状态', permissionStatus: '权限状态',
permissionUseType: '公用/专用', permissionUseType: '公用/专用',
permissionTotal: '权限总数', permissionTotal: '权限总数',
permissionRemains: '生于权限', permissionRemains: '剩余权限',
isForever: '是否永久', isForever: '是否永久',
startTime: '开始时间', startTime: '开始时间',
endTime: '结束时间', endTime: '结束时间',

View File

@ -28,13 +28,14 @@ export default {
replayManage: '回放管理', replayManage: '回放管理',
permissionManage: '权限管理', permissionManage: '权限管理',
selfPermission: '我的权限',
pulishManage: '发布内容管理', pulishManage: '发布内容管理',
publishMapManage: '发布地图管理', publishMapManage: '发布地图管理',
productStateManage: '产品状态管理', productStateManage: '产品状态管理',
publishLessonManage: '发布课程管理', publishLessonManage: '发布课程管理',
runPlanTemplateManage: '模板运行图管理', runPlanTemplateManage: '模板运行图管理',
runPlanCommonManage: '通用运行图管理', runPlanCommonManage: '加载计划运行图管理',
runPlanEveryDayManage: '每日运行图管理', runPlanEveryDayManage: '每日运行图管理',
examRuleManage: '试题规则管理', examRuleManage: '试题规则管理',
@ -43,6 +44,7 @@ export default {
orderManage: '订单管理', orderManage: '订单管理',
authorityManage: '权限管理', authorityManage: '权限管理',
authorityTransferManage: '权限分发管理', authorityTransferManage: '权限分发管理',
userRulesManage: '用户权限统计',
addCommodity: '添加商品', addCommodity: '添加商品',
addOrder: '添加订单', addOrder: '添加订单',
addCoursePermissions: '添加课程权限', addCoursePermissions: '添加课程权限',
@ -51,9 +53,9 @@ export default {
dataDictionary: '数据字典', dataDictionary: '数据字典',
dataDictionaryDetails: '数据字典明细', dataDictionaryDetails: '数据字典明细',
userManage: '用户管理', userManage: '用户管理',
userTrainingManage: '用户实训管理', userTrainingManage: '用户实训统计',
userExamManage: '用户考试管理', userExamManage: '用户考试统计',
userSimulationManage: '用户仿真管理', userSimulationManage: '用户仿真统计',
existingSimulation: '存在仿真管理', existingSimulation: '存在仿真管理',
ibpDraw: 'Ibp盘绘制' ibpDraw: 'Ibp盘绘制'

View File

@ -4,31 +4,31 @@ const deviceRender = {};
/** IbpText渲染配置*/ /** IbpText渲染配置*/
deviceRender[deviceType.IbpText] = { deviceRender[deviceType.IbpText] = {
zlevel: 1 zlevel: 2
}; };
/** SquareButton渲染配置*/ /** SquareButton渲染配置*/
deviceRender[deviceType.SquareButton] = { deviceRender[deviceType.SquareButton] = {
zlevel: 1 zlevel: 2
}; };
/** WarnButton渲染配置*/ /** WarnButton渲染配置*/
deviceRender[deviceType.WarnButton] = { deviceRender[deviceType.WarnButton] = {
zlevel: 1 zlevel: 2
}; };
/** Arrow渲染配置*/ /** Arrow渲染配置*/
deviceRender[deviceType.Arrow] = { deviceRender[deviceType.Arrow] = {
zlevel: 1 zlevel: 2
}; };
/** RotatingButton渲染配置*/ /** RotatingButton渲染配置*/
deviceRender[deviceType.RotatingButton] = { deviceRender[deviceType.RotatingButton] = {
zlevel: 1 zlevel: 2
}; };
/** Tip渲染配置*/ /** TipBox渲染配置*/
deviceRender[deviceType.Tip] = { deviceRender[deviceType.TipBox] = {
zlevel: 1 zlevel: 1
}; };
@ -39,6 +39,32 @@ deviceRender[deviceType.Background] = {
/** CircularLamp渲染配置 */ /** CircularLamp渲染配置 */
deviceRender[deviceType.CircularLamp] = { deviceRender[deviceType.CircularLamp] = {
zlevel: 2
};
/** AppendageBox渲染配置 */
deviceRender[deviceType.AppendageBox] = {
zlevel: 1 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; export default deviceRender;

View File

@ -1,12 +1,17 @@
const deviceType = { const deviceType = {
IbpText: 'IbpText', IbpText: 'IbpText',
SquareButton: 'SquareButton', SquareButton: 'SquareButton',
WarnButton: 'WarnButton',
Arrow: 'Arrow', Arrow: 'Arrow',
RotatingButton: 'RotatingButton', RotatingButton: 'RotatingButton',
Tip: 'Tip', TipBox: 'TipBox',
Background: 'Background', Background: 'Background',
CircularLamp: 'CircularLamp' CircularLamp: 'CircularLamp',
IbpLine: 'IbpLine',
AppendageBox: 'AppendageBox',
Alarm: 'Alarm',
Elevator: 'Elevator',
Key: 'Key',
TeleTerminal: 'TeleTerminal'
}; };
export default deviceType; export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@ import Painter from './painter';
import deviceState from '../jmap/constant/deviceState'; import deviceState from '../jmap/constant/deviceState';
import deviceType from './constant/deviceType'; import deviceType from './constant/deviceType';
import {calculateDCenter, createBoundingRect, modelFactory} from './utils/parser'; import {calculateDCenter, createBoundingRect, modelFactory} from './utils/parser';
import { updateIbpData } from './utils/parser';
const renderer = 'canvas'; const renderer = 'canvas';
const devicePixelRatio = 1; const devicePixelRatio = 1;
@ -122,15 +123,16 @@ class IbpPan {
} }
render(list) { render(list) {
console.log('-*-*-*-*-', list);
(list || []).forEach(elem => { (list || []).forEach(elem => {
const code = elem.code; const code = elem.code;
const type = elem._type; const type = elem._type;
updateIbpData(elem);
const oDevice = this.ibpDevice[code] || {instance: null, event: null, model: modelFactory(type, 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); this.$painter.delete(oDevice);
if (!elem._dispose) { if (!elem._dispose) {
this.ibpDevice[code] = nDevice; this.ibpDevice[code] = nDevice;
console.log('--3', nDevice);
this.$painter.add(nDevice); this.$painter.add(nDevice);
} }
}); });
@ -221,6 +223,7 @@ class IbpPan {
} }
resize(opt) { resize(opt) {
console.log('----------',this.$ibpZr);
this.$ibpZr.resize(opt); this.$ibpZr.resize(opt);
this.$painter.updateZrSize(opt); this.$painter.updateZrSize(opt);
} }

View File

@ -61,8 +61,10 @@ class Painter {
add(device) { add(device) {
device = Object.assign(device, { event: this.$ibp.$mouseController }); device = Object.assign(device, { event: this.$ibp.$mouseController });
const instance = shapefactory(device, this.$ibp); const instance = shapefactory(device, this.$ibp);
console.log('--4', instance);
if (instance) { if (instance) {
device.instance = instance; device.instance = instance;
instance.setDraggable();
this.$transformHandle.transformView(instance); this.$transformHandle.transformView(instance);
this.ibpInstanceLevel[device.model._type].add(instance); this.ibpInstanceLevel[device.model._type].add(instance);
} }

View File

@ -1,13 +1,18 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image'; import Image from 'zrender/src/graphic/Image';
import alarmpic from '@/assets/ibp_images/alarm.png'; import alarmpic from '@/assets/ibp_images/alarm.png';
import store from '@/store';
export default class alarm extends Group { export default class alarm extends Group {
constructor(device) { constructor(device) {
super(); super();
this.model = device.model; this.model = device.model;
this.event = device.event;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create(); this.create();
} }
@ -20,14 +25,13 @@ export default class alarm extends Group {
image: alarmpic, image: alarmpic,
x: model.point.x, x: model.point.x,
y: model.point.y, y: model.point.y,
width: 71, width: model.width,
height: 74 height: model.width/71*74
} }
}); });
this.add(this.imageBg); this.add(this.imageBg);
this.transformScale(); this.transformScale();
} }
/** 缩放按钮 */ /** 缩放按钮 */
transformScale() { transformScale() {
this.imageBg.origin = [this.model.point.x, this.model.point.y]; this.imageBg.origin = [this.model.point.x, this.model.point.y];
@ -36,7 +40,7 @@ export default class alarm extends Group {
} }
setDraggable() { setDraggable() {
this.arrow.attr('draggable', true); this.imageBg.attr('draggable', true);
this.createMouseEvent(); this.createMouseEvent();
} }
createMouseEvent() { createMouseEvent() {
@ -47,6 +51,12 @@ export default class alarm extends Group {
mousedown(e) { mousedown(e) {
this.event.disable(); 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) { mousemove(e) {
@ -54,7 +64,11 @@ export default class alarm extends Group {
mouseup(e) { mouseup(e) {
this.event.enable(); this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX; if (this.dragging) {
this.model.point.y = this.model.point.y + e.offsetY; 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;
}
} }
} }

View 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);
}
}
}

View File

@ -2,12 +2,16 @@ import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import {arrow} from '@/jmap/shape/utils/ShapePoints'; import {arrow} from '@/jmap/shape/utils/ShapePoints';
// import { updateIbpData } from '@/ibp/utils/parser'; // import { updateIbpData } from '@/ibp/utils/parser';
import store from '@/store';
class Arrow extends Group { class Arrow extends Group {
constructor(device) { constructor(device) {
super(); super();
this.event = device.event; this.event = device.event;
this.model = device.model; this.model = device.model;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create(); this.create();
} }
@ -16,13 +20,12 @@ class Arrow extends Group {
this.arrow = new Polygon({ this.arrow = new Polygon({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
draggable: model.draggable || false, draggable: false,
shape: { 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: { style: {
stroke: model.stroke, stroke: model.stroke,
lineWidth: model.lineWidth,
fill: model.fill fill: model.fill
} }
}); });
@ -36,6 +39,14 @@ class Arrow extends Group {
this.transformRotation(0); this.transformRotation(0);
break; break;
} }
case 'top': {
this.transformRotation(90);
break;
}
case 'bottom': {
this.transformRotation(270);
break;
}
case 'right': { case 'right': {
this.transformRotation(180); this.transformRotation(180);
break; break;
@ -63,18 +74,23 @@ class Arrow extends Group {
this.on('mousemove', this.mousemove, this); this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this); this.on('mouseup', this.mouseup, this);
} }
mousedown() { mousedown(e) {
this.event.disable(); 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() { mousemove() {
console.log('鼠标移动');
} }
mouseup(e) { mouseup(e) {
this.event.enable(); this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX; if (this.dragging) {
this.model.point.y = this.model.point.y + e.offsetY; this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
console.log('鼠标抬起', this.model); this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
}
} }
} }

View File

@ -12,7 +12,7 @@ export default class background extends Group {
this.create(); this.create();
} }
create() { create() {
this.imageBg = new Image({ this.imageBg1 = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
style: { style: {
@ -23,6 +23,17 @@ export default class background extends Group {
height: 1024 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({ this.tailorRect = new Rect({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
@ -37,15 +48,8 @@ export default class background extends Group {
} }
tailorBgImage() { tailorBgImage() {
// this.imageBg.setClipPath(this.tailorRect); // this.imageBg.setClipPath(this.tailorRect);
this.add(this.imageBg); this.add(this.imageBg1);
} this.add(this.imageBg2);
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);
} }
setDraggable() { setDraggable() {
} }

View File

@ -10,6 +10,7 @@ import yellowButtonPic from '@/assets/ibp_images/yellow_button.png';
import yellowButtonPicOn from '@/assets/ibp_images/yellow_button_on.png'; import yellowButtonPicOn from '@/assets/ibp_images/yellow_button_on.png';
import grayButtonPic from '@/assets/ibp_images/gray_button.png'; import grayButtonPic from '@/assets/ibp_images/gray_button.png';
import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png'; import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png';
import store from '@/store';
export default class button extends Group { export default class button extends Group {
static colors = new Map([ static colors = new Map([
@ -29,6 +30,10 @@ export default class button extends Group {
this.event = device.event; this.event = device.event;
this.model = device.model; this.model = device.model;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.event = device.event;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create(); this.create();
} }
create() { create() {
@ -74,17 +79,17 @@ export default class button extends Group {
setState(model) { setState(model) {
switch (model.status) { switch (model.status) {
case 'on': { case 'on': {
// 关闭 // 开放
this.close(); this.open();
this.model.status='on'; this.model.status='on';
break; break;
} }
case 'off': { case 'off': {
// 开放 // 关闭
this.open(); this.close();
this.model.status='off'; this.model.status='off';
break; break;
} }
} }
} }
@ -105,17 +110,24 @@ export default class button extends Group {
} }
} }
mousedown() { mousedown(e) {
this.event.disable(); 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() { mousemove() {
} }
mouseup(e) { mouseup(e) {
this.event.enable(); this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX; if (this.dragging) {
this.model.point.y = this.model.point.y + e.offsetY; this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
console.log('鼠标抬起', this.model); this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
}
} }
// 关闭 // 关闭
close() { close() {

View File

@ -1,5 +1,6 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Circle from 'zrender/src/graphic/shape/Circle'; import Circle from 'zrender/src/graphic/shape/Circle';
import store from '@/store';
export default class CircularLamp extends Group { export default class CircularLamp extends Group {
constructor(device) { constructor(device) {
@ -8,6 +9,9 @@ export default class CircularLamp extends Group {
this.event = device.event; this.event = device.event;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.z = device.model.z; this.z = device.model.z;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create(); this.create();
} }
@ -15,7 +19,7 @@ export default class CircularLamp extends Group {
this.lamp = new Circle({ this.lamp = new Circle({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
draggable: this.model.draggable||false, draggable: false,
shape: { shape: {
cx: this.model.point.x, cx: this.model.point.x,
cy: this.model.point.y, cy: this.model.point.y,
@ -40,15 +44,22 @@ export default class CircularLamp extends Group {
this.on('mousemove', this.mousemove, this); this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this); this.on('mouseup', this.mouseup, this);
} }
mousedown() { mousedown(e) {
this.event.disable(); 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() { mousemove() {
console.log('鼠标移动');
} }
mouseup() { mouseup(e) {
this.event.enable(); 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
View 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;
}
}

View File

@ -16,7 +16,8 @@ export default class elevatorArrow extends Group {
const model = this.model; const model = this.model;
this.imageBg = new Image({ this.imageBg = new Image({
zlevel: this.zlevel, zlevel: this.zlevel,
draggable: model.draggable || false, z: model.z,
draggable: false,
style: { style: {
image: this.getStatus(), image: this.getStatus(),
x: model.point.x, x: model.point.x,
@ -25,10 +26,12 @@ export default class elevatorArrow extends Group {
height: 60 height: 60
} }
}); });
// debugger;
this.add(this.imageBg); this.add(this.imageBg);
this.getOrientate(); this.getOrientate();
this.transformScale();
} }
getOrientate() { getOrientate() {
switch (this.model.orientation) { switch (this.model.orientation) {
case 'top': { case 'top': {
@ -49,13 +52,13 @@ export default class elevatorArrow extends Group {
this.imageBg.dirty(); this.imageBg.dirty();
} }
// /** 缩放按钮 */ /** 缩放按钮 */
// transformScale() { transformScale() {
// this.imageBg.origin = [this.model.point.x, this.model.point.y]; this.imageBg.origin = [this.model.point.x, this.model.point.y];
// this.imageBg.scale =[this.model.width/68, this.model.width/68]; this.imageBg.scale =[this.model.width/31, this.model.width/31];
// this.imageBg.dirty(); this.imageBg.dirty();
// } }
getStatus() { getStatus() {
if (this.model.status) { if (this.model.status) {
switch (this.model.status) { switch (this.model.status) {
@ -71,26 +74,41 @@ export default class elevatorArrow extends Group {
} }
} }
setDraggable() { setStatus(data) {
this.arrow.attr('draggable', true); let imageBack;
this.createMouseEvent(); switch (data) {
} case 'on': {
createMouseEvent() { imageBack=elevatorArrowPicOn;
this.on('mousedown', this.mousedown, this); break;
this.on('mousemove', this.mousemove, this); }
this.on('mouseup', this.mouseup, this); case 'off': {
imageBack=elevatorArrowPic;
break;
}
}
this.imageBg.setStyle({image: imageBack});
} }
mousedown(e) { // setDraggable() {
this.event.disable(); // 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) { // mousemove(e) {
this.event.enable(); // }
this.model.point.x = this.model.point.x + e.offsetX;
this.model.point.y = this.model.point.y + e.offsetY; // 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;
// }
} }

View File

@ -1,5 +1,4 @@
import Circle from 'zrender/src/graphic/shape/Circle'; import * as toolpath from 'zrender/src/tool/path';
import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
export default class elevatorBack extends Group { export default class elevatorBack extends Group {
@ -12,58 +11,24 @@ export default class elevatorBack extends Group {
} }
create() { create() {
// debugger;
const model = this.model; 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, zlevel: model.zlevel,
z: model.z, 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: false,
// draggable: model.draggable || false,
shape: {
cx: model.point.x + model.width/6*5,
cy: model.point.y + model.height/8,
r: model.width/6
},
style: { style: {
fill: this.model.fillColor || '#adadad' x: model.point.x,
y: model.point.y,
brushType: 'fill',
fill: this.model.fillColor || '#313131',
lineWidth: 0
} }
}); });
this.add(this.elevatorBack);
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);
} }
} }

View File

@ -3,12 +3,30 @@ import deviceType from '../constant/deviceType';
import Background from './background'; import Background from './background';
import CircularLamp from './circularLamp'; import CircularLamp from './circularLamp';
import IbpText from './ibpText'; 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 = {}; const ibpShape = {};
ibpShape[deviceType.Arrow] = Arrow; ibpShape[deviceType.Arrow] = Arrow;
ibpShape[deviceType.Background] = Background; ibpShape[deviceType.Background] = Background;
ibpShape[deviceType.CircularLamp] = CircularLamp; ibpShape[deviceType.CircularLamp] = CircularLamp;
ibpShape[deviceType.IbpText] = IbpText; 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) { function shapefactory(device, ibp) {
const type = device.model._type; const type = device.model._type;

65
src/ibp/shape/ibpLine.js Normal file
View 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;
}
}
}

View File

@ -1,14 +1,17 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text'; 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) { constructor(device) {
super(); super();
this.model = device.model; this.model = device.model;
this.event = device.event; this.event = device.event;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.z = device.model.z; this.z = device.model.z;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create(); this.create();
} }
create() { create() {
@ -19,8 +22,8 @@ export default class button extends Group {
silent: model.silent || false, silent: model.silent || false,
draggable: model.draggable || false, draggable: model.draggable || false,
style: { style: {
x: model.x, x: model.point.x,
y: model.y, y: model.point.y,
fontWeight: model.fontWeight, fontWeight: model.fontWeight,
fontSize: model.fontSize, fontSize: model.fontSize,
fontFamily: model.fontFamily, fontFamily: model.fontFamily,
@ -29,7 +32,8 @@ export default class button extends Group {
textFill: model.textFill, textFill: model.textFill,
textAlign: model.textAlign, textAlign: model.textAlign,
textPosition: model.textPosition || 'inside', textPosition: model.textPosition || 'inside',
textVerticalAlign: model.textVerticalAlign || null textVerticalAlign: model.textVerticalAlign || null,
textLineHeight: model.fontSize
} }
}); });
this.add(this.textName); this.add(this.textName);
@ -43,18 +47,22 @@ export default class button extends Group {
this.on('mousemove', this.mousemove, this); this.on('mousemove', this.mousemove, this);
this.on('mouseup', this.mouseup, this); this.on('mouseup', this.mouseup, this);
} }
mousedown() { mousedown(e) {
this.event.disable(); 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() { mousemove() {
console.log('鼠标移动');
} }
mouseup(e) { mouseup(e) {
this.event.enable(); this.event.enable();
this.model.x = this.model.x + e.offsetX; if (this.dragging) {
this.model.y = this.model.y + e.offsetY; this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
console.log('鼠标抬起', this.model); this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
updateIbpData(this.model, 'update'); }
} }
} }

View 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
View 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);
}
}

View File

@ -2,6 +2,7 @@ import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image'; import Image from 'zrender/src/graphic/Image';
import rotateBlack from '@/assets/ibp_images/rotate_black.png'; import rotateBlack from '@/assets/ibp_images/rotate_black.png';
import rotateRed from '@/assets/ibp_images/rotate_red.png'; import rotateRed from '@/assets/ibp_images/rotate_red.png';
import store from '@/store';
export default class rotateTip extends Group { export default class rotateTip extends Group {
@ -9,6 +10,10 @@ export default class rotateTip extends Group {
super(); super();
this.model = device.model; this.model = device.model;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.event = device.event;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create(); 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.scale =[this.model.width/68, this.model.width/68];
this.imageBg.dirty(); this.imageBg.dirty();
} }
getRotateColor() { getRotateColor() {
if (this.model.color) { if (this.model.color) {
switch (this.model.color) { switch (this.model.color) {
@ -63,6 +68,12 @@ export default class rotateTip extends Group {
mousedown(e) { mousedown(e) {
this.event.disable(); 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) { mousemove(e) {
@ -70,7 +81,9 @@ export default class rotateTip extends Group {
mouseup(e) { mouseup(e) {
this.event.enable(); this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX; if (this.dragging) {
this.model.point.y = this.model.point.y + e.offsetY; this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
}
} }
} }

View 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);
}
}
}

View File

@ -1,13 +1,18 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Image from 'zrender/src/graphic/Image'; import Image from 'zrender/src/graphic/Image';
import teleTerminalPic from '@/assets/ibp_images/telephone_terminal.png'; import teleTerminalPic from '@/assets/ibp_images/telephone_terminal.png';
import store from '@/store';
export default class alarm extends Group { export default class alarm extends Group {
constructor(device) { constructor(device) {
super(); super();
this.event = device.event;
this.model = device.model; this.model = device.model;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.offsetX = 0;
this.offsetY = 0;
this.dragging = false;
this.create(); this.create();
} }
@ -20,8 +25,8 @@ export default class alarm extends Group {
image: teleTerminalPic, image: teleTerminalPic,
x: model.point.x, x: model.point.x,
y: model.point.y, y: model.point.y,
width: 64, width: 150,
height: 56 height: 150
} }
}); });
this.add(this.imageBg); this.add(this.imageBg);
@ -31,12 +36,12 @@ export default class alarm extends Group {
/** 缩放按钮 */ /** 缩放按钮 */
transformScale() { transformScale() {
this.imageBg.origin = [this.model.point.x, this.model.point.y]; 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(); this.imageBg.dirty();
} }
setDraggable() { setDraggable() {
this.arrow.attr('draggable', true); this.imageBg.attr('draggable', true);
this.createMouseEvent(); this.createMouseEvent();
} }
createMouseEvent() { createMouseEvent() {
@ -47,6 +52,12 @@ export default class alarm extends Group {
mousedown(e) { mousedown(e) {
this.event.disable(); 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) { mousemove(e) {
@ -54,7 +65,9 @@ export default class alarm extends Group {
mouseup(e) { mouseup(e) {
this.event.enable(); this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX; if (this.dragging) {
this.model.point.y = this.model.point.y + e.offsetY; this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
}
} }
} }

View File

@ -2,6 +2,7 @@ import * as zrUtil from 'zrender/src/core/util';
import * as matrix from 'zrender/src/core/matrix'; import * as matrix from 'zrender/src/core/matrix';
import deviceType from '../constant/deviceType'; import deviceType from '../constant/deviceType';
import deviceRender from '../constant/deviceRender'; import deviceRender from '../constant/deviceRender';
import store from '@/store';
export function createTransform(opts) { export function createTransform(opts) {
let transform = matrix.create(); let transform = matrix.create();
@ -57,8 +58,8 @@ export function parser(data, config) {
ibpDevice[elem.code] = createModel(deviceType.CircularLamp, elem, propConvert); ibpDevice[elem.code] = createModel(deviceType.CircularLamp, elem, propConvert);
}, this); }, this);
zrUtil.each(data.warnButtonList || [], elem => { zrUtil.each(data.alarmList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.WarnButton, elem, propConvert); ibpDevice[elem.code] = createModel(deviceType.Alarm, elem, propConvert);
}, this); }, this);
zrUtil.each(data.arrowList || [], elem => { zrUtil.each(data.arrowList || [], elem => {
@ -69,10 +70,246 @@ export function parser(data, config) {
ibpDevice[elem.code] = createModel(deviceType.RotatingButton, elem, propConvert); ibpDevice[elem.code] = createModel(deviceType.RotatingButton, elem, propConvert);
}, this); }, this);
zrUtil.each(data.tipList || [], elem => { zrUtil.each(data.tipBoxList || [], elem => {
ibpDevice[elem.code] = createModel(deviceType.Tip, elem, propConvert); ibpDevice[elem.code] = createModel(deviceType.TipBox, elem, propConvert);
}, this); }, 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; 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);
}

View File

@ -50,18 +50,21 @@ export function JLmapDriving(dom, data, skinCode) {
renderer.domElement.style.top = '0'; renderer.domElement.style.top = '0';
var renderercctv = new THREE.WebGLRenderer(); 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.position = 'absolute';
renderercctv.domElement.style.top = '0'; renderercctv.domElement.style.top = '0';
document.getElementById('jlsimulation').appendChild(renderer.domElement); document.getElementById('jlsimulation').appendChild(renderer.domElement);
document.getElementById('jlcctv').appendChild(renderercctv.domElement); document.getElementById('jlcctv').appendChild(renderercctv.domElement);
// 定义相机 // 定义相机
<<<<<<< HEAD
//let camera = SetCamera(dom); //let camera = SetCamera(dom);
=======
// let camera = SetCamera(dom);
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
// 定义场景(渲染容器) // 定义场景(渲染容器)
const scene = SetScene(); const scene = SetScene();
const speed = 0; const speed = 0;
let drivingcode = null; let drivingcode = null;
@ -104,8 +107,13 @@ export function JLmapDriving(dom, data, skinCode) {
controls3.enabled = true; controls3.enabled = true;
scene.add(controls3.getObject()); scene.add(controls3.getObject());
<<<<<<< HEAD
let cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 150); let cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 150);
cameracctv.position.set( 5, -3,27 ); 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; cameracctv.rotation.y = Math.PI/5*3;
camera.add(cameracctv); camera.add(cameracctv);
@ -136,7 +144,11 @@ export function JLmapDriving(dom, data, skinCode) {
if (scope.animateswitch == true) { if (scope.animateswitch == true) {
// 根据相机渲染场景 // 根据相机渲染场景
renderer.render(scene, camera); renderer.render(scene, camera);
<<<<<<< HEAD
renderercctv.render(scene,cameracctv); renderercctv.render(scene,cameracctv);
=======
renderercctv.render(scene, cameracctv);
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
// updatcontrols(); // updatcontrols();
// renderercctv // renderercctv
controls3.update(); controls3.update();
@ -192,7 +204,7 @@ export function JLmapDriving(dom, data, skinCode) {
this.updatestoptime = function(stime) { this.updatestoptime = function(stime) {
scope.stime = stime; scope.stime = stime;
}; };
this.updatedrivedata = function(drivedata){ this.updatedrivedata = function(drivedata) {
scope.drivecount += 1; scope.drivecount += 1;
scope.drivedata = drivedata; scope.drivedata = drivedata;
}; };

View File

@ -18,7 +18,7 @@ let defaulttrain = {
deviceType:"train", deviceType:"train",
type:"num4", type:"num4",
picUrl:"", 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", deviceType:"suidao",
type:"suidao", type:"suidao",
picUrl:"", 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 }//https://joylink.club/oss/models/suidao/suidao.FBX
//../../static/model/ //../../static/model/

View File

@ -551,7 +551,15 @@ THREE.FBXLoader = ( function () {
if ( materialNode.EmissiveFactor ) { 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 );
}
} }

View File

@ -304,9 +304,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: true, // 公里标显示 kmPostShow: true, // 公里标显示
kilometerPosition: 'down', // 公里标位置 kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold' // 文字错细 fontWeight: 'bold' // 文字错细

View File

@ -300,9 +300,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: false, // 公里标显示 kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up' // 公里标朝向
}; };

View File

@ -297,9 +297,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: false, // 公里标显示 kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up' // 公里标朝向
}; };

View File

@ -279,9 +279,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: true, // 公里标显示 kmPostShow: true, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up' // 公里标朝向
}; };

View File

@ -20,9 +20,6 @@ class Jlmap {
// 鼠标事件 // 鼠标事件
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom'}; this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom'};
// 原始数据
this.data = {};
// 皮肤参数 // 皮肤参数
this.skinCode = ''; this.skinCode = '';
@ -83,12 +80,10 @@ class Jlmap {
this.$options.scaleRate = map.skinVO.scaling || 1; this.$options.scaleRate = map.skinVO.scaling || 1;
this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0; this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0;
this.$options.offsetY = map.skinVO.origin ? map.skinVO.origin.y : 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.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
} }
// 保存原始数据
this.data = map;
// 解析地图数据 // 解析地图数据
this.mapDevice = mapDevice; this.mapDevice = mapDevice;
@ -103,7 +98,6 @@ class Jlmap {
// 视图加载完成 回调 // 视图加载完成 回调
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); } if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); }
} }
setDefaultState() { setDefaultState() {
@ -158,7 +152,6 @@ class Jlmap {
const type = elem._type; const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem); const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
const nDevice = Object.assign(oDevice || {}, elem); const nDevice = Object.assign(oDevice || {}, elem);
this.dataSync(nDevice);
this.$painter.delete(oDevice); this.$painter.delete(oDevice);
if (!elem._dispose) { if (!elem._dispose) {
this.mapDevice[code] = nDevice; this.mapDevice[code] = nDevice;
@ -275,52 +268,6 @@ class Jlmap {
return payload || {}; 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() { getZr() {
return this.$zr; return this.$zr;
} }

View File

@ -99,8 +99,8 @@ class EMouse extends Group {
this.sectionTextBorder && this.sectionTextBorder.show(); this.sectionTextBorder && this.sectionTextBorder.show();
this.lineBorder && this.lineBorder.show(); this.lineBorder && this.lineBorder.show();
const instance = this.getInstanceByCode(this.device.model.trainWindowCode); const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
if (instance && instance.mouseEnter) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
instance.mouseEnter(e); instance.mouseEvent.mouseEnter(e);
} }
} }
} }
@ -118,8 +118,8 @@ class EMouse extends Group {
this.sectionTextBorder && this.sectionTextBorder.hide(); this.sectionTextBorder && this.sectionTextBorder.hide();
this.lineBorder && this.lineBorder.hide(); this.lineBorder && this.lineBorder.hide();
const instance = this.getInstanceByCode(this.device.model.trainWindowCode); const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
if (instance && instance.mouseLeave) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
instance.mouseLeave(e); instance.mouseEvent.mouseLeave(e);
} }
} }
} }

View File

@ -21,7 +21,7 @@ export default class Station extends Group {
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
if (style.Station.text.show) { if (model.visible) {
// 公里标名称是否显示 // 公里标名称是否显示
this.stationText = new ETextName({ this.stationText = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,
@ -38,29 +38,29 @@ export default class Station extends Group {
textFill: model.nameFontColor textFill: model.nameFontColor
}); });
this.add(this.stationText); this.add(this.stationText);
} const path = window.location.href;
if (style.Station.kmPostShow || path.includes('/map/draw')) {
if (style.Station.kmPostShow) {
// 公里标是否显示 // 公里标是否显示
let direction = 1; let direction = 1;
if (this.style.Station.kilometerPosition == 'up') { if (this.style.Station.kilometerPosition == 'up') {
direction = -1; 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);
} }
} }

View File

@ -42,9 +42,9 @@ class EMouse extends Group {
// 创建道岔边框 // 创建道岔边框
craeteSwitchBorder() { craeteSwitchBorder() {
const sectionA = this.device.model.sectionAInstance.instance; const sectionA = this.getInstanceByCode(this.device.model.sectionACode);
const sectionB = this.device.model.sectionBInstance.instance; const sectionB = this.getInstanceByCode(this.device.model.sectionBCode);
const sectionC = this.device.model.sectionCInstance.instance; const sectionC = this.getInstanceByCode(this.device.model.sectionCCode);
const rect = this.device.getBoundingRect(); const rect = this.device.getBoundingRect();
sectionA && rect.union(sectionA.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 section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {}; const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
const instance = this.getInstanceByCode(parentSection.trainWindowCode); const instance = this.getInstanceByCode(parentSection.trainWindowCode);
if (instance && instance.mouseLeave) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
instance.mouseLeave(e); instance.mouseEvent.mouseLeave(e);
} }
} }
} }
@ -101,8 +101,8 @@ class EMouse extends Group {
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {}; const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {}; const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
const instance = this.getInstanceByCode(parentSection.trainWindowCode); const instance = this.getInstanceByCode(parentSection.trainWindowCode);
if (instance && instance.mouseEnter) { if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
instance.mouseEnter(e); instance.mouseEvent.mouseEnter(e);
} }
} }

View 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);
}
}
}

View File

@ -1,6 +1,7 @@
/* 车次窗*/ /* 车次窗*/
import Polygon from 'zrender/src/graphic/shape/Polygon'; import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import EMouse from './EMouse';
import store from '@/store'; import store from '@/store';
class TrainWindow extends Group { class TrainWindow extends Group {
@ -14,6 +15,7 @@ class TrainWindow extends Group {
this.z = 9; this.z = 9;
this.prdType = store.state.training.prdType; this.prdType = store.state.training.prdType;
this.create(model); this.create(model);
this.createMouseEvent();
this.setState(model); this.setState(model);
} }
create(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() { createTrainWindow() {
const model = this.model; const model = this.model;
@ -44,9 +52,7 @@ class TrainWindow extends Group {
lineWidth: this.style.TrainWindow.lineWidth, lineWidth: this.style.TrainWindow.lineWidth,
stroke: this.style.TrainWindow.lineColor, stroke: this.style.TrainWindow.lineColor,
fill: this.style.transparentColor fill: this.style.transparentColor
}, }
onmouseover: (e) => { this.mouseover(e); },
onmouseout: (e) => { this.mouseout(e); }
}); });
this.add(this.trainRect); this.add(this.trainRect);
} }
@ -72,38 +78,6 @@ class TrainWindow extends Group {
getInstanceByCode(code) { getInstanceByCode(code) {
return (store.getters['map/getDeviceByCode'](code) || {}).instance; 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; export default TrainWindow;

View File

@ -1,423 +1,464 @@
<template> <template>
<el-dialog class="fuzhou_01 train-control" :title="title" :visible.sync="show" width="320px" :before-close="doClose" <el-dialog
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form"> class="fuzhou_01 train-control"
<el-form-item label="车 组 号:" prop="trainNumber"> :title="title"
<el-select v-model="formModel.trainNumber" :id="domIdTrainNumber" filterable :visible.sync="show"
:disabled="trainNumberIsDisabled" @change="trainNumberChange"> width="320px"
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber" :before-close="doClose"
:value="train.groupNumber"> :z-index="2000"
</el-option> :modal="false"
</el-select> :close-on-click-modal="false"
</el-form-item> >
<el-form-item prop="trainType" label-width='0px'> <el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-radio-group v-model="formModel.trainType" :id="domIdTrainType" style="margin-left: 15px;" <el-form-item label="车 组 号:" prop="trainNumber">
:disabled="trainTypeIsDisabled" @change="trainTypeChange"> <el-select
<el-radio :label="'01'">计划车</el-radio> :id="domIdTrainNumber"
<el-radio :label="'02'">头码车</el-radio> v-model="formModel.trainNumber"
<el-radio :label="'03'">人工车</el-radio> filterable
</el-radio-group> :disabled="trainNumberIsDisabled"
</el-form-item> @change="trainNumberChange"
<el-form-item prop="serverNo"> >
<span slot="label">&emsp;&emsp;</span> <el-option
<el-input v-model="formModel.serverNo" :id="domIdServerNo" :disabled="serverNoIsDisabled" v-for="train in trainList"
@change="serverNoChange"> :key="train.groupNumber"
</el-input> :label="train.groupNumber"
</el-form-item> :value="train.groupNumber"
<el-form-item label="车 次 号:" prop="trainNo"> />
<el-input v-model="formModel.trainNo" :id="domIdTrainNo" :disabled="trainNoIsDisabled" </el-select>
@change="trainNoChange"></el-input> </el-form-item>
</el-form-item> <el-form-item prop="trainType" label-width="0px">
<el-form-item label="目的地号:" prop="targetCode"> <el-radio-group
<el-input v-model="formModel.targetCode" :id="domIdTargetCode" :disabled="targetCodeIsDisabled" :id="domIdTrainType"
@change="targetCodeChange"> v-model="formModel.trainType"
</el-input> style="margin-left: 15px;"
</el-form-item> :disabled="trainTypeIsDisabled"
</el-form> @change="trainTypeChange"
<el-row justify="center" class="button-group"> >
<el-col :span="10" :offset="2"> <el-radio :label="'01'">计划车</el-radio>
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> <el-radio :label="'02'">头码车</el-radio>
</el-col> <el-radio :label="'03'">人工车</el-radio>
<el-col :span="8" :offset="4"> </el-radio-group>
<el-button :id="domIdCancel" @click="cancel"> </el-button> </el-form-item>
</el-col> <el-form-item prop="serverNo">
</el-row> <span slot="label">&emsp;&emsp;</span>
<confirm-train ref="confirmTrain"></confirm-train> <el-input
<notice-info ref="noticeInfo"></notice-info> :id="domIdServerNo"
</el-dialog> 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> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map'; import { getPublishTrainList } from '@/api/jmap/map';
import ConfirmTrain from './childDialog/confirmTrain'; import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainControl', name: 'TrainControl',
components: { components: {
ConfirmTrain, ConfirmTrain,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainList: [], trainList: [],
formModel: { formModel: {
trainNo: '', trainNo: '',
trainNumber: '', trainNumber: '',
trainType: '01', trainType: '01',
serverNo: '', serverNo: '',
targetCode: '', targetCode: ''
}, },
rules: { rules: {
trainNumber: [ trainNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' } { required: true, message: '请选择车组号', trigger: 'change' }
], ],
trainType: [ trainType: [
{ required: true, message: '请选择一个列车类型', trigger: 'change' } { required: true, message: '请选择一个列车类型', trigger: 'change' }
], ],
serverNo: [ serverNo: [
{ required: true, message: '请输入表号', trigger: 'blur' } { required: true, message: '请输入表号', trigger: 'blur' }
], ],
trainNo: [ trainNo: [
{ required: true, message: '请输入车次号', trigger: 'blur' } { required: true, message: '请输入车次号', trigger: 'blur' }
], ],
targetCode: [ targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur' } { required: true, message: '请输入目的地号', trigger: 'blur' }
] ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false,
direction: 0 direction: 0
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
trainNoIsDisabled() { trainNoIsDisabled() {
return false; return false;
}, },
serverNoIsDisabled() { serverNoIsDisabled() {
return false; return false;
}, },
targetCodeIsDisabled() { targetCodeIsDisabled() {
return false; return false;
}, },
trainNumberIsDisabled() { trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true; return true;
} }
}, return false;
trainTypeIsDisabled() { },
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { trainTypeIsDisabled() {
return true; if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
} return true;
}, }
show() { return false;
return this.dialogShow && !this.$store.state.menuOperation.break; },
}, show() {
domIdTrainNumber() { return this.dialogShow && !this.$store.state.menuOperation.break;
if (this.dialogShow) { },
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { domIdTrainNumber() {
/** 添加列车识别号*/ if (this.dialogShow) {
return OperationEvent.Train.addTrainId.trainNumberChange.domId; if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { /** 添加列车识别号*/
/** 修改列车识别号*/ return OperationEvent.Train.addTrainId.trainNumberChange.domId;
return OperationEvent.Train.editTrainId.trainNumberChange.domId; } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
} /** 修改列车识别号*/
} return OperationEvent.Train.editTrainId.trainNumberChange.domId;
}, }
domIdTrainNo() { }
if (this.dialogShow) { return null;
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { },
/** 添加列车识别号*/ domIdTrainNo() {
return OperationEvent.Train.addTrainId.trainNoChange.domId; if (this.dialogShow) {
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 修改列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId; 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 null;
/** 添加列车识别号*/ },
return OperationEvent.Train.addTrainId.trainTypeChange.domId; domIdTrainType() {
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { if (this.dialogShow) {
/** 修改列车识别号*/ if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return OperationEvent.Train.editTrainId.trainTypeChange.domId; /** 添加列车识别号*/
} return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
}, /** 修改列车识别号*/
domIdServerNo() { return OperationEvent.Train.editTrainId.trainTypeChange.domId;
if (this.dialogShow) { }
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { }
/** 添加列车识别号*/ return null;
return OperationEvent.Train.addTrainId.serverNoChange.domId; },
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { domIdServerNo() {
/** 修改列车识别号*/ if (this.dialogShow) {
return OperationEvent.Train.editTrainId.serverNoChange.domId; if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
} /** 添加列车识别号*/
} return OperationEvent.Train.addTrainId.serverNoChange.domId;
}, } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
domIdTargetCode() { /** 修改列车识别号*/
if (this.dialogShow) { return OperationEvent.Train.editTrainId.serverNoChange.domId;
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { }
/** 添加列车识别号*/ }
return OperationEvent.Train.addTrainId.targetCodeChange.domId; return null;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { },
/** 修改列车识别号*/ domIdTargetCode() {
return OperationEvent.Train.editTrainId.targetCodeChange.domId; if (this.dialogShow) {
} if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
} /** 添加列车识别号*/
}, return OperationEvent.Train.addTrainId.targetCodeChange.domId;
domIdConfirm() { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
if (this.dialogShow) { /** 修改列车识别号*/
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { return OperationEvent.Train.editTrainId.targetCodeChange.domId;
/** 添加列车识别号*/ }
return OperationEvent.Train.addTrainId.menu.domId; }
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { return null;
/** 修改列车识别号*/ },
return OperationEvent.Train.editTrainId.menu.domId; domIdConfirm() {
} if (this.dialogShow) {
} if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
}, /** 添加列车识别号*/
domIdCancel() { return OperationEvent.Train.addTrainId.menu.domId;
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
}, /** 修改列车识别号*/
title() { return OperationEvent.Train.editTrainId.menu.domId;
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { }
return '添加列车识别号'; }
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { return null;
return '修改列车识别号'; },
} domIdCancel() {
} return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
mounted() { title() {
this.$nextTick(() => { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
this.$store.dispatch('training/tipReload'); return '添加列车识别号';
}) } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
}, return '修改列车识别号';
methods: { }
loadInitData(map) { return '';
if (map) { }
getPublishTrainList(map.skinCode).then(resp => { },
this.trainList = resp.data; mounted() {
}).catch(error => { this.$nextTick(() => {
this.$messageBox(`获取列车车组号失败`); this.$store.dispatch('training/tipReload');
}); });
} },
}, methods: {
doShow(operate, selected) { loadInitData(map) {
// if (map) {
if (!this.dialogShow) { getPublishTrainList(map.skinCode).then(resp => {
this.operation = operate.operation; this.trainList = resp.data;
} }).catch(() => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.formModel = { this.formModel = {
trainNumber: selected.trainNumber, trainNumber: selected.trainNumber,
trainNo: selected.trainNo, trainNo: selected.trainNo,
trainType: '01', trainType: '01',
serverNo: selected.serverNo, serverNo: selected.serverNo,
targetCode: selected.targetCode, targetCode: selected.targetCode
}; };
/** 加载列车数据*/ /** 加载列车数据*/
this.loadInitData(this.map); this.loadInitData(this.map);
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange(trainNumber) { trainNumberChange(trainNumber) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainNumber}`, val: `${trainNumber}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
trainTypeChange(trainType) { trainTypeChange(trainType) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainType}`, val: `${trainType}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
serverNoChange(serverNo) { serverNoChange(serverNo) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${serverNo}`, val: `${serverNo}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
trainNoChange(trainNo) { trainNoChange(trainNo) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainNo}`, val: `${trainNo}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
targetCodeChange(targetCode) { targetCodeChange(targetCode) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${targetCode}`, val: `${targetCode}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation; operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation; operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/ /** 增加列车识别号*/
this.addTrainId(); this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
this.editTrainId(); this.editTrainId();
} }
}, },
// //
addTrainId() { addTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let model = this.formModel; const model = this.formModel;
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation, operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [`添加列车识别号:成功`], messages: [`添加列车识别号:成功`],
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`, val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
// //
editTrainId() { editTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation, operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [`修改列车识别号:成功`], messages: [`修改列车识别号:成功`],
val: this.formModel.trainNo, val: this.formModel.trainNo
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
} };
</script> </script>

View File

@ -1,156 +1,165 @@
<template> <template>
<el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form"> class="fuzhou_01 stand-stop-time"
<el-form-item label="车 组 号:" prop="trainNumber"> :title="title"
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange"></el-input> :visible.sync="show"
</el-form-item> width="320px"
</el-form> :before-close="doClose"
<el-row justify="center" class="button-group"> :z-index="2000"
<el-col :span="10" :offset="2"> :modal="false"
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :close-on-click-modal="false"
</el-col> >
<el-col :span="8" :offset="4"> <el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-form-item label="车 组 号:" prop="trainNumber">
</el-col> <el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange" />
</el-row> </el-form-item>
<confirm-control ref="confirmControl"></confirm-control> </el-form>
<notice-info ref="noticeInfo"></notice-info> <el-row justify="center" class="button-group">
</el-dialog> <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> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
components: { components: {
ConfirmControl, ConfirmControl,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
formModel: { formModel: {
trainNumber: '', trainNumber: ''
}, },
rules: { rules: {
trainNumber: [ trainNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
}, },
domIdTrainNumber() { domIdTrainNumber() {
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
}, },
title() { title() {
return '删除列车识别号' return '删除列车识别号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.operation = operate.operation; this.operation = operate.operation;
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange() { trainNumberChange() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainNumber}`, val: `${this.formModel.trainNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.trainNumber val: this.formModel.trainNumber
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
} }
} }
} };
</script> </script>

View File

@ -1,318 +1,321 @@
<template> <template>
<div> <div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu> <pop-menu ref="popMenu" :menu="menu" />
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
<train-control ref="trainControl"></train-control> <train-control ref="trainControl" />
<train-delete ref="trainDelete"></train-delete> <train-delete ref="trainDelete" />
<train-move ref="trainMove"></train-move> <train-move ref="trainMove" />
<train-switch ref="trainSwitch"></train-switch> <train-switch ref="trainSwitch" />
<train-edit-number ref="trainEditNumber"></train-edit-number> <train-edit-number ref="trainEditNumber" />
</div> </div>
</template> </template>
<script> <script>
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo' import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
import TrainControl from './dialog/trainControl'; import TrainControl from './dialog/trainControl';
import TrainDelete from './dialog/trainDelete'; import TrainDelete from './dialog/trainDelete';
import TrainMove from './dialog/trainMove'; import TrainMove from './dialog/trainMove';
import TrainSwitch from './dialog/trainSwitch'; import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber'; import TrainEditNumber from './dialog/trainEditNumber';
export default { export default {
name: 'menuTrain', name: 'MenuTrain',
props: { components: {
selected: { PopMenu,
type: Object NoticeInfo,
} TrainControl,
}, TrainDelete,
components: { TrainMove,
PopMenu, TrainSwitch,
NoticeInfo, TrainEditNumber
TrainControl, },
TrainDelete, props: {
TrainMove, selected: {
TrainSwitch, type: Object,
TrainEditNumber default() {
}, return null;
data() { }
return { }
menu: [], },
menuNormal: { data() {
local: [], return {
central: [ menu: [],
{ menuNormal: {
label: '添加列车识别号', local: [],
handler: this.addTrainId, central: [
disabledCallback: MenuDisabledState.Train.addTrainId, {
auth: { station: true, center: true } label: '添加列车识别号',
}, handler: this.addTrainId,
{ disabledCallback: MenuDisabledState.Train.addTrainId,
label: '删除列车识别号', auth: { station: true, center: true }
handler: this.delTrainId, },
disabledCallback: MenuDisabledState.Train.delTrainId, {
auth: { station: true, center: true } label: '删除列车识别号',
}, handler: this.delTrainId,
{ disabledCallback: MenuDisabledState.Train.delTrainId,
label: '修改列车识别号', auth: { station: true, center: true }
handler: this.editTrainId, },
disabledCallback: MenuDisabledState.Train.editTrainId, {
auth: { station: true, center: true } label: '修改列车识别号',
}, handler: this.editTrainId,
{ disabledCallback: MenuDisabledState.Train.editTrainId,
label: '修改车组号', auth: { station: true, center: true }
handler: this.editTrainNo, },
disabledCallback: MenuDisabledState.Train.editTrainNo, {
auth: { station: true, center: true } label: '修改车组号',
}, handler: this.editTrainNo,
{ disabledCallback: MenuDisabledState.Train.editTrainNo,
label: '移动列车识别号', auth: { station: true, center: true }
handler: this.moveTrainId, },
disabledCallback: MenuDisabledState.Train.moveTrainId, {
auth: { station: true, center: true } label: '移动列车识别号',
}, handler: this.moveTrainId,
{ disabledCallback: MenuDisabledState.Train.moveTrainId,
label: '交换列车识别号', auth: { station: true, center: true }
handler: this.switchTrainId, },
disabledCallback: MenuDisabledState.Train.switchTrainId, {
auth: { station: true, center: true } label: '交换列车识别号',
} handler: this.switchTrainId,
] disabledCallback: MenuDisabledState.Train.switchTrainId,
}, auth: { station: true, center: true }
menuForce: [ }
{ ]
label: '设置通信故障', },
handler: this.setStoppage, menuForce: [
disabledCallback: MenuDisabledState.Train.setStoppage {
}, label: '设置通信故障',
{ handler: this.setStoppage,
label: '取消通信故障', disabledCallback: MenuDisabledState.Train.setStoppage
handler: this.cancelStoppage, },
disabledCallback: MenuDisabledState.Train.cancelStoppage {
} label: '取消通信故障',
], handler: this.cancelStoppage,
menuSpeed: [ disabledCallback: MenuDisabledState.Train.cancelStoppage
{ }
label: '确认运行至前方站', ],
handler: this.limitSpeed, menuSpeed: [
disabledCallback: MenuDisabledState.Train.limitSpeed {
} 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); computed: {
} else { ...mapGetters('training', [
this.doClose(); 'mode',
} 'operatemode'
} ]),
}, ...mapGetters('menuOperation', [
computed: { 'buttonOperation'
...mapGetters('training', [ ])
'mode', },
'operatemode' watch: {
]), '$store.state.menuOperation.menuCount': function () {
...mapGetters('menuOperation', [ if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
'buttonOperation' this.doShow(this.$store.state.menuOperation.menuPosition);
]) } else {
}, this.doClose();
methods: { }
clickEvent() { }
let self = this; },
window.onclick = function (e) { methods: {
self.doClose(); clickEvent() {
} const self = this;
}, window.onclick = function (e) {
initMenu() { self.doClose();
// };
this.menu = trainMenuFiltration(this.menuNormal); },
if (this.operatemode === OperateMode.ADMIN) { initMenu() {
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed] //
} this.menu = trainMenuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
}
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed] this.menu = [...this.menuForce, ...this.menuSpeed];
} }
this.menu = menuConvert(this.menu); this.menu = menuConvert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
this.initMenu(); this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point); this.$refs.popMenu.resetShowPosition(point);
} }
}, },
doClose() { doClose() {
if (this.$refs && this.$refs.popMenu) { if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close(); this.$refs.popMenu.close();
// this.$store.dispatch('map/setTrainWindowShow', false); // this.$store.dispatch('map/setTrainWindowShow', false);
} }
}, },
// //
setStoppage() { setStoppage() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.stoppage.menu.operation operation: OperationEvent.Train.stoppage.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
cancelStoppage() { cancelStoppage() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.cancelStoppage.menu.operation operation: OperationEvent.Train.cancelStoppage.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
limitSpeed() { limitSpeed() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.limitSpeed.menu.operation operation: OperationEvent.Train.limitSpeed.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
addTrainId() { addTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.addTrainId.menu.operation operation: OperationEvent.Train.addTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
delTrainId() { delTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.delTrainId.menu.operation operation: OperationEvent.Train.delTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate, this.selected); this.$refs.trainDelete.doShow(operate, this.selected);
} }
}); });
}, },
// //
editTrainId() { editTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainId.menu.operation operation: OperationEvent.Train.editTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
editTrainNo() { editTrainNo() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainNo.menu.operation operation: OperationEvent.Train.editTrainNo.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainEditNumber.doShow(operate, this.selected); this.$refs.trainEditNumber.doShow(operate, this.selected);
} }
}); });
}, },
// //
moveTrainId() { moveTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.moveTrainId.menu.operation operation: OperationEvent.Train.moveTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainMove.doShow(operate, this.selected); this.$refs.trainMove.doShow(operate, this.selected);
} }
}); });
}, },
// //
switchTrainId() { switchTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.switchTrainId.menu.operation operation: OperationEvent.Train.switchTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSwitch.doShow(operate, this.selected); this.$refs.trainSwitch.doShow(operate, this.selected);
} }
}); });
} }
} }
} };
</script> </script>

View File

@ -1,160 +1,169 @@
<template> <template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form"> class="beijing-01__systerm stand-stop-time"
<el-form-item label="车 组 号:" prop="groupNumber"> :title="title"
<el-input v-model="addModel.groupNumber" @change="inputGroupNumber" :id="domIdInput"></el-input> :visible.sync="show"
</el-form-item> width="320px"
</el-form> :before-close="doClose"
<el-row justify="center" class="button-group"> :z-index="2000"
<el-col :span="10" :offset="2"> :modal="false"
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :close-on-click-modal="false"
</el-col> >
<el-col :span="8" :offset="4"> <el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-form-item label="车 组 号:" prop="groupNumber">
</el-col> <el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-row> </el-form-item>
<confirm-control ref="confirmControl"></confirm-control> </el-form>
<notice-info ref="noticeInfo"></notice-info> <el-row justify="center" class="button-group">
</el-dialog> <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> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
components: { components: {
ConfirmControl, ConfirmControl,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
selected: null, selected: null,
addModel: { addModel: {
groupNumber: '', groupNumber: ''
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdInput() { domIdInput() {
return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : '';
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
}, },
title() { title() {
return '删除车组号' return '删除车组号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.operation = operate.operation; this.operation = operate.operation;
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected); mouseCancelState(this.selected);
}, },
inputGroupNumber() { inputGroupNumber() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.input.operation, operation: OperationEvent.Train.delTrainId.input.operation,
val: this.addModel.groupNumber val: this.addModel.groupNumber
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.addModel.groupNumber val: this.addModel.groupNumber
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
} }
} }
} };
</script> </script>

View File

@ -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: { computed: {
...mapGetters('training', [ ...mapGetters('training', [
'mode', 'mode',
@ -297,6 +288,15 @@ export default {
'buttonOperation' '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: { methods: {
clickEvent() { clickEvent() {
const self = this; const self = this;

View File

@ -1,150 +1,162 @@
<template> <template>
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="margin: 10px"> class="beijing-01__schedule add-task"
<el-row> :title="title"
<el-col :span="3"> :visible.sync="dialogShow"
<el-radio v-model="model.type" label="1">加在最前</el-radio> width="800px"
</el-col> :before-close="doClose"
<el-col :span="2" :offset="1"> :z-index="2000"
<span>车次号</span> :modal="false"
</el-col> :close-on-click-modal="false"
<el-col :span="5"> >
<el-select v-model="model.tripNumber" placeholder="请选择"> <div style="margin: 10px">
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-row>
:value="item.value"> <el-col :span="3">
</el-option> <el-radio v-model="model.type" label="1">加在最前</el-radio>
</el-select> </el-col>
</el-col> <el-col :span="2" :offset="1">
<el-col :span="3" :offset="1"> <span>车次号</span>
<span>开始时间</span> </el-col>
</el-col> <el-col :span="5">
<el-col :span="5"> <el-select v-model="model.tripNumber" placeholder="请选择">
<el-select v-model="model.startTime" placeholder="请选择"> <el-option
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" v-for="item in tripNumberList"
:value="item.value"> :key="item.value"
</el-option> :label="item.label"
</el-select> :value="item.value"
</el-col> />
</el-row> </el-select>
<el-row> </el-col>
<el-col :span="3"> <el-col :span="3" :offset="1">
<el-radio v-model="model.type" label="2">加在最后</el-radio> <span>开始时间</span>
</el-col> </el-col>
<el-col :span="2" :offset="1"> <el-col :span="5">
<span>车次号</span> <el-select v-model="model.startTime" placeholder="请选择">
</el-col> <el-option
<el-col :span="5"> v-for="item in tripNumberList"
<el-select v-model="model.tripNumber" placeholder="请选择"> :key="item.value"
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
</el-option> />
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="3" :offset="1"> </el-row>
<span>开始时间</span> <el-row>
</el-col> <el-col :span="3">
<el-col :span="5"> <el-radio v-model="model.type" label="2">加在最后</el-radio>
<el-select v-model="model.startTime" placeholder="请选择"> </el-col>
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-col :span="2" :offset="1">
:value="item.value"> <span>车次号</span>
</el-option> </el-col>
</el-select> <el-col :span="5">
</el-col> <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-row style="margin-bottom: 5px;"> <el-row style="margin-bottom: 5px;">
交路 交路
</el-row> </el-row>
<el-row> <el-row>
<el-table :data="model.route" border :height="180"> <el-table :data="model.route" border :height="180">
<el-table-column prop="date" label="日期" width="180"> <el-table-column prop="date" label="日期" width="180" />
</el-table-column> <el-table-column prop="name" label="姓名" width="180" />
<el-table-column prop="name" label="姓名" width="180"> <el-table-column prop="address" label="地址" />
</el-table-column> <el-table-column width="20" />
<el-table-column prop="address" label="地址"> </el-table>
</el-table-column> </el-row>
<el-table-column width="20"> <el-row style=" margin-bottom: 5px;margin-top: 10px;">
</el-table-column> 详情
</el-table> </el-row>
</el-row> <el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;"> <el-table :data="model.detail" border :height="180">
详情 <el-table-column prop="date" label="日期" width="180" />
</el-row> <el-table-column prop="name" label="姓名" width="180" />
<el-row> <el-table-column prop="address" label="地址" />
<el-table :data="model.detail" border :height="180"> <el-table-column width="20" />
<el-table-column prop="date" label="日期" width="180"> </el-table>
</el-table-column> </el-row>
<el-table-column prop="name" label="姓名" width="180"> <el-row>
</el-table-column> <el-col :offset="16">
<el-table-column prop="address" label="地址"> <el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
</el-table-column> </el-col>
<el-table-column width="20"> </el-row>
</el-table-column> </div>
</el-table> <el-row type="flex" justify="center" class="button-group">
</el-row> <el-button @click="handleCommit"> </el-button>
<el-row> <el-button @click="doClose"> </el-button>
<el-col :offset="16"> </el-row>
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox> </el-dialog>
</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> </template>
<script> <script>
export default { export default {
name: 'AddTask', name: 'AddTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
type: '1', type: '1',
serviceNumber: '', serviceNumber: '',
tripNumber: '', tripNumber: '',
startTime: '', startTime: '',
default: false, default: false,
route: [], route: [],
detail: [] detail: []
}, },
tripNumberList: [], tripNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '添加任务' return '添加任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
this.model.tripNumber = params.tripNumber; this.model.tripNumber = params.tripNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
/deep/ { /deep/ {
.el-button { .el-button {
margin-left: 40px !important; margin-left: 40px !important;
@ -160,4 +172,4 @@
line-height: 20px !important; line-height: 20px !important;
} }
} }
</style> </style>

View File

@ -18,9 +18,9 @@
</template> </template>
<script> <script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } 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'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
@ -100,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; 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.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();

View File

@ -1,116 +1,126 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule create-week-plan"
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> :title="title"
<el-form-item label="运行图名称:" prop="planId"> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="19"> :before-close="doClose"
<el-input v-model="model.planName" :readonly="true"></el-input> :z-index="2000"
</el-col> :modal="false"
<el-col :span="4" :offset="1"> :close-on-click-modal="false"
<el-button @click="handleChoose">选择 </el-button> >
</el-col> <el-row>
</el-row> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
</el-form-item> <el-form-item label="运行图名称:" prop="planId">
<el-form-item label="计划日期范围:" prop="dateList"> <el-row>
<el-row> <el-col :span="19">
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-input v-model="model.planName" :readonly="true" />
value-format="yyyy-MM-dd"> </el-col>
</el-date-picker> <el-col :span="4" :offset="1">
</el-row> <el-button @click="handleChoose">选择 </el-button>
</el-form-item> </el-col>
</el-form> </el-row>
</el-row> </el-form-item>
<el-row type="flex" justify="center" class="button-group"> <el-form-item label="计划日期范围:" prop="dateList">
<el-button @click="create"> </el-button> <el-row>
<el-button @click="doClose"> </el-button> <el-date-picker
</el-row> v-model="model.dateList"
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> type="dates"
</el-dialog> :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> </template>
<script> <script>
import { createRunPlanLoad } from '@/api/runplan'; import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan'; import ChooseTemplatePlan from './chooseTemplatePlan';
export default { export default {
name: 'CreateWeekPlan', name: 'CreateWeekPlan',
components: { components: {
ChooseTemplatePlan ChooseTemplatePlan
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
} }
} };
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleChoose() { handleChoose() {
this.$refs.choose.doShow(); this.$refs.choose.doShow();
}, },
chooseConfirm(choose) { chooseConfirm(choose) {
if (choose) { if (choose) {
this.model.planId = choose.id; this.model.planId = choose.id;
this.model.planName = choose.name; this.model.planName = choose.name;
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => { return {
return { planDateList: this.model.dateList,
loadTime: date, mapId: this.$route.query.mapId,
mapId: this.$route.query.mapId, templatePlanId: this.model.planId
templatePlanId: this.model.planId };
} },
}); create() {
}, this.$refs['form'].validate((valid) => {
create() { if (valid) {
this.$refs['form'].validate((valid) => { createRunPlanLoad(this.buildModel()).then(response => {
if (valid) { this.$message.success('创建运行图计划成功');
createRunPlanLoad(this.buildModel()).then(response => { this.doClose();
this.$message.success('创建运行图计划成功'); }).catch(() => {
this.$emit('reloadTable', { name: 'managePlanList' }); this.doClose();
this.doClose(); this.$messageBox('创建运行图计划失败');
}).catch(error => { });
this.doClose(); }
this.$messageBox('创建运行图计划失败'); });
}) }
} }
}); };
}
}
}
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -124,4 +134,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,57 +1,66 @@
<template> <template>
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule delete-task"
<el-radio v-model="type" :label="1">删除以前所有任务包含本任务</el-radio> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="400px"
<el-radio v-model="type" :label="2">删除以后所有任务包含本任务</el-radio> :before-close="doClose"
</el-row> :z-index="2000"
<el-row type="flex" justify="center" class="button-group"> :modal="false"
<el-button @click="handleCommit"> </el-button> :close-on-click-modal="false"
<el-button @click="doClose"> </el-button> >
</el-row> <el-row>
</el-dialog> <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> </template>
<script> <script>
export default { export default {
name: 'DeleteTask', name: 'DeleteTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
tripNumber: '', tripNumber: '',
serviceNumber: '', serviceNumber: '',
type: '1', type: '1'
} };
}, },
computed: { computed: {
title() { title() {
return '删除任务' return '删除任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.tripNumber = params.tripNumber; this.tripNumber = params.tripNumber;
this.serviceNumber = params.serviceNumber; this.serviceNumber = params.serviceNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -61,4 +70,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,46 +1,55 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row type="flex" justify="center" class="button-group"> class="beijing-01__schedule create-week-plan"
<el-button @click="handleCommit"> </el-button> :title="title"
<el-button @click="doClose"> </el-button> :visible.sync="dialogShow"
</el-row> width="400px"
</el-dialog> :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> </template>
<script> <script>
export default { export default {
name: 'DeleteTodayPlan', name: 'DeleteTodayPlan',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false loading: false
} };
}, },
computed: { computed: {
title() { title() {
return '删除当天计划' return '删除当天计划';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -50,4 +59,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,122 +1,143 @@
<template> <template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> class="beijing-01__schedule manage-plan-list"
</QueryListPage> :title="title"
</el-dialog> :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> </template>
<script> <script>
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan'; import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
import { listPublishMap } from '@/api/jmap/map';
export default { export default {
name: 'ManagePlanList', name: 'ManagePlanList',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true
queryObject: { },
runPlanName: { queryList: {
type: 'text', query: this.queryFunction,
label: '运行图名称' selectCheckShow: false,
} indexShow: true,
} columns: [
}, {
queryList: { title: this.$t('publish.mapName'),
query: this.queryFunction, prop: 'mapId',
selectCheckShow: false, type: 'tag',
indexShow: true, columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
columns: [ tagType: (row) => { return ''; }
{ },
title: '地图名称', {
prop: 'mapName' title: this.$t('publish.runPlanName'),
}, prop: 'templatePlanId',
{ type: 'tag',
title: '运行图名称', columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
prop: 'runPlanName', tagType: (row) => { return 'success'; }
}, },
{ {
title: '加载日期', title: '加载日期',
prop: 'loadTime' prop: 'loadTime'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '100', width: '100',
buttons: [ buttons: [
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '运行图计划表' return '运行图计划表';
} }
}, },
created() { mounted() {
}, this.loadPageData();
methods: { },
queryFunction(params) { methods: {
if (this.$route.query.mapId) { loadPageData() {
params['mapId'] = this.$route.query.mapId; 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) { if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id; params['userId'] = this.$store.state.user.id;
} }
return getRunPlanLoadList(params); return getRunPlanLoadList(params);
}, },
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', { this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanLoad(row.id).then(response => { deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleCreateRunPlan() { handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); this.$emit('dispatchDialog', { name: 'createWeekPlan' });
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, this.$nextTick(()=> { this.reloadTable(); });
doClose() { },
this.loading = false; doClose() {
this.dialogShow = false; this.loading = false;
}, this.dialogShow = false;
reloadTable() { },
this.queryList.reload() reloadTable() {
} this.queryList.reload();
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
</style> </style>

View File

@ -1,143 +1,152 @@
<template> <template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form"> class="chengdou-03__systerm stand-stop-time"
<el-form-item label="车 组 号:" prop="groupNumber"> :title="title"
<el-input v-model="addModel.groupNumber"></el-input> :visible.sync="show"
</el-form-item> width="320px"
</el-form> :before-close="doClose"
<el-row justify="center" class="button-group"> :z-index="2000"
<el-col :span="10" :offset="2"> :modal="false"
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :close-on-click-modal="false"
</el-col> >
<el-col :span="8" :offset="4"> <el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-form-item label="车 组 号:" prop="groupNumber">
</el-col> <el-input v-model="addModel.groupNumber" />
</el-row> </el-form-item>
<confirm-control ref="confirmControl"></confirm-control> </el-form>
<notice-info ref="noticeInfo"></notice-info> <el-row justify="center" class="button-group">
</el-dialog> <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> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
components: { components: {
ConfirmControl, ConfirmControl,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
selected: null, selected: null,
addModel: { addModel: {
groupNumber: '', groupNumber: ''
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
}, },
title() { title() {
return '删除列车识别号' return '删除列车识别号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.operation = operate.operation; this.operation = operate.operation;
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected); mouseCancelState(this.selected);
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
} }
} }
} };
</script> </script>

View File

@ -755,9 +755,11 @@ export default {
}, },
initMenu(menu) { initMenu(menu) {
this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode); this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
this.menu[2].children = this.initStationList(); if (this.menu.length) {
this.clickEvent(); this.menu[2].children = this.initStationList();
this.closeMenu(true); this.clickEvent();
this.closeMenu(true);
}
}, },
clickEvent() { clickEvent() {
const self = this; const self = this;

View File

@ -1,488 +1,491 @@
<template> <template>
<div> <div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu> <pop-menu ref="popMenu" :menu="menu" />
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
<train-control ref="trainControl"></train-control> <train-control ref="trainControl" />
<train-delete ref="trainDelete"></train-delete> <train-delete ref="trainDelete" />
<train-move ref="trainMove"></train-move> <train-move ref="trainMove" />
<train-switch ref="trainSwitch"></train-switch> <train-switch ref="trainSwitch" />
<train-edit-number ref="trainEditNumber"></train-edit-number> <train-edit-number ref="trainEditNumber" />
<train-create-number ref="trainCreateNumber"></train-create-number> <train-create-number ref="trainCreateNumber" />
<train-move-number ref="trainMoveNumber"></train-move-number> <train-move-number ref="trainMoveNumber" />
<train-delete-number ref="trainDeleteNumber"></train-delete-number> <train-delete-number ref="trainDeleteNumber" />
<train-detail-info ref="trainDetailInfo"></train-detail-info> <train-detail-info ref="trainDetailInfo" />
</div> </div>
</template> </template>
<script> <script>
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo' import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
import TrainControl from './dialog/trainControl'; import TrainControl from './dialog/trainControl';
import TrainDelete from './dialog/trainDelete'; import TrainDelete from './dialog/trainDelete';
import TrainMove from './dialog/trainMove'; import TrainMove from './dialog/trainMove';
import TrainSwitch from './dialog/trainSwitch'; import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber'; import TrainEditNumber from './dialog/trainEditNumber';
import TrainMoveNumber from './dialog/trainMoveNumber'; import TrainMoveNumber from './dialog/trainMoveNumber';
import TrainCreateNumber from './dialog/trainCreateNumber'; import TrainCreateNumber from './dialog/trainCreateNumber';
import TrainDeleteNumber from './dialog/trainDeleteNumber'; import TrainDeleteNumber from './dialog/trainDeleteNumber';
import TrainDetailInfo from './dialog/trainDetailInfo'; import TrainDetailInfo from './dialog/trainDetailInfo';
import { mouseCancelState } from './utils/menuItemStatus'; import { mouseCancelState } from './utils/menuItemStatus';
export default { export default {
name: 'menuTrain', name: 'MenuTrain',
props: { components: {
selected: { PopMenu,
type: Object NoticeInfo,
} TrainControl,
}, TrainDelete,
components: { TrainMove,
PopMenu, TrainSwitch,
NoticeInfo, TrainEditNumber,
TrainControl, TrainMoveNumber,
TrainDelete, TrainCreateNumber,
TrainMove, TrainDeleteNumber,
TrainSwitch, TrainDetailInfo
TrainEditNumber, },
TrainMoveNumber, props: {
TrainCreateNumber, selected: {
TrainDeleteNumber, type: Object,
TrainDetailInfo, default() {
}, return null;
data() { }
return { }
menu: [], },
menuNormal: { data() {
local: [], return {
central: [ menu: [],
{ menuNormal: {
label: '新建车组号', local: [],
handler: this.createTrainNo, central: [
disabledCallback: MenuDisabledState.Train.createTrainNo, {
auth: { station: true, center: true } label: '新建车组号',
}, handler: this.createTrainNo,
{ disabledCallback: MenuDisabledState.Train.createTrainNo,
label: '移动车组号', auth: { station: true, center: true }
handler: this.moveTrainNo, },
disabledCallback: MenuDisabledState.Train.moveTrainNo, {
auth: { station: true, center: true } label: '移动车组号',
}, handler: this.moveTrainNo,
{ disabledCallback: MenuDisabledState.Train.moveTrainNo,
label: '删除车组号', auth: { station: true, center: true }
handler: this.deleteTrainNo, },
disabledCallback: MenuDisabledState.Train.deleteTrainNo, {
auth: { station: true, center: true } label: '删除车组号',
}, handler: this.deleteTrainNo,
{ disabledCallback: MenuDisabledState.Train.deleteTrainNo,
label: '修改车组号', auth: { station: true, center: true }
handler: this.editTrainNo, },
disabledCallback: MenuDisabledState.Train.editTrainNo, {
auth: { station: true, center: true } label: '修改车组号',
}, handler: this.editTrainNo,
{ disabledCallback: MenuDisabledState.Train.editTrainNo,
label: '设计划车', auth: { station: true, center: true }
handler: this.setPlanTrainId, },
disabledCallback: MenuDisabledState.Train.setPlanTrainId, {
auth: { station: true, center: true } label: '设计划车',
}, handler: this.setPlanTrainId,
{ disabledCallback: MenuDisabledState.Train.setPlanTrainId,
label: '设目的地', auth: { station: true, center: true }
handler: this.destinationTrainId, },
disabledCallback: MenuDisabledState.Train.destinationTrainId, {
auth: { station: true, center: true } label: '设目的地',
}, handler: this.destinationTrainId,
{ disabledCallback: MenuDisabledState.Train.destinationTrainId,
label: '设人工车', auth: { station: true, center: true }
handler: this.artificialTrainId, },
disabledCallback: MenuDisabledState.Train.artificialTrainId, {
auth: { station: true, center: true } label: '设人工车',
}, handler: this.artificialTrainId,
{ disabledCallback: MenuDisabledState.Train.artificialTrainId,
label: '设特殊人工车', auth: { station: true, center: true }
handler: this.undeveloped, },
disabledCallback: MenuDisabledState.Train.moveTrainId, {
auth: { station: true, center: true} label: '设特殊人工车',
}, handler: this.undeveloped,
{ disabledCallback: MenuDisabledState.Train.moveTrainId,
label: '详细列车信息', auth: { station: true, center: true}
handler: this.detailTrainInfo, },
disabledCallback: MenuDisabledState.Train.detailTrainInfo, {
auth: { station: true, center: true} label: '详细列车信息',
}, handler: this.detailTrainInfo,
{ disabledCallback: MenuDisabledState.Train.detailTrainInfo,
label: '属性', auth: { station: true, center: true}
handler: this.undeveloped, },
disabledCallback: MenuDisabledState.Train.moveTrainId, {
auth: { station: true, center: true} label: '属性',
} handler: this.undeveloped,
disabledCallback: MenuDisabledState.Train.moveTrainId,
auth: { station: true, center: true}
}
] ]
}, },
menuForce: [ menuForce: [
{ {
label: '设置通信故障', label: '设置通信故障',
handler: this.setStoppage, handler: this.setStoppage,
disabledCallback: MenuDisabledState.Train.setStoppage disabledCallback: MenuDisabledState.Train.setStoppage
}, },
{ {
label: '取消通信故障', label: '取消通信故障',
handler: this.cancelStoppage, handler: this.cancelStoppage,
disabledCallback: MenuDisabledState.Train.cancelStoppage disabledCallback: MenuDisabledState.Train.cancelStoppage
} }
], ],
menuSpeed: [ menuSpeed: [
{ {
label: '确认运行至前方站', label: '确认运行至前方站',
handler: this.limitSpeed, handler: this.limitSpeed,
disabledCallback: MenuDisabledState.Train.limitSpeed disabledCallback: MenuDisabledState.Train.limitSpeed
} }
] ]
} };
}, },
watch: { computed: {
'$store.state.menuOperation.menuCount': function () { ...mapGetters('training', [
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) { 'mode',
this.doShow(this.$store.state.menuOperation.menuPosition); 'operatemode'
} else { ]),
this.doClose(); ...mapGetters('menuOperation', [
} 'buttonOperation'
} ])
}, },
computed: { watch: {
...mapGetters('training', [ '$store.state.menuOperation.menuCount': function () {
'mode', if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
'operatemode' this.doShow(this.$store.state.menuOperation.menuPosition);
]), } else {
...mapGetters('menuOperation', [ this.doClose();
'buttonOperation' }
]) }
}, },
methods: { methods: {
clickEvent() { clickEvent() {
let self = this; const self = this;
window.onclick = function (e) { window.onclick = function (e) {
self.doClose(); self.doClose();
} };
}, },
initMenu() { initMenu() {
// //
this.menu = trainMenuFiltration(this.menuNormal); this.menu = trainMenuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) { if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed] this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
} }
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed] this.menu = [...this.menuForce, ...this.menuSpeed];
} }
this.menu = menuConvert(this.menu); this.menu = menuConvert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
this.initMenu(); this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point); this.$refs.popMenu.resetShowPosition(point);
} }
}, },
doClose() { doClose() {
if (this.$refs && this.$refs.popMenu) { if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close(); this.$refs.popMenu.close();
// this.$store.dispatch('map/setTrainWindowShow', false); // this.$store.dispatch('map/setTrainWindowShow', false);
} }
}, },
// //
setStoppage() { setStoppage() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.stoppage.menu.operation operation: OperationEvent.Train.stoppage.menu.operation
}; };
mouseCancelState(this.selected); mouseCancelState(this.selected);
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
cancelStoppage() { cancelStoppage() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.cancelStoppage.menu.operation operation: OperationEvent.Train.cancelStoppage.menu.operation
}; };
mouseCancelState(this.selected); mouseCancelState(this.selected);
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
limitSpeed() { limitSpeed() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.limitSpeed.menu.operation operation: OperationEvent.Train.limitSpeed.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
setPlanTrainId() { setPlanTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.setPlanTrainId.menu.operation operation: OperationEvent.Train.setPlanTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}) });
}, },
// //
destinationTrainId() { destinationTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.destinationTrainId.menu.operation operation: OperationEvent.Train.destinationTrainId.menu.operation
}; };
this.$store.dispatch('training/next',operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}) });
}, },
// //
artificialTrainId() { artificialTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.artificialTrainId.menu.operation operation: OperationEvent.Train.artificialTrainId.menu.operation
}; };
this.$store.dispatch('training/next',operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if(valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}) });
}, },
// //
detailTrainInfo() { detailTrainInfo() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.detailTrainInfo.menu.operation operation: OperationEvent.Train.detailTrainInfo.menu.operation
}; };
this.$store.dispatch('training/next',operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid){ if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDetailInfo.doShow(operate, this.selected); this.$refs.trainDetailInfo.doShow(operate, this.selected);
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}) });
}, },
undeveloped() { undeveloped() {
this.doClose(); this.doClose();
this.$alert('实现中......', '提示', { this.$alert('实现中......', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
} }
}); });
}, },
// //
addTrainId() { addTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.addTrainId.menu.operation operation: OperationEvent.Train.addTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
createTrainNo() { createTrainNo() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.createTrainNo.menu.operation operation: OperationEvent.Train.createTrainNo.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainCreateNumber.doShow(operate, this.selected); this.$refs.trainCreateNumber.doShow(operate, this.selected);
} }
}); });
}, },
// //
delTrainId() { delTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.delTrainId.menu.operation operation: OperationEvent.Train.delTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate, this.selected); this.$refs.trainDelete.doShow(operate, this.selected);
} }
}); });
}, },
// //
deleteTrainNo() { deleteTrainNo() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.deleteTrainNo.menu.operation operation: OperationEvent.Train.deleteTrainNo.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDeleteNumber.doShow(operate, this.selected); this.$refs.trainDeleteNumber.doShow(operate, this.selected);
} }
}); });
}, },
// //
editTrainId() { editTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainId.menu.operation operation: OperationEvent.Train.editTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
editTrainNo() { editTrainNo() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainNo.menu.operation operation: OperationEvent.Train.editTrainNo.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainEditNumber.doShow(operate, this.selected); this.$refs.trainEditNumber.doShow(operate, this.selected);
} }
}); });
}, },
// //
moveTrainNo() { moveTrainNo() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.moveTrainNo.menu.operation operation: OperationEvent.Train.moveTrainNo.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainMoveNumber.doShow(operate, this.selected); this.$refs.trainMoveNumber.doShow(operate, this.selected);
} }
}); });
}, },
// //
moveTrainId() { moveTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.moveTrainId.menu.operation operation: OperationEvent.Train.moveTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainMove.doShow(operate, this.selected); this.$refs.trainMove.doShow(operate, this.selected);
} }
}); });
}, },
// //
switchTrainId() { switchTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.switchTrainId.menu.operation operation: OperationEvent.Train.switchTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSwitch.doShow(operate, this.selected); this.$refs.trainSwitch.doShow(operate, this.selected);
} }
}); });
} }
} }
} };
</script> </script>

View File

@ -1,150 +1,162 @@
<template> <template>
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="margin: 10px"> class="beijing-01__schedule add-task"
<el-row> :title="title"
<el-col :span="3"> :visible.sync="dialogShow"
<el-radio v-model="model.type" label="1">加在最前</el-radio> width="800px"
</el-col> :before-close="doClose"
<el-col :span="2" :offset="1"> :z-index="2000"
<span>车次号</span> :modal="false"
</el-col> :close-on-click-modal="false"
<el-col :span="5"> >
<el-select v-model="model.tripNumber" placeholder="请选择"> <div style="margin: 10px">
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-row>
:value="item.value"> <el-col :span="3">
</el-option> <el-radio v-model="model.type" label="1">加在最前</el-radio>
</el-select> </el-col>
</el-col> <el-col :span="2" :offset="1">
<el-col :span="3" :offset="1"> <span>车次号</span>
<span>开始时间</span> </el-col>
</el-col> <el-col :span="5">
<el-col :span="5"> <el-select v-model="model.tripNumber" placeholder="请选择">
<el-select v-model="model.startTime" placeholder="请选择"> <el-option
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" v-for="item in tripNumberList"
:value="item.value"> :key="item.value"
</el-option> :label="item.label"
</el-select> :value="item.value"
</el-col> />
</el-row> </el-select>
<el-row> </el-col>
<el-col :span="3"> <el-col :span="3" :offset="1">
<el-radio v-model="model.type" label="2">加在最后</el-radio> <span>开始时间</span>
</el-col> </el-col>
<el-col :span="2" :offset="1"> <el-col :span="5">
<span>车次号</span> <el-select v-model="model.startTime" placeholder="请选择">
</el-col> <el-option
<el-col :span="5"> v-for="item in tripNumberList"
<el-select v-model="model.tripNumber" placeholder="请选择"> :key="item.value"
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
</el-option> />
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="3" :offset="1"> </el-row>
<span>开始时间</span> <el-row>
</el-col> <el-col :span="3">
<el-col :span="5"> <el-radio v-model="model.type" label="2">加在最后</el-radio>
<el-select v-model="model.startTime" placeholder="请选择"> </el-col>
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-col :span="2" :offset="1">
:value="item.value"> <span>车次号</span>
</el-option> </el-col>
</el-select> <el-col :span="5">
</el-col> <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-row style="margin-bottom: 5px;"> <el-row style="margin-bottom: 5px;">
交路 交路
</el-row> </el-row>
<el-row> <el-row>
<el-table :data="model.route" border :height="180"> <el-table :data="model.route" border :height="180">
<el-table-column prop="date" label="日期" width="180"> <el-table-column prop="date" label="日期" width="180" />
</el-table-column> <el-table-column prop="name" label="姓名" width="180" />
<el-table-column prop="name" label="姓名" width="180"> <el-table-column prop="address" label="地址" />
</el-table-column> <el-table-column width="20" />
<el-table-column prop="address" label="地址"> </el-table>
</el-table-column> </el-row>
<el-table-column width="20"> <el-row style=" margin-bottom: 5px;margin-top: 10px;">
</el-table-column> 详情
</el-table> </el-row>
</el-row> <el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;"> <el-table :data="model.detail" border :height="180">
详情 <el-table-column prop="date" label="日期" width="180" />
</el-row> <el-table-column prop="name" label="姓名" width="180" />
<el-row> <el-table-column prop="address" label="地址" />
<el-table :data="model.detail" border :height="180"> <el-table-column width="20" />
<el-table-column prop="date" label="日期" width="180"> </el-table>
</el-table-column> </el-row>
<el-table-column prop="name" label="姓名" width="180"> <el-row>
</el-table-column> <el-col :offset="16">
<el-table-column prop="address" label="地址"> <el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
</el-table-column> </el-col>
<el-table-column width="20"> </el-row>
</el-table-column> </div>
</el-table> <el-row type="flex" justify="center" class="button-group">
</el-row> <el-button @click="handleCommit"> </el-button>
<el-row> <el-button @click="doClose"> </el-button>
<el-col :offset="16"> </el-row>
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox> </el-dialog>
</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> </template>
<script> <script>
export default { export default {
name: 'AddTask', name: 'AddTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
type: '1', type: '1',
serviceNumber: '', serviceNumber: '',
tripNumber: '', tripNumber: '',
startTime: '', startTime: '',
default: false, default: false,
route: [], route: [],
detail: [] detail: []
}, },
tripNumberList: [], tripNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '添加任务' return '添加任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
this.model.tripNumber = params.tripNumber; this.model.tripNumber = params.tripNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
/deep/ { /deep/ {
.el-button { .el-button {
margin-left: 40px !important; margin-left: 40px !important;
@ -160,4 +172,4 @@
line-height: 20px !important; line-height: 20px !important;
} }
} }
</style> </style>

View File

@ -1,10 +1,10 @@
<template> <template>
<el-dialog <el-dialog
:title="title"
v-dialogDrag v-dialogDrag
:title="title"
class="beijing-01__schedule choose-plan-template" class="beijing-01__schedule choose-plan-template"
:visible.sync="dialogShow" :visible.sync="dialogShow"
width="80%" width="70%"
:before-close="doClose" :before-close="doClose"
:modal="false" :modal="false"
:close-on-click-modal="false" :close-on-click-modal="false"

View File

@ -18,10 +18,9 @@
</template> </template>
<script> <script>
// import { listPublishMap } from '@/api/jmap/mapdraft'; import { runPlanTemplateList } from '@/api/runplan';
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
import { getStationListBySkinCode } 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'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
@ -101,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; 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.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();

View File

@ -1,116 +1,126 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule create-week-plan"
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> :title="title"
<el-form-item label="运行图名称:" prop="planId"> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="19"> :before-close="doClose"
<el-input v-model="model.planName" :readonly="true"></el-input> :z-index="2000"
</el-col> :modal="false"
<el-col :span="4" :offset="1"> :close-on-click-modal="false"
<el-button @click="handleChoose">选择 </el-button> >
</el-col> <el-row>
</el-row> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
</el-form-item> <el-form-item label="运行图名称:" prop="planId">
<el-form-item label="计划日期范围:" prop="dateList"> <el-row>
<el-row> <el-col :span="19">
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-input v-model="model.planName" :readonly="true" />
value-format="yyyy-MM-dd"> </el-col>
</el-date-picker> <el-col :span="4" :offset="1">
</el-row> <el-button @click="handleChoose">选择 </el-button>
</el-form-item> </el-col>
</el-form> </el-row>
</el-row> </el-form-item>
<el-row type="flex" justify="center" class="button-group"> <el-form-item label="计划日期范围:" prop="dateList">
<el-button @click="create"> </el-button> <el-row>
<el-button @click="doClose"> </el-button> <el-date-picker
</el-row> v-model="model.dateList"
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> type="dates"
</el-dialog> :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> </template>
<script> <script>
import { createRunPlanLoad } from '@/api/runplan'; import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan'; import ChooseTemplatePlan from './chooseTemplatePlan';
export default { export default {
name: 'CreateWeekPlan', name: 'CreateWeekPlan',
components: { components: {
ChooseTemplatePlan ChooseTemplatePlan
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
} }
} };
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleChoose() { handleChoose() {
this.$refs.choose.doShow(); this.$refs.choose.doShow();
}, },
chooseConfirm(choose) { chooseConfirm(choose) {
if (choose) { if (choose) {
this.model.planId = choose.id; this.model.planId = choose.id;
this.model.planName = choose.name; this.model.planName = choose.name;
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => { return {
return { planDateList: this.model.dateList,
loadTime: date, mapId: this.$route.query.mapId,
mapId: this.$route.query.mapId, templatePlanId: this.model.planId
templatePlanId: this.model.planId };
} },
}); create() {
}, this.$refs['form'].validate((valid) => {
create() { if (valid) {
this.$refs['form'].validate((valid) => { createRunPlanLoad(this.buildModel()).then(response => {
if (valid) { this.$message.success('创建运行图计划成功');
createRunPlanLoad(this.buildModel()).then(response => { this.doClose();
this.$message.success('创建运行图计划成功'); }).catch(() => {
this.$emit('reloadTable', { name: 'managePlanList' }); this.doClose();
this.doClose(); this.$messageBox('创建运行图计划失败');
}).catch(error => { });
this.doClose(); }
this.$messageBox('创建运行图计划失败'); });
}) }
} }
}); };
}
}
}
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -124,4 +134,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,57 +1,66 @@
<template> <template>
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule delete-task"
<el-radio v-model="type" :label="1">删除以前所有任务包含本任务</el-radio> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="400px"
<el-radio v-model="type" :label="2">删除以后所有任务包含本任务</el-radio> :before-close="doClose"
</el-row> :z-index="2000"
<el-row type="flex" justify="center" class="button-group"> :modal="false"
<el-button @click="handleCommit"> </el-button> :close-on-click-modal="false"
<el-button @click="doClose"> </el-button> >
</el-row> <el-row>
</el-dialog> <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> </template>
<script> <script>
export default { export default {
name: 'DeleteTask', name: 'DeleteTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
tripNumber: '', tripNumber: '',
serviceNumber: '', serviceNumber: '',
type: '1', type: '1'
} };
}, },
computed: { computed: {
title() { title() {
return '删除任务' return '删除任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.tripNumber = params.tripNumber; this.tripNumber = params.tripNumber;
this.serviceNumber = params.serviceNumber; this.serviceNumber = params.serviceNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -61,4 +70,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,46 +1,55 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row type="flex" justify="center" class="button-group"> class="beijing-01__schedule create-week-plan"
<el-button @click="handleCommit"> </el-button> :title="title"
<el-button @click="doClose"> </el-button> :visible.sync="dialogShow"
</el-row> width="400px"
</el-dialog> :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> </template>
<script> <script>
export default { export default {
name: 'DeleteTodayPlan', name: 'DeleteTodayPlan',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false loading: false
} };
}, },
computed: { computed: {
title() { title() {
return '删除当天计划' return '删除当天计划';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -50,4 +59,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,122 +1,143 @@
<template> <template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> class="beijing-01__schedule manage-plan-list"
</QueryListPage> :title="title"
</el-dialog> :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> </template>
<script> <script>
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan'; import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
import { listPublishMap } from '@/api/jmap/map';
export default { export default {
name: 'ManagePlanList', name: 'ManagePlanList',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true
queryObject: { },
runPlanName: { queryList: {
type: 'text', query: this.queryFunction,
label: '运行图名称' selectCheckShow: false,
} indexShow: true,
} columns: [
}, {
queryList: { title: this.$t('publish.mapName'),
query: this.queryFunction, prop: 'mapId',
selectCheckShow: false, type: 'tag',
indexShow: true, columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
columns: [ tagType: (row) => { return ''; }
{ },
title: '地图名称', {
prop: 'mapName' title: this.$t('publish.runPlanName'),
}, prop: 'templatePlanId',
{ type: 'tag',
title: '运行图名称', columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
prop: 'runPlanName', tagType: (row) => { return 'success'; }
}, },
{ {
title: '加载日期', title: '加载日期',
prop: 'loadTime' prop: 'loadTime'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '100', width: '100',
buttons: [ buttons: [
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '运行图计划表' return '运行图计划表';
} }
}, },
created() { mounted() {
}, this.loadPageData();
methods: { },
queryFunction(params) { methods: {
if (this.$route.query.mapId) { loadPageData() {
params['mapId'] = this.$route.query.mapId; 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) { if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id; params['userId'] = this.$store.state.user.id;
} }
return getRunPlanLoadList(params); return getRunPlanLoadList(params);
}, },
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', { this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanLoad(row.id).then(response => { deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleCreateRunPlan() { handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); this.$emit('dispatchDialog', { name: 'createWeekPlan' });
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, this.$nextTick(()=> { this.reloadTable(); });
doClose() { },
this.loading = false; doClose() {
this.dialogShow = false; this.loading = false;
}, this.dialogShow = false;
reloadTable() { },
this.queryList.reload() reloadTable() {
} this.queryList.reload();
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
</style> </style>

View File

@ -1,152 +1,152 @@
<template> <template>
<el-dialog class="beijing-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule edit-planning-train"
<el-col :offset="10">列车线路</el-col> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="17"> :before-close="doClose"
<el-table :data="serviceData" border style="width: 100%" height="160"> :z-index="2000"
<el-table-column prop="startStationCode" label="起点站"> :modal="false"
</el-table-column> :close-on-click-modal="false"
<el-table-column prop="startStationStandCode" label="起点站台"> >
</el-table-column> <el-row>
<el-table-column prop="endStationCode" label="终点站"> <el-col :offset="10">列车线路</el-col>
</el-table-column> </el-row>
<el-table-column prop="endStationStandCode" label="终点站台"> <el-row>
</el-table-column> <el-col :span="17">
</el-table> <el-table :data="serviceData" border style="width: 100%" height="160">
</el-col> <el-table-column prop="startStationCode" label="起点站" />
<el-col :span="6" :offset="1"> <el-table-column prop="startStationStandCode" label="起点站台" />
<el-row type="flex" justify="center"> <el-table-column prop="endStationCode" label="终点站" />
<el-button class="view-button" @click="handleAddTask">加任务</el-button> <el-table-column prop="endStationStandCode" label="终点站台" />
</el-row> </el-table>
<el-row type="flex" justify="center"> </el-col>
<el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button> <el-col :span="6" :offset="1">
</el-row> <el-row type="flex" justify="center">
<el-row type="flex" justify="center"> <el-button class="view-button" @click="handleAddTask">加任务</el-button>
<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-row> </el-row>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-button @click="handleCommit"> </el-button> <el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button>
<el-button @click="doClose"> </el-button>
</el-row> </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> </template>
<script> <script>
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'modifyingPlan', name: 'ModifyingPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
effect: false, effect: false,
storeInOut: '1', storeInOut: '1',
oldServiceNumber: '', oldServiceNumber: '',
newServiceNumber: '', newServiceNumber: '',
serviceStartTime: '', serviceStartTime: '',
serviceEndTime: '', serviceEndTime: '',
serviceData: [], serviceData: [],
tripData: [], tripData: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改' return '修改';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
formatTime(time) { formatTime(time) {
return formatTime(time); return formatTime(time);
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
// //
handleAddTask() { handleAddTask() {
this.$emit('dispatchDialog', { name: 'addTask', params: {} }) this.$emit('dispatchDialog', { name: 'addTask', params: {} });
}, },
// //
handleReplace() { handleReplace() {
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
}, },
// //
handleDeleteTask() { handleDeleteTask() {
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} }) this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
}, },
// //
handleModifyingTripNumber() { handleModifyingTripNumber() {
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
}, },
// //
handleCommit() { handleCommit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -157,13 +157,11 @@
margin-left: 0px; margin-left: 0px;
} }
.view-label { .view-label {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.view-box { .view-box {
padding: 10px 0px; padding: 10px 0px;
border: 1px inset gray; border: 1px inset gray;
@ -176,4 +174,4 @@
margin: 5px 20px; margin: 5px 20px;
} }
} }
</style> </style>

View File

@ -1,298 +1,309 @@
<template> <template>
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="margin: 10px"> class="beijing-01__schedule add-task"
<el-row> :title="title"
<el-col :span="4"> :visible.sync="dialogShow"
<el-row> width="1000px"
<el-col :span="9"> :before-close="doClose"
<span>车次号</span> :z-index="2000"
</el-col> :modal="false"
<el-col :span="15"> :close-on-click-modal="false"
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择"> >
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <div style="margin: 10px">
:value="item.value"> <el-row>
</el-option> <el-col :span="4">
</el-select> <el-row>
</el-col> <el-col :span="9">
</el-row> <span>车次号</span>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="15">
<el-row> <el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
<el-col :offset="4"> <el-option
<el-checkbox v-model="model.trainManual">手工</el-checkbox> v-for="item in tripNumberList"
</el-col> :key="item.value"
</el-row> :label="item.label"
</el-col> :value="item.value"
<el-col :span="5"> />
<el-row> </el-select>
<el-col :span="12"> </el-col>
<span>缺省停站时间</span> </el-row>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="2">
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择"> <el-row>
<el-option v-for="item in timeList" :key="item.value" :label="item.label" <el-col :offset="4">
:value="item.value"> <el-checkbox v-model="model.trainManual">手工</el-checkbox>
</el-option> </el-col>
</el-select> </el-row>
</el-col> </el-col>
</el-row> <el-col :span="5">
</el-col> <el-row>
<el-col :span="5"> <el-col :span="12">
<el-row> <span>缺省停站时间</span>
<el-col :span="9" :offset="2"> </el-col>
<span>表号</span> <el-col :span="12">
</el-col> <el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
<el-col :span="13"> <el-option
<el-input v-model="model.serviceNumber"></el-input> v-for="item in timeList"
</el-col> :key="item.value"
</el-row> :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>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
<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-col> </el-col>
</el-row> <el-col :span="6">
<el-row> <el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
<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> </el-col>
<el-col :span="2"> </el-row>
<el-row> </el-col>
<el-col :offset="4"> </el-row>
<el-checkbox v-model="model.serialManual">手工</el-checkbox> </el-col>
</el-col> </el-row>
</el-row> <el-row>
</el-col> <el-col :span="4">
<el-col :span="5"> <el-row>
<el-row> <el-col :span="9">
<el-col :span="12"> <span>序列号</span>
<span>缺省运行等级</span> </el-col>
</el-col> <el-col :span="15">
<el-col :span="12"> <el-select v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择"> <el-option
<el-option v-for="item in levelList" :key="item.value" :label="item.label" v-for="item in serialNumberList"
:value="item.value"> :key="item.value"
</el-option> :label="item.label"
</el-select> :value="model.value"
</el-col> />
</el-row> </el-select>
</el-col> </el-col>
<el-col :span="5"> </el-row>
<el-row> </el-col>
<el-col :span="9" :offset="2"> <el-col :span="2">
<span>开始时间</span> <el-row>
</el-col> <el-col :offset="4">
<el-col :span="13"> <el-checkbox v-model="model.serialManual">手工</el-checkbox>
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false"> </el-col>
</el-time-select> </el-row>
</el-col> </el-col>
</el-row> <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>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-checkbox v-model="model.outStock">出库</el-checkbox>
<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-col> </el-col>
</el-row> <el-col :span="6">
<el-row style="margin-bottom: 5px;"> <el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
交路
</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> </el-col>
</el-row> </el-row>
</div> </el-col>
<el-row type="flex" justify="center" class="button-group"> </el-row>
<el-button @click="handleCommit"> </el-button> </el-col>
<el-button @click="doClose"> </el-button> </el-row>
</el-row> <el-row style="margin-bottom: 5px;">
</el-dialog> 交路
</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> </template>
<script> <script>
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'ModifyingTask', name: 'ModifyingTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
tripNumber: '', tripNumber: '',
serialNumber: '', serialNumber: '',
trainManual: false, trainManual: false,
serialManual: false, serialManual: false,
clearGuest: false, clearGuest: false,
continuationPlan: false, continuationPlan: false,
firstTrain: false, firstTrain: false,
lastTrain: false, lastTrain: false,
inStock: false, inStock: false,
outStock: false, outStock: false,
startTime: '', startTime: '',
route: [], route: [],
detail: [] detail: []
}, },
timeList: [], timeList: [],
levelList: [], levelList: [],
tripNumberList: [], tripNumberList: [],
serialNumberList: [], serialNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改任务' return '修改任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
formatTime(time) { formatTime(time) {
return formatTime(time); return formatTime(time);
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
loadInitData(params) { loadInitData(params) {
this.model.tripNumber = params.tripNumber; this.model.tripNumber = params.tripNumber;
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
let editData = this.$store.state.runPlan.editData[params.serviceNumber] const editData = this.$store.state.runPlan.editData[params.serviceNumber];
if (editData) { if (editData) {
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex }); const trainInfo = editData.trainMap[params.tripNumber];
let trainInfo = editData.trainMap[params.tripNumber]; const lastIndex = trainInfo.stationTimeList.length - 1;
let lastIndex = trainInfo.stationTimeList.length - 1; const taskObj = {
let taskObj = { tripNumber: params.tripNumber,
tripNumber: params.tripNumber, beginStationCode: trainInfo.stationTimeList[0].stationCode,
beginStationCode: trainInfo.stationTimeList[0].stationCode, beginStationStandCode: '',
beginStationStandCode: '', endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode, endStationStandCode: ''
endStationStandCode: '' };
} this.model.route.push(taskObj);
this.model.route.push(taskObj);
trainInfo.stationTimeList.forEach((elem, index) => { trainInfo.stationTimeList.forEach((elem, index) => {
let stationObj = { const stationObj = {
stationCode: elem.stationCode, stationCode: elem.stationCode,
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime, startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime, stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
endTime: elem.secondTime, endTime: elem.secondTime,
level: '', level: ''
} };
this.model.detail.push(stationObj); this.model.detail.push(stationObj);
}) });
} }
}, },
doShow(params) { doShow(params) {
this.loadInitData(params); this.loadInitData(params);
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
/deep/ { /deep/ {
.el-button { .el-button {
margin-left: 40px !important; margin-left: 40px !important;
@ -312,4 +323,4 @@
width: 110px !important; width: 110px !important;
} }
} }
</style> </style>

View File

@ -12,7 +12,10 @@ export default {
}, },
props: { props: {
selected: { selected: {
type: Object type: Object,
default() {
return null;
}
} }
}, },
data() { data() {

View File

@ -1,150 +1,162 @@
<template> <template>
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="margin: 10px"> class="beijing-01__schedule add-task"
<el-row> :title="title"
<el-col :span="3"> :visible.sync="dialogShow"
<el-radio v-model="model.type" label="1">加在最前</el-radio> width="800px"
</el-col> :before-close="doClose"
<el-col :span="2" :offset="1"> :z-index="2000"
<span>车次号</span> :modal="false"
</el-col> :close-on-click-modal="false"
<el-col :span="5"> >
<el-select v-model="model.tripNumber" placeholder="请选择"> <div style="margin: 10px">
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-row>
:value="item.value"> <el-col :span="3">
</el-option> <el-radio v-model="model.type" label="1">加在最前</el-radio>
</el-select> </el-col>
</el-col> <el-col :span="2" :offset="1">
<el-col :span="3" :offset="1"> <span>车次号</span>
<span>开始时间</span> </el-col>
</el-col> <el-col :span="5">
<el-col :span="5"> <el-select v-model="model.tripNumber" placeholder="请选择">
<el-select v-model="model.startTime" placeholder="请选择"> <el-option
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" v-for="item in tripNumberList"
:value="item.value"> :key="item.value"
</el-option> :label="item.label"
</el-select> :value="item.value"
</el-col> />
</el-row> </el-select>
<el-row> </el-col>
<el-col :span="3"> <el-col :span="3" :offset="1">
<el-radio v-model="model.type" label="2">加在最后</el-radio> <span>开始时间</span>
</el-col> </el-col>
<el-col :span="2" :offset="1"> <el-col :span="5">
<span>车次号</span> <el-select v-model="model.startTime" placeholder="请选择">
</el-col> <el-option
<el-col :span="5"> v-for="item in tripNumberList"
<el-select v-model="model.tripNumber" placeholder="请选择"> :key="item.value"
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
</el-option> />
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="3" :offset="1"> </el-row>
<span>开始时间</span> <el-row>
</el-col> <el-col :span="3">
<el-col :span="5"> <el-radio v-model="model.type" label="2">加在最后</el-radio>
<el-select v-model="model.startTime" placeholder="请选择"> </el-col>
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-col :span="2" :offset="1">
:value="item.value"> <span>车次号</span>
</el-option> </el-col>
</el-select> <el-col :span="5">
</el-col> <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-row style="margin-bottom: 5px;"> <el-row style="margin-bottom: 5px;">
交路 交路
</el-row> </el-row>
<el-row> <el-row>
<el-table :data="model.route" border :height="180"> <el-table :data="model.route" border :height="180">
<el-table-column prop="date" label="日期" width="180"> <el-table-column prop="date" label="日期" width="180" />
</el-table-column> <el-table-column prop="name" label="姓名" width="180" />
<el-table-column prop="name" label="姓名" width="180"> <el-table-column prop="address" label="地址" />
</el-table-column> <el-table-column width="20" />
<el-table-column prop="address" label="地址"> </el-table>
</el-table-column> </el-row>
<el-table-column width="20"> <el-row style=" margin-bottom: 5px;margin-top: 10px;">
</el-table-column> 详情
</el-table> </el-row>
</el-row> <el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;"> <el-table :data="model.detail" border :height="180">
详情 <el-table-column prop="date" label="日期" width="180" />
</el-row> <el-table-column prop="name" label="姓名" width="180" />
<el-row> <el-table-column prop="address" label="地址" />
<el-table :data="model.detail" border :height="180"> <el-table-column width="20" />
<el-table-column prop="date" label="日期" width="180"> </el-table>
</el-table-column> </el-row>
<el-table-column prop="name" label="姓名" width="180"> <el-row>
</el-table-column> <el-col :offset="16">
<el-table-column prop="address" label="地址"> <el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
</el-table-column> </el-col>
<el-table-column width="20"> </el-row>
</el-table-column> </div>
</el-table> <el-row type="flex" justify="center" class="button-group">
</el-row> <el-button @click="handleCommit"> </el-button>
<el-row> <el-button @click="doClose"> </el-button>
<el-col :offset="16"> </el-row>
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox> </el-dialog>
</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> </template>
<script> <script>
export default { export default {
name: 'AddTask', name: 'AddTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
type: '1', type: '1',
serviceNumber: '', serviceNumber: '',
tripNumber: '', tripNumber: '',
startTime: '', startTime: '',
default: false, default: false,
route: [], route: [],
detail: [] detail: []
}, },
tripNumberList: [], tripNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '添加任务' return '添加任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
this.model.tripNumber = params.tripNumber; this.model.tripNumber = params.tripNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
/deep/ { /deep/ {
.el-button { .el-button {
margin-left: 40px !important; margin-left: 40px !important;
@ -160,4 +172,4 @@
line-height: 20px !important; line-height: 20px !important;
} }
} }
</style> </style>

View File

@ -1,13 +1,13 @@
<template> <template>
<el-dialog <el-dialog
v-dialogDrag
:title="title" :title="title"
class="beijing-01__schedule choose-plan-template" class="beijing-01__schedule choose-plan-template"
:visible.sync="dialogShow" :visible.sync="dialogShow"
v-dialogDrag width="70%"
width="80%"
:before-close="doClose" :before-close="doClose"
:modal="false" :modal="false"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-row type="flex" justify="center" class="button-group"> <el-row type="flex" justify="center" class="button-group">

View File

@ -1,140 +1,147 @@
<template> <template>
<el-dialog :title="title" class="beijing-01__schedule reload-today-plan" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> :title="title"
</QueryListPage> class="beijing-01__schedule reload-today-plan"
<el-row type="flex" justify="center" class="button-group"> :visible.sync="dialogShow"
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button> width="80%"
<el-button @click="dialogShow = false"> </el-button> :before-close="doClose"
</el-row> :modal="false"
</el-dialog> :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> </template>
<script> <script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } 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' import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
name: 'ReloadTodayPlan', name: 'ReloadTodayPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
skinCodeList: [], skinCodeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
reset: true, reset: true,
labelWidth: '100px', labelWidth: '100px',
queryObject: { queryObject: {
name: { name: {
type: 'text', type: 'text',
label: '运行图名称' label: '运行图名称'
} }
} }
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
radioShow: true, radioShow: true,
columns: [ columns: [
{ {
title: '运行图名称', title: '运行图名称',
prop: 'name' prop: 'name'
}, },
{ {
title: '皮肤类型', title: '皮肤类型',
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']) return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '加载当天计划' return '加载当天计划';
} }
}, },
methods: { methods: {
loadInitData() { loadInitData() {
this.skinCodeList = []; this.skinCodeList = [];
getSkinCodeList().then(response => { getSkinCodeList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
}) });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
this.dialogShow = true; this.dialogShow = true;
this.loadInitData(); this.loadInitData();
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
}, },
queryFunction(params) { queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) { if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode']; params['skinCode'] = this.$store.getters['map/skinCode'];
} }
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
// //
handleConfirm() { handleConfirm() {
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; 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.loading = false;
this.reloadTable() this.reloadTable();
this.loadRunData(); this.loadRunData();
this.doClose(); this.doClose();
this.$message.success(`生成用户每日运行图成功`); this.$message.success(`生成用户每日运行图成功`);
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.reloadTable() this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`); this.$messageBox(`生成用户每日运行图失败`);
}) });
} else { } else {
this.$messageBox(`请选择需要加载的运行图`); this.$messageBox(`请选择需要加载的运行图`);
} }
} }
}, },
loadRunData() { loadRunData() {
let skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
if (skinCode) { if (skinCode) {
getStationListBySkinCode(skinCode).then(response => { getStationListBySkinCode(skinCode).then(response => {
let stations = response.data; const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => { getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(error => { }).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []); this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`); this.$messageBox(`获取运行图数据失败`);
}) });
}) });
}).catch(error => { }).catch(() => {
this.$messageBox(`获取车站列表失败`); this.$messageBox(`获取车站列表失败`);
}); });
} }
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
</style> </style>

View File

@ -1,116 +1,126 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule create-week-plan"
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> :title="title"
<el-form-item label="运行图名称:" prop="planId"> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="19"> :before-close="doClose"
<el-input v-model="model.planName" :readonly="true"></el-input> :z-index="2000"
</el-col> :modal="false"
<el-col :span="4" :offset="1"> :close-on-click-modal="false"
<el-button @click="handleChoose">选择 </el-button> >
</el-col> <el-row>
</el-row> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
</el-form-item> <el-form-item label="运行图名称:" prop="planId">
<el-form-item label="计划日期范围:" prop="dateList"> <el-row>
<el-row> <el-col :span="19">
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-input v-model="model.planName" :readonly="true" />
value-format="yyyy-MM-dd"> </el-col>
</el-date-picker> <el-col :span="4" :offset="1">
</el-row> <el-button @click="handleChoose">选择 </el-button>
</el-form-item> </el-col>
</el-form> </el-row>
</el-row> </el-form-item>
<el-row type="flex" justify="center" class="button-group"> <el-form-item label="计划日期范围:" prop="dateList">
<el-button @click="create"> </el-button> <el-row>
<el-button @click="doClose"> </el-button> <el-date-picker
</el-row> v-model="model.dateList"
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> type="dates"
</el-dialog> :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> </template>
<script> <script>
import { createRunPlanLoad } from '@/api/runplan'; import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan'; import ChooseTemplatePlan from './chooseTemplatePlan';
export default { export default {
name: 'CreateWeekPlan', name: 'CreateWeekPlan',
components: { components: {
ChooseTemplatePlan ChooseTemplatePlan
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
} }
} };
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleChoose() { handleChoose() {
this.$refs.choose.doShow(); this.$refs.choose.doShow();
}, },
chooseConfirm(choose) { chooseConfirm(choose) {
if (choose) { if (choose) {
this.model.planId = choose.id; this.model.planId = choose.id;
this.model.planName = choose.name; this.model.planName = choose.name;
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => { return {
return { planDateList: this.model.dateList,
loadTime: date, mapId: this.$route.query.mapId,
mapId: this.$route.query.mapId, templatePlanId: this.model.planId
templatePlanId: this.model.planId };
} },
}); create() {
}, this.$refs['form'].validate((valid) => {
create() { if (valid) {
this.$refs['form'].validate((valid) => { createRunPlanLoad(this.buildModel()).then(response => {
if (valid) { this.$message.success('创建运行图计划成功');
createRunPlanLoad(this.buildModel()).then(response => { this.doClose();
this.$message.success('创建运行图计划成功'); }).catch(() => {
this.$emit('reloadTable', { name: 'managePlanList' }); this.doClose();
this.doClose(); this.$messageBox('创建运行图计划失败');
}).catch(error => { });
this.doClose(); }
this.$messageBox('创建运行图计划失败'); });
}) }
} }
}); };
}
}
}
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -124,4 +134,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,57 +1,66 @@
<template> <template>
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule delete-task"
<el-radio v-model="type" :label="1">删除以前所有任务包含本任务</el-radio> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="400px"
<el-radio v-model="type" :label="2">删除以后所有任务包含本任务</el-radio> :before-close="doClose"
</el-row> :z-index="2000"
<el-row type="flex" justify="center" class="button-group"> :modal="false"
<el-button @click="handleCommit"> </el-button> :close-on-click-modal="false"
<el-button @click="doClose"> </el-button> >
</el-row> <el-row>
</el-dialog> <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> </template>
<script> <script>
export default { export default {
name: 'DeleteTask', name: 'DeleteTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
tripNumber: '', tripNumber: '',
serviceNumber: '', serviceNumber: '',
type: '1', type: '1'
} };
}, },
computed: { computed: {
title() { title() {
return '删除任务' return '删除任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.tripNumber = params.tripNumber; this.tripNumber = params.tripNumber;
this.serviceNumber = params.serviceNumber; this.serviceNumber = params.serviceNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -61,4 +70,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,46 +1,55 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row type="flex" justify="center" class="button-group"> class="beijing-01__schedule create-week-plan"
<el-button @click="handleCommit"> </el-button> :title="title"
<el-button @click="doClose"> </el-button> :visible.sync="dialogShow"
</el-row> width="400px"
</el-dialog> :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> </template>
<script> <script>
export default { export default {
name: 'DeleteTodayPlan', name: 'DeleteTodayPlan',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false loading: false
} };
}, },
computed: { computed: {
title() { title() {
return '删除当天计划' return '删除当天计划';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -50,4 +59,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,122 +1,143 @@
<template> <template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> class="beijing-01__schedule manage-plan-list"
</QueryListPage> :title="title"
</el-dialog> :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> </template>
<script> <script>
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan'; import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
import { listPublishMap } from '@/api/jmap/map';
export default { export default {
name: 'ManagePlanList', name: 'ManagePlanList',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true
queryObject: { },
runPlanName: { queryList: {
type: 'text', query: this.queryFunction,
label: '运行图名称' selectCheckShow: false,
} indexShow: true,
} columns: [
}, {
queryList: { title: this.$t('publish.mapName'),
query: this.queryFunction, prop: 'mapId',
selectCheckShow: false, type: 'tag',
indexShow: true, columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
columns: [ tagType: (row) => { return ''; }
{ },
title: '地图名称', {
prop: 'mapName' title: this.$t('publish.runPlanName'),
}, prop: 'templatePlanId',
{ type: 'tag',
title: '运行图名称', columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
prop: 'runPlanName', tagType: (row) => { return 'success'; }
}, },
{ {
title: '加载日期', title: '加载日期',
prop: 'loadTime' prop: 'loadTime'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '100', width: '100',
buttons: [ buttons: [
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '运行图计划表' return '运行图计划表';
} }
}, },
created() { mounted() {
}, this.loadPageData();
methods: { },
queryFunction(params) { methods: {
if (this.$route.query.mapId) { loadPageData() {
params['mapId'] = this.$route.query.mapId; 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) { if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id; params['userId'] = this.$store.state.user.id;
} }
return getRunPlanLoadList(params); return getRunPlanLoadList(params);
}, },
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', { this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanLoad(row.id).then(response => { deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleCreateRunPlan() { handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); this.$emit('dispatchDialog', { name: 'createWeekPlan' });
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, this.$nextTick(()=> { this.reloadTable(); });
doClose() { },
this.loading = false; doClose() {
this.dialogShow = false; this.loading = false;
}, this.dialogShow = false;
reloadTable() { },
this.queryList.reload() reloadTable() {
} this.queryList.reload();
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
</style> </style>

View File

@ -1,152 +1,152 @@
<template> <template>
<el-dialog class="beijing-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="beijing-01__schedule edit-planning-train"
<el-col :offset="10">列车线路</el-col> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="17"> :before-close="doClose"
<el-table :data="serviceData" border style="width: 100%" height="160"> :z-index="2000"
<el-table-column prop="startStationCode" label="起点站"> :modal="false"
</el-table-column> :close-on-click-modal="false"
<el-table-column prop="startStationStandCode" label="起点站台"> >
</el-table-column> <el-row>
<el-table-column prop="endStationCode" label="终点站"> <el-col :offset="10">列车线路</el-col>
</el-table-column> </el-row>
<el-table-column prop="endStationStandCode" label="终点站台"> <el-row>
</el-table-column> <el-col :span="17">
</el-table> <el-table :data="serviceData" border style="width: 100%" height="160">
</el-col> <el-table-column prop="startStationCode" label="起点站" />
<el-col :span="6" :offset="1"> <el-table-column prop="startStationStandCode" label="起点站台" />
<el-row type="flex" justify="center"> <el-table-column prop="endStationCode" label="终点站" />
<el-button class="view-button" @click="handleAddTask">加任务</el-button> <el-table-column prop="endStationStandCode" label="终点站台" />
</el-row> </el-table>
<el-row type="flex" justify="center"> </el-col>
<el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button> <el-col :span="6" :offset="1">
</el-row> <el-row type="flex" justify="center">
<el-row type="flex" justify="center"> <el-button class="view-button" @click="handleAddTask">加任务</el-button>
<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-row> </el-row>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-button @click="handleCommit"> </el-button> <el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button>
<el-button @click="doClose"> </el-button>
</el-row> </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> </template>
<script> <script>
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'modifyingPlan', name: 'ModifyingPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
effect: false, effect: false,
storeInOut: '1', storeInOut: '1',
oldServiceNumber: '', oldServiceNumber: '',
newServiceNumber: '', newServiceNumber: '',
serviceStartTime: '', serviceStartTime: '',
serviceEndTime: '', serviceEndTime: '',
serviceData: [], serviceData: [],
tripData: [], tripData: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改' return '修改';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
formatTime(time) { formatTime(time) {
return formatTime(time); return formatTime(time);
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
// //
handleAddTask() { handleAddTask() {
this.$emit('dispatchDialog', { name: 'addTask', params: {} }) this.$emit('dispatchDialog', { name: 'addTask', params: {} });
}, },
// //
handleReplace() { handleReplace() {
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
}, },
// //
handleDeleteTask() { handleDeleteTask() {
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} }) this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
}, },
// //
handleModifyingTripNumber() { handleModifyingTripNumber() {
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
}, },
// //
handleCommit() { handleCommit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -157,13 +157,11 @@
margin-left: 0px; margin-left: 0px;
} }
.view-label { .view-label {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.view-box { .view-box {
padding: 10px 0px; padding: 10px 0px;
border: 1px inset gray; border: 1px inset gray;
@ -176,4 +174,4 @@
margin: 5px 20px; margin: 5px 20px;
} }
} }
</style> </style>

View File

@ -1,298 +1,309 @@
<template> <template>
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="margin: 10px"> class="beijing-01__schedule add-task"
<el-row> :title="title"
<el-col :span="4"> :visible.sync="dialogShow"
<el-row> width="1000px"
<el-col :span="9"> :before-close="doClose"
<span>车次号</span> :z-index="2000"
</el-col> :modal="false"
<el-col :span="15"> :close-on-click-modal="false"
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择"> >
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <div style="margin: 10px">
:value="item.value"> <el-row>
</el-option> <el-col :span="4">
</el-select> <el-row>
</el-col> <el-col :span="9">
</el-row> <span>车次号</span>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="15">
<el-row> <el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
<el-col :offset="4"> <el-option
<el-checkbox v-model="model.trainManual">手工</el-checkbox> v-for="item in tripNumberList"
</el-col> :key="item.value"
</el-row> :label="item.label"
</el-col> :value="item.value"
<el-col :span="5"> />
<el-row> </el-select>
<el-col :span="12"> </el-col>
<span>缺省停站时间</span> </el-row>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="2">
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择"> <el-row>
<el-option v-for="item in timeList" :key="item.value" :label="item.label" <el-col :offset="4">
:value="item.value"> <el-checkbox v-model="model.trainManual">手工</el-checkbox>
</el-option> </el-col>
</el-select> </el-row>
</el-col> </el-col>
</el-row> <el-col :span="5">
</el-col> <el-row>
<el-col :span="5"> <el-col :span="12">
<el-row> <span>缺省停站时间</span>
<el-col :span="9" :offset="2"> </el-col>
<span>表号</span> <el-col :span="12">
</el-col> <el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
<el-col :span="13"> <el-option
<el-input v-model="model.serviceNumber"></el-input> v-for="item in timeList"
</el-col> :key="item.value"
</el-row> :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>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
<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-col> </el-col>
</el-row> <el-col :span="6">
<el-row> <el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
<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> </el-col>
<el-col :span="2"> </el-row>
<el-row> </el-col>
<el-col :offset="4"> </el-row>
<el-checkbox v-model="model.serialManual">手工</el-checkbox> </el-col>
</el-col> </el-row>
</el-row> <el-row>
</el-col> <el-col :span="4">
<el-col :span="5"> <el-row>
<el-row> <el-col :span="9">
<el-col :span="12"> <span>序列号</span>
<span>缺省运行等级</span> </el-col>
</el-col> <el-col :span="15">
<el-col :span="12"> <el-select v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择"> <el-option
<el-option v-for="item in levelList" :key="item.value" :label="item.label" v-for="item in serialNumberList"
:value="item.value"> :key="item.value"
</el-option> :label="item.label"
</el-select> :value="model.value"
</el-col> />
</el-row> </el-select>
</el-col> </el-col>
<el-col :span="5"> </el-row>
<el-row> </el-col>
<el-col :span="9" :offset="2"> <el-col :span="2">
<span>开始时间</span> <el-row>
</el-col> <el-col :offset="4">
<el-col :span="13"> <el-checkbox v-model="model.serialManual">手工</el-checkbox>
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false"> </el-col>
</el-time-select> </el-row>
</el-col> </el-col>
</el-row> <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>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-checkbox v-model="model.outStock">出库</el-checkbox>
<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-col> </el-col>
</el-row> <el-col :span="6">
<el-row style="margin-bottom: 5px;"> <el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
交路
</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> </el-col>
</el-row> </el-row>
</div> </el-col>
<el-row type="flex" justify="center" class="button-group"> </el-row>
<el-button @click="handleCommit"> </el-button> </el-col>
<el-button @click="doClose"> </el-button> </el-row>
</el-row> <el-row style="margin-bottom: 5px;">
</el-dialog> 交路
</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> </template>
<script> <script>
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'ModifyingTask', name: 'ModifyingTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
tripNumber: '', tripNumber: '',
serialNumber: '', serialNumber: '',
trainManual: false, trainManual: false,
serialManual: false, serialManual: false,
clearGuest: false, clearGuest: false,
continuationPlan: false, continuationPlan: false,
firstTrain: false, firstTrain: false,
lastTrain: false, lastTrain: false,
inStock: false, inStock: false,
outStock: false, outStock: false,
startTime: '', startTime: '',
route: [], route: [],
detail: [] detail: []
}, },
timeList: [], timeList: [],
levelList: [], levelList: [],
tripNumberList: [], tripNumberList: [],
serialNumberList: [], serialNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改任务' return '修改任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
formatTime(time) { formatTime(time) {
return formatTime(time); return formatTime(time);
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
loadInitData(params) { loadInitData(params) {
this.model.tripNumber = params.tripNumber; this.model.tripNumber = params.tripNumber;
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
let editData = this.$store.state.runPlan.editData[params.serviceNumber] const editData = this.$store.state.runPlan.editData[params.serviceNumber];
if (editData) { if (editData) {
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex }); const trainInfo = editData.trainMap[params.tripNumber];
let trainInfo = editData.trainMap[params.tripNumber]; const lastIndex = trainInfo.stationTimeList.length - 1;
let lastIndex = trainInfo.stationTimeList.length - 1; const taskObj = {
let taskObj = { tripNumber: params.tripNumber,
tripNumber: params.tripNumber, beginStationCode: trainInfo.stationTimeList[0].stationCode,
beginStationCode: trainInfo.stationTimeList[0].stationCode, beginStationStandCode: '',
beginStationStandCode: '', endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode, endStationStandCode: ''
endStationStandCode: '' };
} this.model.route.push(taskObj);
this.model.route.push(taskObj);
trainInfo.stationTimeList.forEach((elem, index) => { trainInfo.stationTimeList.forEach((elem, index) => {
let stationObj = { const stationObj = {
stationCode: elem.stationCode, stationCode: elem.stationCode,
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime, startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime, stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
endTime: elem.secondTime, endTime: elem.secondTime,
level: '', level: ''
} };
this.model.detail.push(stationObj); this.model.detail.push(stationObj);
}) });
} }
}, },
doShow(params) { doShow(params) {
this.loadInitData(params); this.loadInitData(params);
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleCommit() { handleCommit() {
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
/deep/ { /deep/ {
.el-button { .el-button {
margin-left: 40px !important; margin-left: 40px !important;
@ -312,4 +323,4 @@
width: 110px !important; width: 110px !important;
} }
} }
</style> </style>

View File

@ -1,423 +1,464 @@
<template> <template>
<el-dialog class="fuzhou-01__systerm train-control" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form"> class="fuzhou-01__systerm train-control"
<el-form-item label="车 组 号:" prop="groupNumber"> :title="title"
<el-select v-model="formModel.groupNumber" :id="domIdTrainNumber" filterable :visible.sync="show"
:disabled="trainNumberIsDisabled" @change="trainNumberChange"> width="320px"
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber" :before-close="doClose"
:value="train.groupNumber"> :z-index="2000"
</el-option> :modal="false"
</el-select> :close-on-click-modal="false"
</el-form-item> >
<el-form-item prop="trainType" label-width='0px'> <el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-radio-group v-model="formModel.trainType" :id="domIdTrainType" style="margin-left: 15px;" <el-form-item label="车 组 号:" prop="groupNumber">
:disabled="trainTypeIsDisabled" @change="trainTypeChange"> <el-select
<el-radio :label="'01'">计划车</el-radio> :id="domIdTrainNumber"
<el-radio :label="'02'">头码车</el-radio> v-model="formModel.groupNumber"
<el-radio :label="'03'">人工车</el-radio> filterable
</el-radio-group> :disabled="trainNumberIsDisabled"
</el-form-item> @change="trainNumberChange"
<el-form-item prop="serviceNumber"> >
<span slot="label">&emsp;&emsp;</span> <el-option
<el-input v-model="formModel.serviceNumber" :id="domIdServerNo" :disabled="serverNoIsDisabled" v-for="train in trainList"
@change="serverNoChange"> :key="train.groupNumber"
</el-input> :label="train.groupNumber"
</el-form-item> :value="train.groupNumber"
<el-form-item label="车 次 号:" prop="tripNumber"> />
<el-input v-model="formModel.tripNumber" :id="domIdTrainNo" :disabled="trainNoIsDisabled" </el-select>
@change="trainNoChange"></el-input> </el-form-item>
</el-form-item> <el-form-item prop="trainType" label-width="0px">
<el-form-item label="目的地号:" prop="targetCode"> <el-radio-group
<el-input v-model="formModel.targetCode" :id="domIdTargetCode" :disabled="targetCodeIsDisabled" :id="domIdTrainType"
@change="targetCodeChange"> v-model="formModel.trainType"
</el-input> style="margin-left: 15px;"
</el-form-item> :disabled="trainTypeIsDisabled"
</el-form> @change="trainTypeChange"
<el-row justify="center" class="button-group"> >
<el-col :span="10" :offset="2"> <el-radio :label="'01'">计划车</el-radio>
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> <el-radio :label="'02'">头码车</el-radio>
</el-col> <el-radio :label="'03'">人工车</el-radio>
<el-col :span="8" :offset="4"> </el-radio-group>
<el-button :id="domIdCancel" @click="cancel"> </el-button> </el-form-item>
</el-col> <el-form-item prop="serviceNumber">
</el-row> <span slot="label">&emsp;&emsp;</span>
<confirm-train ref="confirmTrain"></confirm-train> <el-input
<notice-info ref="noticeInfo"></notice-info> :id="domIdServerNo"
</el-dialog> 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> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map'; import { getPublishTrainList } from '@/api/jmap/map';
import ConfirmTrain from './childDialog/confirmTrain'; import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainControl', name: 'TrainControl',
components: { components: {
ConfirmTrain, ConfirmTrain,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainList: [], trainList: [],
formModel: { formModel: {
tripNumber: '', tripNumber: '',
groupNumber: '', groupNumber: '',
trainType: '01', trainType: '01',
serviceNumber: '', serviceNumber: '',
targetCode: '', targetCode: ''
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' } { required: true, message: '请选择车组号', trigger: 'change' }
], ],
trainType: [ trainType: [
{ required: true, message: '请选择一个列车类型', trigger: 'change' } { required: true, message: '请选择一个列车类型', trigger: 'change' }
], ],
serviceNumber: [ serviceNumber: [
{ required: true, message: '请输入表号', trigger: 'blur' } { required: true, message: '请输入表号', trigger: 'blur' }
], ],
tripNumber: [ tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' } { required: true, message: '请输入车次号', trigger: 'blur' }
], ],
targetCode: [ targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur' } { required: true, message: '请输入目的地号', trigger: 'blur' }
] ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false,
direction: 0 direction: 0
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
trainNoIsDisabled() { trainNoIsDisabled() {
return false; return false;
}, },
serverNoIsDisabled() { serverNoIsDisabled() {
return false; return false;
}, },
targetCodeIsDisabled() { targetCodeIsDisabled() {
return false; return false;
}, },
trainNumberIsDisabled() { trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true; return true;
} }
}, return '';
trainTypeIsDisabled() { },
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { trainTypeIsDisabled() {
return true; if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
} return true;
}, }
show() { return '';
return this.dialogShow && !this.$store.state.menuOperation.break; },
}, show() {
domIdTrainNumber() { return this.dialogShow && !this.$store.state.menuOperation.break;
if (this.dialogShow) { },
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { domIdTrainNumber() {
/** 添加列车识别号*/ if (this.dialogShow) {
return OperationEvent.Train.addTrainId.trainNumberChange.domId; if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { /** 添加列车识别号*/
/** 修改列车识别号*/ return OperationEvent.Train.addTrainId.trainNumberChange.domId;
return OperationEvent.Train.editTrainId.trainNumberChange.domId; } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
} /** 修改列车识别号*/
} return OperationEvent.Train.editTrainId.trainNumberChange.domId;
}, }
domIdTrainNo() { }
if (this.dialogShow) { return '';
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { },
/** 添加列车识别号*/ domIdTrainNo() {
return OperationEvent.Train.addTrainId.trainNoChange.domId; if (this.dialogShow) {
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 修改列车识别号*/ /** 添加列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId; 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 '';
/** 添加列车识别号*/ },
return OperationEvent.Train.addTrainId.trainTypeChange.domId; domIdTrainType() {
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { if (this.dialogShow) {
/** 修改列车识别号*/ if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return OperationEvent.Train.editTrainId.trainTypeChange.domId; /** 添加列车识别号*/
} return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
}, /** 修改列车识别号*/
domIdServerNo() { return OperationEvent.Train.editTrainId.trainTypeChange.domId;
if (this.dialogShow) { }
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { }
/** 添加列车识别号*/ return '';
return OperationEvent.Train.addTrainId.serverNoChange.domId; },
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { domIdServerNo() {
/** 修改列车识别号*/ if (this.dialogShow) {
return OperationEvent.Train.editTrainId.serverNoChange.domId; if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
} /** 添加列车识别号*/
} return OperationEvent.Train.addTrainId.serverNoChange.domId;
}, } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
domIdTargetCode() { /** 修改列车识别号*/
if (this.dialogShow) { return OperationEvent.Train.editTrainId.serverNoChange.domId;
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { }
/** 添加列车识别号*/ }
return OperationEvent.Train.addTrainId.targetCodeChange.domId; return '';
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { },
/** 修改列车识别号*/ domIdTargetCode() {
return OperationEvent.Train.editTrainId.targetCodeChange.domId; if (this.dialogShow) {
} if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
} /** 添加列车识别号*/
}, return OperationEvent.Train.addTrainId.targetCodeChange.domId;
domIdConfirm() { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
if (this.dialogShow) { /** 修改列车识别号*/
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { return OperationEvent.Train.editTrainId.targetCodeChange.domId;
/** 添加列车识别号*/ }
return OperationEvent.Train.addTrainId.menu.domId; }
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { return '';
/** 修改列车识别号*/ },
return OperationEvent.Train.editTrainId.menu.domId; domIdConfirm() {
} if (this.dialogShow) {
} if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
}, /** 添加列车识别号*/
domIdCancel() { return OperationEvent.Train.addTrainId.menu.domId;
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
}, /** 修改列车识别号*/
title() { return OperationEvent.Train.editTrainId.menu.domId;
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { }
return '添加列车识别号'; }
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { return '';
return '修改列车识别号'; },
} domIdCancel() {
} return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
mounted() { title() {
this.$nextTick(() => { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
this.$store.dispatch('training/tipReload'); return '添加列车识别号';
}) } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
}, return '修改列车识别号';
methods: { }
loadInitData(map) { return '';
if (map.skinCode) { }
getPublishTrainList(map.skinCode).then(resp => { },
this.trainList = resp.data; mounted() {
}).catch(error => { this.$nextTick(() => {
this.$messageBox(`获取列车车组号失败`); this.$store.dispatch('training/tipReload');
}); });
} },
}, methods: {
doShow(operate, selected) { loadInitData(map) {
// if (map.skinCode) {
if (!this.dialogShow) { getPublishTrainList(map.skinCode).then(resp => {
this.operation = operate.operation; this.trainList = resp.data;
} }).catch(() => {
let model = this.$store.getters['map/getDeviceByCode'](selected.code); this.$messageBox(`获取列车车组号失败`);
this.formModel = { });
groupNumber: model.groupNumber, }
tripNumber: model.tripNumber, },
trainType: '01', doShow(operate, selected) {
serviceNumber: model.serviceNumber, //
targetCode: model.targetCode, 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.loadInitData(this.map);
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange(groupNumber) { trainNumberChange(groupNumber) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${groupNumber}`, val: `${groupNumber}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
trainTypeChange(trainType) { trainTypeChange(trainType) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainType}`, val: `${trainType}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
serverNoChange(serviceNumber) { serverNoChange(serviceNumber) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${serviceNumber}`, val: `${serviceNumber}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
trainNoChange(tripNumber) { trainNoChange(tripNumber) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${tripNumber}`, val: `${tripNumber}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
targetCodeChange(targetCode) { targetCodeChange(targetCode) {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${targetCode}`, val: `${targetCode}`,
operation: '' operation: ''
} };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation; operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation; operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/ /** 增加列车识别号*/
this.addTrainId(); this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/ /** 修改列车识别号*/
this.editTrainId(); this.editTrainId();
} }
}, },
// //
addTrainId() { addTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let model = this.formModel; const model = this.formModel;
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation, operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [`添加列车识别号:成功`], messages: [`添加列车识别号:成功`],
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`, val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
// //
editTrainId() { editTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation, operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [`修改列车识别号:成功`], messages: [`修改列车识别号:成功`],
val: this.formModel.tripNumber, val: this.formModel.tripNumber
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate); this.$refs.confirmTrain.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
} };
</script> </script>

View File

@ -1,156 +1,165 @@
<template> <template>
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form"> class="fuzhou-01__systerm stand-stop-time"
<el-form-item label="车 组 号:" prop="groupNumber"> :title="title"
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange"></el-input> :visible.sync="show"
</el-form-item> width="320px"
</el-form> :before-close="doClose"
<el-row justify="center" class="button-group"> :z-index="2000"
<el-col :span="10" :offset="2"> :modal="false"
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button> :close-on-click-modal="false"
</el-col> >
<el-col :span="8" :offset="4"> <el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-form-item label="车 组 号:" prop="groupNumber">
</el-col> <el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange" />
</el-row> </el-form-item>
<confirm-control ref="confirmControl"></confirm-control> </el-form>
<notice-info ref="noticeInfo"></notice-info> <el-row justify="center" class="button-group">
</el-dialog> <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> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
components: { components: {
ConfirmControl, ConfirmControl,
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
trainNoList: [], trainNoList: [],
formModel: { formModel: {
groupNumber: '', groupNumber: ''
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
}, },
domIdTrainNumber() { domIdTrainNumber() {
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
}, },
title() { title() {
return '删除列车识别号' return '删除列车识别号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.operation = operate.operation; this.operation = operate.operation;
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange() { trainNumberChange() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${groupNumber}`, val: `${this.formModel.groupNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.groupNumber val: this.formModel.groupNumber
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
} }
} }
} };
</script> </script>

View File

@ -1,318 +1,321 @@
<template> <template>
<div> <div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu> <pop-menu ref="popMenu" :menu="menu" />
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
<train-control ref="trainControl"></train-control> <train-control ref="trainControl" />
<train-delete ref="trainDelete"></train-delete> <train-delete ref="trainDelete" />
<train-move ref="trainMove"></train-move> <train-move ref="trainMove" />
<train-switch ref="trainSwitch"></train-switch> <train-switch ref="trainSwitch" />
<train-edit-number ref="trainEditNumber"></train-edit-number> <train-edit-number ref="trainEditNumber" />
</div> </div>
</template> </template>
<script> <script>
import PopMenu from '@/components/PopMenu'; import PopMenu from '@/components/PopMenu';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo' import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
import TrainControl from './dialog/trainControl'; import TrainControl from './dialog/trainControl';
import TrainDelete from './dialog/trainDelete'; import TrainDelete from './dialog/trainDelete';
import TrainMove from './dialog/trainMove'; import TrainMove from './dialog/trainMove';
import TrainSwitch from './dialog/trainSwitch'; import TrainSwitch from './dialog/trainSwitch';
import TrainEditNumber from './dialog/trainEditNumber'; import TrainEditNumber from './dialog/trainEditNumber';
export default { export default {
name: 'menuTrain', name: 'MenuTrain',
props: { components: {
selected: { PopMenu,
type: Object NoticeInfo,
} TrainControl,
}, TrainDelete,
components: { TrainMove,
PopMenu, TrainSwitch,
NoticeInfo, TrainEditNumber
TrainControl, },
TrainDelete, props: {
TrainMove, selected: {
TrainSwitch, type: Object,
TrainEditNumber default() {
}, return null;
data() { }
return { }
menu: [], },
menuNormal: { data() {
local: [], return {
central: [ menu: [],
{ menuNormal: {
label: '添加列车识别号', local: [],
handler: this.addTrainId, central: [
disabledCallback: MenuDisabledState.Train.addTrainId, {
auth: { station: true, center: true } label: '添加列车识别号',
}, handler: this.addTrainId,
{ disabledCallback: MenuDisabledState.Train.addTrainId,
label: '删除列车识别号', auth: { station: true, center: true }
handler: this.delTrainId, },
disabledCallback: MenuDisabledState.Train.delTrainId, {
auth: { station: true, center: true } label: '删除列车识别号',
}, handler: this.delTrainId,
{ disabledCallback: MenuDisabledState.Train.delTrainId,
label: '修改列车识别号', auth: { station: true, center: true }
handler: this.editTrainId, },
disabledCallback: MenuDisabledState.Train.editTrainId, {
auth: { station: true, center: true } label: '修改列车识别号',
}, handler: this.editTrainId,
{ disabledCallback: MenuDisabledState.Train.editTrainId,
label: '修改车组号', auth: { station: true, center: true }
handler: this.editTrainNo, },
disabledCallback: MenuDisabledState.Train.editTrainNo, {
auth: { station: true, center: true } label: '修改车组号',
}, handler: this.editTrainNo,
{ disabledCallback: MenuDisabledState.Train.editTrainNo,
label: '移动列车识别号', auth: { station: true, center: true }
handler: this.moveTrainId, },
disabledCallback: MenuDisabledState.Train.moveTrainId, {
auth: { station: true, center: true } label: '移动列车识别号',
}, handler: this.moveTrainId,
{ disabledCallback: MenuDisabledState.Train.moveTrainId,
label: '交换列车识别号', auth: { station: true, center: true }
handler: this.switchTrainId, },
disabledCallback: MenuDisabledState.Train.switchTrainId, {
auth: { station: true, center: true } label: '交换列车识别号',
} handler: this.switchTrainId,
] disabledCallback: MenuDisabledState.Train.switchTrainId,
}, auth: { station: true, center: true }
menuForce: [ }
{ ]
label: '设置通信故障', },
handler: this.setStoppage, menuForce: [
disabledCallback: MenuDisabledState.Train.setStoppage {
}, label: '设置通信故障',
{ handler: this.setStoppage,
label: '取消通信故障', disabledCallback: MenuDisabledState.Train.setStoppage
handler: this.cancelStoppage, },
disabledCallback: MenuDisabledState.Train.cancelStoppage {
} label: '取消通信故障',
], handler: this.cancelStoppage,
menuSpeed: [ disabledCallback: MenuDisabledState.Train.cancelStoppage
{ }
label: '确认运行至前方站', ],
handler: this.limitSpeed, menuSpeed: [
disabledCallback: MenuDisabledState.Train.limitSpeed {
} 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); computed: {
} else { ...mapGetters('training', [
this.doClose(); 'mode',
} 'operatemode'
} ]),
}, ...mapGetters('menuOperation', [
computed: { 'buttonOperation'
...mapGetters('training', [ ])
'mode', },
'operatemode' watch: {
]), '$store.state.menuOperation.menuCount': function () {
...mapGetters('menuOperation', [ if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
'buttonOperation' this.doShow(this.$store.state.menuOperation.menuPosition);
]) } else {
}, this.doClose();
methods: { }
clickEvent() { }
let self = this; },
window.onclick = function (e) { methods: {
self.doClose(); clickEvent() {
} const self = this;
}, window.onclick = function (e) {
initMenu() { self.doClose();
// };
this.menu = trainMenuFiltration(this.menuNormal); },
if (this.operatemode === OperateMode.ADMIN) { initMenu() {
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed] //
} this.menu = trainMenuFiltration(this.menuNormal);
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
}
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed] this.menu = [...this.menuForce, ...this.menuSpeed];
} }
this.menu = menuConvert(this.menu); this.menu = menuConvert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
this.initMenu(); this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point); this.$refs.popMenu.resetShowPosition(point);
} }
}, },
doClose() { doClose() {
if (this.$refs && this.$refs.popMenu) { if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close(); this.$refs.popMenu.close();
// this.$store.dispatch('map/setTrainWindowShow', false); // this.$store.dispatch('map/setTrainWindowShow', false);
} }
}, },
// //
setStoppage() { setStoppage() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.stoppage.menu.operation operation: OperationEvent.Train.stoppage.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
cancelStoppage() { cancelStoppage() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.cancelStoppage.menu.operation operation: OperationEvent.Train.cancelStoppage.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
limitSpeed() { limitSpeed() {
let operate = { const operate = {
start: true, start: true,
send: true, send: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.limitSpeed.menu.operation operation: OperationEvent.Train.limitSpeed.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { } else {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(error => { }).catch(() => {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
}, },
// //
addTrainId() { addTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.addTrainId.menu.operation operation: OperationEvent.Train.addTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
delTrainId() { delTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.delTrainId.menu.operation operation: OperationEvent.Train.delTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainDelete.doShow(operate, this.selected); this.$refs.trainDelete.doShow(operate, this.selected);
} }
}); });
}, },
// //
editTrainId() { editTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainId.menu.operation operation: OperationEvent.Train.editTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(operate, this.selected); this.$refs.trainControl.doShow(operate, this.selected);
} }
}); });
}, },
// //
editTrainNo() { editTrainNo() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.editTrainNo.menu.operation operation: OperationEvent.Train.editTrainNo.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainEditNumber.doShow(operate, this.selected); this.$refs.trainEditNumber.doShow(operate, this.selected);
} }
}); });
}, },
// //
moveTrainId() { moveTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.moveTrainId.menu.operation operation: OperationEvent.Train.moveTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainMove.doShow(operate, this.selected); this.$refs.trainMove.doShow(operate, this.selected);
} }
}); });
}, },
// //
switchTrainId() { switchTrainId() {
let operate = { const operate = {
start: true, start: true,
code: this.selected.code, code: this.selected.code,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
label: MapDeviceType.Train.label, label: MapDeviceType.Train.label,
operation: OperationEvent.Train.switchTrainId.menu.operation operation: OperationEvent.Train.switchTrainId.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainSwitch.doShow(operate, this.selected); this.$refs.trainSwitch.doShow(operate, this.selected);
} }
}); });
} }
} }
} };
</script> </script>

View File

@ -1,150 +1,162 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="margin: 10px"> class="fuzhou-01__schedule add-task"
<el-row> :title="title"
<el-col :span="3"> :visible.sync="dialogShow"
<el-radio v-model="model.type" label="1">加在最前</el-radio> width="800px"
</el-col> :before-close="doClose"
<el-col :span="2" :offset="1"> :z-index="2000"
<span>车次号</span> :modal="false"
</el-col> :close-on-click-modal="false"
<el-col :span="5"> >
<el-select v-model="model.tripNumber" placeholder="请选择"> <div style="margin: 10px">
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-row>
:value="item.value"> <el-col :span="3">
</el-option> <el-radio v-model="model.type" label="1">加在最前</el-radio>
</el-select> </el-col>
</el-col> <el-col :span="2" :offset="1">
<el-col :span="3" :offset="1"> <span>车次号</span>
<span>开始时间</span> </el-col>
</el-col> <el-col :span="5">
<el-col :span="5"> <el-select v-model="model.tripNumber" placeholder="请选择">
<el-select v-model="model.startTime" placeholder="请选择"> <el-option
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" v-for="item in tripNumberList"
:value="item.value"> :key="item.value"
</el-option> :label="item.label"
</el-select> :value="item.value"
</el-col> />
</el-row> </el-select>
<el-row> </el-col>
<el-col :span="3"> <el-col :span="3" :offset="1">
<el-radio v-model="model.type" label="2">加在最后</el-radio> <span>开始时间</span>
</el-col> </el-col>
<el-col :span="2" :offset="1"> <el-col :span="5">
<span>车次号</span> <el-select v-model="model.startTime" placeholder="请选择">
</el-col> <el-option
<el-col :span="5"> v-for="item in tripNumberList"
<el-select v-model="model.tripNumber" placeholder="请选择"> :key="item.value"
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
</el-option> />
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="3" :offset="1"> </el-row>
<span>开始时间</span> <el-row>
</el-col> <el-col :span="3">
<el-col :span="5"> <el-radio v-model="model.type" label="2">加在最后</el-radio>
<el-select v-model="model.startTime" placeholder="请选择"> </el-col>
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-col :span="2" :offset="1">
:value="item.value"> <span>车次号</span>
</el-option> </el-col>
</el-select> <el-col :span="5">
</el-col> <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-row style="margin-bottom: 5px;"> <el-row style="margin-bottom: 5px;">
交路 交路
</el-row> </el-row>
<el-row> <el-row>
<el-table :data="model.route" border :height="180"> <el-table :data="model.route" border :height="180">
<el-table-column prop="date" label="日期" width="180"> <el-table-column prop="date" label="日期" width="180" />
</el-table-column> <el-table-column prop="name" label="姓名" width="180" />
<el-table-column prop="name" label="姓名" width="180"> <el-table-column prop="address" label="地址" />
</el-table-column> <el-table-column width="20" />
<el-table-column prop="address" label="地址"> </el-table>
</el-table-column> </el-row>
<el-table-column width="20"> <el-row style=" margin-bottom: 5px;margin-top: 10px;">
</el-table-column> 详情
</el-table> </el-row>
</el-row> <el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;"> <el-table :data="model.detail" border :height="180">
详情 <el-table-column prop="date" label="日期" width="180" />
</el-row> <el-table-column prop="name" label="姓名" width="180" />
<el-row> <el-table-column prop="address" label="地址" />
<el-table :data="model.detail" border :height="180"> <el-table-column width="20" />
<el-table-column prop="date" label="日期" width="180"> </el-table>
</el-table-column> </el-row>
<el-table-column prop="name" label="姓名" width="180"> <el-row>
</el-table-column> <el-col :offset="16">
<el-table-column prop="address" label="地址"> <el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox>
</el-table-column> </el-col>
<el-table-column width="20"> </el-row>
</el-table-column> </div>
</el-table> <el-row type="flex" justify="center" class="button-group">
</el-row> <el-button @click="commit"> </el-button>
<el-row> <el-button @click="doClose"> </el-button>
<el-col :offset="16"> </el-row>
<el-checkbox v-model="model.default">显示默认停站时间和运行等级</el-checkbox> </el-dialog>
</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> </template>
<script> <script>
export default { export default {
name: 'AddTask', name: 'AddTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
type: '1', type: '1',
serviceNumber: '', serviceNumber: '',
tripNumber: '', tripNumber: '',
startTime: '', startTime: '',
default: false, default: false,
route: [], route: [],
detail: [] detail: []
}, },
tripNumberList: [], tripNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '添加任务' return '添加任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
this.model.tripNumber = params.tripNumber; this.model.tripNumber = params.tripNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
commit() { commit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
/deep/ { /deep/ {
.el-button { .el-button {
margin-left: 40px !important; margin-left: 40px !important;
@ -160,4 +172,4 @@
line-height: 20px !important; line-height: 20px !important;
} }
} }
</style> </style>

View File

@ -4,7 +4,7 @@
:title="title" :title="title"
class="fuzhou-01__schedule choose-plan-template" class="fuzhou-01__schedule choose-plan-template"
:visible.sync="dialogShow" :visible.sync="dialogShow"
width="80%" width="70%"
:before-close="doClose" :before-close="doClose"
:modal="false" :modal="false"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -93,11 +93,11 @@ export default {
return runPlanTemplateList(params); return runPlanTemplateList(params);
}, },
handleConfirm() { handleConfirm() {
this.doClose();
if (this.$refs && this.$refs.pageRules) { if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose) { if (choose) {
this.$emit('chooseConfirm', choose); this.$emit('chooseConfirm', choose);
this.doClose();
} else { } else {
this.$messageBox(`请选择模板运行图`); this.$messageBox(`请选择模板运行图`);
} }

View File

@ -18,9 +18,9 @@
</template> </template>
<script> <script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } 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'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
@ -100,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; 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.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();

View File

@ -1,116 +1,126 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="fuzhou-01__schedule create-week-plan"
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> :title="title"
<el-form-item label="运行图名称:" prop="planId"> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="19"> :before-close="doClose"
<el-input v-model="model.planName" :readonly="true"></el-input> :z-index="2000"
</el-col> :modal="false"
<el-col :span="4" :offset="1"> :close-on-click-modal="false"
<el-button @click="handleChoose">选择 </el-button> >
</el-col> <el-row>
</el-row> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
</el-form-item> <el-form-item label="运行图名称:" prop="planId">
<el-form-item label="计划日期范围:" prop="dateList"> <el-row>
<el-row> <el-col :span="19">
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-input v-model="model.planName" :readonly="true" />
value-format="yyyy-MM-dd"> </el-col>
</el-date-picker> <el-col :span="4" :offset="1">
</el-row> <el-button @click="handleChoose">选择 </el-button>
</el-form-item> </el-col>
</el-form> </el-row>
</el-row> </el-form-item>
<el-row type="flex" justify="center" class="button-group"> <el-form-item label="计划日期范围:" prop="dateList">
<el-button @click="create"> </el-button> <el-row>
<el-button @click="doClose"> </el-button> <el-date-picker
</el-row> v-model="model.dateList"
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> type="dates"
</el-dialog> :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> </template>
<script> <script>
import { createRunPlanLoad } from '@/api/runplan'; import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan'; import ChooseTemplatePlan from './chooseTemplatePlan';
export default { export default {
name: 'CreateWeekPlan', name: 'CreateWeekPlan',
components: { components: {
ChooseTemplatePlan ChooseTemplatePlan
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
} }
} };
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
handleChoose() { handleChoose() {
this.$refs.choose.doShow(); this.$refs.choose.doShow();
}, },
chooseConfirm(choose) { chooseConfirm(choose) {
if (choose) { if (choose) {
this.model.planId = choose.id; this.model.planId = choose.id;
this.model.planName = choose.name; this.model.planName = choose.name;
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => { return {
return { planDateList: this.model.dateList,
loadTime: date, mapId: this.$route.query.mapId,
mapId: this.$route.query.mapId, templatePlanId: this.model.planId
templatePlanId: this.model.planId };
} },
}); create() {
}, this.$refs['form'].validate((valid) => {
create() { if (valid) {
this.$refs['form'].validate((valid) => { createRunPlanLoad(this.buildModel()).then(response => {
if (valid) { this.$message.success('创建运行图计划成功');
createRunPlanLoad(this.buildModel()).then(response => { this.doClose();
this.$message.success('创建运行图计划成功'); }).catch(() => {
this.$emit('reloadTable', { name: 'managePlanList' }); this.doClose();
this.doClose(); this.$messageBox('创建运行图计划失败');
}).catch(error => { });
this.doClose(); }
this.$messageBox('创建运行图计划失败'); });
}) }
} }
}); };
}
}
}
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -124,4 +134,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,57 +1,66 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="fuzhou-01__schedule delete-task"
<el-radio v-model="type" :label="1">删除以前所有任务包含本任务</el-radio> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="400px"
<el-radio v-model="type" :label="2">删除以后所有任务包含本任务</el-radio> :before-close="doClose"
</el-row> :z-index="2000"
<el-row type="flex" justify="center" class="button-group"> :modal="false"
<el-button @click="commit"> </el-button> :close-on-click-modal="false"
<el-button @click="doClose"> </el-button> >
</el-row> <el-row>
</el-dialog> <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> </template>
<script> <script>
export default { export default {
name: 'DeleteTask', name: 'DeleteTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
tripNumber: '', tripNumber: '',
serviceNumber: '', serviceNumber: '',
type: '1', type: '1'
} };
}, },
computed: { computed: {
title() { title() {
return '删除任务' return '删除任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.tripNumber = params.tripNumber; this.tripNumber = params.tripNumber;
this.serviceNumber = params.serviceNumber; this.serviceNumber = params.serviceNumber;
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
commit() { commit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -61,4 +70,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,46 +1,55 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row type="flex" justify="center" class="button-group"> class="fuzhou-01__schedule create-week-plan"
<el-button @click="commit"> </el-button> :title="title"
<el-button @click="doClose"> </el-button> :visible.sync="dialogShow"
</el-row> width="400px"
</el-dialog> :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> </template>
<script> <script>
export default { export default {
name: 'DeleteTodayPlan', name: 'DeleteTodayPlan',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false loading: false
} };
}, },
computed: { computed: {
title() { title() {
return '删除当天计划' return '删除当天计划';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
doShow(params) { doShow(params) {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
commit() { commit() {
// this.tripNumber // this.tripNumber
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -50,4 +59,4 @@
margin: 10px; margin: 10px;
} }
} }
</style> </style>

View File

@ -1,122 +1,143 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> class="fuzhou-01__schedule manage-plan-list"
</QueryListPage> :title="title"
</el-dialog> :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> </template>
<script> <script>
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan'; import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
import { listPublishMap } from '@/api/jmap/map';
export default { export default {
name: 'ManagePlanList', name: 'ManagePlanList',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '140px',
reset: true, reset: true
queryObject: { },
runPlanName: { queryList: {
type: 'text', query: this.queryFunction,
label: '运行图名称' selectCheckShow: false,
} indexShow: true,
} columns: [
}, {
queryList: { title: this.$t('publish.mapName'),
query: this.queryFunction, prop: 'mapId',
selectCheckShow: false, type: 'tag',
indexShow: true, columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
columns: [ tagType: (row) => { return ''; }
{ },
title: '地图名称', {
prop: 'mapName' title: this.$t('publish.runPlanName'),
}, prop: 'templatePlanId',
{ type: 'tag',
title: '运行图名称', columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
prop: 'runPlanName', tagType: (row) => { return 'success'; }
}, },
{ {
title: '加载日期', title: '加载日期',
prop: 'loadTime' prop: 'loadTime'
}, },
{ {
type: 'button', type: 'button',
title: '操作', title: '操作',
width: '100', width: '100',
buttons: [ buttons: [
{ {
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
} }
] ]
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '运行图计划表' return '运行图计划表';
} }
}, },
created() { mounted() {
}, this.loadPageData();
methods: { },
queryFunction(params) { methods: {
if (this.$route.query.mapId) { loadPageData() {
params['mapId'] = this.$route.query.mapId; 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) { if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id; params['userId'] = this.$store.state.user.id;
} }
return getRunPlanLoadList(params); return getRunPlanLoadList(params);
}, },
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', { this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanLoad(row.id).then(response => { deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleCreateRunPlan() { handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); this.$emit('dispatchDialog', { name: 'createWeekPlan' });
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, this.$nextTick(()=> { this.reloadTable(); });
doClose() { },
this.loading = false; doClose() {
this.dialogShow = false; this.loading = false;
}, this.dialogShow = false;
reloadTable() { },
this.queryList.reload() reloadTable() {
} this.queryList.reload();
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
</style> </style>

View File

@ -1,152 +1,152 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-row> class="fuzhou-01__schedule edit-planning-train"
<el-col :offset="10">列车线路</el-col> :title="title"
</el-row> :visible.sync="dialogShow"
<el-row> width="800px"
<el-col :span="17"> :before-close="doClose"
<el-table :data="serviceData" border style="width: 100%" height="160"> :z-index="2000"
<el-table-column prop="startStationCode" label="起点站"> :modal="false"
</el-table-column> :close-on-click-modal="false"
<el-table-column prop="startStationStandCode" label="起点站台"> >
</el-table-column> <el-row>
<el-table-column prop="endStationCode" label="终点站"> <el-col :offset="10">列车线路</el-col>
</el-table-column> </el-row>
<el-table-column prop="endStationStandCode" label="终点站台"> <el-row>
</el-table-column> <el-col :span="17">
</el-table> <el-table :data="serviceData" border style="width: 100%" height="160">
</el-col> <el-table-column prop="startStationCode" label="起点站" />
<el-col :span="6" :offset="1"> <el-table-column prop="startStationStandCode" label="起点站台" />
<el-row type="flex" justify="center"> <el-table-column prop="endStationCode" label="终点站" />
<el-button class="view-button" @click="handleAddTask">加任务</el-button> <el-table-column prop="endStationStandCode" label="终点站台" />
</el-row> </el-table>
<el-row type="flex" justify="center"> </el-col>
<el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button> <el-col :span="6" :offset="1">
</el-row> <el-row type="flex" justify="center">
<el-row type="flex" justify="center"> <el-button class="view-button" @click="handleAddTask">加任务</el-button>
<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-row> </el-row>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-button @click="commit"> </el-button> <el-button class="view-button" @click="handleReplace">&ensp;&ensp;</el-button>
<el-button @click="doClose"> </el-button>
</el-row> </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> </template>
<script> <script>
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'modifyingPlan', name: 'ModifyingPlan',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
effect: false, effect: false,
storeInOut: '1', storeInOut: '1',
oldServiceNumber: '', oldServiceNumber: '',
newServiceNumber: '', newServiceNumber: '',
serviceStartTime: '', serviceStartTime: '',
serviceEndTime: '', serviceEndTime: '',
serviceData: [], serviceData: [],
tripData: [], tripData: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改' return '修改';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
formatTime(time) { formatTime(time) {
return formatTime(time); return formatTime(time);
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
doShow() { doShow() {
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
// //
handleAddTask() { handleAddTask() {
this.$emit('dispatchDialog', { name: 'addTask', params: {} }) this.$emit('dispatchDialog', { name: 'addTask', params: {} });
}, },
// //
handleReplace() { handleReplace() {
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
}, },
// //
handleDeleteTask() { handleDeleteTask() {
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} }) this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
}, },
// //
handleModifyingTripNumber() { handleModifyingTripNumber() {
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} }) this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
}, },
// //
commit() { commit() {
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -157,13 +157,11 @@
margin-left: 0px; margin-left: 0px;
} }
.view-label { .view-label {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.view-box { .view-box {
padding: 10px 0px; padding: 10px 0px;
border: 1px inset gray; border: 1px inset gray;
@ -176,4 +174,4 @@
margin: 5px 20px; margin: 5px 20px;
} }
} }
</style> </style>

View File

@ -1,298 +1,309 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<div style="margin: 10px"> class="fuzhou-01__schedule add-task"
<el-row> :title="title"
<el-col :span="4"> :visible.sync="dialogShow"
<el-row> width="1000px"
<el-col :span="9"> :before-close="doClose"
<span>车次号</span> :z-index="2000"
</el-col> :modal="false"
<el-col :span="15"> :close-on-click-modal="false"
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择"> >
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <div style="margin: 10px">
:value="item.value"> <el-row>
</el-option> <el-col :span="4">
</el-select> <el-row>
</el-col> <el-col :span="9">
</el-row> <span>车次号</span>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="15">
<el-row> <el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
<el-col :offset="4"> <el-option
<el-checkbox v-model="model.trainManual">手工</el-checkbox> v-for="item in tripNumberList"
</el-col> :key="item.value"
</el-row> :label="item.label"
</el-col> :value="item.value"
<el-col :span="5"> />
<el-row> </el-select>
<el-col :span="12"> </el-col>
<span>缺省停站时间</span> </el-row>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="2">
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择"> <el-row>
<el-option v-for="item in timeList" :key="item.value" :label="item.label" <el-col :offset="4">
:value="item.value"> <el-checkbox v-model="model.trainManual">手工</el-checkbox>
</el-option> </el-col>
</el-select> </el-row>
</el-col> </el-col>
</el-row> <el-col :span="5">
</el-col> <el-row>
<el-col :span="5"> <el-col :span="12">
<el-row> <span>缺省停站时间</span>
<el-col :span="9" :offset="2"> </el-col>
<span>表号</span> <el-col :span="12">
</el-col> <el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
<el-col :span="13"> <el-option
<el-input v-model="model.serviceNumber"></el-input> v-for="item in timeList"
</el-col> :key="item.value"
</el-row> :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>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-checkbox v-model="model.continuationPlan">延续计划</el-checkbox>
<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-col> </el-col>
</el-row> <el-col :span="6">
<el-row> <el-checkbox v-model="model.firstTrain">首班车</el-checkbox>
<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> </el-col>
<el-col :span="2"> </el-row>
<el-row> </el-col>
<el-col :offset="4"> </el-row>
<el-checkbox v-model="model.serialManual">手工</el-checkbox> </el-col>
</el-col> </el-row>
</el-row> <el-row>
</el-col> <el-col :span="4">
<el-col :span="5"> <el-row>
<el-row> <el-col :span="9">
<el-col :span="12"> <span>序列号</span>
<span>缺省运行等级</span> </el-col>
</el-col> <el-col :span="15">
<el-col :span="12"> <el-select v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择"> <el-option
<el-option v-for="item in levelList" :key="item.value" :label="item.label" v-for="item in serialNumberList"
:value="item.value"> :key="item.value"
</el-option> :label="item.label"
</el-select> :value="model.value"
</el-col> />
</el-row> </el-select>
</el-col> </el-col>
<el-col :span="5"> </el-row>
<el-row> </el-col>
<el-col :span="9" :offset="2"> <el-col :span="2">
<span>开始时间</span> <el-row>
</el-col> <el-col :offset="4">
<el-col :span="13"> <el-checkbox v-model="model.serialManual">手工</el-checkbox>
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false"> </el-col>
</el-time-select> </el-row>
</el-col> </el-col>
</el-row> <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>
<el-col :span="8"> <el-col :span="8">
<el-row> <el-checkbox v-model="model.outStock">出库</el-checkbox>
<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-col> </el-col>
</el-row> <el-col :span="6">
<el-row style="margin-bottom: 5px;"> <el-checkbox v-model="model.lastTrain">末班车</el-checkbox>
交路
</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> </el-col>
</el-row> </el-row>
</div> </el-col>
<el-row type="flex" justify="center" class="button-group"> </el-row>
<el-button @click="commit"> </el-button> </el-col>
<el-button @click="doClose"> </el-button> </el-row>
</el-row> <el-row style="margin-bottom: 5px;">
</el-dialog> 交路
</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> </template>
<script> <script>
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
name: 'ModifyingTask', name: 'ModifyingTask',
components: { components: {
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
model: { model: {
tripNumber: '', tripNumber: '',
serialNumber: '', serialNumber: '',
trainManual: false, trainManual: false,
serialManual: false, serialManual: false,
clearGuest: false, clearGuest: false,
continuationPlan: false, continuationPlan: false,
firstTrain: false, firstTrain: false,
lastTrain: false, lastTrain: false,
inStock: false, inStock: false,
outStock: false, outStock: false,
startTime: '', startTime: '',
route: [], route: [],
detail: [] detail: []
}, },
timeList: [], timeList: [],
levelList: [], levelList: [],
tripNumberList: [], tripNumberList: [],
serialNumberList: [], serialNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改任务' return '修改任务';
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
formatTime(time) { formatTime(time) {
return formatTime(time); return formatTime(time);
}, },
formatName(code) { formatName(code) {
return formatName(code); return formatName(code);
}, },
loadInitData(params) { loadInitData(params) {
this.model.tripNumber = params.tripNumber; this.model.tripNumber = params.tripNumber;
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
let editData = this.$store.state.runPlan.editData[params.serviceNumber] const editData = this.$store.state.runPlan.editData[params.serviceNumber];
if (editData) { if (editData) {
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex }); const trainInfo = editData.trainMap[params.tripNumber];
let trainInfo = editData.trainMap[params.tripNumber]; const lastIndex = trainInfo.stationTimeList.length - 1;
let lastIndex = trainInfo.stationTimeList.length - 1; const taskObj = {
let taskObj = { tripNumber: params.tripNumber,
tripNumber: params.tripNumber, beginStationCode: trainInfo.stationTimeList[0].stationCode,
beginStationCode: trainInfo.stationTimeList[0].stationCode, beginStationStandCode: '',
beginStationStandCode: '', endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode, endStationStandCode: ''
endStationStandCode: '' };
} this.model.route.push(taskObj);
this.model.route.push(taskObj);
trainInfo.stationTimeList.forEach((elem, index) => { trainInfo.stationTimeList.forEach((elem, index) => {
let stationObj = { const stationObj = {
stationCode: elem.stationCode, stationCode: elem.stationCode,
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime, startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime, stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
endTime: elem.secondTime, endTime: elem.secondTime,
level: '', level: ''
} };
this.model.detail.push(stationObj); this.model.detail.push(stationObj);
}) });
} }
}, },
doShow(params) { doShow(params) {
this.loadInitData(params); this.loadInitData(params);
this.dialogShow = true; this.dialogShow = true;
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
}, },
commit() { commit() {
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
/deep/ { /deep/ {
.el-button { .el-button {
margin-left: 40px !important; margin-left: 40px !important;
@ -312,4 +323,4 @@
width: 110px !important; width: 110px !important;
} }
} }
</style> </style>

View File

@ -160,9 +160,6 @@ export function parser(data, skinCode) {
section['relSwitchCode'] = elem.code; section['relSwitchCode'] = elem.code;
} }
mapDevice[elem.code]['sectionAInstance'] = cnodeSection;
mapDevice[elem.code]['sectionBInstance'] = lnodeSection;
mapDevice[elem.code]['sectionCInstance'] = rnodeSection;
rnodeSection['layer'] = -1; rnodeSection['layer'] = -1;
} }
}, this); }, this);

View File

@ -3,6 +3,7 @@ import Vue from 'vue';
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import ElementLocale from 'element-ui/lib/locale';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n // import locale from 'element-ui/lib/locale/lang/en' // lang i18n
@ -31,6 +32,8 @@ export const i18n = new VueI18n({
messages messages
}); });
ElementLocale.i18n((key, value) => i18n.t(key, value));
new Vue({ new Vue({
el: '#app', el: '#app',
router, router,

Some files were not shown because too many files have changed in this diff Show More