pull
@ -10,14 +10,6 @@ export function getLessonPermissonPageList(params) {
|
||||
});
|
||||
}
|
||||
|
||||
// 根据ID获取权限数据
|
||||
// export function getLessonPermissonDetail(id) {
|
||||
// return request({
|
||||
// url: `/api/permission/${id}`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 创建课程权限*/
|
||||
export function createLessonPermisson(data) {
|
||||
return request({
|
||||
@ -26,10 +18,19 @@ export function createLessonPermisson(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取权限详情*/
|
||||
export function getPermissonDetail(id) {
|
||||
return request({
|
||||
url: `/api/permission/${id}/package`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户某课程某段时间内可用的权限数量*/
|
||||
export function getTotalRemains(params) {
|
||||
return request({
|
||||
url: '/api/permission/totalRemains',
|
||||
url: '/api/userPermission/totalRemains',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
@ -37,7 +38,7 @@ export function getTotalRemains(params) {
|
||||
/** 设置权限失效或有效*/
|
||||
export function setLessonPermisson(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.id}/status`,
|
||||
url: `/api/userPermission/${data.id}/status`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
@ -48,7 +49,7 @@ export function setLessonPermisson(data) {
|
||||
*/
|
||||
export function queryPermissionSimulation(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`,
|
||||
url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -56,38 +57,28 @@ export function queryPermissionSimulation(data) {
|
||||
/** 获取大屏权限列表*/
|
||||
export function queryPermissionScreen() {
|
||||
return request({
|
||||
url: `/api/permission/bigScreen`,
|
||||
url: `/api/userPermission/bigScreen`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新课程权限*/
|
||||
/*
|
||||
export function updateLessonPermisson(data) {
|
||||
return request({
|
||||
url: '/api/permission',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/** 删除课程权限*/
|
||||
/*
|
||||
export function deleteLessonPermisson(id) {
|
||||
return request({
|
||||
url: '/api/permission/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* 用户权限列表
|
||||
*/
|
||||
export function listPermision(params) {
|
||||
return request({
|
||||
url: `/api/userPermission`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人权限列表
|
||||
*/
|
||||
export function listUserPermision(params) {
|
||||
return request({
|
||||
url: `/api/permission/my`,
|
||||
url: `/api/userPermission/my`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
@ -101,10 +92,10 @@ export function getDistribute(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户权限列表 */
|
||||
/** 设置权限所有者 */
|
||||
export function putPermissionOwner(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.id}/owner`,
|
||||
url: `/api/userPermission/${data.id}/owner`,
|
||||
method: 'put',
|
||||
data: data.owner
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 上课权限获取*/
|
||||
/** 权限转增*/
|
||||
export function getLessons(data) {
|
||||
return request({
|
||||
url: '/api/distribute/getLessons',
|
||||
@ -9,15 +9,41 @@ export function getLessons(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 上课权限分发*/
|
||||
/** 权限分发*/
|
||||
export function giveLessons(data) {
|
||||
return request({
|
||||
url: '/api/distribute/givePermission',
|
||||
url: '/api/distribute/distribute',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限转增*/
|
||||
export function permissionTurnAdd(data) {
|
||||
return request({
|
||||
url: '/api/distribute/transfer',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 从订单分发权限(获取二维码)*/
|
||||
export function postDistribute(data) {
|
||||
return request({
|
||||
url: `/api/distribute/${data.code}/distribute`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限获取*/
|
||||
export function getPermission(state) {
|
||||
return request({
|
||||
url: `/api/distribute/getPermission?state=${state}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 接收课程权限*/
|
||||
export function receiveLessons(data) {
|
||||
return request({
|
||||
|
@ -66,7 +66,7 @@ export function getCommodityDetailById(id) {
|
||||
*/
|
||||
export function updataCommodityList(data) {
|
||||
return request({
|
||||
url: `/api/goods`,
|
||||
url: `/api/goods/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
|
@ -277,20 +277,14 @@ export function deleteRunPlanTemplate(planId) {
|
||||
}
|
||||
|
||||
/** 生成通用每日运行图*/
|
||||
export function generateCommonRunPlanEveryDay(planId) {
|
||||
export function generateCommonRunPlanEveryDay(planId, params) {
|
||||
return request({
|
||||
url: `/api/runPlan/template/generate/${planId}`,
|
||||
method: 'post'
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成用户每日运行图*/
|
||||
export function generateUserRunPlanEveryDay(planId, group) {
|
||||
return request({
|
||||
url: `/api/runPlan/daily/privilege/${planId}?group=${group}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 获取运行计划每日列表*/
|
||||
export function runPlanEveryDayList(params) {
|
||||
return request({
|
||||
@ -309,20 +303,12 @@ export function deleteRunPlanEveryDay(planId) {
|
||||
}
|
||||
|
||||
/** 获取地图运行图的车次号*/
|
||||
export function getPublishMapTrainNos(skinCode) {
|
||||
return request({
|
||||
url: `/api/runPlan/daily/${skinCode}/trainNos`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取服务号、车组号*/
|
||||
export function getPublishMapTrainServerNos(skinCode) {
|
||||
return request({
|
||||
url: `/api/runPlan/daily/${skinCode}/serverNos`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// export function getPublishMapTrainNos(skinCode) {
|
||||
// return request({
|
||||
// url: `/api/runPlan/daily/${skinCode}/trainNos`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 分页查询加载计划*/
|
||||
export function getRunPlanLoadList(params) {
|
||||
@ -374,3 +360,11 @@ export function queryRunPlanDaily(planId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取模板运行图列表*/
|
||||
export function listAllTempLateRunPlan() {
|
||||
return request({
|
||||
url: `/api/runPlan/template/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
46
src/api/scheduling.js
Normal file
@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function querySecheduling(group, params) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/day`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function generateScheduling(group, params) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/generate`,
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function getSchedulingAllTrains(group) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/train/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function checkScheduling(group) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/check`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
export function saveScheduling(group, data) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/save`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function generateSchedulingAgain(group) {
|
||||
return request({
|
||||
url: `/api/scheduling/${group}/rebuild`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
@ -160,14 +160,6 @@ export function getEveryDayRunPlanData(group) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成手机同步仿真二维码*/
|
||||
// export function getSimulationQrCodeUrl(group) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/qrCode`,
|
||||
// method: 'post'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 录制脚本仿真*/
|
||||
export function scriptRecordNotify(scriptId) {
|
||||
return request({
|
||||
@ -239,7 +231,7 @@ export function selectScriptMembers(group, data) {
|
||||
export function modifyScriptMemberSex(group, playerId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
|
||||
method: 'put',
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
@ -293,85 +285,6 @@ export function modifyScriptAction(group, actionId, data) {
|
||||
});
|
||||
}
|
||||
|
||||
// /** 根据成员角色查询设备列表*/
|
||||
// export function getDevicesByRole(group, params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/role/devices`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
// /** 获取任务录制的成员角色列表 */
|
||||
// export function getMembersByGroup(group) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/members`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 添加任务角色成员 */
|
||||
// export function postQuestMember(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 删除任务角色成员 */
|
||||
// export function deleteQuestMember(group, memberId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member/${memberId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
// // /** 添加/修改任务角色行为 */
|
||||
// export function postMemberBehavior(group, memberId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为 */
|
||||
// export function deleteMemberBehavior(group, memberId, behaviorId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为动作 */
|
||||
// export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务角色行为动作 */
|
||||
// export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务目标条件*/
|
||||
// export function postTargetConditionAction(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务目标条件*/
|
||||
// export function deleteTargetConditionAction(group, tcId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 分页查询存在的仿真 */
|
||||
export function getExistingSimulation(params) {
|
||||
return request({
|
||||
@ -396,14 +309,6 @@ export function getDeviceCodeByDeviceType(group, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
// /** 根据设备类型获取设备条件列表 */
|
||||
// export function getDeviceCoditionByDeviceType(params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/deviceType/conditions`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 获取任务录制的数据 */
|
||||
export function getScriptRecord(group) {
|
||||
@ -486,3 +391,20 @@ export function executeScript(group) {
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成用户自己的当日运行图*/
|
||||
export function generateDayRunPlan(planId, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建排班计划仿真*/
|
||||
export function schedulingNotify(params) {
|
||||
return request({
|
||||
url: `/api/scheduling/simulation`,
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
BIN
src/assets/ibp_images/appendage_box.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 5.0 MiB After Width: | Height: | Size: 13 MiB |
BIN
src/assets/ibp_images/key.png
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
src/assets/ibp_images/key_on.png
Normal file
After Width: | Height: | Size: 138 KiB |
BIN
src/assets/ibp_images/keyhole.png
Normal file
After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 13 KiB |
@ -63,8 +63,7 @@
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="column.tagType(scope.row, scope.$index)">{{ column.columnValue(scope.row,
|
||||
scope.$index) }}</el-tag>
|
||||
<el-tag v-if="column.columnValue(scope.row, scope.$index)" :type="column.tagType(scope.row, scope.$index)">{{ column.columnValue(scope.row, scope.$index) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
@ -13,7 +13,7 @@ export default {
|
||||
trainingRule: 'Training rules',
|
||||
trainingManage: 'Training management',
|
||||
taskManage: 'Task management',
|
||||
scriptManage: 'Script management',
|
||||
scriptManage: 'Script',
|
||||
|
||||
teachSystem: 'Teaching',
|
||||
|
||||
@ -28,13 +28,14 @@ export default {
|
||||
replayManage: 'Playback',
|
||||
|
||||
permissionManage: 'Permission',
|
||||
selfPermission: 'My Permission',
|
||||
|
||||
pulishManage: 'Publication',
|
||||
publishMapManage: 'Publishing map management',
|
||||
productStateManage: 'Product state management',
|
||||
publishLessonManage: 'Publishing lesson management',
|
||||
runPlanTemplateManage: 'Template plan management',
|
||||
runPlanCommonManage: 'General plan management',
|
||||
runPlanCommonManage: 'Loading Plan Managemen',
|
||||
runPlanEveryDayManage: 'Daily plan Management',
|
||||
examRuleManage: 'Management of examination rules',
|
||||
|
||||
@ -43,6 +44,7 @@ export default {
|
||||
orderManage: 'Order management',
|
||||
authorityManage: 'authority management',
|
||||
authorityTransferManage: 'Privilege distribution management',
|
||||
userRulesManage: 'User Rights Statistics',
|
||||
addCommodity: 'Adding goods',
|
||||
addOrder: 'Adding orders',
|
||||
addCoursePermissions: 'Adding course permissions',
|
||||
|
@ -46,7 +46,7 @@ export default {
|
||||
renew: '续费',
|
||||
productName: '产品名称',
|
||||
recovery: '回收',
|
||||
permissionPack: '权限包',
|
||||
permissionPack: '包权限',
|
||||
privilegeTransferQRCode: '权限转赠二维码',
|
||||
generatingQRCode: '生成二维码',
|
||||
transferQRCode: '转赠二维码',
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
permissionStatus: '权限状态',
|
||||
permissionUseType: '公用/专用',
|
||||
permissionTotal: '权限总数',
|
||||
permissionRemains: '生于权限',
|
||||
permissionRemains: '剩余权限',
|
||||
isForever: '是否永久',
|
||||
startTime: '开始时间',
|
||||
endTime: '结束时间',
|
||||
|
@ -28,13 +28,14 @@ export default {
|
||||
replayManage: '回放管理',
|
||||
|
||||
permissionManage: '权限管理',
|
||||
selfPermission: '我的权限',
|
||||
|
||||
pulishManage: '发布内容管理',
|
||||
publishMapManage: '发布地图管理',
|
||||
productStateManage: '产品状态管理',
|
||||
publishLessonManage: '发布课程管理',
|
||||
runPlanTemplateManage: '模板运行图管理',
|
||||
runPlanCommonManage: '通用运行图管理',
|
||||
runPlanCommonManage: '加载计划运行图管理',
|
||||
runPlanEveryDayManage: '每日运行图管理',
|
||||
examRuleManage: '试题规则管理',
|
||||
|
||||
@ -43,6 +44,7 @@ export default {
|
||||
orderManage: '订单管理',
|
||||
authorityManage: '权限管理',
|
||||
authorityTransferManage: '权限分发管理',
|
||||
userRulesManage: '用户权限统计',
|
||||
addCommodity: '添加商品',
|
||||
addOrder: '添加订单',
|
||||
addCoursePermissions: '添加课程权限',
|
||||
@ -51,9 +53,9 @@ export default {
|
||||
dataDictionary: '数据字典',
|
||||
dataDictionaryDetails: '数据字典明细',
|
||||
userManage: '用户管理',
|
||||
userTrainingManage: '用户实训管理',
|
||||
userExamManage: '用户考试管理',
|
||||
userSimulationManage: '用户仿真管理',
|
||||
userTrainingManage: '用户实训统计',
|
||||
userExamManage: '用户考试统计',
|
||||
userSimulationManage: '用户仿真统计',
|
||||
existingSimulation: '存在仿真管理',
|
||||
|
||||
ibpDraw: 'Ibp盘绘制'
|
||||
|
@ -4,31 +4,31 @@ const deviceRender = {};
|
||||
|
||||
/** IbpText渲染配置*/
|
||||
deviceRender[deviceType.IbpText] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** SquareButton渲染配置*/
|
||||
deviceRender[deviceType.SquareButton] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** WarnButton渲染配置*/
|
||||
deviceRender[deviceType.WarnButton] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Arrow渲染配置*/
|
||||
deviceRender[deviceType.Arrow] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** RotatingButton渲染配置*/
|
||||
deviceRender[deviceType.RotatingButton] = {
|
||||
zlevel: 1
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Tip渲染配置*/
|
||||
deviceRender[deviceType.Tip] = {
|
||||
/** TipBox渲染配置*/
|
||||
deviceRender[deviceType.TipBox] = {
|
||||
zlevel: 1
|
||||
};
|
||||
|
||||
@ -39,6 +39,32 @@ deviceRender[deviceType.Background] = {
|
||||
|
||||
/** CircularLamp渲染配置 */
|
||||
deviceRender[deviceType.CircularLamp] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** AppendageBox渲染配置 */
|
||||
deviceRender[deviceType.AppendageBox] = {
|
||||
zlevel: 1
|
||||
};
|
||||
|
||||
/** IbpLine渲染配置 */
|
||||
deviceRender[deviceType.IbpLine] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Elevator 渲染配置 */
|
||||
deviceRender[deviceType.Elevator] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
/** Key 渲染配置 */
|
||||
deviceRender[deviceType.Key] = {
|
||||
zlevel: 3
|
||||
};
|
||||
|
||||
/** TeleTerminal 渲染配置 */
|
||||
deviceRender[deviceType.TeleTerminal] = {
|
||||
zlevel: 2
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -1,12 +1,17 @@
|
||||
const deviceType = {
|
||||
IbpText: 'IbpText',
|
||||
SquareButton: 'SquareButton',
|
||||
WarnButton: 'WarnButton',
|
||||
Arrow: 'Arrow',
|
||||
RotatingButton: 'RotatingButton',
|
||||
Tip: 'Tip',
|
||||
TipBox: 'TipBox',
|
||||
Background: 'Background',
|
||||
CircularLamp: 'CircularLamp'
|
||||
CircularLamp: 'CircularLamp',
|
||||
IbpLine: 'IbpLine',
|
||||
AppendageBox: 'AppendageBox',
|
||||
Alarm: 'Alarm',
|
||||
Elevator: 'Elevator',
|
||||
Key: 'Key',
|
||||
TeleTerminal: 'TeleTerminal'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -7,6 +7,7 @@ import Painter from './painter';
|
||||
import deviceState from '../jmap/constant/deviceState';
|
||||
import deviceType from './constant/deviceType';
|
||||
import {calculateDCenter, createBoundingRect, modelFactory} from './utils/parser';
|
||||
import { updateIbpData } from './utils/parser';
|
||||
|
||||
const renderer = 'canvas';
|
||||
const devicePixelRatio = 1;
|
||||
@ -122,15 +123,16 @@ class IbpPan {
|
||||
}
|
||||
|
||||
render(list) {
|
||||
console.log('-*-*-*-*-', list);
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
updateIbpData(elem);
|
||||
const oDevice = this.ibpDevice[code] || {instance: null, event: null, model: modelFactory(type, elem)};
|
||||
const nDevice = Object.assign(oDevice.model || {}, elem);
|
||||
const nDevice = {instance: null, event: null, model: Object.assign(oDevice.model || {}, elem)};
|
||||
this.$painter.delete(oDevice);
|
||||
if (!elem._dispose) {
|
||||
this.ibpDevice[code] = nDevice;
|
||||
console.log('--3', nDevice);
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
});
|
||||
@ -221,6 +223,7 @@ class IbpPan {
|
||||
}
|
||||
|
||||
resize(opt) {
|
||||
console.log('----------',this.$ibpZr);
|
||||
this.$ibpZr.resize(opt);
|
||||
this.$painter.updateZrSize(opt);
|
||||
}
|
||||
|
@ -61,8 +61,10 @@ class Painter {
|
||||
add(device) {
|
||||
device = Object.assign(device, { event: this.$ibp.$mouseController });
|
||||
const instance = shapefactory(device, this.$ibp);
|
||||
console.log('--4', instance);
|
||||
if (instance) {
|
||||
device.instance = instance;
|
||||
instance.setDraggable();
|
||||
this.$transformHandle.transformView(instance);
|
||||
this.ibpInstanceLevel[device.model._type].add(instance);
|
||||
}
|
||||
|
@ -1,13 +1,18 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import alarmpic from '@/assets/ibp_images/alarm.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class alarm extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -20,14 +25,13 @@ export default class alarm extends Group {
|
||||
image: alarmpic,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 71,
|
||||
height: 74
|
||||
width: model.width,
|
||||
height: model.width/71*74
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
@ -36,7 +40,7 @@ export default class alarm extends Group {
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.imageBg.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
@ -47,6 +51,12 @@ export default class alarm extends Group {
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -54,7 +64,11 @@ export default class alarm extends Group {
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
this.draggable = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
63
src/ibp/shape/appendageBox.js
Normal file
@ -0,0 +1,63 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import AppendageBoxImage from '@/assets/ibp_images/appendage_box.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class AppendageBox extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
this.appendageBox = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: AppendageBoxImage,
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
}
|
||||
});
|
||||
this.add(this.appendageBox);
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.appendageBox.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -2,12 +2,16 @@ import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import {arrow} from '@/jmap/shape/utils/ShapePoints';
|
||||
// import { updateIbpData } from '@/ibp/utils/parser';
|
||||
import store from '@/store';
|
||||
|
||||
class Arrow extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -16,13 +20,12 @@ class Arrow extends Group {
|
||||
this.arrow = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: model.draggable || false,
|
||||
draggable: false,
|
||||
shape: {
|
||||
points: arrow(this.model.point.x, this.model.point.y, this.model.length, 10)
|
||||
points: arrow(this.model.point.x, this.model.point.y, this.model.length, this.model.width)
|
||||
},
|
||||
style: {
|
||||
stroke: model.stroke,
|
||||
lineWidth: model.lineWidth,
|
||||
fill: model.fill
|
||||
}
|
||||
});
|
||||
@ -36,6 +39,14 @@ class Arrow extends Group {
|
||||
this.transformRotation(0);
|
||||
break;
|
||||
}
|
||||
case 'top': {
|
||||
this.transformRotation(90);
|
||||
break;
|
||||
}
|
||||
case 'bottom': {
|
||||
this.transformRotation(270);
|
||||
break;
|
||||
}
|
||||
case 'right': {
|
||||
this.transformRotation(180);
|
||||
break;
|
||||
@ -63,18 +74,23 @@ class Arrow extends Group {
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
console.log('鼠标移动');
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
console.log('鼠标抬起', this.model);
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ export default class background extends Group {
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.imageBg = new Image({
|
||||
this.imageBg1 = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
@ -23,6 +23,17 @@ export default class background extends Group {
|
||||
height: 1024
|
||||
}
|
||||
});
|
||||
this.imageBg2 = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: {
|
||||
x: 2048,
|
||||
y: 0,
|
||||
image: ibpBg,
|
||||
width: 2048,
|
||||
height: 1024
|
||||
}
|
||||
});
|
||||
this.tailorRect = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
@ -37,15 +48,8 @@ export default class background extends Group {
|
||||
}
|
||||
tailorBgImage() {
|
||||
// this.imageBg.setClipPath(this.tailorRect);
|
||||
this.add(this.imageBg);
|
||||
}
|
||||
setInitialPosition(opt) {
|
||||
const x = this.imageBg.style.x;
|
||||
const y = this.imageBg.style.y;
|
||||
this.imageBg.setStyle('x', x-opt.offsetX);
|
||||
this.imageBg.setStyle('y', y-opt.offsetY);
|
||||
this.tailorRect.setShape('x', x-opt.offsetX);
|
||||
this.tailorRect.setShape('y', y-opt.offsetY);
|
||||
this.add(this.imageBg1);
|
||||
this.add(this.imageBg2);
|
||||
}
|
||||
setDraggable() {
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import yellowButtonPic from '@/assets/ibp_images/yellow_button.png';
|
||||
import yellowButtonPicOn from '@/assets/ibp_images/yellow_button_on.png';
|
||||
import grayButtonPic from '@/assets/ibp_images/gray_button.png';
|
||||
import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class button extends Group {
|
||||
static colors = new Map([
|
||||
@ -29,6 +30,10 @@ export default class button extends Group {
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -74,14 +79,14 @@ export default class button extends Group {
|
||||
setState(model) {
|
||||
switch (model.status) {
|
||||
case 'on': {
|
||||
// 关闭
|
||||
this.close();
|
||||
// 开放
|
||||
this.open();
|
||||
this.model.status='on';
|
||||
break;
|
||||
}
|
||||
case 'off': {
|
||||
// 开放
|
||||
this.open();
|
||||
// 关闭
|
||||
this.close();
|
||||
this.model.status='off';
|
||||
break;
|
||||
}
|
||||
@ -105,17 +110,24 @@ export default class button extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
console.log('鼠标抬起', this.model);
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
|
||||
}
|
||||
// 关闭
|
||||
close() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
import store from '@/store';
|
||||
|
||||
export default class CircularLamp extends Group {
|
||||
constructor(device) {
|
||||
@ -8,6 +9,9 @@ export default class CircularLamp extends Group {
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -15,7 +19,7 @@ export default class CircularLamp extends Group {
|
||||
this.lamp = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: this.model.draggable||false,
|
||||
draggable: false,
|
||||
shape: {
|
||||
cx: this.model.point.x,
|
||||
cy: this.model.point.y,
|
||||
@ -40,15 +44,22 @@ export default class CircularLamp extends Group {
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
console.log('鼠标移动');
|
||||
}
|
||||
mouseup() {
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
console.log('鼠标抬起');
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
128
src/ibp/shape/elevator.js
Normal file
@ -0,0 +1,128 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import ElevatorBack from './elevatorBack';
|
||||
import ElevatorArrow from './elevatorArrow';
|
||||
import store from '@/store';
|
||||
|
||||
export default class elevator extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
|
||||
this.grouper=new Group({
|
||||
id: '111',
|
||||
// width: model.width,
|
||||
// height: model.height,
|
||||
position: [model.point.x, model.point.y],
|
||||
draggable: model.draggable || false
|
||||
});
|
||||
|
||||
this.elevatorBack = new ElevatorBack({model: {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// model.draggable ||
|
||||
draggable: false,
|
||||
point: {
|
||||
x: model.point.x,
|
||||
y: model.point.y
|
||||
},
|
||||
width: model.width,
|
||||
height: model.height,
|
||||
fillColor: model.fillColor ||'#313131',
|
||||
stroke: model.fillColor ||'#313131',
|
||||
lineWidth: 0
|
||||
}
|
||||
});
|
||||
|
||||
this.elevatorArrowTop=new ElevatorArrow({model: {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
point: {
|
||||
x: model.width/6*4.7,
|
||||
y: model.height/8*0.1
|
||||
},
|
||||
width: model.width/6*0.8,
|
||||
status: this.getStatus('top'),
|
||||
orientation: 'top'
|
||||
}});
|
||||
|
||||
this.elevatorArrowBottom=new ElevatorArrow({model: {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
point: {
|
||||
x: model.width/6*1.3,
|
||||
y: model.height/8*7.9
|
||||
},
|
||||
width: model.width/6*0.8,
|
||||
status: this.getStatus('bottom'),
|
||||
orientation: 'bottom'
|
||||
}});
|
||||
|
||||
this.grouper.add(this.elevatorBack);
|
||||
this.grouper.add(this.elevatorArrowTop);
|
||||
this.grouper.add(this.elevatorArrowBottom);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
|
||||
getStatus(status) {
|
||||
if (this.model.direction=='none') {
|
||||
return 'off';
|
||||
} else {
|
||||
return status==this.model.direction? 'on':'off';
|
||||
}
|
||||
}
|
||||
|
||||
setStatus(model) {
|
||||
if (model.direction=='none') {
|
||||
this.elevatorArrowBottom.setStatus('off');
|
||||
this.elevatorArrowTop.setStatus('off');
|
||||
} else if (model.direction=='top') {
|
||||
this.elevatorArrowBottom.setStatus('off');
|
||||
this.elevatorArrowTop.setStatus('on');
|
||||
} else if (model.direction=='bottom') {
|
||||
this.elevatorArrowBottom.setStatus('on');
|
||||
this.elevatorArrowTop.setStatus('off');
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.grouper.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.draggroup =this.grouper;
|
||||
this.deltPostion =[e.event.zrX-this.draggroup.position[0], e.event.zrY-this.draggroup.position[1]];
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
if (this.draggroup !=null) {
|
||||
var new_pos =[e.event.zrX, e.event.zrY];
|
||||
this.draggroup.position=[new_pos[0]-this.deltPostion[0], new_pos[1]-this.deltPostion[1]];
|
||||
this.draggroup.dirty();
|
||||
}
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.draggroup=null;
|
||||
}
|
||||
}
|
@ -16,7 +16,8 @@ export default class elevatorArrow extends Group {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
draggable: model.draggable || false,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: this.getStatus(),
|
||||
x: model.point.x,
|
||||
@ -25,8 +26,10 @@ export default class elevatorArrow extends Group {
|
||||
height: 60
|
||||
}
|
||||
});
|
||||
// debugger;
|
||||
this.add(this.imageBg);
|
||||
this.getOrientate();
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
getOrientate() {
|
||||
@ -49,12 +52,12 @@ export default class elevatorArrow extends Group {
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
// /** 缩放按钮 */
|
||||
// transformScale() {
|
||||
// this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
// this.imageBg.scale =[this.model.width/68, this.model.width/68];
|
||||
// this.imageBg.dirty();
|
||||
// }
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/31, this.model.width/31];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
getStatus() {
|
||||
if (this.model.status) {
|
||||
@ -71,26 +74,41 @@ export default class elevatorArrow extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
setStatus(data) {
|
||||
let imageBack;
|
||||
switch (data) {
|
||||
case 'on': {
|
||||
imageBack=elevatorArrowPicOn;
|
||||
break;
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
case 'off': {
|
||||
imageBack=elevatorArrowPic;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.imageBg.setStyle({image: imageBack});
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
}
|
||||
// setDraggable() {
|
||||
// this.arrow.attr('draggable', true);
|
||||
// this.createMouseEvent();
|
||||
// }
|
||||
// createMouseEvent() {
|
||||
// this.on('mousedown', this.mousedown, this);
|
||||
// this.on('mousemove', this.mousemove, this);
|
||||
// this.on('mouseup', this.mouseup, this);
|
||||
// }
|
||||
|
||||
mousemove(e) {
|
||||
}
|
||||
// mousedown(e) {
|
||||
// this.event.disable();
|
||||
// }
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
}
|
||||
// mousemove(e) {
|
||||
// }
|
||||
|
||||
// mouseup(e) {
|
||||
// this.event.enable();
|
||||
// this.model.point.x = this.model.point.x + e.offsetX;
|
||||
// this.model.point.y = this.model.point.y + e.offsetY;
|
||||
// }
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
import * as toolpath from 'zrender/src/tool/path';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
|
||||
export default class elevatorBack extends Group {
|
||||
@ -12,58 +11,24 @@ export default class elevatorBack extends Group {
|
||||
}
|
||||
|
||||
create() {
|
||||
// debugger;
|
||||
const model = this.model;
|
||||
this.arrowCircle = new Circle({
|
||||
const tempString='M'+model.width/6+' '+model.height/8*6+' L'+model.width/6*4+
|
||||
' 0 L'+model.width/6*5+' 0 A '+model.width/6+' '+model.width/6+' 0 0 1 '+
|
||||
model.width/6*5+' '+model.height/4+'L '+model.width/3+' '+model.height+' L'+model.width/6+
|
||||
' '+model.height+' '+'A'+model.width/6+' '+model.width/6+' 0 0 1 '+model.width/6+' '+model.height/8*6;
|
||||
this.elevatorBack = toolpath.createFromString(tempString, {
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0',
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
cx: model.point.x + model.width/6*5,
|
||||
cy: model.point.y + model.height/8,
|
||||
r: model.width/6
|
||||
},
|
||||
draggable: false,
|
||||
style: {
|
||||
fill: this.model.fillColor || '#adadad'
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
brushType: 'fill',
|
||||
fill: this.model.fillColor || '#313131',
|
||||
lineWidth: 0
|
||||
}
|
||||
});
|
||||
|
||||
this.arrowPoly = new Polygon({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
points: [ [model.point.x+model.width/6, model.point.y + model.height], [model.point.x+model.width/6*2, model.point.y + model.height],
|
||||
[model.point.x+model.width/6*5, model.point.y + model.height/8*2],
|
||||
[model.point.x+model.width/6*5, model.point.y],
|
||||
[model.point.x+model.width/6*4, model.point.y],
|
||||
[model.point.x+model.width/6, model.point.y + model.height/8*6]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
stroke: model.stroke || '#adadad',
|
||||
lineWidth: model.lineWidth,
|
||||
fill: model.fill || '#adadad'
|
||||
}
|
||||
});
|
||||
|
||||
this.arrowCircleRight = new Circle({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
// path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0',
|
||||
// draggable: model.draggable || false,
|
||||
shape: {
|
||||
cx: model.point.x + model.width/6,
|
||||
cy: model.point.y + model.height/8*7,
|
||||
r: model.width/6
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor || '#adadad'
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.arrowPoly);
|
||||
this.add(this.arrowCircle);
|
||||
this.add(this.arrowCircleRight);
|
||||
this.add(this.elevatorBack);
|
||||
}
|
||||
}
|
@ -3,12 +3,30 @@ import deviceType from '../constant/deviceType';
|
||||
import Background from './background';
|
||||
import CircularLamp from './circularLamp';
|
||||
import IbpText from './ibpText';
|
||||
import Alarm from './alarm';
|
||||
import IbpLine from './ibpLine';
|
||||
import Button from './button';
|
||||
import TipBox from './ibpTipBox';
|
||||
import AppendageBox from './appendageBox';
|
||||
import RotatingButton from './rotatingButton';
|
||||
import Elevator from './elevator';
|
||||
import Key from './key';
|
||||
import TeleTerminal from './teleTerminal';
|
||||
|
||||
const ibpShape = {};
|
||||
ibpShape[deviceType.Arrow] = Arrow;
|
||||
ibpShape[deviceType.Background] = Background;
|
||||
ibpShape[deviceType.CircularLamp] = CircularLamp;
|
||||
ibpShape[deviceType.IbpText] = IbpText;
|
||||
ibpShape[deviceType.Alarm] = Alarm;
|
||||
ibpShape[deviceType.IbpLine] = IbpLine;
|
||||
ibpShape[deviceType.SquareButton] = Button;
|
||||
ibpShape[deviceType.TipBox] = TipBox;
|
||||
ibpShape[deviceType.AppendageBox] = AppendageBox;
|
||||
ibpShape[deviceType.RotatingButton] = RotatingButton;
|
||||
ibpShape[deviceType.Elevator] = Elevator;
|
||||
ibpShape[deviceType.Key] = Key;
|
||||
ibpShape[deviceType.TeleTerminal] = TeleTerminal;
|
||||
|
||||
function shapefactory(device, ibp) {
|
||||
const type = device.model._type;
|
||||
|
65
src/ibp/shape/ibpLine.js
Normal file
@ -0,0 +1,65 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
import store from '@/store';
|
||||
|
||||
export default class ibpLine extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.ibpLine = new Line({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x1: this.model.point1.x,
|
||||
y1: this.model.point1.y,
|
||||
x2: this.model.point2.x,
|
||||
y2: this.model.point2.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: this.model.lineWidth,
|
||||
stroke: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.add(this.ibpLine);
|
||||
}
|
||||
setDraggable() {
|
||||
this.ibpLine.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point1.x = this.model.point1.x - this.offsetX + e.offsetX;
|
||||
this.model.point1.y = this.model.point1.y - this.offsetY + e.offsetY;
|
||||
this.model.point2.x = this.model.point2.x - this.offsetX + e.offsetX;
|
||||
this.model.point2.y = this.model.point2.y - this.offsetY + e.offsetY;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
import { updateIbpData } from '@/ibp/utils/parser';
|
||||
import store from '@/store';
|
||||
|
||||
export default class button extends Group {
|
||||
export default class ibpText extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
@ -19,8 +22,8 @@ export default class button extends Group {
|
||||
silent: model.silent || false,
|
||||
draggable: model.draggable || false,
|
||||
style: {
|
||||
x: model.x,
|
||||
y: model.y,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
fontWeight: model.fontWeight,
|
||||
fontSize: model.fontSize,
|
||||
fontFamily: model.fontFamily,
|
||||
@ -29,7 +32,8 @@ export default class button extends Group {
|
||||
textFill: model.textFill,
|
||||
textAlign: model.textAlign,
|
||||
textPosition: model.textPosition || 'inside',
|
||||
textVerticalAlign: model.textVerticalAlign || null
|
||||
textVerticalAlign: model.textVerticalAlign || null,
|
||||
textLineHeight: model.fontSize
|
||||
}
|
||||
});
|
||||
this.add(this.textName);
|
||||
@ -43,18 +47,22 @@ export default class button extends Group {
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown() {
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
console.log('鼠标按下');
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
console.log('鼠标移动');
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.x = this.model.x + e.offsetX;
|
||||
this.model.y = this.model.y + e.offsetY;
|
||||
console.log('鼠标抬起', this.model);
|
||||
updateIbpData(this.model, 'update');
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
62
src/ibp/shape/ibpTipBox.js
Normal file
@ -0,0 +1,62 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import store from '@/store';
|
||||
|
||||
export default class ibpTipBox extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.tipBox = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.add(this.tipBox);
|
||||
}
|
||||
setDraggable() {
|
||||
this.tipBox.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
103
src/ibp/shape/key.js
Normal file
@ -0,0 +1,103 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import keyPic from '@/assets/ibp_images/key.png';
|
||||
import keyPicOn from '@/assets/ibp_images/key_on.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class key extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.imageBg = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: model.z,
|
||||
draggable: model.draggable || false,
|
||||
style: {
|
||||
image: this.getRotateColor(),
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 314,
|
||||
height: 932
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
this.transformScale();
|
||||
}
|
||||
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/314, this.model.width/314];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
getRotateColor() {
|
||||
if (this.model.status) {
|
||||
switch (this.model.status) {
|
||||
case 'on': {
|
||||
return keyPicOn;
|
||||
}
|
||||
case 'off': {
|
||||
return keyPic;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return keyPic;
|
||||
}
|
||||
}
|
||||
|
||||
setStatus(model) {
|
||||
switch (model.status) {
|
||||
case 'on': {
|
||||
// 开放
|
||||
this.imageBg.setStyle({image: keyPicOn});
|
||||
this.model.status='on';
|
||||
break;
|
||||
}
|
||||
case 'off': {
|
||||
// 关闭
|
||||
this.imageBg.setStyle({image: keyPic});
|
||||
this.model.status='off';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.imageBg.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import rotateBlack from '@/assets/ibp_images/rotate_black.png';
|
||||
import rotateRed from '@/assets/ibp_images/rotate_red.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class rotateTip extends Group {
|
||||
|
||||
@ -9,6 +10,10 @@ export default class rotateTip extends Group {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.event = device.event;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -63,6 +68,12 @@ export default class rotateTip extends Group {
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -70,7 +81,9 @@ export default class rotateTip extends Group {
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
62
src/ibp/shape/rotatingButton.js
Normal file
@ -0,0 +1,62 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import Keyhole from '@/assets/ibp_images/keyhole.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class RotatingButton extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this.event = device.event;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
this.rotatingButton = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
draggable: false,
|
||||
style: {
|
||||
image: Keyhole,
|
||||
x: this.model.point.x,
|
||||
y: this.model.point.y,
|
||||
width: this.model.width,
|
||||
height: this.model.width/434*381
|
||||
}
|
||||
});
|
||||
this.add(this.rotatingButton);
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.rotatingButton.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
this.on('mousedown', this.mousedown, this);
|
||||
this.on('mousemove', this.mousemove, this);
|
||||
this.on('mouseup', this.mouseup, this);
|
||||
}
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
mousemove() {
|
||||
}
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +1,18 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
import teleTerminalPic from '@/assets/ibp_images/telephone_terminal.png';
|
||||
import store from '@/store';
|
||||
|
||||
export default class alarm extends Group {
|
||||
|
||||
constructor(device) {
|
||||
super();
|
||||
this.event = device.event;
|
||||
this.model = device.model;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
this.dragging = false;
|
||||
this.create();
|
||||
}
|
||||
|
||||
@ -20,8 +25,8 @@ export default class alarm extends Group {
|
||||
image: teleTerminalPic,
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: 64,
|
||||
height: 56
|
||||
width: 150,
|
||||
height: 150
|
||||
}
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
@ -31,12 +36,12 @@ export default class alarm extends Group {
|
||||
/** 缩放按钮 */
|
||||
transformScale() {
|
||||
this.imageBg.origin = [this.model.point.x, this.model.point.y];
|
||||
this.imageBg.scale =[this.model.width/64, this.model.width/64];
|
||||
this.imageBg.scale =[this.model.width/150, this.model.width/150];
|
||||
this.imageBg.dirty();
|
||||
}
|
||||
|
||||
setDraggable() {
|
||||
this.arrow.attr('draggable', true);
|
||||
this.imageBg.attr('draggable', true);
|
||||
this.createMouseEvent();
|
||||
}
|
||||
createMouseEvent() {
|
||||
@ -47,6 +52,12 @@ export default class alarm extends Group {
|
||||
|
||||
mousedown(e) {
|
||||
this.event.disable();
|
||||
if (e.which == 3) {
|
||||
store.dispatch('ibp/setUpdateDeviceData', this.model);
|
||||
}
|
||||
this.offsetX = e.offsetX;
|
||||
this.offsetY = e.offsetY;
|
||||
this.dragging = true;
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
@ -54,7 +65,9 @@ export default class alarm extends Group {
|
||||
|
||||
mouseup(e) {
|
||||
this.event.enable();
|
||||
this.model.point.x = this.model.point.x + e.offsetX;
|
||||
this.model.point.y = this.model.point.y + e.offsetY;
|
||||
if (this.dragging) {
|
||||
this.model.point.x = this.model.point.x + (e.offsetX - this.offsetX);
|
||||
this.model.point.y = this.model.point.y + (e.offsetY - this.offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import * as zrUtil from 'zrender/src/core/util';
|
||||
import * as matrix from 'zrender/src/core/matrix';
|
||||
import deviceType from '../constant/deviceType';
|
||||
import deviceRender from '../constant/deviceRender';
|
||||
import store from '@/store';
|
||||
|
||||
export function createTransform(opts) {
|
||||
let transform = matrix.create();
|
||||
@ -57,8 +58,8 @@ export function parser(data, config) {
|
||||
ibpDevice[elem.code] = createModel(deviceType.CircularLamp, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.warnButtonList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.WarnButton, elem, propConvert);
|
||||
zrUtil.each(data.alarmList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Alarm, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.arrowList || [], elem => {
|
||||
@ -69,10 +70,246 @@ export function parser(data, config) {
|
||||
ibpDevice[elem.code] = createModel(deviceType.RotatingButton, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.tipList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Tip, elem, propConvert);
|
||||
zrUtil.each(data.tipBoxList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.TipBox, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.ibpLineList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.IbpLine, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.appendageBoxList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.AppendageBox, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.elevatorList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Elevator, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.keyList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.Key, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.teleTerminalList || [], elem => {
|
||||
ibpDevice[elem.code] = createModel(deviceType.TeleTerminal, elem, propConvert);
|
||||
}, this);
|
||||
|
||||
}
|
||||
|
||||
return ibpDevice;
|
||||
}
|
||||
export function updateIbpData(device) {
|
||||
const ibpData = store.getters['ibp/ibp'];
|
||||
switch (device._type) {
|
||||
case deviceType.Background : {
|
||||
ibpData.background = device;
|
||||
break;
|
||||
}
|
||||
case deviceType.IbpText : {
|
||||
if (ibpData.textList && ibpData.textList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.textList.length; i++) {
|
||||
if (device.code === ibpData.textList[i].code) {
|
||||
device.dispose ? ibpData.textList.splice(i, 1) :ibpData.textList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.textList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.textList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.SquareButton : {
|
||||
if (ibpData.squareButtonList && ibpData.squareButtonList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.squareButtonList.length; i++) {
|
||||
if (device.code === ibpData.squareButtonList[i].code) {
|
||||
device.dispose ? ibpData.squareButtonList.splice(i, 1):ibpData.squareButtonList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.squareButtonList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.squareButtonList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Arrow : {
|
||||
if (ibpData.arrowList && ibpData.arrowList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.arrowList.length; i++) {
|
||||
if (device.code === ibpData.arrowList[i].code) {
|
||||
device.dispose ? ibpData.arrowList.splice(i, 1):ibpData.arrowList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.arrowList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.arrowList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.RotatingButton : {
|
||||
if (ibpData.rotatingButtonList && ibpData.rotatingButtonList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.rotatingButtonList.length; i++) {
|
||||
if (device.code === ibpData.rotatingButtonList[i].code) {
|
||||
device.dispose ? ibpData.rotatingButtonList.splice(i, 1):ibpData.rotatingButtonList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.rotatingButtonList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.rotatingButtonList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.TipBox : {
|
||||
if (ibpData.tipBoxList && ibpData.tipBoxList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.tipBoxList.length; i++) {
|
||||
if (device.code === ibpData.tipBoxList[i].code) {
|
||||
device.dispose ? ibpData.tipBoxList.splice(i, 1):ibpData.tipBoxList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.tipBoxList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.tipBoxList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.CircularLamp : {
|
||||
if (ibpData.circularLampList && ibpData.circularLampList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.circularLampList.length; i++) {
|
||||
if (device.code === ibpData.circularLampList[i].code) {
|
||||
device.dispose ? ibpData.circularLampList.splice(i, 1):ibpData.circularLampList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.circularLampList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.circularLampList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.IbpLine : {
|
||||
if (ibpData.ibpLineList && ibpData.ibpLineList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.ibpLineList.length; i++) {
|
||||
if (device.code === ibpData.ibpLineList[i].code) {
|
||||
device.dispose ? ibpData.ibpLineList.splice(i, 1):ibpData.ibpLineList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.ibpLineList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.ibpLineList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.AppendageBox : {
|
||||
if (ibpData.appendageBoxList && ibpData.appendageBoxList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.appendageBoxList.length; i++) {
|
||||
if (device.code === ibpData.appendageBoxList[i].code) {
|
||||
device.dispose ? ibpData.appendageBoxList.splice(i, 1):ibpData.appendageBoxList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.appendageBoxList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.appendageBoxList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Alarm : {
|
||||
if (ibpData.alarmList && ibpData.alarmList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.alarmList.length; i++) {
|
||||
if (device.code === ibpData.alarmList[i].code) {
|
||||
device.dispose ? ibpData.alarmList.splice(i, 1):ibpData.alarmList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.alarmList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.alarmList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Elevator : {
|
||||
if (ibpData.elevatorList && ibpData.elevatorList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.elevatorList.length; i++) {
|
||||
if (device.code === ibpData.elevatorList[i].code) {
|
||||
device.dispose ? ibpData.elevatorList.splice(i, 1):ibpData.elevatorList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.elevatorList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.elevatorList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.Key : {
|
||||
if (ibpData.keyList && ibpData.keyList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.keyList.length; i++) {
|
||||
if (device.code === ibpData.keyList[i].code) {
|
||||
device.dispose ? ibpData.keyList.splice(i, 1):ibpData.keyList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.keyList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.keyList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case deviceType.TeleTerminal : {
|
||||
if (ibpData.teleTerminalList && ibpData.teleTerminalList.length > 0) {
|
||||
let newDevice = true;
|
||||
for (let i=0; i<ibpData.teleTerminalList.length; i++) {
|
||||
if (device.code === ibpData.teleTerminalList[i].code) {
|
||||
device.dispose ? ibpData.teleTerminalList.splice(i, 1):ibpData.teleTerminalList[i] = device;
|
||||
newDevice = false;
|
||||
}
|
||||
}
|
||||
if (newDevice) {
|
||||
ibpData.teleTerminalList.push(device);
|
||||
}
|
||||
} else {
|
||||
ibpData.teleTerminalList = [device];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
store.dispatch('ibp/setIbpData', ibpData);
|
||||
}
|
||||
|
@ -57,11 +57,14 @@ export function JLmapDriving(dom, data, skinCode) {
|
||||
document.getElementById('jlsimulation').appendChild(renderer.domElement);
|
||||
document.getElementById('jlcctv').appendChild(renderercctv.domElement);
|
||||
// 定义相机
|
||||
<<<<<<< HEAD
|
||||
//let camera = SetCamera(dom);
|
||||
=======
|
||||
// let camera = SetCamera(dom);
|
||||
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
|
||||
// 定义场景(渲染容器)
|
||||
const scene = SetScene();
|
||||
|
||||
|
||||
const speed = 0;
|
||||
|
||||
let drivingcode = null;
|
||||
@ -104,8 +107,13 @@ export function JLmapDriving(dom, data, skinCode) {
|
||||
controls3.enabled = true;
|
||||
scene.add(controls3.getObject());
|
||||
|
||||
<<<<<<< HEAD
|
||||
let cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 150);
|
||||
cameracctv.position.set( 5, -3,27 );
|
||||
=======
|
||||
const cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 150);
|
||||
cameracctv.position.set( 5, -3, 27 );
|
||||
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
|
||||
|
||||
cameracctv.rotation.y = Math.PI/5*3;
|
||||
camera.add(cameracctv);
|
||||
@ -136,7 +144,11 @@ export function JLmapDriving(dom, data, skinCode) {
|
||||
if (scope.animateswitch == true) {
|
||||
// 根据相机渲染场景
|
||||
renderer.render(scene, camera);
|
||||
<<<<<<< HEAD
|
||||
renderercctv.render(scene,cameracctv);
|
||||
=======
|
||||
renderercctv.render(scene, cameracctv);
|
||||
>>>>>>> 327bf6f32b24ee9862ae9627615dc63ceccd3c9f
|
||||
// updatcontrols();
|
||||
// renderercctv
|
||||
controls3.update();
|
||||
|
@ -18,7 +18,7 @@ let defaulttrain = {
|
||||
deviceType:"train",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/train/train.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/train/train.FBX"
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ let defaultsuidao = {
|
||||
deviceType:"suidao",
|
||||
type:"suidao",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/suidao/suidao.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/suidao/suidao.FBX"
|
||||
}//https://joylink.club/oss/models/suidao/suidao.FBX
|
||||
//../../static/model/
|
||||
|
||||
|
@ -551,7 +551,15 @@ THREE.FBXLoader = ( function () {
|
||||
|
||||
if ( materialNode.EmissiveFactor ) {
|
||||
|
||||
parameters.emissiveIntensity = parseFloat( materialNode.EmissiveFactor.value );
|
||||
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
||||
parameters.side = THREE.DoubleSide;
|
||||
parameters.transparent = true;
|
||||
parameters.alphaTest = 0.7;
|
||||
parameters.opacity = 1;
|
||||
|
||||
}else{
|
||||
parameters.opacity = parseFloat( materialNode.Opacity.value );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -304,9 +304,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
kilometerPosition: 'down', // 公里标位置
|
||||
fontWeight: 'bold' // 文字错细
|
||||
|
@ -300,9 +300,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: false, // 公里标显示
|
||||
kilometerPosition: 'up' // 公里标朝向
|
||||
};
|
||||
|
@ -297,9 +297,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: false, // 公里标显示
|
||||
kilometerPosition: 'up' // 公里标朝向
|
||||
};
|
||||
|
@ -279,9 +279,9 @@ class SkinCode extends defaultStyle {
|
||||
};
|
||||
|
||||
this[deviceType.Station] = {
|
||||
text: {
|
||||
show: true // 公里标名称显示
|
||||
},
|
||||
// text: {
|
||||
// show: true // 公里标名称显示
|
||||
// },
|
||||
kmPostShow: true, // 公里标显示
|
||||
kilometerPosition: 'up' // 公里标朝向
|
||||
};
|
||||
|
@ -20,9 +20,6 @@ class Jlmap {
|
||||
// 鼠标事件
|
||||
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom'};
|
||||
|
||||
// 原始数据
|
||||
this.data = {};
|
||||
|
||||
// 皮肤参数
|
||||
this.skinCode = '';
|
||||
|
||||
@ -83,12 +80,10 @@ class Jlmap {
|
||||
this.$options.scaleRate = map.skinVO.scaling || 1;
|
||||
this.$options.offsetX = map.skinVO.origin ? map.skinVO.origin.x : 0;
|
||||
this.$options.offsetY = map.skinVO.origin ? map.skinVO.origin.y : 0;
|
||||
// 更新视图大小
|
||||
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
||||
}
|
||||
|
||||
// 保存原始数据
|
||||
this.data = map;
|
||||
|
||||
// 解析地图数据
|
||||
this.mapDevice = mapDevice;
|
||||
|
||||
@ -103,7 +98,6 @@ class Jlmap {
|
||||
|
||||
// 视图加载完成 回调
|
||||
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); }
|
||||
|
||||
}
|
||||
|
||||
setDefaultState() {
|
||||
@ -158,7 +152,6 @@ class Jlmap {
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
const nDevice = Object.assign(oDevice || {}, elem);
|
||||
this.dataSync(nDevice);
|
||||
this.$painter.delete(oDevice);
|
||||
if (!elem._dispose) {
|
||||
this.mapDevice[code] = nDevice;
|
||||
@ -275,52 +268,6 @@ class Jlmap {
|
||||
return payload || {};
|
||||
}
|
||||
|
||||
dataSync(model) {
|
||||
var prop = null;
|
||||
var type = model._type;
|
||||
var code = model.code;
|
||||
|
||||
switch (type) {
|
||||
case deviceType.Link: prop = 'linkList'; break;
|
||||
case deviceType.Section: prop = 'sectionList'; break;
|
||||
case deviceType.Switch: prop = 'switchList'; break;
|
||||
case deviceType.Signal: prop = 'signalList'; break;
|
||||
case deviceType.Station: prop = 'stationList'; break;
|
||||
case deviceType.StationStand: prop = 'stationStandList'; break;
|
||||
case deviceType.StationControl: prop = 'stationControlList'; break;
|
||||
case deviceType.StationCounter: prop = 'stationCounterList'; break;
|
||||
case deviceType.ZcControl: prop = 'zcControlList'; break;
|
||||
case deviceType.StationDelayUnlock: prop = 'stationDelayUnlockList'; break;
|
||||
case deviceType.LcControl: prop = 'lcControlList'; break;
|
||||
case deviceType.ButtonControl: prop = 'buttonList'; break;
|
||||
case deviceType.LimitControl: prop = 'tempSpeedLimitList'; break;
|
||||
case deviceType.ImageControl: prop = 'imageControl'; break;
|
||||
case deviceType.Train: prop = 'trainList'; break;
|
||||
case deviceType.TrainWindow: prop = 'trainWindowList'; break;
|
||||
case deviceType.Line: prop = 'lineList'; break;
|
||||
case deviceType.Text: prop = 'textList'; break;
|
||||
}
|
||||
|
||||
const list = this.data[prop] || [];
|
||||
const idex = list.findIndex(elem => { return elem.code == code; });
|
||||
if (list) {
|
||||
if (model._dispose) {
|
||||
idex >= 0 && list.splice(idex, 1);
|
||||
} else {
|
||||
const elem = list[idex];
|
||||
if (elem) {
|
||||
Object.keys(model).forEach(key => {
|
||||
if (key != 'instance') {
|
||||
elem[key] = model[key];
|
||||
}
|
||||
});
|
||||
} else {
|
||||
list.push(Object.assign({}, model));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getZr() {
|
||||
return this.$zr;
|
||||
}
|
||||
|
@ -99,8 +99,8 @@ class EMouse extends Group {
|
||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseEnter) {
|
||||
instance.mouseEnter(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -118,8 +118,8 @@ class EMouse extends Group {
|
||||
this.sectionTextBorder && this.sectionTextBorder.hide();
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseLeave) {
|
||||
instance.mouseLeave(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export default class Station extends Group {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
|
||||
if (style.Station.text.show) {
|
||||
if (model.visible) {
|
||||
// 公里标名称是否显示
|
||||
this.stationText = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
@ -38,9 +38,8 @@ export default class Station extends Group {
|
||||
textFill: model.nameFontColor
|
||||
});
|
||||
this.add(this.stationText);
|
||||
}
|
||||
|
||||
if (style.Station.kmPostShow) {
|
||||
const path = window.location.href;
|
||||
if (style.Station.kmPostShow || path.includes('/map/draw')) {
|
||||
// 公里标是否显示
|
||||
let direction = 1;
|
||||
if (this.style.Station.kilometerPosition == 'up') {
|
||||
@ -63,6 +62,7 @@ export default class Station extends Group {
|
||||
this.add(this.mileageText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
setState(model) {
|
||||
|
@ -42,9 +42,9 @@ class EMouse extends Group {
|
||||
|
||||
// 创建道岔边框
|
||||
craeteSwitchBorder() {
|
||||
const sectionA = this.device.model.sectionAInstance.instance;
|
||||
const sectionB = this.device.model.sectionBInstance.instance;
|
||||
const sectionC = this.device.model.sectionCInstance.instance;
|
||||
const sectionA = this.getInstanceByCode(this.device.model.sectionACode);
|
||||
const sectionB = this.getInstanceByCode(this.device.model.sectionBCode);
|
||||
const sectionC = this.getInstanceByCode(this.device.model.sectionCCode);
|
||||
const rect = this.device.getBoundingRect();
|
||||
|
||||
sectionA && rect.union(sectionA.getBoundingRect());
|
||||
@ -83,8 +83,8 @@ class EMouse extends Group {
|
||||
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
||||
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
||||
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
|
||||
if (instance && instance.mouseLeave) {
|
||||
instance.mouseLeave(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -101,8 +101,8 @@ class EMouse extends Group {
|
||||
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
|
||||
const parentSection = store.getters['map/getDeviceByCode'](section.parentCode) || {};
|
||||
const instance = this.getInstanceByCode(parentSection.trainWindowCode);
|
||||
if (instance && instance.mouseEnter) {
|
||||
instance.mouseEnter(e);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
37
src/jmap/shape/TrainWindow/EMouse.js
Normal file
@ -0,0 +1,37 @@
|
||||
export default class EMouse {
|
||||
constructor(device) {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
mouseover(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(true);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(false || this.device.model.trainWindowShow);
|
||||
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
if (this.device.prdType) {
|
||||
this.device.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
mouseLeave(e) {
|
||||
if (this.device.prdType ) {
|
||||
this.device.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
/* 车次窗*/
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import EMouse from './EMouse';
|
||||
import store from '@/store';
|
||||
|
||||
class TrainWindow extends Group {
|
||||
@ -14,6 +15,7 @@ class TrainWindow extends Group {
|
||||
this.z = 9;
|
||||
this.prdType = store.state.training.prdType;
|
||||
this.create(model);
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
create(model) {
|
||||
@ -22,6 +24,12 @@ class TrainWindow extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
|
||||
/** 创建车次窗*/
|
||||
createTrainWindow() {
|
||||
const model = this.model;
|
||||
@ -44,9 +52,7 @@ class TrainWindow extends Group {
|
||||
lineWidth: this.style.TrainWindow.lineWidth,
|
||||
stroke: this.style.TrainWindow.lineColor,
|
||||
fill: this.style.transparentColor
|
||||
},
|
||||
onmouseover: (e) => { this.mouseover(e); },
|
||||
onmouseout: (e) => { this.mouseout(e); }
|
||||
}
|
||||
});
|
||||
this.add(this.trainRect);
|
||||
}
|
||||
@ -72,38 +78,6 @@ class TrainWindow extends Group {
|
||||
getInstanceByCode(code) {
|
||||
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (this.prdType) {
|
||||
this.setVisible(false);
|
||||
const instance = this.getInstanceByCode(this.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseover(e) {
|
||||
if (this.prdType) {
|
||||
this.setVisible(true);
|
||||
const instance = this.getInstanceByCode(this.model.sectionCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
if (this.prdType) {
|
||||
this.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
mouseLeave(e) {
|
||||
if (this.prdType ) {
|
||||
this.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default TrainWindow;
|
||||
|
@ -1,18 +1,40 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou_01 train-control" :title="title" :visible.sync="show" width="320px" :before-close="doClose"
|
||||
:zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou_01 train-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="trainNumber">
|
||||
<el-select v-model="formModel.trainNumber" :id="domIdTrainNumber" filterable
|
||||
:disabled="trainNumberIsDisabled" @change="trainNumberChange">
|
||||
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber"
|
||||
:value="train.groupNumber">
|
||||
</el-option>
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.trainNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width='0px'>
|
||||
<el-radio-group v-model="formModel.trainType" :id="domIdTrainType" style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled" @change="trainTypeChange">
|
||||
<el-form-item prop="trainType" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.trainType"
|
||||
style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'01'">计划车</el-radio>
|
||||
<el-radio :label="'02'">头码车</el-radio>
|
||||
<el-radio :label="'03'">人工车</el-radio>
|
||||
@ -20,18 +42,28 @@
|
||||
</el-form-item>
|
||||
<el-form-item prop="serverNo">
|
||||
<span slot="label">表  号</span>
|
||||
<el-input v-model="formModel.serverNo" :id="domIdServerNo" :disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange">
|
||||
</el-input>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serverNo"
|
||||
:disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车 次 号:" prop="trainNo">
|
||||
<el-input v-model="formModel.trainNo" :id="domIdTrainNo" :disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"></el-input>
|
||||
<el-input
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.trainNo"
|
||||
:disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的地号:" prop="targetCode">
|
||||
<el-input v-model="formModel.targetCode" :id="domIdTargetCode" :disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange">
|
||||
</el-input>
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.targetCode"
|
||||
:disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
@ -42,8 +74,8 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-train ref="confirmTrain"></confirm-train>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<confirm-train ref="confirmTrain" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -52,7 +84,7 @@
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishTrainList } from '@/api/jmap/map';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
@ -68,7 +100,7 @@
|
||||
trainNumber: '',
|
||||
trainType: '01',
|
||||
serverNo: '',
|
||||
targetCode: '',
|
||||
targetCode: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
@ -92,7 +124,7 @@
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
direction: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
@ -111,11 +143,13 @@
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
trainTypeIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
@ -130,6 +164,7 @@
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -141,6 +176,7 @@
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
@ -152,6 +188,7 @@
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -163,6 +200,7 @@
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
@ -174,6 +212,7 @@
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
@ -185,6 +224,7 @@
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
@ -195,19 +235,20 @@
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishTrainList(map.skinCode).then(resp => {
|
||||
this.trainList = resp.data;
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
@ -223,7 +264,7 @@
|
||||
trainNo: selected.trainNo,
|
||||
trainType: '01',
|
||||
serverNo: selected.serverNo,
|
||||
targetCode: selected.targetCode,
|
||||
targetCode: selected.targetCode
|
||||
};
|
||||
|
||||
/** 加载列车数据*/
|
||||
@ -240,11 +281,11 @@
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange(trainNumber) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
@ -256,14 +297,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainType}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
@ -275,14 +316,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
serverNoChange(serverNo) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${serverNo}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
|
||||
@ -294,14 +335,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
trainNoChange(trainNo) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNo}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
@ -313,14 +354,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
targetCodeChange(targetCode) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${targetCode}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
|
||||
@ -332,7 +373,7 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
@ -347,14 +388,14 @@
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let model = this.formModel;
|
||||
let operate = {
|
||||
const model = this.formModel;
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
messages: [`添加列车识别号:成功`],
|
||||
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`,
|
||||
}
|
||||
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -364,11 +405,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -378,13 +419,13 @@
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
messages: [`修改列车识别号:成功`],
|
||||
val: this.formModel.trainNo,
|
||||
}
|
||||
val: this.formModel.trainNo
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -394,30 +435,30 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,9 +1,18 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou_01 stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="trainNumber">
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange"></el-input>
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
@ -14,17 +23,17 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
@ -36,18 +45,18 @@
|
||||
return {
|
||||
trainNoList: [],
|
||||
formModel: {
|
||||
trainNumber: '',
|
||||
trainNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
trainNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
@ -66,22 +75,22 @@
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号'
|
||||
return '删除列车识别号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
@ -101,27 +110,27 @@
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainNumber}`,
|
||||
val: `${this.formModel.trainNumber}`,
|
||||
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.formModel.trainNumber
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -129,28 +138,28 @@
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<train-control ref="trainControl"></train-control>
|
||||
<train-delete ref="trainDelete"></train-delete>
|
||||
<train-move ref="trainMove"></train-move>
|
||||
<train-switch ref="trainSwitch"></train-switch>
|
||||
<train-edit-number ref="trainEditNumber"></train-edit-number>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-control ref="trainControl" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<train-move ref="trainMove" />
|
||||
<train-switch ref="trainSwitch" />
|
||||
<train-edit-number ref="trainEditNumber" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
@ -24,12 +24,7 @@
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
|
||||
export default {
|
||||
name: 'menuTrain',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
name: 'MenuTrain',
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
@ -39,6 +34,14 @@
|
||||
TrainSwitch,
|
||||
TrainEditNumber
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
@ -102,16 +105,7 @@
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
@ -122,23 +116,32 @@
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed]
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
@ -159,7 +162,7 @@
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -173,13 +176,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -193,13 +196,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 限速行驶
|
||||
limitSpeed() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -213,13 +216,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 添加列车识别号
|
||||
addTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -235,7 +238,7 @@
|
||||
},
|
||||
// 删除列车识别号
|
||||
delTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -251,7 +254,7 @@
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -267,7 +270,7 @@
|
||||
},
|
||||
// 修改车组号
|
||||
editTrainNo() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -283,7 +286,7 @@
|
||||
},
|
||||
// 移动列车识别号
|
||||
moveTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -299,7 +302,7 @@
|
||||
},
|
||||
// 交换列车识别号
|
||||
switchTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -314,5 +317,5 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,9 +1,18 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" @change="inputGroupNumber" :id="domIdInput"></el-input>
|
||||
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
@ -14,18 +23,18 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
@ -38,18 +47,18 @@
|
||||
trainNoList: [],
|
||||
selected: null,
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
groupNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
@ -68,22 +77,22 @@
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除车组号'
|
||||
return '删除车组号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
@ -105,27 +114,27 @@
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
inputGroupNumber() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.input.operation,
|
||||
val: this.addModel.groupNumber
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.addModel.groupNumber
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -133,28 +142,28 @@
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -279,15 +279,6 @@ export default {
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
@ -297,6 +288,15 @@ export default {
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
@ -11,9 +20,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -21,9 +33,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -36,9 +51,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -46,9 +64,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
@ -58,14 +79,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
@ -73,14 +90,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -115,12 +128,12 @@
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -139,12 +152,11 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
|
@ -18,9 +18,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
@ -100,7 +100,7 @@ export default {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
|
@ -1,12 +1,21 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
@ -15,9 +24,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -26,7 +39,7 @@
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -46,23 +59,23 @@
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
@ -87,30 +100,27 @@
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
@ -26,12 +35,12 @@
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -51,7 +60,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
@ -18,11 +27,11 @@
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -40,7 +49,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,13 +1,22 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
@ -21,13 +30,7 @@
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
@ -35,12 +38,18 @@
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
@ -60,21 +69,32 @@
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
@ -93,29 +113,30 @@
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,9 +1,18 @@
|
||||
<template>
|
||||
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-03__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber"></el-input>
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
@ -14,18 +23,18 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
@ -38,18 +47,18 @@
|
||||
trainNoList: [],
|
||||
selected: null,
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
groupNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
@ -65,22 +74,22 @@
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号'
|
||||
return '删除列车识别号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
@ -104,11 +113,11 @@
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -116,28 +125,28 @@
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -755,9 +755,11 @@ export default {
|
||||
},
|
||||
initMenu(menu) {
|
||||
this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
|
||||
if (this.menu.length) {
|
||||
this.menu[2].children = this.initStationList();
|
||||
this.clickEvent();
|
||||
this.closeMenu(true);
|
||||
}
|
||||
},
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
|
@ -1,24 +1,24 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<train-control ref="trainControl"></train-control>
|
||||
<train-delete ref="trainDelete"></train-delete>
|
||||
<train-move ref="trainMove"></train-move>
|
||||
<train-switch ref="trainSwitch"></train-switch>
|
||||
<train-edit-number ref="trainEditNumber"></train-edit-number>
|
||||
<train-create-number ref="trainCreateNumber"></train-create-number>
|
||||
<train-move-number ref="trainMoveNumber"></train-move-number>
|
||||
<train-delete-number ref="trainDeleteNumber"></train-delete-number>
|
||||
<train-detail-info ref="trainDetailInfo"></train-detail-info>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-control ref="trainControl" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<train-move ref="trainMove" />
|
||||
<train-switch ref="trainSwitch" />
|
||||
<train-edit-number ref="trainEditNumber" />
|
||||
<train-create-number ref="trainCreateNumber" />
|
||||
<train-move-number ref="trainMoveNumber" />
|
||||
<train-delete-number ref="trainDeleteNumber" />
|
||||
<train-detail-info ref="trainDetailInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
@ -33,12 +33,7 @@
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'menuTrain',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
name: 'MenuTrain',
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
@ -50,7 +45,15 @@
|
||||
TrainMoveNumber,
|
||||
TrainCreateNumber,
|
||||
TrainDeleteNumber,
|
||||
TrainDetailInfo,
|
||||
TrainDetailInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -140,16 +143,7 @@
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
@ -160,23 +154,32 @@
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed]
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
@ -197,7 +200,7 @@
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -213,13 +216,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -235,13 +238,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 限速行驶
|
||||
limitSpeed() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -255,13 +258,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 设计划车
|
||||
setPlanTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -275,11 +278,11 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
// 设目的地车
|
||||
destinationTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -293,11 +296,11 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
// 设人工车
|
||||
artificialTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -311,11 +314,11 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
// 详细列车信息
|
||||
detailTrainInfo() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -329,7 +332,7 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
@ -341,7 +344,7 @@
|
||||
},
|
||||
// 添加列车识别号
|
||||
addTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -357,7 +360,7 @@
|
||||
},
|
||||
// 创建车组号
|
||||
createTrainNo() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -373,7 +376,7 @@
|
||||
},
|
||||
// 删除列车识别号
|
||||
delTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -389,7 +392,7 @@
|
||||
},
|
||||
// 删除车组号
|
||||
deleteTrainNo() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -405,7 +408,7 @@
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -421,7 +424,7 @@
|
||||
},
|
||||
// 修改车组号
|
||||
editTrainNo() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -437,7 +440,7 @@
|
||||
},
|
||||
// 移动车组号
|
||||
moveTrainNo() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -453,7 +456,7 @@
|
||||
},
|
||||
// 移动列车识别号
|
||||
moveTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -469,7 +472,7 @@
|
||||
},
|
||||
// 交换列车识别号
|
||||
switchTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -484,5 +487,5 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
@ -11,9 +20,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -21,9 +33,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -36,9 +51,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -46,9 +64,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
@ -58,14 +79,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
@ -73,14 +90,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -115,12 +128,12 @@
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -139,12 +152,11 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
width="70%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
|
@ -18,10 +18,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { listPublishMap } from '@/api/jmap/mapdraft';
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
@ -101,7 +100,7 @@ export default {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
|
@ -1,12 +1,21 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
@ -15,9 +24,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -26,7 +39,7 @@
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -46,23 +59,23 @@
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
@ -87,30 +100,27 @@
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
@ -26,12 +35,12 @@
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -51,7 +60,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
@ -18,11 +27,11 @@
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -40,7 +49,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,13 +1,22 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
@ -21,13 +30,7 @@
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
@ -35,12 +38,18 @@
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
@ -60,21 +69,32 @@
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
@ -93,29 +113,30 @@
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,20 +1,25 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule edit-planning-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationStandCode" label="起点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationCode" label="起点站" />
|
||||
<el-table-column prop="startStationStandCode" label="起点站台" />
|
||||
<el-table-column prop="endStationCode" label="终点站" />
|
||||
<el-table-column prop="endStationStandCode" label="终点站台" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
@ -39,23 +44,23 @@
|
||||
</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-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-input>
|
||||
<el-input v-model="newServiceNumber" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button @click="handleModifyingTripNumber" style="width: 150px;">改车次号</el-button>
|
||||
<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-time-select>
|
||||
<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-time-select>
|
||||
<el-time-select v-model="serviceEndTime" size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
@ -63,16 +68,11 @@
|
||||
</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-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">
|
||||
@ -89,7 +89,7 @@
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'modifyingPlan',
|
||||
name: 'ModifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -101,12 +101,12 @@
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: [],
|
||||
}
|
||||
tripData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改'
|
||||
return '修改';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -127,26 +127,26 @@
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} });
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
|
||||
},
|
||||
// 确定修改
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -157,13 +157,11 @@
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
.view-label {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
|
||||
.view-box {
|
||||
padding: 10px 0px;
|
||||
border: 1px inset gray;
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="1000px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
@ -9,10 +18,13 @@
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -30,10 +42,13 @@
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择">
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -44,7 +59,7 @@
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber"></el-input>
|
||||
<el-input v-model="model.serviceNumber" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
@ -73,10 +88,13 @@
|
||||
<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 v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in serialNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="model.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -94,10 +112,13 @@
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择">
|
||||
<el-option v-for="item in levelList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select 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>
|
||||
@ -108,8 +129,7 @@
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false">
|
||||
</el-time-select>
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
@ -141,19 +161,15 @@
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台">
|
||||
</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>
|
||||
<el-table-column prop="describe" label="描述" :width="280">
|
||||
</el-table-column>
|
||||
<el-table-column :width="40">
|
||||
</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;">
|
||||
@ -181,10 +197,8 @@
|
||||
{{ 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-column prop="level" label="运行等级" />
|
||||
<el-table-column width="280" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -229,12 +243,12 @@
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: [],
|
||||
}
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务'
|
||||
return '修改任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -249,30 +263,29 @@
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
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) {
|
||||
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex });
|
||||
let trainInfo = editData.trainMap[params.tripNumber];
|
||||
let lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
let taskObj = {
|
||||
const trainInfo = editData.trainMap[params.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
}
|
||||
};
|
||||
this.model.route.push(taskObj);
|
||||
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
let stationObj = {
|
||||
const stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: '',
|
||||
}
|
||||
level: ''
|
||||
};
|
||||
this.model.detail.push(stationObj);
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
@ -286,13 +299,11 @@
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
|
@ -12,7 +12,10 @@ export default {
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
@ -11,9 +20,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -21,9 +33,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -36,9 +51,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -46,9 +64,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
@ -58,14 +79,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
@ -73,14 +90,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -115,12 +128,12 @@
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -139,12 +152,11 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
v-dialogDrag
|
||||
width="80%"
|
||||
width="70%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
|
@ -1,20 +1,27 @@
|
||||
<template>
|
||||
<el-dialog :title="title" class="beijing-01__schedule reload-today-plan" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule reload-today-plan"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" @click="handleConfirm" :loading="loading">加 载</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">加 载</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin'
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
@ -51,19 +58,19 @@
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
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: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '加载当天计划'
|
||||
return '加载当天计划';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -71,7 +78,7 @@
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
@ -93,47 +100,47 @@
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
this.doClose();
|
||||
this.$message.success(`生成用户每日运行图成功`);
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.reloadTable();
|
||||
this.$messageBox(`生成用户每日运行图失败`);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(`请选择需要加载的运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadRunData() {
|
||||
let skinCode = this.$route.query.skinCode;
|
||||
const skinCode = this.$route.query.skinCode;
|
||||
this.$store.dispatch('runPlan/clear');
|
||||
if (skinCode) {
|
||||
getStationListBySkinCode(skinCode).then(response => {
|
||||
let stations = response.data;
|
||||
const stations = response.data;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
|
||||
this.$store.dispatch('runPlan/setStations', stations).then(() => {
|
||||
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(`获取运行图数据失败`);
|
||||
})
|
||||
})
|
||||
}).catch(error => {
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取车站列表失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,12 +1,21 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
@ -15,9 +24,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -26,7 +39,7 @@
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -46,23 +59,23 @@
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
@ -87,30 +100,27 @@
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
@ -26,12 +35,12 @@
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -51,7 +60,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleCommit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
@ -18,11 +27,11 @@
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -40,7 +49,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,13 +1,22 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
@ -21,13 +30,7 @@
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
@ -35,12 +38,18 @@
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
@ -60,21 +69,32 @@
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
@ -93,29 +113,30 @@
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,20 +1,25 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule edit-planning-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationStandCode" label="起点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationCode" label="起点站" />
|
||||
<el-table-column prop="startStationStandCode" label="起点站台" />
|
||||
<el-table-column prop="endStationCode" label="终点站" />
|
||||
<el-table-column prop="endStationStandCode" label="终点站台" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
@ -39,23 +44,23 @@
|
||||
</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-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-input>
|
||||
<el-input v-model="newServiceNumber" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button @click="handleModifyingTripNumber" style="width: 150px;">改车次号</el-button>
|
||||
<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-time-select>
|
||||
<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-time-select>
|
||||
<el-time-select v-model="serviceEndTime" size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
@ -63,16 +68,11 @@
|
||||
</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-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">
|
||||
@ -89,7 +89,7 @@
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'modifyingPlan',
|
||||
name: 'ModifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -101,12 +101,12 @@
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: [],
|
||||
}
|
||||
tripData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改'
|
||||
return '修改';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -127,26 +127,26 @@
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} });
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
|
||||
},
|
||||
// 确定修改
|
||||
handleCommit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -157,13 +157,11 @@
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
.view-label {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
|
||||
.view-box {
|
||||
padding: 10px 0px;
|
||||
border: 1px inset gray;
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="1000px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
@ -9,10 +18,13 @@
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -30,10 +42,13 @@
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择">
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -44,7 +59,7 @@
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber"></el-input>
|
||||
<el-input v-model="model.serviceNumber" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
@ -73,10 +88,13 @@
|
||||
<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 v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in serialNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="model.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -94,10 +112,13 @@
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择">
|
||||
<el-option v-for="item in levelList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select 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>
|
||||
@ -108,8 +129,7 @@
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false">
|
||||
</el-time-select>
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
@ -141,19 +161,15 @@
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台">
|
||||
</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>
|
||||
<el-table-column prop="describe" label="描述" :width="280">
|
||||
</el-table-column>
|
||||
<el-table-column :width="40">
|
||||
</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;">
|
||||
@ -181,10 +197,8 @@
|
||||
{{ 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-column prop="level" label="运行等级" />
|
||||
<el-table-column width="280" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -229,12 +243,12 @@
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: [],
|
||||
}
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务'
|
||||
return '修改任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -249,30 +263,29 @@
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
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) {
|
||||
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex });
|
||||
let trainInfo = editData.trainMap[params.tripNumber];
|
||||
let lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
let taskObj = {
|
||||
const trainInfo = editData.trainMap[params.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
}
|
||||
};
|
||||
this.model.route.push(taskObj);
|
||||
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
let stationObj = {
|
||||
const stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: '',
|
||||
}
|
||||
level: ''
|
||||
};
|
||||
this.model.detail.push(stationObj);
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
@ -286,13 +299,11 @@
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
|
@ -1,18 +1,40 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm train-control" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm train-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-select v-model="formModel.groupNumber" :id="domIdTrainNumber" filterable
|
||||
:disabled="trainNumberIsDisabled" @change="trainNumberChange">
|
||||
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber"
|
||||
:value="train.groupNumber">
|
||||
</el-option>
|
||||
<el-select
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.groupNumber"
|
||||
filterable
|
||||
:disabled="trainNumberIsDisabled"
|
||||
@change="trainNumberChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="train in trainList"
|
||||
:key="train.groupNumber"
|
||||
:label="train.groupNumber"
|
||||
:value="train.groupNumber"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width='0px'>
|
||||
<el-radio-group v-model="formModel.trainType" :id="domIdTrainType" style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled" @change="trainTypeChange">
|
||||
<el-form-item prop="trainType" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.trainType"
|
||||
style="margin-left: 15px;"
|
||||
:disabled="trainTypeIsDisabled"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'01'">计划车</el-radio>
|
||||
<el-radio :label="'02'">头码车</el-radio>
|
||||
<el-radio :label="'03'">人工车</el-radio>
|
||||
@ -20,18 +42,28 @@
|
||||
</el-form-item>
|
||||
<el-form-item prop="serviceNumber">
|
||||
<span slot="label">表  号</span>
|
||||
<el-input v-model="formModel.serviceNumber" :id="domIdServerNo" :disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange">
|
||||
</el-input>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
@change="serverNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车 次 号:" prop="tripNumber">
|
||||
<el-input v-model="formModel.tripNumber" :id="domIdTrainNo" :disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"></el-input>
|
||||
<el-input
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.tripNumber"
|
||||
:disabled="trainNoIsDisabled"
|
||||
@change="trainNoChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的地号:" prop="targetCode">
|
||||
<el-input v-model="formModel.targetCode" :id="domIdTargetCode" :disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange">
|
||||
</el-input>
|
||||
<el-input
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.targetCode"
|
||||
:disabled="targetCodeIsDisabled"
|
||||
@change="targetCodeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
@ -42,8 +74,8 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-train ref="confirmTrain"></confirm-train>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<confirm-train ref="confirmTrain" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -68,7 +100,7 @@
|
||||
groupNumber: '',
|
||||
trainType: '01',
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
targetCode: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
@ -92,7 +124,7 @@
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
direction: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
@ -111,11 +143,13 @@
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
trainTypeIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
@ -130,6 +164,7 @@
|
||||
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTrainNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -141,6 +176,7 @@
|
||||
return OperationEvent.Train.editTrainId.trainNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTrainType() {
|
||||
if (this.dialogShow) {
|
||||
@ -152,6 +188,7 @@
|
||||
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdServerNo() {
|
||||
if (this.dialogShow) {
|
||||
@ -163,6 +200,7 @@
|
||||
return OperationEvent.Train.editTrainId.serverNoChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdTargetCode() {
|
||||
if (this.dialogShow) {
|
||||
@ -174,6 +212,7 @@
|
||||
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
@ -185,6 +224,7 @@
|
||||
return OperationEvent.Train.editTrainId.menu.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
@ -195,19 +235,20 @@
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map.skinCode) {
|
||||
getPublishTrainList(map.skinCode).then(resp => {
|
||||
this.trainList = resp.data;
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
}
|
||||
@ -217,13 +258,13 @@
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
let model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
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,
|
||||
targetCode: model.targetCode
|
||||
};
|
||||
|
||||
/** 加载列车数据*/
|
||||
@ -240,11 +281,11 @@
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange(groupNumber) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${groupNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
@ -256,14 +297,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${trainType}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
@ -275,14 +316,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
serverNoChange(serviceNumber) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${serviceNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
|
||||
@ -294,14 +335,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
trainNoChange(tripNumber) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${tripNumber}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
@ -313,14 +354,14 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
targetCodeChange(targetCode) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${targetCode}`,
|
||||
operation: ''
|
||||
}
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
|
||||
@ -332,7 +373,7 @@
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
@ -347,14 +388,14 @@
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let model = this.formModel;
|
||||
let operate = {
|
||||
const model = this.formModel;
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
messages: [`添加列车识别号:成功`],
|
||||
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`,
|
||||
}
|
||||
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -364,11 +405,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -378,13 +419,13 @@
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
messages: [`修改列车识别号:成功`],
|
||||
val: this.formModel.tripNumber,
|
||||
}
|
||||
val: this.formModel.tripNumber
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -394,30 +435,30 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,9 +1,18 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="车 组 号:" prop="groupNumber">
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange"></el-input>
|
||||
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
@ -14,17 +23,17 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
// import { getPublishMapTrainNos } from '@/api/runplan';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TrainDelete',
|
||||
@ -36,18 +45,18 @@
|
||||
return {
|
||||
trainNoList: [],
|
||||
formModel: {
|
||||
groupNumber: '',
|
||||
groupNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: '请输入车组号', trigger: 'blur' }
|
||||
],
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
@ -66,22 +75,22 @@
|
||||
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '删除列车识别号'
|
||||
return '删除列车识别号';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (map) {
|
||||
getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
this.trainNoList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取列车车组号失败`);
|
||||
});
|
||||
// getPublishMapTrainNos(map.skinCode).then(response => {
|
||||
// this.trainNoList = response.data;
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(`获取列车车组号失败`);
|
||||
// });
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
@ -101,27 +110,27 @@
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
trainNumberChange() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
val: `${groupNumber}`,
|
||||
val: `${this.formModel.groupNumber}`,
|
||||
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
|
||||
}
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.delTrainId.menu.operation,
|
||||
val: this.formModel.groupNumber
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -129,28 +138,28 @@
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<train-control ref="trainControl"></train-control>
|
||||
<train-delete ref="trainDelete"></train-delete>
|
||||
<train-move ref="trainMove"></train-move>
|
||||
<train-switch ref="trainSwitch"></train-switch>
|
||||
<train-edit-number ref="trainEditNumber"></train-edit-number>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<train-control ref="trainControl" />
|
||||
<train-delete ref="trainDelete" />
|
||||
<train-move ref="trainMove" />
|
||||
<train-switch ref="trainSwitch" />
|
||||
<train-edit-number ref="trainEditNumber" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainControl from './dialog/trainControl';
|
||||
@ -24,12 +24,7 @@
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
|
||||
export default {
|
||||
name: 'menuTrain',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
name: 'MenuTrain',
|
||||
components: {
|
||||
PopMenu,
|
||||
NoticeInfo,
|
||||
@ -39,6 +34,14 @@
|
||||
TrainSwitch,
|
||||
TrainEditNumber
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
@ -102,16 +105,7 @@
|
||||
disabledCallback: MenuDisabledState.Train.limitSpeed
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
@ -122,23 +116,32 @@
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function () {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed]
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
@ -159,7 +162,7 @@
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -173,13 +176,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -193,13 +196,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 限速行驶
|
||||
limitSpeed() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -213,13 +216,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 添加列车识别号
|
||||
addTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -235,7 +238,7 @@
|
||||
},
|
||||
// 删除列车识别号
|
||||
delTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -251,7 +254,7 @@
|
||||
},
|
||||
// 修改列车识别号
|
||||
editTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -267,7 +270,7 @@
|
||||
},
|
||||
// 修改车组号
|
||||
editTrainNo() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -283,7 +286,7 @@
|
||||
},
|
||||
// 移动列车识别号
|
||||
moveTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -299,7 +302,7 @@
|
||||
},
|
||||
// 交换列车识别号
|
||||
switchTrainId() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
@ -314,5 +317,5 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
@ -11,9 +20,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -21,9 +33,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -36,9 +51,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-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">
|
||||
@ -46,9 +64,12 @@
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
@ -58,14 +79,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
@ -73,14 +90,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
<el-table-column prop="date" label="日期" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="日期" width="180" />
|
||||
<el-table-column prop="name" label="姓名" width="180" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -115,12 +128,12 @@
|
||||
route: [],
|
||||
detail: []
|
||||
},
|
||||
tripNumberList: [],
|
||||
}
|
||||
tripNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加任务'
|
||||
return '添加任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -139,12 +152,11 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
|
@ -4,7 +4,7 @@
|
||||
:title="title"
|
||||
class="fuzhou-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
width="70%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
@ -93,11 +93,11 @@ export default {
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
this.doClose();
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
|
@ -18,9 +18,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationListBySkinCode } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
@ -100,7 +100,7 @@ export default {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
|
@ -1,12 +1,21 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
|
||||
<el-form-item label="运行图名称:" prop="planId">
|
||||
<el-row>
|
||||
<el-col :span="19">
|
||||
<el-input v-model="model.planName" :readonly="true"></el-input>
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">选择 </el-button>
|
||||
@ -15,9 +24,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期范围:" prop="dateList">
|
||||
<el-row>
|
||||
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="model.dateList"
|
||||
type="dates"
|
||||
:clearable="false"
|
||||
placeholder="选择一个或多个日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -26,7 +39,7 @@
|
||||
<el-button @click="create">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -46,23 +59,23 @@
|
||||
model: {
|
||||
planId: '',
|
||||
planName: '',
|
||||
dateList: [],
|
||||
}
|
||||
dateList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '创建一周计划'
|
||||
return '创建一周计划';
|
||||
},
|
||||
rules() {
|
||||
let rules = {
|
||||
const rules = {
|
||||
planId: [
|
||||
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
|
||||
],
|
||||
dateList: [
|
||||
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
return rules;
|
||||
}
|
||||
@ -87,30 +100,27 @@
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
return this.model.dateList.map(date => {
|
||||
return {
|
||||
loadTime: date,
|
||||
planDateList: this.model.dateList,
|
||||
mapId: this.$route.query.mapId,
|
||||
templatePlanId: this.model.planId
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
createRunPlanLoad(this.buildModel()).then(response => {
|
||||
this.$message.success('创建运行图计划成功');
|
||||
this.$emit('reloadTable', { name: 'managePlanList' });
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$messageBox('创建运行图计划失败');
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule delete-task" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule delete-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">删除以前所有任务(包含本任务)</el-radio>
|
||||
</el-row>
|
||||
@ -26,12 +35,12 @@
|
||||
loading: false,
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
type: '1',
|
||||
}
|
||||
type: '1'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除任务'
|
||||
return '删除任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -51,7 +60,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule create-week-plan"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">确 定</el-button>
|
||||
<el-button @click="doClose">取 消</el-button>
|
||||
@ -18,11 +27,11 @@
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '删除当天计划'
|
||||
return '删除当天计划';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -40,7 +49,7 @@
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,13 +1,22 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule manage-plan-list"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
@ -21,13 +30,7 @@
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
runPlanName: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
@ -35,12 +38,18 @@
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'runPlanName',
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
@ -60,21 +69,32 @@
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表'
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
@ -93,29 +113,30 @@
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
}).catch(() => { })
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,20 +1,25 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule edit-planning-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :offset="10">列车线路</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-table :data="serviceData" border style="width: 100%" height="160">
|
||||
<el-table-column prop="startStationCode" label="起点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationStandCode" label="起点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" label="终点站">
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationStandCode" label="终点站台">
|
||||
</el-table-column>
|
||||
<el-table-column prop="startStationCode" label="起点站" />
|
||||
<el-table-column prop="startStationStandCode" label="起点站台" />
|
||||
<el-table-column prop="endStationCode" label="终点站" />
|
||||
<el-table-column prop="endStationStandCode" label="终点站台" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
@ -39,23 +44,23 @@
|
||||
</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-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-input>
|
||||
<el-input v-model="newServiceNumber" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button @click="handleModifyingTripNumber" style="width: 150px;">改车次号</el-button>
|
||||
<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-time-select>
|
||||
<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-time-select>
|
||||
<el-time-select v-model="serviceEndTime" size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
@ -63,16 +68,11 @@
|
||||
</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-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">
|
||||
@ -89,7 +89,7 @@
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'modifyingPlan',
|
||||
name: 'ModifyingPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -101,12 +101,12 @@
|
||||
serviceStartTime: '',
|
||||
serviceEndTime: '',
|
||||
serviceData: [],
|
||||
tripData: [],
|
||||
}
|
||||
tripData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改'
|
||||
return '修改';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -127,26 +127,26 @@
|
||||
},
|
||||
// 加任务
|
||||
handleAddTask() {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params: {} });
|
||||
},
|
||||
// 替换
|
||||
handleReplace() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params: {} });
|
||||
},
|
||||
// 删任务
|
||||
handleDeleteTask() {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params: {} });
|
||||
},
|
||||
// 改车次号
|
||||
handleModifyingTripNumber() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} })
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTripNumber', params: {} });
|
||||
},
|
||||
// 确定修改
|
||||
commit() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -157,13 +157,11 @@
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
.view-label {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
|
||||
.view-box {
|
||||
padding: 10px 0px;
|
||||
border: 1px inset gray;
|
||||
|
@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__schedule add-task" :title="title" :visible.sync="dialogShow" width="1000px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__schedule add-task"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="1000px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
@ -9,10 +18,13 @@
|
||||
<span>车次号:</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select style="display: inline-black" v-model="model.tripNumber" placeholder="请选择">
|
||||
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select v-model="model.tripNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in tripNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -30,10 +42,13 @@
|
||||
<span>缺省停站时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.time" placeholder="请选择">
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select v-model="model.time" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -44,7 +59,7 @@
|
||||
<span>表号:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber"></el-input>
|
||||
<el-input v-model="model.serviceNumber" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
@ -73,10 +88,13 @@
|
||||
<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 v-model="model.serialNumber" style="display: inline-black" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in serialNumberList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="model.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -94,10 +112,13 @@
|
||||
<span>缺省运行等级:</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select style="display: inline-black" v-model="model.level" placeholder="请选择">
|
||||
<el-option v-for="item in levelList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-select 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>
|
||||
@ -108,8 +129,7 @@
|
||||
<span>开始时间:</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false">
|
||||
</el-time-select>
|
||||
<el-time-select v-model="model.startTime" placeholder="选择时间" :clearable="false" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
@ -141,19 +161,15 @@
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" label="起始站台">
|
||||
</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>
|
||||
<el-table-column prop="describe" label="描述" :width="280">
|
||||
</el-table-column>
|
||||
<el-table-column :width="40">
|
||||
</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;">
|
||||
@ -181,10 +197,8 @@
|
||||
{{ 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-column prop="level" label="运行等级" />
|
||||
<el-table-column width="280" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@ -229,12 +243,12 @@
|
||||
timeList: [],
|
||||
levelList: [],
|
||||
tripNumberList: [],
|
||||
serialNumberList: [],
|
||||
}
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改任务'
|
||||
return '修改任务';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -249,30 +263,29 @@
|
||||
loadInitData(params) {
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
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) {
|
||||
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex });
|
||||
let trainInfo = editData.trainMap[params.tripNumber];
|
||||
let lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
let taskObj = {
|
||||
const trainInfo = editData.trainMap[params.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const taskObj = {
|
||||
tripNumber: params.tripNumber,
|
||||
beginStationCode: trainInfo.stationTimeList[0].stationCode,
|
||||
beginStationStandCode: '',
|
||||
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
endStationStandCode: ''
|
||||
}
|
||||
};
|
||||
this.model.route.push(taskObj);
|
||||
|
||||
trainInfo.stationTimeList.forEach((elem, index) => {
|
||||
let stationObj = {
|
||||
const stationObj = {
|
||||
stationCode: elem.stationCode,
|
||||
startTime: index == 0 ? null : trainInfo.stationTimeList[index - 1].secondTime,
|
||||
stopTime: index == 0 ? null : elem.secondTime - trainInfo.stationTimeList[index - 1].secondTime,
|
||||
endTime: elem.secondTime,
|
||||
level: '',
|
||||
}
|
||||
level: ''
|
||||
};
|
||||
this.model.detail.push(stationObj);
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(params) {
|
||||
@ -286,13 +299,11 @@
|
||||
commit() {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
|
@ -160,9 +160,6 @@ export function parser(data, skinCode) {
|
||||
section['relSwitchCode'] = elem.code;
|
||||
}
|
||||
|
||||
mapDevice[elem.code]['sectionAInstance'] = cnodeSection;
|
||||
mapDevice[elem.code]['sectionBInstance'] = lnodeSection;
|
||||
mapDevice[elem.code]['sectionCInstance'] = rnodeSection;
|
||||
rnodeSection['layer'] = -1;
|
||||
}
|
||||
}, this);
|
||||
|
@ -3,6 +3,7 @@ import Vue from 'vue';
|
||||
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
|
||||
|
||||
import ElementUI from 'element-ui';
|
||||
import ElementLocale from 'element-ui/lib/locale';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
|
||||
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
|
||||
@ -31,6 +32,8 @@ export const i18n = new VueI18n({
|
||||
messages
|
||||
});
|
||||
|
||||
ElementLocale.i18n((key, value) => i18n.t(key, value));
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
|