Merge remote-tracking branch 'remotes/origin/test'
# Conflicts: # src/App.vue # src/views/display/menuDemon.vue # src/views/orderauthor/permission/create/permission.vue # src/views/scriptManage/create.vue # src/views/trainRoom/index.vue
This commit is contained in:
commit
a067444fd0
@ -7,7 +7,7 @@
|
||||
|
||||
<script>
|
||||
import { handleToken } from '@/utils/auth';
|
||||
import { creatSubscribe, perpetualTopic } from '@/utils/stomp';
|
||||
import { creatSubscribe, perpetualTopic, commonTopic } from '@/utils/stomp';
|
||||
import DeomonTopic from '@/views/demonstration/deomonTopic';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import { ProjectIcon } from '@/scripts/ConstDic';
|
||||
@ -47,6 +47,7 @@ export default {
|
||||
if (!this.$route.path.includes('/login') && this.$route.path != '/404') {
|
||||
const header = { group: '', 'X-Token': handleToken() };
|
||||
creatSubscribe(perpetualTopic, header);
|
||||
creatSubscribe(commonTopic, header);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -59,9 +59,9 @@ export function putLessonOffLine(id) {
|
||||
/**
|
||||
* 获取地图产品下的课程列表
|
||||
*/
|
||||
export function getCommodityProductLesson(prdCode) {
|
||||
export function getCommodityProductLesson(prdId) {
|
||||
return request({
|
||||
url: `/api/lesson/${prdCode}/list`,
|
||||
url: `/api/lesson/${prdId}/list`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -8,11 +8,18 @@ export function getPublishMapList(params) {
|
||||
params: params
|
||||
});
|
||||
}
|
||||
/** 获取所有可用地图列表*/
|
||||
export function getPublishMapListOnline() {
|
||||
return request({
|
||||
url: '/api/map/listOnline',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 根据皮肤获取发布地图列表*/
|
||||
export function getPublishMapListBySkinCode(skinCode) {
|
||||
export function getPublishMapListByLineCode(lineCode) {
|
||||
return request({
|
||||
url: `/api/map/${skinCode}/list`,
|
||||
url: `/api/map/${lineCode}/list`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -33,7 +40,7 @@ export function getPublishMapDetailById(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取发布地图列表*/
|
||||
/** 获取发布地图列表(不包含项目线路)*/
|
||||
export function listPublishMap(params) {
|
||||
return request({
|
||||
url: `/api/map/list`,
|
||||
|
@ -2,194 +2,186 @@ import request from '@/utils/request';
|
||||
|
||||
/** 清除实训数据*/
|
||||
export function clearTraining(args) {
|
||||
return request({
|
||||
url: `/api/training/${args.id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${args.id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** 开始实训*/
|
||||
export function startTraining(args, group) {
|
||||
return request({
|
||||
url: `/api/training/${args.id}/start`,
|
||||
method: 'get',
|
||||
params: {
|
||||
group
|
||||
}
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${args.id}/start`,
|
||||
method: 'get',
|
||||
params: {
|
||||
group
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 实训结束*/
|
||||
export function endTraining(args, group) {
|
||||
return request({
|
||||
url: `/api/training/${args.lessonId}/${args.id}/end`,
|
||||
method: 'get',
|
||||
params: {
|
||||
mode: args.mode,
|
||||
usedTime: args.usedTime,
|
||||
group
|
||||
}
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${args.lessonId}/${args.id}/end`,
|
||||
method: 'get',
|
||||
params: {
|
||||
mode: args.mode,
|
||||
usedTime: args.usedTime,
|
||||
group
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 发送步骤数据*/
|
||||
export function sendTrainingNextStep(data, group) {
|
||||
return request({
|
||||
url: `/api/training/${data.trainingId}/nextStep`,
|
||||
method: 'post',
|
||||
data: data.operate,
|
||||
params: {
|
||||
group
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取实训树*/
|
||||
export function getTrainingTree() {
|
||||
return request({
|
||||
url: `/api/training/tree`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${data.trainingId}/nextStep`,
|
||||
method: 'post',
|
||||
data: data.operate,
|
||||
params: {
|
||||
group
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取章节基本信息*/
|
||||
export function getTrainingDetail(trainingId) {
|
||||
return request({
|
||||
url: `/api/training/${trainingId}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${trainingId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加实训*/
|
||||
export function addTraining(data) {
|
||||
return request({
|
||||
url: '/api/training',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/training',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新实训*/
|
||||
export function updateTraining(data) {
|
||||
return request({
|
||||
url: `/api/training/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存实训初始状态*/
|
||||
export function saveTrainingInitStatus(data, group) {
|
||||
return request({
|
||||
url: `/api/training/${data.id}/detailSave?group=${group}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${data.id}/detailSave?group=${group}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存实训步骤数据*/
|
||||
export function saveTrainingStepsData(data) {
|
||||
return request({
|
||||
url: `/api/training/${data.id}/stepsSave`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${data.id}/stepsSave`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取实训步骤数据*/
|
||||
export function getTrainingStepsDetail(trainingId, params) {
|
||||
return request({
|
||||
url: `/api/training/${trainingId}/detail`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/${trainingId}/detail`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询实训列表*/
|
||||
export function pageQueryTraining(params) {
|
||||
return request({
|
||||
url: `/api/training/pagedQuery`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/pagedQuery`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 自动生成实训操作*/
|
||||
export function addAutoTraining(data) {
|
||||
return request({
|
||||
url: `/api/training/generate`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/generate`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改自动删除实训操作*/
|
||||
export function updateAutoTraining(data) {
|
||||
return request({
|
||||
url: `/api/training/batchUpdateGenerate`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/batchUpdateGenerate`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除自动生成实训*/
|
||||
export function deleteAutoTraining(params) {
|
||||
return request({
|
||||
url: `/api/training/generate`,
|
||||
method: 'delete',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/generate`,
|
||||
method: 'delete',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户实训列表*/
|
||||
export function getTrainingList(data) {
|
||||
return request({
|
||||
url: `/api/training/list`,
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/list`,
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
}
|
||||
|
||||
export function sendCommand(group, command) {
|
||||
return request({
|
||||
url: `/api/training/deviceChange?group=${group}`,
|
||||
method: 'put',
|
||||
data: {
|
||||
param: command.val,
|
||||
type: command.type,
|
||||
code: command.code,
|
||||
operation: command.operation
|
||||
}
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/deviceChange?group=${group}`,
|
||||
method: 'put',
|
||||
data: {
|
||||
param: command.val,
|
||||
type: command.type,
|
||||
code: command.code,
|
||||
operation: command.operation
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function updateLesson(data) {
|
||||
return request({
|
||||
url: `/api/training/userTraining/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/userTraining/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 添加用户实训数据
|
||||
export function addUserTraining(data) {
|
||||
return request({
|
||||
url: `/api/training/userTraining`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/userTraining`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 更新用户实训数据
|
||||
export function putUserTraining(data) {
|
||||
return request({
|
||||
url: `/api/training/userTraining/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/userTraining/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 清除实训数据
|
||||
export function deleteUserTraining(statsId) {
|
||||
return request({
|
||||
url: `/api/training/userTraining/${statsId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/training/userTraining/${statsId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
@ -3,125 +3,115 @@ import request from '@/utils/request';
|
||||
|
||||
/** 分页获取课程权限数据*/
|
||||
export function getLessonPermissonPageList(params) {
|
||||
return request({
|
||||
url: '/api/permission',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: '/api/permission',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建课程权限*/
|
||||
export function createLessonPermisson(data) {
|
||||
return request({
|
||||
url: '/api/permission',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/permission',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取权限详情*/
|
||||
export function getPermissonDetail(id) {
|
||||
return request({
|
||||
url: `/api/permission/${id}/package`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/permission/${id}/package`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改权限*/
|
||||
export function putPermissonDetail(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/permission/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 一键生成所有权限*/
|
||||
export function postPermissonList(mapId) {
|
||||
return request({
|
||||
url: `/api/permission/${mapId}/generate`,
|
||||
method: 'post'
|
||||
});
|
||||
return request({
|
||||
url: `/api/permission/${mapId}/generate`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户某课程某段时间内可用的权限数量*/
|
||||
export function getTotalRemains(params) {
|
||||
return request({
|
||||
url: '/api/userPermission/totalRemains',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: '/api/userPermission/totalRemains',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
/** 设置权限失效或有效*/
|
||||
export function setLessonPermisson(data) {
|
||||
return request({
|
||||
url: `/api/userPermission/${data.id}/status`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/userPermission/${data.id}/status`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 设置权限失效或有效*/
|
||||
export function getPermissionList(id) {
|
||||
return request({
|
||||
url: `/api/permission/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仿真权限列表
|
||||
*/
|
||||
export function queryPermissionSimulation(data) {
|
||||
return request({
|
||||
url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/permission/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取大屏权限列表*/
|
||||
export function queryPermissionScreen() {
|
||||
return request({
|
||||
url: `/api/userPermission/bigScreen`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/userPermission/bigScreen`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户权限列表
|
||||
*/
|
||||
export function listPermision(params) {
|
||||
return request({
|
||||
url: `/api/userPermission`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/userPermission`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人权限列表
|
||||
*/
|
||||
export function listUserPermision(params) {
|
||||
return request({
|
||||
url: `/api/userPermission/my`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/userPermission/my`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户权限列表 */
|
||||
export function getDistribute(id) {
|
||||
return request({
|
||||
url: `/api/distribute/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 设置权限所有者 */
|
||||
export function putPermissionOwner(data) {
|
||||
return request({
|
||||
url: `/api/userPermission/${data.id}/owner`,
|
||||
method: 'put',
|
||||
data: data.owner
|
||||
});
|
||||
return request({
|
||||
url: `/api/userPermission/${data.id}/owner`,
|
||||
method: 'put',
|
||||
data: data.owner
|
||||
});
|
||||
}
|
||||
|
@ -2,140 +2,159 @@ import request from '@/utils/request';
|
||||
|
||||
/** 权限转增*/
|
||||
export function getLessons(data) {
|
||||
return request({
|
||||
url: '/api/distribute/getLessons',
|
||||
method: 'get',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/distribute/getLessons',
|
||||
method: 'get',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限分发*/
|
||||
export function giveLessons(data) {
|
||||
return request({
|
||||
url: '/api/distribute/distribute',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/distribute/distribute',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限转增*/
|
||||
export function permissionTurnAdd(data) {
|
||||
return request({
|
||||
url: '/api/distribute/transfer',
|
||||
method: 'post',
|
||||
data: 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
|
||||
});
|
||||
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'
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/getPermission?state=${state}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 接收课程权限*/
|
||||
export function receiveLessons(data) {
|
||||
return request({
|
||||
url: '/api/distribute/receiveLessons',
|
||||
method: 'get',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/distribute/receiveLessons',
|
||||
method: 'get',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 考试权限分发*/
|
||||
export function giveExams(data) {
|
||||
return request({
|
||||
url: `/api/distribute/giveExams`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/giveExams`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限打包分页查询*/
|
||||
export function listPackagePermission(params) {
|
||||
return request({
|
||||
url: '/api/distribute',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: '/api/distribute',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 打包权限*/
|
||||
export function packagePermissionDistribute(data) {
|
||||
return request({
|
||||
url: `/api/distribute/givePermission/package`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/givePermission/package`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限回收*/
|
||||
export function restorePackagePermission(id) {
|
||||
return request({
|
||||
url: `/api/distribute/${id}/restore`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/${id}/restore`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成打包权限二维码*/
|
||||
export function getPackageQrCode(params) {
|
||||
return request({
|
||||
url: `/api/distribute/package/qrCode`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/package/qrCode`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限分发打包详情*/
|
||||
export function getPermissionPackageDetail(id, params) {
|
||||
return request({
|
||||
url: `/api/distribute/package/${id}/detail`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/package/${id}/detail`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限分发打包*/
|
||||
export function permissionDistributePackage(data) {
|
||||
return request({
|
||||
url: `/api/distribute/package`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/package`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 权限分发解包*/
|
||||
export function permissionDistributeUnPackage(permissionId) {
|
||||
return request({
|
||||
url: `/api/distribute/${permissionId}/unPackage`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/${permissionId}/unPackage`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询可打包的权限分发*/
|
||||
export function listCanPackagePermission(params) {
|
||||
return request({
|
||||
url: `/api/distribute/package`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/package`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
// 设置权限分发列表 权限失效
|
||||
export function setCommodityStatus(id) {
|
||||
return request({
|
||||
url: `/api/distribute/${id}/invalid`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/distribute/${id}/invalid`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户可以分发/转增的权限*/
|
||||
export function getAvailableUserPermission(params) {
|
||||
return request({
|
||||
url: `/api/userPermission/getAvailableUserPermission`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户权限转增分发打包生成权限*/
|
||||
export function givePermission(data) {
|
||||
return request({
|
||||
url: `/api/distribute/packageUserPermission`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 分页查询皮肤*/
|
||||
/** 分页查询真实线路*/
|
||||
export function getSkinCodePageList(params) {
|
||||
return request({
|
||||
url: `/api/realLine`,
|
||||
@ -9,7 +9,7 @@ export function getSkinCodePageList(params) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加皮肤*/
|
||||
/** 添加真实线路*/
|
||||
export function addSkinCode(data) {
|
||||
return request({
|
||||
url: `/api/realLine`,
|
||||
@ -18,7 +18,7 @@ export function addSkinCode(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除皮肤*/
|
||||
/** 删除真实线路*/
|
||||
export function delSkinCode(id) {
|
||||
return request({
|
||||
url: `/api/realLine/${id}`,
|
||||
@ -26,7 +26,7 @@ export function delSkinCode(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询地图皮肤 */
|
||||
/** 根据id查询真实线路 */
|
||||
export function querySkinCode(id) {
|
||||
return request({
|
||||
url: `/api/realLine/${id}`,
|
||||
@ -34,7 +34,7 @@ export function querySkinCode(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改地图皮肤*/
|
||||
/** 修改真实线路*/
|
||||
export function updateSkinCode(data) {
|
||||
return request({
|
||||
url: `/api/realLine/${data.id}`,
|
||||
@ -52,7 +52,7 @@ export function updateSkinCodeByCode(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询皮肤是否存在*/
|
||||
/** 检查code是否存在*/
|
||||
export function querySkinCodeExistByCode(code) {
|
||||
return request({
|
||||
url: `/api/realLine/${code}/exist`,
|
||||
@ -60,8 +60,8 @@ export function querySkinCodeExistByCode(code) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取皮肤列表*/
|
||||
export function getSkinCodeList() {
|
||||
/** 获取真实线路列表*/
|
||||
export function getLineCodeList() {
|
||||
return request({
|
||||
url: `/api/realLine/list`,
|
||||
method: 'get'
|
@ -9,9 +9,9 @@ export function getPublishMapTree(cityCode) {
|
||||
}
|
||||
|
||||
/** 获取产品详细内容*/
|
||||
export function getProductDetail(prdCode) {
|
||||
export function getProductDetail(prdId) {
|
||||
return request({
|
||||
url: `/api/mapPrd/${prdCode}`,
|
||||
url: `/api/mapPrd/${prdId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -72,9 +72,9 @@ export function getCommodityMapProduct(mapId) {
|
||||
/**
|
||||
* 获取地图下的产品详情
|
||||
*/
|
||||
export function getMapProductDetail(prdCode) {
|
||||
export function getMapProductDetail(prdId) {
|
||||
return request({
|
||||
url: `/api/mapPrd/${prdCode}`,
|
||||
url: `/api/mapPrd/${prdId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -106,8 +106,7 @@ export function getPlaceholderList(data) {
|
||||
url: `/api/operate/placeholder`,
|
||||
method: 'get',
|
||||
params: {
|
||||
trainingType: data.trainingType,
|
||||
skinCode: data.skinCode
|
||||
trainingType: data.trainingType
|
||||
}
|
||||
});
|
||||
}
|
||||
|
10
src/api/pushMessage.js
Normal file
10
src/api/pushMessage.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 推送通知消息*/
|
||||
export function pushMessage(data) {
|
||||
return request({
|
||||
url: `/api/pushMessage`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
@ -2,73 +2,73 @@ import request from '@/utils/request';
|
||||
|
||||
/** 分页查找个人录制的仿真任务*/
|
||||
export function getQuestPageList(mapId, params) {
|
||||
return request({
|
||||
url: `/api/script/draft/${mapId}/list`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft/${mapId}/list`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
/** 创建任务 */
|
||||
export function createQuest(data) {
|
||||
return request({
|
||||
url: `/api/script/draft`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 根据任务id删除任务 */
|
||||
export function deleteQuest(id) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 根据id查询任务基础信息 */
|
||||
export function getQuestById(id) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 根据id查询任务详情信息 */
|
||||
export function getQuestByIdList(id) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/detail`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/detail`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 更新任务基本信息 */
|
||||
export function updateQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查找上线的仿真任务*/
|
||||
export function getQuestPageListOnline(params) {
|
||||
return request({
|
||||
url: `/api/quest/paging/online`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/quest/paging/online`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 剧本发布 */
|
||||
export function publishQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/publish`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/publish`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 剧本撤销发布 */
|
||||
export function retractQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/retract`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/retract`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,15 +1,5 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取地图速度等级列表
|
||||
*/
|
||||
export function getSpeedLevels(skinCode) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/${skinCode}/speed`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建地图速度等级列表
|
||||
*/
|
||||
@ -52,7 +42,7 @@ export function queryRunPlan(planId) {
|
||||
});
|
||||
}
|
||||
|
||||
// 根据skinCode查询发布运行图列表
|
||||
// 根据mapId查询发布运行图列表
|
||||
export function queryRunPlanList(mapId) {
|
||||
return request({
|
||||
url: `/api/runPlan/template/${mapId}/list`,
|
||||
@ -108,14 +98,6 @@ export function importRunPlan(data) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取运行图停车点列表*/
|
||||
export function getRunPlanStopPointList(skinCode) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/stopPoint/${skinCode}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 运行图*/
|
||||
export function getRpListByMapId(mapId) {
|
||||
return request({
|
||||
@ -297,14 +279,6 @@ export function deleteRunPlanEveryDay(planId) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取地图运行图的车次号*/
|
||||
// export function getPublishMapTrainNos(skinCode) {
|
||||
// return request({
|
||||
// url: `/api/runPlan/daily/${skinCode}/trainNos`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 分页查询加载计划*/
|
||||
export function getRunPlanLoadList(params) {
|
||||
return request({
|
||||
|
@ -2,78 +2,78 @@ import request from '@/utils/request';
|
||||
|
||||
/** 获取故障规则列表*/
|
||||
export function getFailureGenerateRules(params) {
|
||||
return request({
|
||||
url: `/api/simulation/failureGenerateRules`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/failureGenerateRules`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 设置自动故障*/
|
||||
export function setFailureMode(data, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/failureMode`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/failureMode`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 仿真系统按计划行车
|
||||
*/
|
||||
export function runDiagramStart(params, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/start`,
|
||||
method: 'put',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/start`,
|
||||
method: 'put',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 仿真系统结束计划行车
|
||||
*/
|
||||
export function runDiagramOver(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/over`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/over`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出仿真系统
|
||||
*/
|
||||
export function runDiagramQuit(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/quit`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/quit`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取仿真系统时间*/
|
||||
export function runDiagramGetTime(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/systemTime`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/systemTime`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 查看是否开始按计划行车
|
||||
export function runDiagramIsStart(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/isRunPlanStart`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/isRunPlanStart`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 仿真系统CBTC
|
||||
* @param {*} mapId
|
||||
*/
|
||||
export function simulationNotify({ mapId, code }) {
|
||||
return request({
|
||||
url: `/api/simulation/${mapId}/${code}`,
|
||||
method: 'get'
|
||||
});
|
||||
export function simulationNotify({ mapId, mapPrdId }) {
|
||||
return request({
|
||||
url: `/api/simulation/${mapId}/${mapPrdId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,10 +81,10 @@ export function simulationNotify({ mapId, code }) {
|
||||
* @param {*} mapId
|
||||
*/
|
||||
export function bitScreenNotify({ mapId }) {
|
||||
return request({
|
||||
url: `/api/simulation/bigScreen/${mapId}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/bigScreen/${mapId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,10 +92,10 @@ export function bitScreenNotify({ mapId }) {
|
||||
* @param {*} data
|
||||
*/
|
||||
export function trainingNotify({ trainingId }) {
|
||||
return request({
|
||||
url: `/api/simulation/training/${trainingId}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/training/${trainingId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,334 +103,334 @@ export function trainingNotify({ trainingId }) {
|
||||
* @param {*} data
|
||||
*/
|
||||
export function examNotify({ examId }) {
|
||||
return request({
|
||||
url: `/api/simulation/exam/${examId}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/exam/${examId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户实训列表*/
|
||||
export function getSimulationList(data) {
|
||||
return request({
|
||||
url: `/api/simulation/stats`,
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/stats`,
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加用户仿真数据*/
|
||||
export function postSimulationStats(data) {
|
||||
return request({
|
||||
url: `/api/simulation/stats`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/stats`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新用户仿真数据*/
|
||||
export function putSimulationStats(data) {
|
||||
return request({
|
||||
url: `/api/simulation/${data.id}/stats`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${data.id}/stats`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除用户仿真数据*/
|
||||
export function deleteSimulationStats(statsId) {
|
||||
return request({
|
||||
url: `/api/simulation/${statsId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${statsId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户鼠标左键选中的设备信息*/
|
||||
export function letfMouseSelectDevice(deviceCode, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/device/${deviceCode}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/device/${deviceCode}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取每日运行图*/
|
||||
export function getEveryDayRunPlanData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/runPlan`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/runPlan`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 录制脚本仿真*/
|
||||
export function scriptRecordNotify(scriptId) {
|
||||
return request({
|
||||
url: `/api/simulation/scriptWrite/${scriptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/scriptWrite/${scriptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存剧本背景*/
|
||||
export function saveScriptScenes(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/scenes`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/scenes`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存录制任务数据*/
|
||||
export function saveScriptData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新任务地图定位信息*/
|
||||
export function updateMapLocation(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/mapLocation`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/mapLocation`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取剧本编制的所有成员角色*/
|
||||
export function getScriptMemberData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/members`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取剧本出演成员角色 */
|
||||
export function getScriptPlayMember(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/players`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/players`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 取消剧本演出成员角色 */
|
||||
export function cancleScriptMembers(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/removePlayers`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/removePlayers`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 选择剧本演出成员角色 */
|
||||
export function selectScriptMembers(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/choosePlayers`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/choosePlayers`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改剧本演出成员性别 */
|
||||
export function modifyScriptMemberSex(group, playerId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 清除仿真剧本数据*/
|
||||
export function dumpScriptData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询录制剧本步骤*/
|
||||
export function queryScriptStep(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptRecordStage`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptRecordStage`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取指定时间里可加载列车的个数*/
|
||||
export function getDesignatedTimeTrainNum(params, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/plan/trainNum`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/plan/trainNum`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 添加剧本动作 */
|
||||
export function addScriptAction(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/action`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/action`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除剧本动作 */
|
||||
export function deleteScriptAction(group, actionId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改剧本动作 */
|
||||
export function modifyScriptAction(group, actionId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查询存在的仿真 */
|
||||
export function getExistingSimulation(params) {
|
||||
return request({
|
||||
url: `/api/simulation/manage/page`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/manage/page`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除存在的仿真 */
|
||||
export function deleteExistingSimulation(group) {
|
||||
return request({
|
||||
url: `/api/simulation/manage/${group}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/manage/${group}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 根据设备类型获取设备列表 */
|
||||
export function getDeviceCodeByDeviceType(group, params) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/deviceType/devices`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/deviceType/devices`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取任务录制的数据 */
|
||||
export function getScriptRecord(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 加载任务*/
|
||||
export function loadQuest(questId, memberId, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/quest/${questId}?memberId=${memberId}`,
|
||||
method: 'post'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/quest/${questId}?memberId=${memberId}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 加载剧本 */
|
||||
export function loadScript(scriptId, memberId, group) {
|
||||
return request({
|
||||
url: `api/simulation/${group}/script/${scriptId}?memberId=${memberId}`,
|
||||
method: 'post'
|
||||
});
|
||||
return request({
|
||||
url: `api/simulation/${group}/script/${scriptId}?memberId=${memberId}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 退出剧本*/
|
||||
export function quitScript(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/script`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/script`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** 退出任务*/
|
||||
export function quitQuest(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/quest`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/quest`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 根据group获取仿真对象*/
|
||||
export function getSimulationInfo(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取可用的设备指令*/
|
||||
export function getAvailableDeviceCommand(params) {
|
||||
return request({
|
||||
url: `/api/simulation/deviceCommand/available`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/deviceCommand/available`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存/修改任务剧本*/
|
||||
export function saveTaskScript(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/script`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/script`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 暂停剧本编制的仿真 */
|
||||
export function scriptPause(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/pause`,
|
||||
method: 'post'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/pause`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 恢复仿真运行并执行刚编辑的剧本动作 */
|
||||
export function executeScript(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/execute`,
|
||||
method: 'post'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/execute`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 生成用户自己的当日运行图*/
|
||||
export function generateDayRunPlan(planId, group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
|
||||
method: 'post'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建派班计划仿真*/
|
||||
export function schedulingNotify(params) {
|
||||
return request({
|
||||
url: `/api/scheduling/simulation`,
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
return request({
|
||||
url: `/api/scheduling/simulation`,
|
||||
method: 'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取PLC网关 */
|
||||
export function getPlcGateway(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/plcGateway`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/plcGateway`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 处理ibp盘事件 */
|
||||
export function handlerIbpEvent(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/ibp/event`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/${group}/ibp/event`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 预览脚本仿真*/
|
||||
export function scriptDraftRecordNotify(scriptId) {
|
||||
return request({
|
||||
url: `/api/simulation/scriptDraft/${scriptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/simulation/scriptDraft/${scriptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -9,15 +9,6 @@ export function getTrainingSystemList(cityCode, params) {
|
||||
});
|
||||
}
|
||||
|
||||
export function querySystemByTypeAndPrdCode(params, prodCode) {
|
||||
/** 根据系统类型和地图产品code查询系统的内容(课程、章节、考试)*/
|
||||
return request({
|
||||
url: `/api/mapSystem/queryByTypeAndPrdCode/${prodCode}`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function getTrainingSystemListByMapId(mapId) {
|
||||
/** 根据mapId去获取其子系统 */
|
||||
return request({
|
||||
|
@ -87,132 +87,133 @@
|
||||
<script>
|
||||
import { checkRectCollision } from '@/utils/index';
|
||||
export default {
|
||||
name: 'PopMenu',
|
||||
props: {
|
||||
menu: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
defaultFontSize: 14,
|
||||
tPosition: {
|
||||
x: -1000,
|
||||
y: -1000
|
||||
},
|
||||
height: 'auto'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
let fontNum = 0;
|
||||
let newLabel='';
|
||||
this.menu.forEach(elem => {
|
||||
newLabel = elem.label && elem.label.replace(/[^\u0000-\u00ff]/g, 'aa');
|
||||
if (elem.label && newLabel.length > fontNum) {
|
||||
fontNum=newLabel.length;
|
||||
// fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
var width = fontNum/2 * this.defaultFontSize + 60 + 'px';
|
||||
// if(this.$t('global.lanuage')==='en'){
|
||||
// width = fontNum/2 * this.defaultFontSize + 40 + 'px';
|
||||
// }
|
||||
return width;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
resetShowPosition(point) {
|
||||
if (point) {
|
||||
this.show = true;
|
||||
const self = this;
|
||||
this.$nextTick(() => {
|
||||
const gutter = 3;
|
||||
// 位置
|
||||
const height = self.$el.clientHeight;
|
||||
const width = self.$el.clientWidth;
|
||||
let px = 0;
|
||||
let py = 0;
|
||||
if (point.x + width > document.documentElement.clientWidth) {
|
||||
px = document.documentElement.clientWidth - width - gutter;
|
||||
} else {
|
||||
px = point.x;
|
||||
}
|
||||
if (point.y + height > document.documentElement.clientHeight) {
|
||||
py = document.documentElement.clientHeight - height - gutter;
|
||||
} else {
|
||||
py = point.y;
|
||||
}
|
||||
// 处理和提示框重叠问题
|
||||
const popTipDialog = document.getElementById('pop_tip_dialog');
|
||||
if (popTipDialog) {
|
||||
const tipRect = {
|
||||
point: { x: popTipDialog.offsetLeft, y: popTipDialog.offsetTop },
|
||||
width: popTipDialog.offsetWidth,
|
||||
height: popTipDialog.offsetHeight
|
||||
};
|
||||
const menuRect = {
|
||||
point: { x: px, y: py },
|
||||
width: self.$el.offsetWidth,
|
||||
height: self.$el.offsetHeight
|
||||
};
|
||||
const collision = checkRectCollision(tipRect, menuRect);
|
||||
// 若重叠,调整位置
|
||||
if (collision) {
|
||||
px = tipRect.point.x + tipRect.width + gutter;
|
||||
if (px + width > document.documentElement.clientWidth) {
|
||||
px = tipRect.point.x - menuRect.width - gutter;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.tPosition.x = px;
|
||||
self.tPosition.y = py;
|
||||
});
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
// 关闭时立即影藏popover组件
|
||||
const popoverList = document.getElementsByClassName('el-popover');
|
||||
for (let i = 0; i < popoverList.length; i++) {
|
||||
popoverList[i].style.display = 'none';
|
||||
}
|
||||
},
|
||||
checkIfDisabled(menuObj) {
|
||||
return menuObj.disabled === true;
|
||||
},
|
||||
isShow(menuObj) {
|
||||
if (typeof (menuObj.show) === 'undefined') {
|
||||
return true;
|
||||
} else {
|
||||
return menuObj.show;
|
||||
}
|
||||
},
|
||||
calculateSubWidth(item) {
|
||||
const children = item.children;
|
||||
let width = 0;
|
||||
let fontNum = 0;
|
||||
children.forEach(elem => {
|
||||
if (elem.label.length > fontNum) {
|
||||
fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
width = fontNum * this.defaultFontSize + 20 + 'px';
|
||||
return width;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.label][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.handler(file);
|
||||
obj.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'PopMenu',
|
||||
props: {
|
||||
menu: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
defaultFontSize: 14,
|
||||
tPosition: {
|
||||
x: -1000,
|
||||
y: -1000
|
||||
},
|
||||
height: 'auto'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
let fontNum = 0;
|
||||
let newLabel = '';
|
||||
this.menu.forEach(elem => {
|
||||
newLabel = elem.label && elem.label.replace(/[^\u0000-\u00ff]/g, 'aa');
|
||||
if (elem.label && newLabel.length > fontNum) {
|
||||
fontNum = newLabel.length;
|
||||
// fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
var width = fontNum / 2 * this.defaultFontSize + 60 + 'px';
|
||||
// if(this.$t('global.lanuage')==='en'){
|
||||
// width = fontNum/2 * this.defaultFontSize + 40 + 'px';
|
||||
// }
|
||||
return width;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
resetShowPosition(point) {
|
||||
console.log(point);
|
||||
if (point) {
|
||||
this.show = true;
|
||||
const self = this;
|
||||
this.$nextTick(() => {
|
||||
const gutter = 3;
|
||||
// 位置
|
||||
const height = self.$el.clientHeight;
|
||||
const width = self.$el.clientWidth;
|
||||
let px = 0;
|
||||
let py = 0;
|
||||
if (point.x + width > document.documentElement.clientWidth) {
|
||||
px = document.documentElement.clientWidth - width - gutter;
|
||||
} else {
|
||||
px = point.x;
|
||||
}
|
||||
if (point.y + height > document.documentElement.clientHeight) {
|
||||
py = document.documentElement.clientHeight - height - gutter;
|
||||
} else {
|
||||
py = point.y;
|
||||
}
|
||||
// 处理和提示框重叠问题
|
||||
const popTipDialog = document.getElementById('pop_tip_dialog');
|
||||
if (popTipDialog) {
|
||||
const tipRect = {
|
||||
point: { x: popTipDialog.offsetLeft, y: popTipDialog.offsetTop },
|
||||
width: popTipDialog.offsetWidth,
|
||||
height: popTipDialog.offsetHeight
|
||||
};
|
||||
const menuRect = {
|
||||
point: { x: px, y: py },
|
||||
width: self.$el.offsetWidth,
|
||||
height: self.$el.offsetHeight
|
||||
};
|
||||
const collision = checkRectCollision(tipRect, menuRect);
|
||||
// 若重叠,调整位置
|
||||
if (collision) {
|
||||
px = tipRect.point.x + tipRect.width + gutter;
|
||||
if (px + width > document.documentElement.clientWidth) {
|
||||
px = tipRect.point.x - menuRect.width - gutter;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.tPosition.x = px;
|
||||
self.tPosition.y = py;
|
||||
});
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
// 关闭时立即影藏popover组件
|
||||
const popoverList = document.getElementsByClassName('el-popover');
|
||||
for (let i = 0; i < popoverList.length; i++) {
|
||||
popoverList[i].style.display = 'none';
|
||||
}
|
||||
},
|
||||
checkIfDisabled(menuObj) {
|
||||
return menuObj.disabled === true;
|
||||
},
|
||||
isShow(menuObj) {
|
||||
if (typeof (menuObj.show) === 'undefined') {
|
||||
return true;
|
||||
} else {
|
||||
return menuObj.show;
|
||||
}
|
||||
},
|
||||
calculateSubWidth(item) {
|
||||
const children = item.children;
|
||||
let width = 0;
|
||||
let fontNum = 0;
|
||||
children.forEach(elem => {
|
||||
if (elem.label.length > fontNum) {
|
||||
fontNum = elem.label.length;
|
||||
}
|
||||
});
|
||||
width = fontNum * this.defaultFontSize + 20 + 'px';
|
||||
return width;
|
||||
},
|
||||
openLoadFile(item) {
|
||||
const obj = this.$refs[item.label][0];
|
||||
if (obj.files) {
|
||||
const file = obj.files[0];
|
||||
item.handler(file);
|
||||
obj.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
<el-input
|
||||
v-model="formModel[item.prop]"
|
||||
type="textarea"
|
||||
:autosize='item.isAutoSize||false'
|
||||
:autosize="item.isAutoSize||false"
|
||||
:placeholder="item.placeholder"
|
||||
:disabled="item.disabled"
|
||||
:style="{width: item.tooltip ? 'calc(100% - 50px)' : '100%'}"
|
||||
@ -114,6 +114,7 @@
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:disabled="option.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@ -132,6 +133,7 @@
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:disabled="option.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@ -147,6 +149,7 @@
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:disabled="option.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@ -163,6 +166,7 @@
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:disabled="option.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@ -178,6 +182,7 @@
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:disabled="option.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@ -233,52 +238,52 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DataForm',
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
formModel: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
rules: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
checkFieldType(field, type) {
|
||||
if (field.hasOwnProperty('show')) {
|
||||
return field.type === type && field.show;
|
||||
} else {
|
||||
return field.type === type;
|
||||
}
|
||||
},
|
||||
validateForm(callback) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
callback();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
},
|
||||
clearValidate() {
|
||||
this.$refs.form.clearValidate();
|
||||
}
|
||||
}
|
||||
name: 'DataForm',
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
formModel: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
rules: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
checkFieldType(field, type) {
|
||||
if (field.hasOwnProperty('show')) {
|
||||
return field.type === type && field.show;
|
||||
} else {
|
||||
return field.type === type;
|
||||
}
|
||||
},
|
||||
validateForm(callback) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
callback();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
},
|
||||
clearValidate() {
|
||||
this.$refs.form.clearValidate();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
@ -152,329 +152,332 @@
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'QueryForm',
|
||||
props: {
|
||||
queryList: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return { actions: [] };
|
||||
}
|
||||
},
|
||||
queryForm: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
beforeQuery: {
|
||||
type: Function,
|
||||
default(val) {
|
||||
return val;
|
||||
}
|
||||
},
|
||||
canQuery: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
leftSpan: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 18;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
columnNum: 4,
|
||||
queryObject: {},
|
||||
queryFlag: this.canQuery,
|
||||
exportFlag: false,
|
||||
resetShow: true,
|
||||
formModel: {},
|
||||
modelFields: [],
|
||||
ossConfig: {
|
||||
accessKeyId: 'LTAIuLzS7VK3mV8d',
|
||||
accessKeySecret: '7F7aWIi3ymq3J7uGxs9M2c2DnfSiF3',
|
||||
bucket: 'kfexcel'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rowColumnList() {
|
||||
const alocateColumnNum = function(field) {
|
||||
let need = 1;
|
||||
switch (field.type) {
|
||||
case 'daterange':
|
||||
need = 2;
|
||||
break;
|
||||
case 'timerange':
|
||||
need = 2;
|
||||
break;
|
||||
case 'datetimerange':
|
||||
need = 2;
|
||||
break;
|
||||
}
|
||||
field.columnNeed = need;
|
||||
return need;
|
||||
};
|
||||
const objNumList = [];
|
||||
let tempColumnNum = 0;
|
||||
let rowColumnNum = 0;
|
||||
for (const item in this.queryObject) {
|
||||
var colNum = alocateColumnNum(this.queryObject[item]);
|
||||
tempColumnNum = tempColumnNum + colNum;
|
||||
if (tempColumnNum > this.columnNum) {
|
||||
objNumList.push(rowColumnNum);
|
||||
rowColumnNum = 1;
|
||||
tempColumnNum = colNum;
|
||||
} else if (tempColumnNum === this.columnNum) {
|
||||
objNumList.push(++rowColumnNum);
|
||||
rowColumnNum = 0;
|
||||
tempColumnNum = 0;
|
||||
} else {
|
||||
++rowColumnNum;
|
||||
}
|
||||
}
|
||||
if (tempColumnNum > 0 && rowColumnNum > 0) {
|
||||
objNumList.push(rowColumnNum);
|
||||
}
|
||||
return objNumList;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'queryForm.queryObject': function(newVal) {
|
||||
this.initPageData();
|
||||
},
|
||||
canQuery(newVal) {
|
||||
this.queryFlag = newVal;
|
||||
},
|
||||
formModel: {
|
||||
handler: function(form) {
|
||||
if (form) {
|
||||
localStore.set(this.$route.path, form);
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initPageData();
|
||||
this.initQueryModel();
|
||||
},
|
||||
methods: {
|
||||
// 获取默认查询参数
|
||||
initQueryModel() {
|
||||
this.formModel = localStore.get(this.$route.path) || this.formModel;
|
||||
if (typeof this.queryForm.initLoadCallback === 'function') {
|
||||
this.queryForm.initLoadCallback(this.formModel);
|
||||
}
|
||||
this.query();
|
||||
},
|
||||
// 初始化页面数据
|
||||
initPageData() {
|
||||
this.modelFields = [];
|
||||
this.exportFlag = this.queryForm.canExport;
|
||||
this.resetShow = this.queryForm.reset;
|
||||
this.buildQueryField();
|
||||
this.buildForm();
|
||||
},
|
||||
// 构建查询表单对象、显示的查询对象
|
||||
buildForm() {
|
||||
// 获取表单Field的默认值
|
||||
const getDefaultValueByField = function(field) {
|
||||
let defaultValue = '';
|
||||
switch (field.type) {
|
||||
case 'select':
|
||||
if (field.config.multiple) {
|
||||
defaultValue = [];
|
||||
} else {
|
||||
defaultValue = '';
|
||||
}
|
||||
break;
|
||||
case 'daterange':
|
||||
defaultValue = [];
|
||||
break;
|
||||
case 'timerange':
|
||||
defaultValue = [];
|
||||
break;
|
||||
case 'datetimerange':
|
||||
defaultValue = [];
|
||||
break;
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
// 构建查询表单对象、显示的查询对象
|
||||
const queryObject = {};
|
||||
const model = {};
|
||||
for (const item in this.queryForm.queryObject) {
|
||||
if (this.queryForm.queryObject.show === false) {
|
||||
continue;
|
||||
} else if (this.queryForm.queryObject.visible === false) {
|
||||
model[item] = this.queryForm.queryObject[item].value;
|
||||
} else {
|
||||
queryObject[item] = this.queryForm.queryObject[item];
|
||||
model[item] = this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
|
||||
}
|
||||
}
|
||||
name: 'QueryForm',
|
||||
props: {
|
||||
queryList: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return { actions: [] };
|
||||
}
|
||||
},
|
||||
queryForm: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
beforeQuery: {
|
||||
type: Function,
|
||||
default(val) {
|
||||
return val;
|
||||
}
|
||||
},
|
||||
canQuery: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
leftSpan: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 18;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
columnNum: 4,
|
||||
queryObject: {},
|
||||
queryFlag: this.canQuery,
|
||||
exportFlag: false,
|
||||
resetShow: true,
|
||||
formModel: {},
|
||||
modelFields: [],
|
||||
ossConfig: {
|
||||
accessKeyId: 'LTAIuLzS7VK3mV8d',
|
||||
accessKeySecret: '7F7aWIi3ymq3J7uGxs9M2c2DnfSiF3',
|
||||
bucket: 'kfexcel'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rowColumnList() {
|
||||
const alocateColumnNum = function(field) {
|
||||
let need = 1;
|
||||
switch (field.type) {
|
||||
case 'daterange':
|
||||
need = 2;
|
||||
break;
|
||||
case 'timerange':
|
||||
need = 2;
|
||||
break;
|
||||
case 'datetimerange':
|
||||
need = 2;
|
||||
break;
|
||||
}
|
||||
field.columnNeed = need;
|
||||
return need;
|
||||
};
|
||||
const objNumList = [];
|
||||
let tempColumnNum = 0;
|
||||
let rowColumnNum = 0;
|
||||
for (const item in this.queryObject) {
|
||||
var colNum = alocateColumnNum(this.queryObject[item]);
|
||||
tempColumnNum = tempColumnNum + colNum;
|
||||
if (tempColumnNum > this.columnNum) {
|
||||
objNumList.push(rowColumnNum);
|
||||
rowColumnNum = 1;
|
||||
tempColumnNum = colNum;
|
||||
} else if (tempColumnNum === this.columnNum) {
|
||||
objNumList.push(++rowColumnNum);
|
||||
rowColumnNum = 0;
|
||||
tempColumnNum = 0;
|
||||
} else {
|
||||
++rowColumnNum;
|
||||
}
|
||||
}
|
||||
if (tempColumnNum > 0 && rowColumnNum > 0) {
|
||||
objNumList.push(rowColumnNum);
|
||||
}
|
||||
return objNumList;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'queryForm.queryObject': function(newVal) {
|
||||
this.initPageData();
|
||||
},
|
||||
canQuery(newVal) {
|
||||
this.queryFlag = newVal;
|
||||
},
|
||||
formModel: {
|
||||
handler: function(form) {
|
||||
if (form) {
|
||||
localStore.set(this.$route.path, form);
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initPageData();
|
||||
this.initQueryModel();
|
||||
},
|
||||
methods: {
|
||||
// 获取默认查询参数
|
||||
initQueryModel() {
|
||||
this.formModel = localStore.get(this.$route.path) || this.formModel;
|
||||
if (typeof this.queryForm.initLoadCallback === 'function') {
|
||||
this.queryForm.initLoadCallback(this.formModel);
|
||||
}
|
||||
this.query();
|
||||
},
|
||||
// 初始化页面数据
|
||||
initPageData() {
|
||||
this.modelFields = [];
|
||||
this.exportFlag = this.queryForm.canExport;
|
||||
this.resetShow = this.queryForm.reset;
|
||||
this.buildQueryField();
|
||||
this.buildForm();
|
||||
},
|
||||
// 构建查询表单对象、显示的查询对象
|
||||
buildForm() {
|
||||
// 获取表单Field的默认值
|
||||
const getDefaultValueByField = function(field) {
|
||||
let defaultValue = '';
|
||||
switch (field.type) {
|
||||
case 'select':
|
||||
if (field.config.multiple) {
|
||||
defaultValue = [];
|
||||
} else {
|
||||
defaultValue = '';
|
||||
}
|
||||
break;
|
||||
case 'daterange':
|
||||
defaultValue = [];
|
||||
break;
|
||||
case 'timerange':
|
||||
defaultValue = [];
|
||||
break;
|
||||
case 'datetimerange':
|
||||
defaultValue = [];
|
||||
break;
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
// 构建查询表单对象、显示的查询对象
|
||||
const queryObject = {};
|
||||
const model = {};
|
||||
for (const item in this.queryForm.queryObject) {
|
||||
if (this.queryForm.queryObject.show === false) {
|
||||
continue;
|
||||
} else if (this.queryForm.queryObject.visible === false) {
|
||||
model[item] = this.queryForm.queryObject[item].value;
|
||||
} else {
|
||||
queryObject[item] = this.queryForm.queryObject[item];
|
||||
model[item] = this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
|
||||
}
|
||||
}
|
||||
|
||||
this.queryObject = queryObject;
|
||||
this.formModel = model;
|
||||
},
|
||||
// 构建查询fieldName列表
|
||||
buildQueryField() {
|
||||
const fields = [];
|
||||
for (const item in this.queryForm.queryObject) {
|
||||
if (this.queryForm.queryObject.show === false) {
|
||||
continue;
|
||||
} else if (this.queryForm.queryObject.visible === false) {
|
||||
fields.push({ field: item });
|
||||
} else {
|
||||
const type = this.queryForm.queryObject[item].type;
|
||||
switch (type) {
|
||||
case 'text':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'date':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'daterange':
|
||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||
break;
|
||||
case 'time':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'timerange':
|
||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||
break;
|
||||
case 'datetime':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'datetimerange':
|
||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||
break;
|
||||
case 'select':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.modelFields = fields;
|
||||
},
|
||||
checkColumnIndex(rowIndex, objIndex) {
|
||||
var flag = false;
|
||||
if (rowIndex === 0) {
|
||||
if (objIndex >= 0 && objIndex < this.rowColumnList[rowIndex]) {
|
||||
flag = true;
|
||||
}
|
||||
} else {
|
||||
let objNum = 0;
|
||||
for (var i = 0; i < rowIndex; ++i) {
|
||||
objNum += this.rowColumnList[i];
|
||||
}
|
||||
if (objIndex >= objNum && objIndex < objNum + this.rowColumnList[rowIndex]) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
},
|
||||
checkFieldType(field, type, name) {
|
||||
if (field.type === type) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
handleTreeListChildren(treeList) {
|
||||
const traverse = function(list) {
|
||||
if (list && list.length > 0) {
|
||||
list.forEach(element => {
|
||||
if (element.children != null && element.children.length > 0) {
|
||||
traverse(element.children);
|
||||
} else if (element.children != null && element.children.length === 0) {
|
||||
element.children = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
if (treeList && treeList.length > 0) {
|
||||
traverse(treeList);
|
||||
return treeList;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
// 重置操作
|
||||
doClean() {
|
||||
this.initPageData();
|
||||
this.query();
|
||||
},
|
||||
// 导出操作
|
||||
doExport() {
|
||||
this.doExportFront();
|
||||
},
|
||||
// 前端方式导出
|
||||
doExportFront() {
|
||||
const resultData = this.prepareQueryData();
|
||||
if (resultData === false) {
|
||||
return;
|
||||
}
|
||||
this.$emit('queryExport', resultData);
|
||||
},
|
||||
// 将表单对象转换为查询对象
|
||||
prepareQueryData() {
|
||||
let resultData = {};
|
||||
// 将formModel转换为查询对象
|
||||
for (const item in this.formModel) {
|
||||
for (var i = 0; i < this.modelFields.length; ++i) {
|
||||
if (item === this.modelFields[i].field) {
|
||||
if (this.modelFields[i].type === 'treeSelect') {
|
||||
const qo = this.queryForm.queryObject[item];
|
||||
const nodeKey = qo.treeConfig.nodeKey ? qo.treeConfig.nodeKey : 'id';
|
||||
const tmpIds = [];
|
||||
for (var v = 0; v < this.formModel[item].length; ++v) {
|
||||
tmpIds[v] = this.formModel[item][v][nodeKey];
|
||||
}
|
||||
resultData[item] = tmpIds;
|
||||
break;
|
||||
} else {
|
||||
if (this.modelFields[i].subFields) {
|
||||
for (var j = 0; j < this.modelFields[i].subFields.length; ++j) {
|
||||
if (this.formModel[item] && this.formModel[item].length > j) {
|
||||
resultData[this.modelFields[i].subFields[j]] = this.formModel[item][j];
|
||||
} else {
|
||||
resultData[this.modelFields[i].subFields[j]] = '';
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
resultData[item] = this.formModel[item];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 对所有的数据进行trim操作
|
||||
for (const item in resultData) {
|
||||
if (resultData[item] && resultData[item].trim) {
|
||||
resultData[item] = resultData[item].trim();
|
||||
}
|
||||
}
|
||||
// 查询前数据处理
|
||||
resultData = this.beforeQuery(resultData);
|
||||
return resultData;
|
||||
},
|
||||
query() {
|
||||
const resultData = this.prepareQueryData();
|
||||
if (resultData === false) {
|
||||
return;
|
||||
}
|
||||
this.$emit('query', resultData);
|
||||
},
|
||||
selectChange(row, form) {
|
||||
if (row.change) {
|
||||
row.change(form);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.queryObject = queryObject;
|
||||
this.formModel = model;
|
||||
},
|
||||
// 构建查询fieldName列表
|
||||
buildQueryField() {
|
||||
const fields = [];
|
||||
for (const item in this.queryForm.queryObject) {
|
||||
if (this.queryForm.queryObject.show === false) {
|
||||
continue;
|
||||
} else if (this.queryForm.queryObject.visible === false) {
|
||||
fields.push({ field: item });
|
||||
} else {
|
||||
const type = this.queryForm.queryObject[item].type;
|
||||
switch (type) {
|
||||
case 'text':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'date':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'daterange':
|
||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||
break;
|
||||
case 'time':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'timerange':
|
||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||
break;
|
||||
case 'datetime':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
case 'datetimerange':
|
||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||
break;
|
||||
case 'select':
|
||||
fields.push({ field: item });
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.modelFields = fields;
|
||||
},
|
||||
checkColumnIndex(rowIndex, objIndex) {
|
||||
var flag = false;
|
||||
if (rowIndex === 0) {
|
||||
if (objIndex >= 0 && objIndex < this.rowColumnList[rowIndex]) {
|
||||
flag = true;
|
||||
}
|
||||
} else {
|
||||
let objNum = 0;
|
||||
for (var i = 0; i < rowIndex; ++i) {
|
||||
objNum += this.rowColumnList[i];
|
||||
}
|
||||
if (objIndex >= objNum && objIndex < objNum + this.rowColumnList[rowIndex]) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
},
|
||||
checkFieldType(field, type, name) {
|
||||
if (field.type === type) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
handleTreeListChildren(treeList) {
|
||||
const traverse = function(list) {
|
||||
if (list && list.length > 0) {
|
||||
list.forEach(element => {
|
||||
if (element.children != null && element.children.length > 0) {
|
||||
traverse(element.children);
|
||||
} else if (element.children != null && element.children.length === 0) {
|
||||
element.children = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
if (treeList && treeList.length > 0) {
|
||||
traverse(treeList);
|
||||
return treeList;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
// 重置操作
|
||||
doClean() {
|
||||
this.initPageData();
|
||||
this.query();
|
||||
},
|
||||
// 导出操作
|
||||
doExport() {
|
||||
this.doExportFront();
|
||||
},
|
||||
// 前端方式导出
|
||||
doExportFront() {
|
||||
const resultData = this.prepareQueryData();
|
||||
if (resultData === false) {
|
||||
return;
|
||||
}
|
||||
this.$emit('queryExport', resultData);
|
||||
},
|
||||
// 将表单对象转换为查询对象
|
||||
prepareQueryData() {
|
||||
let resultData = {};
|
||||
// 将formModel转换为查询对象
|
||||
for (const item in this.formModel) {
|
||||
for (var i = 0; i < this.modelFields.length; ++i) {
|
||||
if (item === this.modelFields[i].field) {
|
||||
if (this.modelFields[i].type === 'treeSelect') {
|
||||
const qo = this.queryForm.queryObject[item];
|
||||
const nodeKey = qo.treeConfig.nodeKey ? qo.treeConfig.nodeKey : 'id';
|
||||
const tmpIds = [];
|
||||
for (var v = 0; v < this.formModel[item].length; ++v) {
|
||||
tmpIds[v] = this.formModel[item][v][nodeKey];
|
||||
}
|
||||
resultData[item] = tmpIds;
|
||||
break;
|
||||
} else {
|
||||
if (this.modelFields[i].subFields) {
|
||||
for (var j = 0; j < this.modelFields[i].subFields.length; ++j) {
|
||||
if (this.formModel[item] && this.formModel[item].length > j) {
|
||||
resultData[this.modelFields[i].subFields[j]] = this.formModel[item][j];
|
||||
} else {
|
||||
resultData[this.modelFields[i].subFields[j]] = '';
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
resultData[item] = this.formModel[item];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 对所有的数据进行trim操作
|
||||
for (const item in resultData) {
|
||||
if (resultData[item] && resultData[item].trim) {
|
||||
resultData[item] = resultData[item].trim();
|
||||
}
|
||||
}
|
||||
// 查询前数据处理
|
||||
resultData = this.beforeQuery(resultData);
|
||||
return resultData;
|
||||
},
|
||||
query() {
|
||||
const resultData = this.prepareQueryData();
|
||||
if (resultData === false) {
|
||||
return;
|
||||
}
|
||||
this.$emit('query', resultData);
|
||||
},
|
||||
selectChange(row, form) {
|
||||
if (row.change) {
|
||||
row.change(form);
|
||||
}
|
||||
if ( typeof row.selectChange === 'function') {
|
||||
row.selectChange && row.selectChange(form);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
@ -10,6 +10,7 @@ export default {
|
||||
deleteFailed: 'Failed to delete',
|
||||
exportFailed: 'Export Execution Exceptions',
|
||||
getListFailed: 'Failed to retrieve list data',
|
||||
getPermissionListFailed: 'Failed to get permission list',
|
||||
getDistributeQrcodeFailed: 'Failure to obtain permission to distribute two-dimensional code',
|
||||
obtainMaxNumberFailed: 'Failed to obtain the maximum number of user privileges',
|
||||
getTransferQrcodeFailed: 'Failure to obtain permission to transfer two-dimensional code',
|
||||
@ -102,5 +103,6 @@ export default {
|
||||
connectToRealDeviceFailed: 'Connect to real device failed!',
|
||||
getRealDeviceListFailed: 'Get real device list failed!',
|
||||
deleteRealDeviceFailed: 'Delete real device failed!',
|
||||
checkTheValidityFirst: 'Please check the validity first!'
|
||||
checkTheValidityFirst: 'Please check the validity first!',
|
||||
permissionAtLeast:'At least one of the number of permissions is more than 0'
|
||||
};
|
||||
|
@ -196,5 +196,6 @@ export default {
|
||||
america: 'America',
|
||||
companyInfo:'Beijing Jiulian Technology Co., Ltd',
|
||||
companyTel:'Tel: +86 13289398171',
|
||||
companyICP:'Copyright ©2018 Beijing Jiulian Technology Co., Ltd ICP: 18028522'
|
||||
companyICP:'Copyright ©2018 Beijing Jiulian Technology Co., Ltd ICP: 18028522',
|
||||
enterPermissionNum:'please input permission number'
|
||||
};
|
||||
|
@ -120,5 +120,6 @@ export default {
|
||||
explanation: 'Explanation',
|
||||
courseDetails: 'Course details',
|
||||
courseTree: 'Course tree:',
|
||||
mapName:'Map Name'
|
||||
mapName:'Map Name',
|
||||
copy: 'Copy'
|
||||
};
|
||||
|
@ -88,6 +88,7 @@ export default {
|
||||
button: 'button',
|
||||
|
||||
mapName: 'Name of the map:',
|
||||
skinName: 'Skin style:',
|
||||
selectCity: 'city:',
|
||||
offsetXColon: 'X Offset:',
|
||||
offsetYColon: 'Y Offset:',
|
||||
@ -375,6 +376,7 @@ export default {
|
||||
pointSystem2: 'TwoPointSystem',
|
||||
pointSystem5: 'FivePointSystem',
|
||||
skinType: 'SkinType',
|
||||
lineCode:'Line Type',
|
||||
turnoverTime: 'TurnoverTime',
|
||||
productList: 'ProductList',
|
||||
belongsToMapName: 'BelongsToMapName',
|
||||
@ -543,5 +545,6 @@ export default {
|
||||
|
||||
horizontal: 'Horizontal',
|
||||
vertical: 'Vertical',
|
||||
piece: 'piece'
|
||||
piece: 'piece',
|
||||
setStationCode: 'Batch set up centralized station'
|
||||
};
|
||||
|
@ -492,5 +492,6 @@ export default {
|
||||
sourceTrainWindow: 'Source train window',
|
||||
trainWindow: 'Train window',
|
||||
targetTrainWindow: 'Target train window',
|
||||
category: 'category'
|
||||
category: 'category',
|
||||
lineCode:'Line Type'
|
||||
};
|
||||
|
@ -1,35 +1,40 @@
|
||||
export default {
|
||||
permissionPack: 'Package',
|
||||
setSuccess: 'Set successfully',
|
||||
isSureSetBelonger: 'Are you sure to set {name} to be the owner of the permission?',
|
||||
setBelonger: 'Set Owner',
|
||||
lessonName: 'Lesson Name',
|
||||
mapName: 'Map Name',
|
||||
mapProductName: 'Product Name',
|
||||
permissionType: 'Permission Type',
|
||||
permissionStatus: 'Permission Status',
|
||||
permissionUseType: 'Public/Private',
|
||||
permissionTotal: 'Total',
|
||||
permissionRemains: 'Remains',
|
||||
isForever: 'Permanent',
|
||||
startTime: 'Start Time',
|
||||
endTime: 'End Time',
|
||||
belonger: 'Owner',
|
||||
userList: 'User List',
|
||||
customPackageRules: 'Custom packaging rules',
|
||||
addRules: 'Add rules',
|
||||
package: 'Pack',
|
||||
getQrcode: 'Get qr code',
|
||||
hasExitRule: 'This type rule already exists',
|
||||
pleaseAddRule: 'Please add rules',
|
||||
selectDate: 'Select time',
|
||||
addPermissionPackageRule: 'Add authority packaging rules',
|
||||
editPermissionPackageRule: 'edit authority packaging rule',
|
||||
restPermissionMaxNumber: '(maximum number of remaining permissions: {0})',
|
||||
pleaseSelectTransferPermission: 'Select transfer permissions',
|
||||
permissionName: 'Permission Name',
|
||||
private: 'Private',
|
||||
public: 'Public',
|
||||
userName: 'User Name',
|
||||
statusType: 'Status Type'
|
||||
permissionPack: 'Package',
|
||||
setSuccess: 'Set successfully',
|
||||
isSureSetBelonger: 'Are you sure to set {name} to be the owner of the permission?',
|
||||
setBelonger: 'Set Owner',
|
||||
lessonName: 'Lesson Name',
|
||||
mapName: 'Map Name',
|
||||
mapProductName: 'Product Name',
|
||||
permissionType: 'Permission Type',
|
||||
permissionStatus: 'Permission Status',
|
||||
permissionUseType: 'Public/Private',
|
||||
permissionTotal: 'Total',
|
||||
permissionRemains: 'Remains',
|
||||
isForever: 'Permanent',
|
||||
startTime: 'Start Time',
|
||||
endTime: 'End Time',
|
||||
belonger: 'Owner',
|
||||
userList: 'User List',
|
||||
customPackageRules: 'Custom packaging rules',
|
||||
addRules: 'Add rules',
|
||||
package: 'Pack',
|
||||
getQrcode: 'Get qr code',
|
||||
hasExitRule: 'This type rule already exists',
|
||||
pleaseAddRule: 'Please add rules',
|
||||
selectDate: 'Select time',
|
||||
addPermissionPackageRule: 'Add authority packaging rules',
|
||||
editPermissionPackageRule: 'edit authority packaging rule',
|
||||
restPermissionMaxNumber: '(maximum number of remaining permissions: {0})',
|
||||
pleaseSelectTransferPermission: 'Select transfer permissions',
|
||||
permissionName: 'Permission Name',
|
||||
private: 'Private',
|
||||
public: 'Public',
|
||||
userName: 'User Name',
|
||||
statusType: 'Status Type',
|
||||
isPackage:'Package',
|
||||
numOfDistribute:'Num of distribute',
|
||||
numOfTransfer:'Num of transfer',
|
||||
transferTips:'You can receive multiple permissions at a time, and the permissions you receive can continue to be transferred.',
|
||||
distributeTips:'Only one permission can be obtained at a time. The permission received is a dedicated permission and cannot be redistributed.'
|
||||
};
|
||||
|
@ -119,5 +119,8 @@ export default {
|
||||
theBelongsProjectCannotBeEmpty: 'The belongs project cannot be empty',
|
||||
pleaseSelectTheBelongsProject: 'Please select the belongs project',
|
||||
copyMapAs: 'Copy map as',
|
||||
whetherToCopyData: 'Whether to copy data'
|
||||
whetherToCopyData: 'Whether to copy data',
|
||||
copy:'Copy',
|
||||
lineType:'Line Type',
|
||||
belongsToMap: 'Belongs to map'
|
||||
};
|
||||
|
@ -1,71 +1,72 @@
|
||||
export default {
|
||||
homePage: 'Home',
|
||||
homePage: 'Home',
|
||||
|
||||
mapManage: 'Map',
|
||||
skinManage: 'Skin management',
|
||||
mapDraw: 'Map draw',
|
||||
runPlanManage: 'Run plan',
|
||||
productEdit: 'Product editor',
|
||||
mapManage: 'Map',
|
||||
skinManage: 'Skin management',
|
||||
mapDraw: 'Map draw',
|
||||
runPlanManage: 'Run plan',
|
||||
productEdit: 'Product editor',
|
||||
|
||||
designhomePage: 'Public map',
|
||||
designUserPage: 'Personal map',
|
||||
designhomePage: 'Public map',
|
||||
designUserPage: 'Personal map',
|
||||
|
||||
lessaonManage: 'Lesson',
|
||||
lessonEdit: 'Lesson editor',
|
||||
trainingRecord: 'Trainning recording',
|
||||
trainingRule: 'Training rules',
|
||||
trainingManage: 'Training management',
|
||||
taskManage: 'Task management',
|
||||
scriptManage: 'Script',
|
||||
lessaonManage: 'Lesson',
|
||||
lessonEdit: 'Lesson editor',
|
||||
trainingRecord: 'Trainning recording',
|
||||
trainingRule: 'Training rules',
|
||||
trainingManage: 'Training management',
|
||||
taskManage: 'Task management',
|
||||
scriptManage: 'Script',
|
||||
|
||||
teachSystem: 'Teaching',
|
||||
teachSystem: 'Teaching',
|
||||
|
||||
examSystem: 'Examination',
|
||||
examSystem: 'Examination',
|
||||
|
||||
demonstrationSystem: 'Simulation',
|
||||
demonstrationSystem: 'Simulation',
|
||||
|
||||
dpSystem: 'Large screen',
|
||||
dpSystem: 'Large screen',
|
||||
|
||||
planSystem: 'Lian plan',
|
||||
planSystem: 'Lian plan',
|
||||
|
||||
replayManage: 'Playback',
|
||||
replayManage: 'Playback',
|
||||
|
||||
permissionManage: 'Permission',
|
||||
selfPermission: 'My Permission',
|
||||
permissionManage: 'Permission',
|
||||
selfPermission: 'My Permission',
|
||||
|
||||
pulishManage: 'Publication',
|
||||
publishMapManage: 'Publishing map management',
|
||||
productStateManage: 'Product state management',
|
||||
publishLessonManage: 'Publishing lesson management',
|
||||
runPlanTemplateManage: 'Template plan management',
|
||||
runPlanCommonManage: 'Loading Plan Managemen',
|
||||
runPlanEveryDayManage: 'Daily plan Management',
|
||||
examRuleManage: 'Management of examination rules',
|
||||
pulishManage: 'Publication',
|
||||
publishMapManage: 'Publishing map management',
|
||||
productStateManage: 'Product state management',
|
||||
publishLessonManage: 'Publishing lesson management',
|
||||
runPlanTemplateManage: 'Template plan management',
|
||||
runPlanCommonManage: 'Loading Plan Managemen',
|
||||
runPlanEveryDayManage: 'Daily plan Management',
|
||||
examRuleManage: 'Management of examination rules',
|
||||
|
||||
orderAuthorityManage: 'Order&Authority',
|
||||
commodityManage: 'Commodity management',
|
||||
orderManage: 'Order management',
|
||||
authorityManage: 'authority management',
|
||||
authorityTransferManage: 'Privilege distribution management',
|
||||
userRulesManage: 'User Rights Statistics',
|
||||
addCommodity: 'Adding goods',
|
||||
addOrder: 'Adding orders',
|
||||
addCoursePermissions: 'Adding course permissions',
|
||||
orderAuthorityManage: 'Order&Authority',
|
||||
commodityManage: 'Commodity management',
|
||||
orderManage: 'Order management',
|
||||
authorityManage: 'authority management',
|
||||
authorityTransferManage: 'Privilege distribution management',
|
||||
userRulesManage: 'User Rights Statistics',
|
||||
addCommodity: 'Adding goods',
|
||||
addOrder: 'Adding orders',
|
||||
addCoursePermissions: 'Adding course permissions',
|
||||
|
||||
systemManage: 'System',
|
||||
dataDictionary: 'Data dictionary',
|
||||
dataDictionaryDetails: 'Data dictionary details',
|
||||
userManage: 'user management',
|
||||
cacheManage: 'cache management',
|
||||
userTrainingManage: 'User training management',
|
||||
userExamManage: 'User examination management',
|
||||
userSimulationManage: 'User simulation management',
|
||||
existingSimulation: 'Existence simulation management',
|
||||
ibpDraw: 'Ibp Draw',
|
||||
trainingPlatform: 'trainingPlatform',
|
||||
releaseApplication: 'Release application',
|
||||
courseApplication: 'Course release application',
|
||||
scriptReleaseApplication: 'Script release application',
|
||||
runGraphReleaseApplication: 'Run graph release application',
|
||||
subsystemGeneration: 'Subsystem generation'
|
||||
systemManage: 'System',
|
||||
dataDictionary: 'Data dictionary',
|
||||
dataDictionaryDetails: 'Data dictionary details',
|
||||
userManage: 'user management',
|
||||
cacheManage: 'cache management',
|
||||
userTrainingManage: 'User training management',
|
||||
userExamManage: 'User examination management',
|
||||
userSimulationManage: 'User simulation management',
|
||||
existingSimulation: 'Existence simulation management',
|
||||
ibpDraw: 'Ibp Draw',
|
||||
trainingPlatform: 'trainingPlatform',
|
||||
releaseApplication: 'Release application',
|
||||
courseApplication: 'Course release application',
|
||||
scriptReleaseApplication: 'Script release application',
|
||||
runGraphReleaseApplication: 'Run graph release application',
|
||||
subsystemGeneration: 'Subsystem generation',
|
||||
newsBulletin: 'New bulletin'
|
||||
};
|
||||
|
@ -1,314 +1,319 @@
|
||||
export default {
|
||||
pleaseSelect: 'Please select',
|
||||
selectEquipment: 'Please select equipment',
|
||||
deviceTypeNotNull: 'The device type code cannot be empty',
|
||||
operationTypeNotNull: 'The opcode cannot be empty',
|
||||
tipsNotNull: 'The prompt message cannot be empty',
|
||||
pleaseSelectEncoding: 'Please select a unique encoding',
|
||||
pleaseEnterStatusSignal: 'Please enter the name of the status signal',
|
||||
pleaseEnterXCoordinate: 'Please enter the x coordinate',
|
||||
pleaseEnterYCoordinate: 'Please enter the y coordinate',
|
||||
pleaseSelect: 'Please select',
|
||||
selectEquipment: 'Please select equipment',
|
||||
deviceTypeNotNull: 'The device type code cannot be empty',
|
||||
operationTypeNotNull: 'The opcode cannot be empty',
|
||||
tipsNotNull: 'The prompt message cannot be empty',
|
||||
pleaseSelectEncoding: 'Please select a unique encoding',
|
||||
pleaseEnterStatusSignal: 'Please enter the name of the status signal',
|
||||
pleaseEnterXCoordinate: 'Please enter the x coordinate',
|
||||
pleaseEnterYCoordinate: 'Please enter the y coordinate',
|
||||
|
||||
pleaseSelectLine: 'Please select a Line',
|
||||
pleaseSelectLineType: 'Select type Line',
|
||||
pleaseSelectLineWidth: 'Please enter line width',
|
||||
pleaseSelectCity: 'Please select city',
|
||||
pleaseSelectLine: 'Please select a Line',
|
||||
pleaseSelectLineType: 'Select type Line',
|
||||
pleaseSelectLineWidth: 'Please enter line width',
|
||||
pleaseSelectCity: 'Please select city',
|
||||
|
||||
linkXCoordinate: 'Please enter the Link x coordinate',
|
||||
linkYCoordinate: 'Please enter the Link y coordinate',
|
||||
linkEnterLength: 'Please enter display length',
|
||||
linkEnterDisplayLength: 'Please enter the true length',
|
||||
linkXCoordinate: 'Please enter the Link x coordinate',
|
||||
linkYCoordinate: 'Please enter the Link y coordinate',
|
||||
linkEnterLength: 'Please enter display length',
|
||||
linkEnterDisplayLength: 'Please enter the true length',
|
||||
|
||||
linkSelectBase: 'Select the base Link',
|
||||
linkEnterLeft: 'Please enter the left forward Link',
|
||||
linkEnterRight: 'Please enter the forward Link on the right',
|
||||
linkSelectName: 'Enter the Link name',
|
||||
linkSelectDisplayLength: 'Please enter the actual length of the Link',
|
||||
linkSelectBase: 'Select the base Link',
|
||||
linkEnterLeft: 'Please enter the left forward Link',
|
||||
linkEnterRight: 'Please enter the forward Link on the right',
|
||||
linkSelectName: 'Enter the Link name',
|
||||
linkSelectDisplayLength: 'Please enter the actual length of the Link',
|
||||
|
||||
lengthShow: 'According to the length of the:',
|
||||
lengthFact: 'The real length:',
|
||||
color: 'color:',
|
||||
lengthShow: 'According to the length of the:',
|
||||
lengthFact: 'The real length:',
|
||||
color: 'color:',
|
||||
|
||||
pointX: 'Coordinates x:',
|
||||
pointY: 'Coordinates y:',
|
||||
direct: 'The direction of:',
|
||||
basisLink: 'Based on the Link:',
|
||||
sectionRelSwitchCode: 'sectionRelSwitchCode',
|
||||
pointX: 'Coordinates x:',
|
||||
pointY: 'Coordinates y:',
|
||||
direct: 'The direction of:',
|
||||
basisLink: 'Based on the Link:',
|
||||
sectionRelSwitchCode: 'sectionRelSwitchCode',
|
||||
|
||||
pleaseSelectSectionName: 'Select the section name',
|
||||
pleaseFillOffset: 'Please fill in the offset',
|
||||
pleaseFillValue: 'Please fill in the value',
|
||||
pleaseSelectLeftSectionName: 'Please select the left section name',
|
||||
pleaseSelectRightSectionName: 'Select the right section name',
|
||||
pleaseEnterYValue: 'Please enter the coordinate Y value',
|
||||
pleaseEnterSectionType: 'Please enter the section type',
|
||||
pleaseEnterSectionName: 'Please enter a section name',
|
||||
pleaseSelectAssociatedPlatform: 'Please select the associated platform',
|
||||
pleaseEnterLeftStopPointOffset: 'Please enter left stop point offset',
|
||||
rightStopPointOffset: 'Please enter an offset to the right stop point',
|
||||
destinationCode: 'Please enter destination code',
|
||||
destinationCodePointX: 'Please enter destination code coordinate X',
|
||||
destinationCodePointY: 'Please enter destination code coordinate Y',
|
||||
sectionNamePointX: 'Please enter the section name coordinate X',
|
||||
sectionNamePointY: 'Please enter the section name coordinate Y',
|
||||
logicSectionNameSort: 'Select logical extent name sort',
|
||||
sectionOffsetLeft: 'Please enter the left Link offset',
|
||||
sectionSepTypeLeft: 'Please select the left separator',
|
||||
sectionOffsetRight: 'Please enter the right Link offset',
|
||||
sectionSepTypeRight: 'Select the right separator',
|
||||
selectPhysicalExtentName: 'Select the physical extent name',
|
||||
pleaseSelectSectionName: 'Select the section name',
|
||||
pleaseSelectSection: 'Select the section',
|
||||
pleaseSelectStationCode: 'Select the section station code',
|
||||
pleaseFillOffset: 'Please fill in the offset',
|
||||
pleaseFillValue: 'Please fill in the value',
|
||||
pleaseSelectLeftSectionName: 'Please select the left section name',
|
||||
pleaseSelectRightSectionName: 'Select the right section name',
|
||||
pleaseEnterYValue: 'Please enter the coordinate Y value',
|
||||
pleaseEnterSectionType: 'Please enter the section type',
|
||||
pleaseEnterSectionName: 'Please enter a section name',
|
||||
pleaseSelectAssociatedPlatform: 'Please select the associated platform',
|
||||
pleaseEnterLeftStopPointOffset: 'Please enter left stop point offset',
|
||||
rightStopPointOffset: 'Please enter an offset to the right stop point',
|
||||
destinationCode: 'Please enter destination code',
|
||||
destinationCodePointX: 'Please enter destination code coordinate X',
|
||||
destinationCodePointY: 'Please enter destination code coordinate Y',
|
||||
sectionNamePointX: 'Please enter the section name coordinate X',
|
||||
sectionNamePointY: 'Please enter the section name coordinate Y',
|
||||
logicSectionNameSort: 'Select logical extent name sort',
|
||||
sectionOffsetLeft: 'Please enter the left Link offset',
|
||||
sectionSepTypeLeft: 'Please select the left separator',
|
||||
sectionOffsetRight: 'Please enter the right Link offset',
|
||||
sectionSepTypeRight: 'Select the right separator',
|
||||
selectPhysicalExtentName: 'Select the physical extent name',
|
||||
|
||||
pleaseEnterSemaphoreName: 'Please enter a semaphore name',
|
||||
pleaseEnterSignalName: 'Please enter a unique name for the signal',
|
||||
pleaseEnterSignalOffset: 'Please enter an offset',
|
||||
pleaseEnterSignalStation: 'Please enter device central station',
|
||||
pleaseEnterSignalPositionX: 'Please input signal x',
|
||||
pleaseEnterSignalPositionY: 'Please input signal y',
|
||||
signalButtonPositionX: 'Please enter button x',
|
||||
signalButtonPositionY: 'Please enter button y',
|
||||
signalGuidePositionX: 'Please enter the boot signal x',
|
||||
signalGuidePositionY: 'Please enter the boot signal y',
|
||||
pleaseEnterSemaphoreName: 'Please enter a semaphore name',
|
||||
pleaseEnterSignalName: 'Please enter a unique name for the signal',
|
||||
pleaseEnterSignalOffset: 'Please enter an offset',
|
||||
pleaseEnterSignalStation: 'Please enter device central station',
|
||||
pleaseEnterSignalPositionX: 'Please input signal x',
|
||||
pleaseEnterSignalPositionY: 'Please input signal y',
|
||||
signalButtonPositionX: 'Please enter button x',
|
||||
signalButtonPositionY: 'Please enter button y',
|
||||
signalGuidePositionX: 'Please enter the boot signal x',
|
||||
signalGuidePositionY: 'Please enter the boot signal y',
|
||||
|
||||
stationName: 'Please enter station name',
|
||||
stationKmRange: 'Please enter kilometer mark distance',
|
||||
stationKmPost: 'Please enter the name of the kilometer mark',
|
||||
stationName: 'Please enter station name',
|
||||
stationKmRange: 'Please enter kilometer mark distance',
|
||||
stationKmPost: 'Please enter the name of the kilometer mark',
|
||||
|
||||
stationControlStationName: 'Please select the station name',
|
||||
stationControlStationCode: 'Please select your station',
|
||||
stationControlZokContent: 'Please enter the content of central control',
|
||||
stationControlZakContent: 'Please enter the content of station control',
|
||||
stationControlJjzkContent: 'Please enter emergency station control',
|
||||
stationControlZzkContent: 'Please input the content of station central control',
|
||||
stationControlPositionX: 'Please enter coordinate x',
|
||||
stationControlPositionY: 'Please enter coordinate y',
|
||||
stationControlStationName: 'Please select the station name',
|
||||
stationControlStationCode: 'Please select your station',
|
||||
stationControlZokContent: 'Please enter the content of central control',
|
||||
stationControlZakContent: 'Please enter the content of station control',
|
||||
stationControlJjzkContent: 'Please enter emergency station control',
|
||||
stationControlZzkContent: 'Please input the content of station central control',
|
||||
stationControlPositionX: 'Please enter coordinate x',
|
||||
stationControlPositionY: 'Please enter coordinate y',
|
||||
|
||||
pleaseReSelectDevice: 'Please re-select the device',
|
||||
stationCode: 'Please select the associated station',
|
||||
stationstandCountName: 'Please enter a counter name',
|
||||
doorLocationType: 'Please choose the platform direction',
|
||||
deviceStationCode: 'Please select your own centralized station',
|
||||
stationstandDirection: 'Please choose the upstream and downstream direction',
|
||||
stationstandWidth: 'Please enter station width',
|
||||
stationstandHeight: 'Please enter station height',
|
||||
pleaseReSelectDevice: 'Please re-select the device',
|
||||
stationCode: 'Please select the associated station',
|
||||
stationstandCountName: 'Please enter a counter name',
|
||||
doorLocationType: 'Please choose the platform direction',
|
||||
deviceStationCode: 'Please select your own centralized station',
|
||||
stationstandDirection: 'Please choose the upstream and downstream direction',
|
||||
stationstandWidth: 'Please enter station width',
|
||||
stationstandHeight: 'Please enter station height',
|
||||
|
||||
switchName: 'Please enter the switch name',
|
||||
switchNamePointX: 'Please enter switch name coordinate x',
|
||||
switchNamePointY: 'Please enter switch name coordinate y',
|
||||
switchStationCode: 'Please enter device central station',
|
||||
switchTurnTime: 'Please enter switch time',
|
||||
switchTpX: 'Please enter the time coordinate x',
|
||||
switchTpY: 'Please enter the time coordinate y',
|
||||
switchName: 'Please enter the switch name',
|
||||
switchNamePointX: 'Please enter switch name coordinate x',
|
||||
switchNamePointY: 'Please enter switch name coordinate y',
|
||||
switchStationCode: 'Please enter device central station',
|
||||
switchTurnTime: 'Please enter switch time',
|
||||
switchTpX: 'Please enter the time coordinate x',
|
||||
switchTpY: 'Please enter the time coordinate y',
|
||||
|
||||
selectText: 'Please select the Text',
|
||||
pleaseEnterContent: 'Please enter content',
|
||||
textFont: 'Please select the text format',
|
||||
textFontColor: 'Please select the text color',
|
||||
pleaseEnterGroupNumber: 'Please enter the group number',
|
||||
selectTrainType: 'Please select car type',
|
||||
trainPositionX: 'Please enter the x position',
|
||||
trainPositionY: 'Please enter the y position',
|
||||
pleaseEnterTrainNumber: 'Please fill in the group number',
|
||||
selectText: 'Please select the Text',
|
||||
pleaseEnterContent: 'Please enter content',
|
||||
textFont: 'Please select the text format',
|
||||
textFontColor: 'Please select the text color',
|
||||
pleaseEnterGroupNumber: 'Please enter the group number',
|
||||
selectTrainType: 'Please select car type',
|
||||
trainPositionX: 'Please enter the x position',
|
||||
trainPositionY: 'Please enter the y position',
|
||||
pleaseEnterTrainNumber: 'Please fill in the group number',
|
||||
|
||||
trainCode: 'The train model Code cannot be empty',
|
||||
pleaseEnterTrainTypeName: 'Please enter train type name',
|
||||
trainLength: 'Please enter train length',
|
||||
safeDistance: 'Please enter a safe distance',
|
||||
maxSafeDistance: 'Please enter the maximum safe distance',
|
||||
averageVelocity: 'Please enter average speed',
|
||||
averageDeceleration: 'Please enter average deceleration',
|
||||
defaultVelocity: 'Please enter the default speed',
|
||||
maxVelocity: 'Please enter the maximum speed',
|
||||
trainCode: 'The train model Code cannot be empty',
|
||||
pleaseEnterTrainTypeName: 'Please enter train type name',
|
||||
trainLength: 'Please enter train length',
|
||||
safeDistance: 'Please enter a safe distance',
|
||||
maxSafeDistance: 'Please enter the maximum safe distance',
|
||||
averageVelocity: 'Please enter average speed',
|
||||
averageDeceleration: 'Please enter average deceleration',
|
||||
defaultVelocity: 'Please enter the default speed',
|
||||
maxVelocity: 'Please enter the maximum speed',
|
||||
|
||||
trainWindowWidth: 'Please enter the number window width',
|
||||
trainWindowHeight: 'Please enter the number window height',
|
||||
trainWindowSectionCode: 'Please enter the association section',
|
||||
trainWindowWidth: 'Please enter the number window width',
|
||||
trainWindowHeight: 'Please enter the number window height',
|
||||
trainWindowSectionCode: 'Please enter the association section',
|
||||
|
||||
visible: 'Please select whether it is visible',
|
||||
pleaseSelectStartSignal: 'Please select start signal',
|
||||
pleaseSelectEndSignal: 'Please select end signal',
|
||||
visible: 'Please select whether it is visible',
|
||||
pleaseSelectStartSignal: 'Please select start signal',
|
||||
pleaseSelectEndSignal: 'Please select end signal',
|
||||
|
||||
pleaseEnterPathName: 'Please enter the path name',
|
||||
proximitySection: 'Please select the proximity section',
|
||||
accessPropertyType: 'Please select the access property type',
|
||||
autoAccessType: 'Please select auto - access type',
|
||||
physicalSegmentData: 'Select access physical segment data',
|
||||
pleaseEnterPathName: 'Please enter the path name',
|
||||
proximitySection: 'Please select the proximity section',
|
||||
accessPropertyType: 'Please select the access property type',
|
||||
autoAccessType: 'Please select auto - access type',
|
||||
physicalSegmentData: 'Select access physical segment data',
|
||||
|
||||
routingName: 'Please enter the traffic name',
|
||||
startStationCode: 'Please select the starting station',
|
||||
startSectionCode: 'Select the start section',
|
||||
endStationCode: 'Please choose the terminal',
|
||||
endSectionCode: 'Please select end to section',
|
||||
routingName: 'Please enter the traffic name',
|
||||
startStationCode: 'Please select the starting station',
|
||||
startSectionCode: 'Select the start section',
|
||||
endStationCode: 'Please choose the terminal',
|
||||
endSectionCode: 'Please select end to section',
|
||||
|
||||
selectTurnoutID: 'Please select the turnout ID',
|
||||
switchesCannot: 'Switches cannot be identical',
|
||||
selectTurnoutID: 'Please select the turnout ID',
|
||||
switchesCannot: 'Switches cannot be identical',
|
||||
|
||||
pleaseInputName: 'Please enter name',
|
||||
pleaseInputNickName: 'Please enter nickName',
|
||||
pleaseSelectStatus: 'Please select state',
|
||||
pleaseInputCode: 'Please enter code',
|
||||
strLength1To25: 'The length is between 1 and 25 characters',
|
||||
strLengthNotExceed50: 'No more than 50 characters',
|
||||
pleaseInputName: 'Please enter name',
|
||||
pleaseInputNickName: 'Please enter nickName',
|
||||
pleaseSelectStatus: 'Please select state',
|
||||
pleaseInputCode: 'Please enter code',
|
||||
strLength1To25: 'The length is between 1 and 25 characters',
|
||||
strLengthNotExceed50: 'No more than 50 characters',
|
||||
|
||||
pleaseEnterMapName: 'Please enter a map name',
|
||||
pleaseChooseSkinCode: 'Please choose skin style',
|
||||
pleaseSelectMapSource: 'Please select the map source',
|
||||
pleaseSelectAssociatedCity: 'Please select the associated city',
|
||||
pleaseSelectAssociatedSkin: 'Please select associated skin',
|
||||
pleaseEnteMapLinkWidth: 'Please enter map Link width',
|
||||
pleaseEnterMapSectionWidth: 'Please enter map section width',
|
||||
pleaseEnterMapName: 'Please enter a map name',
|
||||
pleaseChooseSkinCode: 'Please choose skin style',
|
||||
pleaseSelectMapSource: 'Please select the map source',
|
||||
pleaseSelectAssociatedCity: 'Please select the associated city',
|
||||
pleaseSelectAssociatedSkin: 'Please select associated skin',
|
||||
pleaseEnteMapLinkWidth: 'Please enter map Link width',
|
||||
pleaseEnterMapSectionWidth: 'Please enter map section width',
|
||||
|
||||
organizationInput: 'Please enter the name of the organization or business',
|
||||
productSelect: 'Please select products',
|
||||
itemPricingInput: 'Please enter unit price',
|
||||
orderTypeSelect: 'Please select the order type',
|
||||
contractNumberInput: 'Please enter the contract number',
|
||||
salesmanInput: 'Please select a salesperson',
|
||||
authorAmountInput: 'Please enter the number of permissions to purchase',
|
||||
authorAmountInputError: 'Please enter the number of valid permissions',
|
||||
totalPriceInput: 'Please enter the total price',
|
||||
totalPriceInputError1: 'Please enter the price in two decimal places',
|
||||
totalPriceInputError2: 'Please enter valid total price',
|
||||
monthAmountInput: 'Please enter purchase month',
|
||||
monthAmountInputError: 'Please enter valid months of purchase',
|
||||
startTimePick: 'Please select a start date',
|
||||
bizTypeSelect: 'Select a business type',
|
||||
payWaysSelect: 'Please select payment method',
|
||||
payStatusSelect: 'Please select payment status',
|
||||
goodsNameInput: 'Please enter product name',
|
||||
productTypeInput: 'Please select product type',
|
||||
mapInput: 'Please select map',
|
||||
productInput: 'Please select product',
|
||||
lessonInput: 'Please select courses',
|
||||
trialTimeInput: 'Please enter trial duration',
|
||||
unitOfTimeRadio: 'Please select a time unit',
|
||||
goodsDescribtionInput: 'Please enter product description',
|
||||
userNameInput: 'Please enter user name',
|
||||
permissionTypeInput: 'Please select the permission type',
|
||||
timeInput: 'Please enter the time',
|
||||
chooseUser: 'Please select the user',
|
||||
pleaseInputLessonName: 'Please enter the course name',
|
||||
pleaseSelectTraining: 'Please select training',
|
||||
organizationInput: 'Please enter the name of the organization or business',
|
||||
productSelect: 'Please select products',
|
||||
itemPricingInput: 'Please enter unit price',
|
||||
orderTypeSelect: 'Please select the order type',
|
||||
contractNumberInput: 'Please enter the contract number',
|
||||
salesmanInput: 'Please select a salesperson',
|
||||
authorAmountInput: 'Please enter the number of permissions to purchase',
|
||||
authorAmountInputError: 'Please enter the number of valid permissions',
|
||||
totalPriceInput: 'Please enter the total price',
|
||||
totalPriceInputError1: 'Please enter the price in two decimal places',
|
||||
totalPriceInputError2: 'Please enter valid total price',
|
||||
monthAmountInput: 'Please enter purchase month',
|
||||
monthAmountInputError: 'Please enter valid months of purchase',
|
||||
startTimePick: 'Please select a start date',
|
||||
bizTypeSelect: 'Select a business type',
|
||||
payWaysSelect: 'Please select payment method',
|
||||
payStatusSelect: 'Please select payment status',
|
||||
goodsNameInput: 'Please enter product name',
|
||||
productTypeInput: 'Please select product type',
|
||||
mapInput: 'Please select map',
|
||||
productInput: 'Please select product',
|
||||
lessonInput: 'Please select courses',
|
||||
trialTimeInput: 'Please enter trial duration',
|
||||
unitOfTimeRadio: 'Please select a time unit',
|
||||
goodsDescribtionInput: 'Please enter product description',
|
||||
userNameInput: 'Please enter user name',
|
||||
permissionTypeInput: 'Please select the permission type',
|
||||
timeInput: 'Please enter the time',
|
||||
chooseUser: 'Please select the user',
|
||||
pleaseInputLessonName: 'Please enter the course name',
|
||||
pleaseSelectTraining: 'Please select training',
|
||||
|
||||
maxScaling: '(The maximum scale is 8 steps)',
|
||||
skinCodingInput: 'Please enter skin code',
|
||||
skinDesignationInput: 'Please enter skin name',
|
||||
coordinatesOriginInput: 'Please enter the origin coordinates',
|
||||
scalingInput: 'Please enter the scale',
|
||||
scalingInputPrompt: 'Please enter a valid scale',
|
||||
selectImportFiles: 'Select the file you want to import',
|
||||
speedLevelEnter1: 'Please enter speed level 1',
|
||||
speedLevelEnter2: 'Please enter speed level 2',
|
||||
speedLevelEnter3: 'Please enter speed level 3',
|
||||
speedLevelEnter4: 'Please enter speed level 4',
|
||||
drivingDirectionSelect: 'Please choose your driving direction',
|
||||
timeBetweenDeparturesEnter: 'Please enter the interval',
|
||||
stopTimeEnter: 'Please enter the docking time',
|
||||
entranceStationSelect: 'Please select the entrance',
|
||||
exportStationSelect: 'Please select the exit gate',
|
||||
selectDataRange: 'Please select the data range range',
|
||||
productCodeEnter: 'Please enter the product code',
|
||||
productNameEnter: 'Please enter product name',
|
||||
productDescriptionEnter: 'Please enter product description',
|
||||
trainingTypeSelect: 'Please select the associated training type',
|
||||
linkWidthInput: 'Please enter Link width',
|
||||
linkWidthInputPrompt: 'Please enter a valid Link width',
|
||||
sectionWidthInput: 'Please enter section width',
|
||||
sectionWidthInputPrompt: 'Please enter a valid segment width',
|
||||
selectShowWatermark: 'Select whether or not to watermark',
|
||||
pleaseInputMapName: 'Please enter a new name for the map',
|
||||
inputTemplateRunPlan: 'Please select the template run plan',
|
||||
inputSkinType: 'Please select skin type',
|
||||
inputOperateCode: 'Please enter the step code',
|
||||
inputStepNo: 'Please enter the step number',
|
||||
inputStepTips: 'Please enter step number. Please enter step prompt',
|
||||
selectMapName: 'Please select a map name',
|
||||
selectMapProductName: 'Please select map product name',
|
||||
inputTime: 'Please enter time',
|
||||
inputPermissionNumber: 'Please enter the number of permissions',
|
||||
permissionNumberGreater0: 'The number of permissions must be greater than 0',
|
||||
enterChapterName: 'Please enter chapter name',
|
||||
enterChapterInstructions: 'Please enter chapter instructions',
|
||||
selectCourseName: 'Please select the course name',
|
||||
enterCourseName: 'Please enter the course name',
|
||||
selectAssociatedProduct: 'Please select the associated product',
|
||||
enterCourseDescription: 'Please enter the course description',
|
||||
pleaseLessonIntroduction: 'Please enter the course description',
|
||||
courseIdIsEmpty: 'Course Id is empty',
|
||||
selectCity: 'Please select city',
|
||||
enterStandardTime: 'Please enter standard time',
|
||||
enterNumericValue: 'Please enter a numeric value',
|
||||
greaterThanMinTime: 'Must be greater than the minimum time',
|
||||
selectTrainingType: 'Please select training type',
|
||||
selectOneTrainingType: 'Only one training type can be selected',
|
||||
enterProductType: 'Please enter product type',
|
||||
selectAssociatedStation: 'Please select the associated station',
|
||||
pleaseSelectTrainDir: 'Please select the direction of the train',
|
||||
pleaseEnterSplit: 'Please enter the split number',
|
||||
pleaseEnterSplitNumber: 'Please enter a reasonable number of split',
|
||||
enterScale: 'Please enter the zoom ratio',
|
||||
enterXOffset: 'Please enter X offset',
|
||||
enterYOffset: 'Please enter Y offset',
|
||||
pleaseSelectButtonType: 'Please select the button type',
|
||||
pleaseSelectButtonContent: 'Please enter the content',
|
||||
endTimeRules: 'The end time must be greater than the start time.',
|
||||
selectCourses: 'Please select courses',
|
||||
selectTheMapRoute: 'Please select the map route.',
|
||||
enterKeyword: 'Please enter a keyword',
|
||||
successfullyModified: 'Successfully modified',
|
||||
modifyTheFailure: 'Modify the failure',
|
||||
selectTheCourseNameFirst: 'Please select the course name first',
|
||||
selectMultiplePermissions: 'Please select multiple permissions',
|
||||
enterPermissionName: 'Please enter a permission name',
|
||||
pleaseSelectPermission: 'Please select permission',
|
||||
pleaseSelectTemplateRunGraph: 'Please select a template to run the diagram',
|
||||
selectTheRunningDiagramToBeLoaded: 'Please select the running diagram to be loaded',
|
||||
selectOneOrMoreDates: 'Select one or more dates',
|
||||
selectAPlannedDateRange: 'Please select a planned date range',
|
||||
selectGroupNumber: 'Please select group number',
|
||||
selectATrainType: 'Please select a train type',
|
||||
enterTheServiceNumber: 'Please enter the service number',
|
||||
enterTheTripNumber: 'Please enter the trip number',
|
||||
enterTheTargetCode: 'Please enter the target code',
|
||||
selectStation: 'Please select station',
|
||||
inputTrainingName: 'Please input training name',
|
||||
inputTrainingRemark: 'Please input training remark',
|
||||
inputTrainingType: 'Please input training type',
|
||||
inputOperationType: 'Please input operation type',
|
||||
inputMinDuration: 'Please input best duration',
|
||||
inputMaxDuration: 'Please input max duration',
|
||||
accessNumber: 'Please input the number of permissions',
|
||||
courseNameEmpty: 'Course name cannot be empty',
|
||||
purchaseMonth: 'Please input the number of months to buy',
|
||||
pleaseEnterGoodPrice: 'Please enter the price of the goods',
|
||||
enterTheNameOfTheRunGraph: 'Please enter the name of the run graph',
|
||||
chooseToPublishTheRunGraph: 'Please choose to publish the run chart',
|
||||
enterTheAlarmCode: 'Please enter the alarm code',
|
||||
enterTheAlarmWidth: 'Please enter the alarm width',
|
||||
enterTheEscalatorFrameCode: 'Please enter the escalator frame code',
|
||||
enterTheEscalatorFrameWidth: 'Please enter the escalator frame width',
|
||||
enterTheEscalatorFrameHeight: 'Please enter the escalator frame height',
|
||||
enterTheBorderWidth: 'Please enter the border width',
|
||||
selectTheDirectionOfTheArrow: 'Please select the direction of the arrow',
|
||||
enterTheArrowCode: 'Please enter the arrow code',
|
||||
enterTheArrowLength: 'Please enter the arrow length',
|
||||
enterTheArrowWidth: 'Please enter the arrow width',
|
||||
enterTheArrowColor: 'Please enter the arrow color',
|
||||
enterTheBackgroundWidth: 'Please enter the background width',
|
||||
enterTheBackgroundHeight: 'Please enter the background height',
|
||||
selectTheButtonColor: 'Please select the button color',
|
||||
enterTheButtonCode: 'Please enter the button code',
|
||||
enterTheButtonWidth: 'Please enter the button width',
|
||||
enterTheDigitalClockCode: 'Please enter the digital clock code',
|
||||
enterTheDigitalClockWidth: 'Please enter the digital clock width',
|
||||
selectTheStartingDirection: 'Please select the starting direction',
|
||||
enterTheElevatorCode: 'Please enter the elevator code',
|
||||
enterTheElevatorWidth: 'Please enter the elevator width',
|
||||
enterTheElevatorHeight: 'Please enter the elevator height',
|
||||
enterTheElevatorColor: 'Please enter the elevator color',
|
||||
enterTheKeyCode: 'Please enter the key code',
|
||||
enterTheKeyWidth: 'Please enter the key width',
|
||||
enterTheKeyDirection: 'Please select the key direction',
|
||||
enterTheUpperText: 'Please enter the upper text',
|
||||
enterTheLowerText: 'Please enter the lower text',
|
||||
enterRejectReason: 'Please enter reject reason'
|
||||
maxScaling: '(The maximum scale is 8 steps)',
|
||||
skinCodingInput: 'Please enter skin code',
|
||||
skinDesignationInput: 'Please enter skin name',
|
||||
coordinatesOriginInput: 'Please enter the origin coordinates',
|
||||
scalingInput: 'Please enter the scale',
|
||||
scalingInputPrompt: 'Please enter a valid scale',
|
||||
selectImportFiles: 'Select the file you want to import',
|
||||
speedLevelEnter1: 'Please enter speed level 1',
|
||||
speedLevelEnter2: 'Please enter speed level 2',
|
||||
speedLevelEnter3: 'Please enter speed level 3',
|
||||
speedLevelEnter4: 'Please enter speed level 4',
|
||||
drivingDirectionSelect: 'Please choose your driving direction',
|
||||
timeBetweenDeparturesEnter: 'Please enter the interval',
|
||||
stopTimeEnter: 'Please enter the docking time',
|
||||
entranceStationSelect: 'Please select the entrance',
|
||||
exportStationSelect: 'Please select the exit gate',
|
||||
selectDataRange: 'Please select the data range range',
|
||||
productCodeEnter: 'Please enter the product code',
|
||||
productNameEnter: 'Please enter product name',
|
||||
productDescriptionEnter: 'Please enter product description',
|
||||
trainingTypeSelect: 'Please select the associated training type',
|
||||
linkWidthInput: 'Please enter Link width',
|
||||
linkWidthInputPrompt: 'Please enter a valid Link width',
|
||||
sectionWidthInput: 'Please enter section width',
|
||||
sectionWidthInputPrompt: 'Please enter a valid segment width',
|
||||
selectShowWatermark: 'Select whether or not to watermark',
|
||||
pleaseInputMapName: 'Please enter a new name for the map',
|
||||
inputTemplateRunPlan: 'Please select the template run plan',
|
||||
inputSkinType: 'Please select skin type',
|
||||
inputOperateCode: 'Please enter the step code',
|
||||
inputStepNo: 'Please enter the step number',
|
||||
inputStepTips: 'Please enter step number. Please enter step prompt',
|
||||
selectMapName: 'Please select a map name',
|
||||
selectMapProductName: 'Please select map product name',
|
||||
inputTime: 'Please enter time',
|
||||
inputPermissionNumber: 'Please enter the number of permissions',
|
||||
permissionNumberGreater0: 'The number of permissions must be greater than 0',
|
||||
enterChapterName: 'Please enter chapter name',
|
||||
enterChapterInstructions: 'Please enter chapter instructions',
|
||||
selectCourseName: 'Please select the course name',
|
||||
enterCourseName: 'Please enter the course name',
|
||||
selectAssociatedProduct: 'Please select the associated product',
|
||||
enterCourseDescription: 'Please enter the course description',
|
||||
pleaseLessonIntroduction: 'Please enter the course description',
|
||||
courseIdIsEmpty: 'Course Id is empty',
|
||||
selectCity: 'Please select city',
|
||||
enterStandardTime: 'Please enter standard time',
|
||||
enterNumericValue: 'Please enter a numeric value',
|
||||
greaterThanMinTime: 'Must be greater than the minimum time',
|
||||
selectTrainingType: 'Please select training type',
|
||||
selectOneTrainingType: 'Only one training type can be selected',
|
||||
enterProductType: 'Please enter product type',
|
||||
selectAssociatedStation: 'Please select the associated station',
|
||||
pleaseSelectTrainDir: 'Please select the direction of the train',
|
||||
pleaseEnterSplit: 'Please enter the split number',
|
||||
pleaseEnterSplitNumber: 'Please enter a reasonable number of split',
|
||||
enterScale: 'Please enter the zoom ratio',
|
||||
enterXOffset: 'Please enter X offset',
|
||||
enterYOffset: 'Please enter Y offset',
|
||||
pleaseSelectButtonType: 'Please select the button type',
|
||||
pleaseSelectButtonContent: 'Please enter the content',
|
||||
endTimeRules: 'The end time must be greater than the start time.',
|
||||
selectCourses: 'Please select courses',
|
||||
selectTheMapRoute: 'Please select the map route.',
|
||||
enterKeyword: 'Please enter a keyword',
|
||||
successfullyModified: 'Successfully modified',
|
||||
modifyTheFailure: 'Modify the failure',
|
||||
selectTheCourseNameFirst: 'Please select the course name first',
|
||||
selectMultiplePermissions: 'Please select multiple permissions',
|
||||
enterPermissionName: 'Please enter a permission name',
|
||||
pleaseSelectPermission: 'Please select permission',
|
||||
pleaseSelectTemplateRunGraph: 'Please select a template to run the diagram',
|
||||
selectTheRunningDiagramToBeLoaded: 'Please select the running diagram to be loaded',
|
||||
selectOneOrMoreDates: 'Select one or more dates',
|
||||
selectAPlannedDateRange: 'Please select a planned date range',
|
||||
selectGroupNumber: 'Please select group number',
|
||||
selectATrainType: 'Please select a train type',
|
||||
enterTheServiceNumber: 'Please enter the service number',
|
||||
enterTheTripNumber: 'Please enter the trip number',
|
||||
enterTheTargetCode: 'Please enter the target code',
|
||||
selectStation: 'Please select station',
|
||||
inputTrainingName: 'Please input training name',
|
||||
inputTrainingRemark: 'Please input training remark',
|
||||
inputTrainingType: 'Please input training type',
|
||||
inputOperationType: 'Please input operation type',
|
||||
inputMinDuration: 'Please input best duration',
|
||||
inputMaxDuration: 'Please input max duration',
|
||||
accessNumber: 'Please input the number of permissions',
|
||||
courseNameEmpty: 'Course name cannot be empty',
|
||||
purchaseMonth: 'Please input the number of months to buy',
|
||||
pleaseEnterGoodPrice: 'Please enter the price of the goods',
|
||||
enterTheNameOfTheRunGraph: 'Please enter the name of the run graph',
|
||||
chooseToPublishTheRunGraph: 'Please choose to publish the run chart',
|
||||
enterTheAlarmCode: 'Please enter the alarm code',
|
||||
enterTheAlarmWidth: 'Please enter the alarm width',
|
||||
enterTheEscalatorFrameCode: 'Please enter the escalator frame code',
|
||||
enterTheEscalatorFrameWidth: 'Please enter the escalator frame width',
|
||||
enterTheEscalatorFrameHeight: 'Please enter the escalator frame height',
|
||||
enterTheBorderWidth: 'Please enter the border width',
|
||||
selectTheDirectionOfTheArrow: 'Please select the direction of the arrow',
|
||||
enterTheArrowCode: 'Please enter the arrow code',
|
||||
enterTheArrowLength: 'Please enter the arrow length',
|
||||
enterTheArrowWidth: 'Please enter the arrow width',
|
||||
enterTheArrowColor: 'Please enter the arrow color',
|
||||
enterTheBackgroundWidth: 'Please enter the background width',
|
||||
enterTheBackgroundHeight: 'Please enter the background height',
|
||||
selectTheButtonColor: 'Please select the button color',
|
||||
enterTheButtonCode: 'Please enter the button code',
|
||||
enterTheButtonWidth: 'Please enter the button width',
|
||||
enterTheDigitalClockCode: 'Please enter the digital clock code',
|
||||
enterTheDigitalClockWidth: 'Please enter the digital clock width',
|
||||
selectTheStartingDirection: 'Please select the starting direction',
|
||||
enterTheElevatorCode: 'Please enter the elevator code',
|
||||
enterTheElevatorWidth: 'Please enter the elevator width',
|
||||
enterTheElevatorHeight: 'Please enter the elevator height',
|
||||
enterTheElevatorColor: 'Please enter the elevator color',
|
||||
enterTheKeyCode: 'Please enter the key code',
|
||||
enterTheKeyWidth: 'Please enter the key width',
|
||||
enterTheKeyDirection: 'Please select the key direction',
|
||||
enterTheUpperText: 'Please enter the upper text',
|
||||
enterTheLowerText: 'Please enter the lower text',
|
||||
enterRejectReason: 'Please enter reject reason',
|
||||
enterTheNewsTitle: 'Please enter news title',
|
||||
enterTheNewsContent: 'Please enter news content',
|
||||
chooseNewsCanBeClosed: 'Please select the news can be closed'
|
||||
};
|
||||
|
@ -1,107 +1,113 @@
|
||||
export default {
|
||||
scriptTitle: 'Task Recording',
|
||||
saveBackground: 'Save Background',
|
||||
saveData: 'Save Data',
|
||||
mapList: 'Map List',
|
||||
createScript: 'Create Script',
|
||||
modifyScript: 'Modify Script',
|
||||
scriptName: 'Script Name',
|
||||
addScript: 'Add Script',
|
||||
map: 'Map',
|
||||
scriptDescription: 'Script Description',
|
||||
submit: 'submit',
|
||||
scriptNameRule: 'Please input script name',
|
||||
scriptDescriptionRule: 'Please input script description',
|
||||
createScriptSuccess: 'Create script success',
|
||||
createScriptFail: 'Create script failure',
|
||||
scriptDetail: 'Script Detail',
|
||||
scriptRecord: 'Edit',
|
||||
scriptCreate: 'Create',
|
||||
scriptModify: 'Modify',
|
||||
scriptDelete: 'Delete',
|
||||
getScriptFail: 'Get script information failure',
|
||||
createSimulationFail: 'Create simulation failure',
|
||||
modifyScriptSuccess: 'Modify script success',
|
||||
modifyScriptFail: 'Modify script failure',
|
||||
deleteScriptTip: 'This action will delete this script, whether to continue?',
|
||||
deleteScriptSucess: 'delete script sucess',
|
||||
deleteScriptFail: 'delete script failure',
|
||||
scriptRecordTitle: 'Script Record',
|
||||
drivingPause: 'Pause',
|
||||
recoverAndExecute: 'Recover And Execute',
|
||||
resetScript: 'Reset Script',
|
||||
pauseFail: 'Pause failure',
|
||||
recoverFail: 'Recover failure',
|
||||
saveBackgroundSuceess: 'Save background suceess',
|
||||
updateLocationFail: 'update location failure',
|
||||
saveBackgroundFail: 'Save background failure',
|
||||
saveDataSucess: 'Save data sucess',
|
||||
saveDataFail: 'Save data failure',
|
||||
clearDataTip: 'This action will clear the saved script data, whether to continue?',
|
||||
resetDataSuccess: 'Reset script success',
|
||||
resetDataFail: 'Reset script failure',
|
||||
scriptTitle: 'Task Recording',
|
||||
saveBackground: 'Save Background',
|
||||
saveData: 'Save Data',
|
||||
mapList: 'Map List',
|
||||
createScript: 'Create Script',
|
||||
modifyScript: 'Modify Script',
|
||||
scriptName: 'Script Name',
|
||||
addScript: 'Add Script',
|
||||
map: 'Map',
|
||||
scriptDescription: 'Script Description',
|
||||
submit: 'submit',
|
||||
scriptNameRule: 'Please input script name',
|
||||
scriptDescriptionRule: 'Please input script description',
|
||||
createScriptSuccess: 'Create script success',
|
||||
createScriptFail: 'Create script failure',
|
||||
scriptDetail: 'Script Detail',
|
||||
scriptRecord: 'Edit',
|
||||
scriptCreate: 'Create',
|
||||
scriptModify: 'Modify',
|
||||
scriptDelete: 'Delete',
|
||||
getScriptFail: 'Get script information failure',
|
||||
createSimulationFail: 'Create simulation failure',
|
||||
modifyScriptSuccess: 'Modify script success',
|
||||
modifyScriptFail: 'Modify script failure',
|
||||
deleteScriptTip: 'This action will delete this script, whether to continue?',
|
||||
deleteScriptSucess: 'delete script sucess',
|
||||
deleteScriptFail: 'delete script failure',
|
||||
scriptRecordTitle: 'Script Record',
|
||||
drivingPause: 'Pause',
|
||||
recoverAndExecute: 'Recover And Execute',
|
||||
resetScript: 'Reset Script',
|
||||
pauseFail: 'Pause failure',
|
||||
recoverFail: 'Recover failure',
|
||||
saveBackgroundSuceess: 'Save background suceess',
|
||||
updateLocationFail: 'update location failure',
|
||||
saveBackgroundFail: 'Save background failure',
|
||||
saveDataSucess: 'Save data sucess',
|
||||
saveDataFail: 'Save data failure',
|
||||
clearDataTip: 'This action will clear the saved script data, whether to continue?',
|
||||
resetDataSuccess: 'Reset script success',
|
||||
resetDataFail: 'Reset script failure',
|
||||
|
||||
allRoles: 'All Roles',
|
||||
actors: 'Actor Role',
|
||||
roleSexMale: 'Male',
|
||||
roleSexFemale: 'Female',
|
||||
selectScriptActorSuccess: 'Select script actor success',
|
||||
selectScriptActorFail: 'Select script actor failure',
|
||||
cancleScriptActorSuccess: 'Cancle script actor success',
|
||||
cancleScriptActorFail: 'Cancle script actor failure',
|
||||
modifyScriptActorSexSuccess: 'Modify script actor sex success',
|
||||
modifyScriptActorSexFail: 'Modify script actor sex failure',
|
||||
allRoles: 'All Roles',
|
||||
actors: 'Actor Role',
|
||||
roleSexMale: 'Male',
|
||||
roleSexFemale: 'Female',
|
||||
selectScriptActorSuccess: 'Select script actor success',
|
||||
selectScriptActorFail: 'Select script actor failure',
|
||||
cancleScriptActorSuccess: 'Cancle script actor success',
|
||||
cancleScriptActorFail: 'Cancle script actor failure',
|
||||
modifyScriptActorSexSuccess: 'Modify script actor sex success',
|
||||
modifyScriptActorSexFail: 'Modify script actor sex failure',
|
||||
|
||||
addConversition: 'Add Dialogue',
|
||||
narrator: 'Sender',
|
||||
narratorRules: 'Please select Sender',
|
||||
receiver: 'Receiver',
|
||||
receiverRules: 'Please select receiver',
|
||||
conversitionContent: 'Content',
|
||||
addCommand: 'Add Command',
|
||||
executor: 'Executor',
|
||||
executorRules: 'Please select executor',
|
||||
executeCommand: 'Command',
|
||||
executeCommandRules: 'Please select execute command',
|
||||
startStation: 'Start Station',
|
||||
startStationRules: 'Please select start station ',
|
||||
endStation: 'End Station',
|
||||
endStationRules: 'Please select end station',
|
||||
addConversition: 'Add Dialogue',
|
||||
narrator: 'Sender',
|
||||
narratorRules: 'Please select Sender',
|
||||
receiver: 'Receiver',
|
||||
receiverRules: 'Please select receiver',
|
||||
conversitionContent: 'Content',
|
||||
addCommand: 'Add Command',
|
||||
executor: 'Executor',
|
||||
executorRules: 'Please select executor',
|
||||
executeCommand: 'Command',
|
||||
executeCommandRules: 'Please select execute command',
|
||||
startStation: 'Start Station',
|
||||
startStationRules: 'Please select start station ',
|
||||
endStation: 'End Station',
|
||||
endStationRules: 'Please select end station',
|
||||
drivingMode:'Driving Mode',
|
||||
drivingModeRules:'Please select driving mode',
|
||||
speed:'Speed',
|
||||
signal:'Signal',
|
||||
speedRules:'Please input speed',
|
||||
signalRules:'Please select signal',
|
||||
|
||||
addCommandButton: 'Add Command',
|
||||
addConversitionButton: 'Add Dialogue',
|
||||
conversitionContentRules: 'Please input content',
|
||||
addCommandSucess: 'Add command sucess',
|
||||
addCommandFail: 'Add command failure',
|
||||
addConversitionSuccess: 'Add dialogue success',
|
||||
addConversitionFail: 'Add dialogue failure',
|
||||
modifyConversitionSuccess: 'Modify conversition success',
|
||||
modifyConversitionFail: 'Modify conversition failure',
|
||||
modifyConversition: 'Modify Conversition',
|
||||
modifyConversitionButton: 'modify',
|
||||
drivingByPlan: 'Driving By Plan',
|
||||
scriptBack: 'Back',
|
||||
speakTo: 'to',
|
||||
executeCommandTips: 'execute command: ',
|
||||
operate: 'Operate',
|
||||
scriptList: 'Script List',
|
||||
applyPublish: 'Apply for release',
|
||||
preview: 'Preview',
|
||||
status: 'Status',
|
||||
applyRevoke: 'Revoke',
|
||||
publish: 'Publish',
|
||||
revokeReason: 'Revoke explanation',
|
||||
language: 'language',
|
||||
chinese: 'Chinese Simplified',
|
||||
english: 'English',
|
||||
publishScript: 'Publish Script',
|
||||
releaseScriptSuccess: 'release script success',
|
||||
releaseScriptFailed: 'release script failed',
|
||||
publishScriptSuccess: 'Publish Script Success',
|
||||
publishScriptFailed: 'Publish Script Failed',
|
||||
releaseScriptTip: 'This action will apply to release script, whether to continue?',
|
||||
revokeScriptTip: 'This action will undo release script, whether to continue?',
|
||||
inputScriptName: 'Please input script name',
|
||||
selectMap: 'Please select map',
|
||||
inputScriptDescription: 'Please input script description'
|
||||
addCommandButton: 'Add Command',
|
||||
addConversitionButton: 'Add Dialogue',
|
||||
conversitionContentRules: 'Please input content',
|
||||
addCommandSucess: 'Add command sucess',
|
||||
addCommandFail: 'Add command failure',
|
||||
addConversitionSuccess: 'Add dialogue success',
|
||||
addConversitionFail: 'Add dialogue failure',
|
||||
modifyConversitionSuccess: 'Modify conversition success',
|
||||
modifyConversitionFail: 'Modify conversition failure',
|
||||
modifyConversition: 'Modify Conversition',
|
||||
modifyConversitionButton: 'modify',
|
||||
drivingByPlan: 'Driving By Plan',
|
||||
scriptBack: 'Back',
|
||||
speakTo: 'to',
|
||||
executeCommandTips: 'execute command: ',
|
||||
operate: 'Operate',
|
||||
scriptList: 'Script List',
|
||||
applyPublish: 'Apply for release',
|
||||
preview: 'Preview',
|
||||
status: 'Status',
|
||||
applyRevoke: 'Revoke',
|
||||
publish: 'Publish',
|
||||
revokeReason: 'Revoke explanation',
|
||||
language: 'language',
|
||||
chinese: 'Chinese Simplified',
|
||||
english: 'English',
|
||||
publishScript: 'Publish Script',
|
||||
releaseScriptSuccess: 'release script success',
|
||||
releaseScriptFailed: 'release script failed',
|
||||
publishScriptSuccess: 'Publish Script Success',
|
||||
publishScriptFailed: 'Publish Script Failed',
|
||||
releaseScriptTip: 'This action will apply to release script, whether to continue?',
|
||||
revokeScriptTip: 'This action will undo release script, whether to continue?',
|
||||
inputScriptName: 'Please input script name',
|
||||
selectMap: 'Please select map',
|
||||
inputScriptDescription: 'Please input script description'
|
||||
};
|
||||
|
@ -1,52 +1,57 @@
|
||||
export default {
|
||||
code: 'Code',
|
||||
name: 'Name',
|
||||
status: 'Status',
|
||||
remarks: 'Remarks',
|
||||
createDirectory: 'Create dictionary',
|
||||
editDictionary: 'Edit dictionary',
|
||||
deleteSuccess: 'Successful deletion',
|
||||
createSuccess: 'Create successful',
|
||||
updateSuccess: 'Update successful',
|
||||
destory: 'Destory',
|
||||
simulationGroup: 'Simulation Group',
|
||||
userName: 'User Name',
|
||||
skinCode: 'Skin Code',
|
||||
prdType: 'Product Type',
|
||||
simulationType: 'Simulation Type',
|
||||
simulationGroupId: 'Simulation Member ID',
|
||||
productName: 'Product Name',
|
||||
isError: 'Is Error',
|
||||
isSuspend: 'Is Suspend',
|
||||
isDrivingAsplanned: 'Whether to drive as planned',
|
||||
wellDelUserSimulation: 'This operation will delete the user simulation data. Do you want to continue?',
|
||||
createDetail: 'Create details',
|
||||
editDetail: 'Editorial details',
|
||||
mapName: 'Map Name',
|
||||
trainingName: 'Training Name',
|
||||
trainingUseTime: 'Training Time',
|
||||
minute: 'Minute',
|
||||
second: 'Second',
|
||||
createSimulationTitle: 'Create Simulation Information',
|
||||
addSuccess: 'Added Successfully',
|
||||
pleaseInputNames: 'Please enter your nickname/name/cell phone number',
|
||||
examUser: 'Examination Users',
|
||||
examScore: 'Examination Score',
|
||||
examResult: 'Examination Results',
|
||||
examName: 'Paper Name',
|
||||
wellDelExamResult: 'This operation will delete the test result. Do you want to continue?',
|
||||
editExamDetail: 'Edit exam details',
|
||||
subscribeMap: 'Subscribe',
|
||||
roles: 'Roles',
|
||||
nickname: 'Nickname',
|
||||
wellDelType: 'This operation will delete the type. Do you want to continue?',
|
||||
permission: 'Permission',
|
||||
editUserPermission: 'Edit User Rights',
|
||||
lessonName: 'Lesson Name',
|
||||
selectTraining: 'Selection Training',
|
||||
createUserTraining: 'Creating User Training',
|
||||
editTrainingDetail: 'Editor Training Details',
|
||||
trainingTime: 'Training duration',
|
||||
subscribeToTheMapList: 'Subscribe to the map list:',
|
||||
editSimulationDetails: 'Edit simulation details'
|
||||
code: 'Code',
|
||||
name: 'Name',
|
||||
status: 'Status',
|
||||
remarks: 'Remarks',
|
||||
createDirectory: 'Create dictionary',
|
||||
editDictionary: 'Edit dictionary',
|
||||
deleteSuccess: 'Successful deletion',
|
||||
createSuccess: 'Create successful',
|
||||
updateSuccess: 'Update successful',
|
||||
destory: 'Destory',
|
||||
simulationGroup: 'Simulation Group',
|
||||
userName: 'User Name',
|
||||
skinCode: 'Skin Code',
|
||||
prdType: 'Product Type',
|
||||
simulationType: 'Simulation Type',
|
||||
simulationGroupId: 'Simulation Member ID',
|
||||
productName: 'Product Name',
|
||||
isError: 'Is Error',
|
||||
isSuspend: 'Is Suspend',
|
||||
isDrivingAsplanned: 'Whether to drive as planned',
|
||||
wellDelUserSimulation: 'This operation will delete the user simulation data. Do you want to continue?',
|
||||
createDetail: 'Create details',
|
||||
editDetail: 'Editorial details',
|
||||
mapName: 'Map Name',
|
||||
trainingName: 'Training Name',
|
||||
trainingUseTime: 'Training Time',
|
||||
minute: 'Minute',
|
||||
second: 'Second',
|
||||
createSimulationTitle: 'Create Simulation Information',
|
||||
addSuccess: 'Added Successfully',
|
||||
pleaseInputNames: 'Please enter your nickname/name/cell phone number',
|
||||
examUser: 'Examination Users',
|
||||
examScore: 'Examination Score',
|
||||
examResult: 'Examination Results',
|
||||
examName: 'Paper Name',
|
||||
wellDelExamResult: 'This operation will delete the test result. Do you want to continue?',
|
||||
editExamDetail: 'Edit exam details',
|
||||
subscribeMap: 'Subscribe',
|
||||
roles: 'Roles',
|
||||
nickname: 'Nickname',
|
||||
wellDelType: 'This operation will delete the type. Do you want to continue?',
|
||||
permission: 'Permission',
|
||||
editUserPermission: 'Edit User Rights',
|
||||
lessonName: 'Lesson Name',
|
||||
selectTraining: 'Selection Training',
|
||||
createUserTraining: 'Creating User Training',
|
||||
editTrainingDetail: 'Editor Training Details',
|
||||
trainingTime: 'Training duration',
|
||||
subscribeToTheMapList: 'Subscribe to the map list:',
|
||||
editSimulationDetails: 'Edit simulation details',
|
||||
newsBulletin: 'News bulletin:',
|
||||
newsHeadlines: 'News headlines:',
|
||||
newsContent: 'News content:',
|
||||
whetherTheNewsCanBeClosed: 'Whether the news can be closed:',
|
||||
push: 'Push'
|
||||
};
|
||||
|
@ -219,5 +219,7 @@ export default {
|
||||
setProjectSuccess: 'Set belongs project success!',
|
||||
setProjectFail: 'Set belongs project fail!',
|
||||
copyMapSuccess: 'Copy map success!',
|
||||
copyMapFail: 'Copy map fail!'
|
||||
copyMapFail: 'Copy map fail!',
|
||||
pushNewsSuccess: 'Push news success!',
|
||||
pushNewsFailed: 'Push news failed!'
|
||||
};
|
||||
|
@ -1,36 +1,37 @@
|
||||
export default {
|
||||
comprehensiveTrainingManager: 'Comprehensive training manager:',
|
||||
comprehensiveDrillRoom: 'Comprehensive drill room',
|
||||
numberOfAssignableRoles: 'Number of assignable roles:',
|
||||
dispatcher: 'Dispatcher',
|
||||
increaseDispatchers: 'Increase dispatchers',
|
||||
stationAttendant: 'Station attendant',
|
||||
increaseStationAttendant: 'Increase station attendant',
|
||||
teacher: 'Teacher',
|
||||
increaseTeacher: 'Increase teacher',
|
||||
universalAccount: 'Universal Account',
|
||||
increaseUniversalAccount: 'Increase universal account',
|
||||
driver: 'Driver',
|
||||
increaseDriver: 'Increase driver',
|
||||
bigScreen: 'Big screen',
|
||||
increaseBigScreen: 'Increase big screen',
|
||||
destroyRoom: 'Destroy room',
|
||||
generatingQRCode: 'Generating QRCode',
|
||||
startSimulation: 'Start simulation',
|
||||
enterSimulation: 'Enter simulation',
|
||||
endSimulation: 'End Simulation',
|
||||
distributeTheRoomQRCode: 'Distribute the room QR code',
|
||||
increaseIbp: 'increase IBP',
|
||||
kickOutTheRoom: 'Kick out the room',
|
||||
sending: 'sending...',
|
||||
holdAndTalk: 'Hold and talk',
|
||||
recording: 'recording...',
|
||||
sendText: 'Send text',
|
||||
left: 'left',
|
||||
right: 'right',
|
||||
realDevice: 'Real device',
|
||||
plcGatewayOnline: '[PLC gateway online]',
|
||||
plcGatewayOffline: '[PLC gateway offline]',
|
||||
uplinkPlatform: 'Uplink platform',
|
||||
downlinkPlatform: 'Downlink platform'
|
||||
comprehensiveTrainingManager: 'Comprehensive training manager:',
|
||||
comprehensiveDrillRoom: 'Comprehensive drill room',
|
||||
numberOfAssignableRoles: 'Number of assignable roles:',
|
||||
dispatcher: 'Dispatcher',
|
||||
increaseDispatchers: 'Increase dispatchers',
|
||||
stationAttendant: 'Station attendant',
|
||||
increaseStationAttendant: 'Increase station attendant',
|
||||
teacher: 'Teacher',
|
||||
increaseTeacher: 'Increase teacher',
|
||||
universalAccount: 'Universal Account',
|
||||
increaseUniversalAccount: 'Increase universal account',
|
||||
driver: 'Driver',
|
||||
increaseDriver: 'Increase driver',
|
||||
bigScreen: 'Big screen',
|
||||
increaseBigScreen: 'Increase big screen',
|
||||
destroyRoom: 'Destroy room',
|
||||
generatingQRCode: 'Generating QRCode',
|
||||
startSimulation: 'Start simulation',
|
||||
enterSimulation: 'Enter simulation',
|
||||
endSimulation: 'End Simulation',
|
||||
distributeTheRoomQRCode: 'Distribute the room QR code',
|
||||
increaseIbp: 'increase IBP',
|
||||
kickOutTheRoom: 'Kick out the room',
|
||||
sending: 'sending...',
|
||||
holdAndTalk: 'Hold and talk',
|
||||
recording: 'recording...',
|
||||
sendText: 'Send text',
|
||||
left: 'left',
|
||||
right: 'right',
|
||||
realDevice: 'Real device',
|
||||
plcGatewayOnline: '[PLC gateway online]',
|
||||
plcGatewayOffline: '[PLC gateway offline]',
|
||||
uplinkPlatform: 'Uplink platform',
|
||||
downlinkPlatform: 'Downlink platform',
|
||||
ibp:'IBP'
|
||||
};
|
||||
|
@ -10,6 +10,7 @@ export default {
|
||||
deleteFailed: '删除失败',
|
||||
exportFailed: '导出执行异常',
|
||||
getListFailed: '获取列表数据失败',
|
||||
getPermissionListFailed: '获取权限列表数据失败',
|
||||
getDistributeQrcodeFailed: '获取权限分发二维码失败',
|
||||
obtainMaxNumberFailed: '获取用户最大权限个数失败',
|
||||
getTransferQrcodeFailed: '获取权限转赠二维码失败',
|
||||
@ -102,5 +103,6 @@ export default {
|
||||
connectToRealDeviceFailed: '关联真实设备失败!',
|
||||
getRealDeviceListFailed: '获取真实设备列表失败!',
|
||||
deleteRealDeviceFailed: '删除真实设备失败!',
|
||||
checkTheValidityFirst: '请先进行有效性检查!'
|
||||
checkTheValidityFirst: '请先进行有效性检查!',
|
||||
permissionAtLeast:'至少有一种权限的数量大于0'
|
||||
};
|
||||
|
@ -196,5 +196,6 @@ export default {
|
||||
america: '美国',
|
||||
companyInfo:'北京玖琏科技有限公司',
|
||||
companyTel:'联系电话: 13289398171',
|
||||
companyICP:'Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号'
|
||||
companyICP:'Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号',
|
||||
enterPermissionNum:'请输入权限数量'
|
||||
};
|
||||
|
@ -30,34 +30,34 @@ import login from './login';
|
||||
import designPlatform from './designPlatform';
|
||||
|
||||
export default {
|
||||
...cnLocale,
|
||||
map,
|
||||
global,
|
||||
router,
|
||||
lesson,
|
||||
error,
|
||||
teach,
|
||||
rules,
|
||||
scriptRecord,
|
||||
tip,
|
||||
system,
|
||||
orderAuthor,
|
||||
publish,
|
||||
permission,
|
||||
replay,
|
||||
planMonitor,
|
||||
screenMonitor,
|
||||
demonstration,
|
||||
exam,
|
||||
dashboard,
|
||||
jlmap3d,
|
||||
display,
|
||||
joinTraining,
|
||||
trainRoom,
|
||||
menu,
|
||||
ibp,
|
||||
approval,
|
||||
systemGenerate,
|
||||
login,
|
||||
designPlatform
|
||||
...cnLocale,
|
||||
map,
|
||||
global,
|
||||
router,
|
||||
lesson,
|
||||
error,
|
||||
teach,
|
||||
rules,
|
||||
scriptRecord,
|
||||
tip,
|
||||
system,
|
||||
orderAuthor,
|
||||
publish,
|
||||
permission,
|
||||
replay,
|
||||
planMonitor,
|
||||
screenMonitor,
|
||||
demonstration,
|
||||
exam,
|
||||
dashboard,
|
||||
jlmap3d,
|
||||
display,
|
||||
joinTraining,
|
||||
trainRoom,
|
||||
menu,
|
||||
ibp,
|
||||
approval,
|
||||
systemGenerate,
|
||||
login,
|
||||
designPlatform
|
||||
};
|
||||
|
@ -119,6 +119,7 @@ export default {
|
||||
explanation: '驳回说明',
|
||||
courseDetails: '课程详情',
|
||||
courseTree: '课程树:',
|
||||
mapName:'地图名称'
|
||||
mapName:'地图名称',
|
||||
copy: '复制'
|
||||
};
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -488,6 +488,7 @@ export default {
|
||||
sourceTrainWindow: '源车次窗',
|
||||
trainWindow: '车次窗',
|
||||
targetTrainWindow: '目的车次窗',
|
||||
category: '类别'
|
||||
category: '类别',
|
||||
lineCode:'线路类型'
|
||||
|
||||
};
|
||||
|
@ -1,42 +1,48 @@
|
||||
export default {
|
||||
permissionPack: '权限打包',
|
||||
setSuccess: '设置成功',
|
||||
isSureSetBelonger: '是否确定设置{name}为权限所属人?',
|
||||
setBelonger: '设置归属人',
|
||||
lessonName: '课程名称',
|
||||
mapName: '地图名称',
|
||||
mapProductName: '产品名称',
|
||||
permissionType: '权限类型',
|
||||
permissionStatus: '权限状态',
|
||||
permissionUseType: '公用/专用',
|
||||
permissionTotal: '权限总数',
|
||||
permissionRemains: '剩余权限',
|
||||
isForever: '是否永久',
|
||||
startTime: '开始时间',
|
||||
endTime: '结束时间',
|
||||
belonger: '归属人',
|
||||
userList: '用户列表',
|
||||
customPackageRules: '定制打包规则',
|
||||
addRules: '添加规则',
|
||||
package: '打包',
|
||||
getQrcode: '获取二维码',
|
||||
hasExitRule: '已存在此类型规则',
|
||||
pleaseAddRule: '请添加规则',
|
||||
selectDate: '选择时间',
|
||||
addPermissionPackageRule: '增加权限打包规则',
|
||||
editPermissionPackageRule: '编辑权限打包规则',
|
||||
restPermissionMaxNumber: '(剩余最大权限个数:{0})',
|
||||
pleaseSelectTransferPermission: '选择转赠权限',
|
||||
permissionName: '权限名称',
|
||||
private: '专用',
|
||||
public: '公用',
|
||||
selectPermission: '选择权限',
|
||||
createOrder: '创建订单',
|
||||
checkCode: '查看二维码',
|
||||
goodsName: '商品名称',
|
||||
price: '价格',
|
||||
permissionList: '查看权限列表',
|
||||
lastShep: '上一步',
|
||||
userName: '用户名称',
|
||||
statusType: '状态类型'
|
||||
permissionPack: '权限打包',
|
||||
setSuccess: '设置成功',
|
||||
isSureSetBelonger: '是否确定设置{name}为权限所属人?',
|
||||
setBelonger: '设置归属人',
|
||||
lessonName: '课程名称',
|
||||
mapName: '地图名称',
|
||||
mapProductName: '产品名称',
|
||||
permissionType: '权限类型',
|
||||
permissionStatus: '权限状态',
|
||||
permissionUseType: '公用/专用',
|
||||
permissionTotal: '权限总数',
|
||||
permissionRemains: '剩余权限',
|
||||
isForever: '是否永久',
|
||||
startTime: '开始时间',
|
||||
endTime: '结束时间',
|
||||
belonger: '归属人',
|
||||
userList: '用户列表',
|
||||
customPackageRules: '定制打包规则',
|
||||
addRules: '添加规则',
|
||||
package: '打包',
|
||||
getQrcode: '获取二维码',
|
||||
hasExitRule: '已存在此类型规则',
|
||||
pleaseAddRule: '请添加规则',
|
||||
selectDate: '选择时间',
|
||||
addPermissionPackageRule: '增加权限打包规则',
|
||||
editPermissionPackageRule: '编辑权限打包规则',
|
||||
restPermissionMaxNumber: '(剩余最大权限个数:{0})',
|
||||
pleaseSelectTransferPermission: '选择转赠权限',
|
||||
permissionName: '权限名称',
|
||||
private: '专用',
|
||||
public: '公用',
|
||||
selectPermission: '选择权限',
|
||||
createOrder: '创建订单',
|
||||
checkCode: '查看二维码',
|
||||
goodsName: '商品名称',
|
||||
price: '价格',
|
||||
permissionList: '查看权限列表',
|
||||
lastShep: '上一步',
|
||||
userName: '用户名称',
|
||||
statusType: '状态类型',
|
||||
isPackage:'是否万能',
|
||||
numOfDistribute:'分发权限数量',
|
||||
numOfTransfer:'转赠权限数量',
|
||||
transferTips:'一次可以领取多个权限,领到的权限可以继续转赠',
|
||||
distributeTips:'一次只能领取一个权限,领到的权限是专用权限,不可再次分发'
|
||||
|
||||
};
|
||||
|
@ -123,5 +123,8 @@ export default {
|
||||
theBelongsProjectCannotBeEmpty: '所属项目不能为空',
|
||||
pleaseSelectTheBelongsProject: '请选择归属项目',
|
||||
copyMapAs: '复制地图为',
|
||||
whetherToCopyData: '是否复制数据'
|
||||
whetherToCopyData: '是否复制数据',
|
||||
copy:'复制',
|
||||
lineType:'线路类型',
|
||||
belongsToMap: '所属地图'
|
||||
};
|
||||
|
@ -5,6 +5,7 @@ export default {
|
||||
designUserPage: '个人地图',
|
||||
|
||||
mapManage: '地图管理',
|
||||
skinManage: '皮肤管理',
|
||||
mapDraw: '地图绘制',
|
||||
runPlanManage: '运行图管理',
|
||||
productEdit: '产品编辑',
|
||||
@ -67,5 +68,6 @@ export default {
|
||||
courseApplication: '课程发布申请',
|
||||
scriptReleaseApplication: '剧本发布申请',
|
||||
runGraphReleaseApplication: '运行图发布申请',
|
||||
subsystemGeneration: '子系统生成'
|
||||
subsystemGeneration: '子系统生成',
|
||||
newsBulletin: '消息公告'
|
||||
};
|
||||
|
@ -1,316 +1,321 @@
|
||||
export default {
|
||||
pleaseSelect: '请选择',
|
||||
selectEquipment: '请选择设备',
|
||||
deviceTypeNotNull: '设备类型码不能为空',
|
||||
operationTypeNotNull: '操作码不能为空',
|
||||
tipsNotNull: '提示信息不能为空',
|
||||
pleaseSelectEncoding: '请选择唯一编码',
|
||||
pleaseEnterStatusSignal: '请输入状态信号名称',
|
||||
pleaseEnterXCoordinate: '请输入x坐标',
|
||||
pleaseEnterYCoordinate: '请输入y坐标',
|
||||
pleaseSelect: '请选择',
|
||||
selectEquipment: '请选择设备',
|
||||
deviceTypeNotNull: '设备类型码不能为空',
|
||||
operationTypeNotNull: '操作码不能为空',
|
||||
tipsNotNull: '提示信息不能为空',
|
||||
pleaseSelectEncoding: '请选择唯一编码',
|
||||
pleaseEnterStatusSignal: '请输入状态信号名称',
|
||||
pleaseEnterXCoordinate: '请输入x坐标',
|
||||
pleaseEnterYCoordinate: '请输入y坐标',
|
||||
|
||||
pleaseSelectLine: '请选择Line',
|
||||
pleaseSelectLineType: '请选择Line类型',
|
||||
pleaseSelectLineWidth: '请输入线条宽度',
|
||||
pleaseSelectLine: '请选择Line',
|
||||
pleaseSelectLineType: '请选择Line类型',
|
||||
pleaseSelectLineWidth: '请输入线条宽度',
|
||||
|
||||
linkXCoordinate: '请输入Link x坐标',
|
||||
linkYCoordinate: '请输入Link y坐标',
|
||||
linkEnterLength: '请输入显示长度',
|
||||
linkEnterDisplayLength: '请输入真实长度',
|
||||
linkXCoordinate: '请输入Link x坐标',
|
||||
linkYCoordinate: '请输入Link y坐标',
|
||||
linkEnterLength: '请输入显示长度',
|
||||
linkEnterDisplayLength: '请输入真实长度',
|
||||
|
||||
linkSelectBase: '请选择基础Link',
|
||||
linkEnterLeft: '请输入左侧正向Link',
|
||||
linkEnterRight: '请输入右侧正向Link',
|
||||
linkSelectName: '请输入Link名称',
|
||||
linkSelectDisplayLength: '请输入Link实际长度',
|
||||
linkSelectBase: '请选择基础Link',
|
||||
linkEnterLeft: '请输入左侧正向Link',
|
||||
linkEnterRight: '请输入右侧正向Link',
|
||||
linkSelectName: '请输入Link名称',
|
||||
linkSelectDisplayLength: '请输入Link实际长度',
|
||||
|
||||
lengthShow: '显示长度:',
|
||||
lengthFact: '真实长度:',
|
||||
color: '颜色:',
|
||||
lengthShow: '显示长度:',
|
||||
lengthFact: '真实长度:',
|
||||
color: '颜色:',
|
||||
|
||||
pointX: '坐标 x:',
|
||||
pointY: '坐标 y:',
|
||||
direct: '方向:',
|
||||
basisLink: '基础Link:',
|
||||
pointX: '坐标 x:',
|
||||
pointY: '坐标 y:',
|
||||
direct: '方向:',
|
||||
basisLink: '基础Link:',
|
||||
|
||||
pleaseSelectSectionName: '请选择区段名称',
|
||||
pleaseFillOffset: '请填写偏移量',
|
||||
pleaseFillValue: '请填写数值',
|
||||
pleaseSelectLeftSectionName: '请选择左侧区段名称',
|
||||
pleaseSelectRightSectionName: '请选择右侧区段名称',
|
||||
pleaseEnterYValue: '请输入坐标Y值',
|
||||
pleaseEnterSectionType: '请输入区段类型',
|
||||
pleaseEnterSectionName: '请输入区段名称',
|
||||
pleaseSelectAssociatedPlatform: '请选择关联站台',
|
||||
pleaseEnterLeftStopPointOffset: '请输入左向停车点偏移量',
|
||||
rightStopPointOffset: '请输入右向停车点偏移量',
|
||||
destinationCode: '请输入目的地码',
|
||||
destinationCodePointX: '请输入目的地码坐标X',
|
||||
destinationCodePointY: '请输入目的地码坐标Y',
|
||||
sectionNamePointX: '请输入区段名称坐标X',
|
||||
sectionNamePointY: '请输入区段名称坐标Y',
|
||||
logicSectionNameSort: '请选择逻辑区段名称排序',
|
||||
sectionOffsetLeft: '请输入左侧Link偏移量',
|
||||
sectionSepTypeLeft: '请选择左侧分隔符',
|
||||
sectionOffsetRight: '请输入右侧Link偏移量',
|
||||
sectionSepTypeRight: '请选择右侧分隔符',
|
||||
selectPhysicalExtentName: '请选择物理区段名称',
|
||||
pleaseSelectSectionName: '请选择区段名称',
|
||||
pleaseSelectSection: '请选择区段',
|
||||
pleaseSelectStationCode: '请选择设备集中站',
|
||||
pleaseFillOffset: '请填写偏移量',
|
||||
pleaseFillValue: '请填写数值',
|
||||
pleaseSelectLeftSectionName: '请选择左侧区段名称',
|
||||
pleaseSelectRightSectionName: '请选择右侧区段名称',
|
||||
pleaseEnterYValue: '请输入坐标Y值',
|
||||
pleaseEnterSectionType: '请输入区段类型',
|
||||
pleaseEnterSectionName: '请输入区段名称',
|
||||
pleaseSelectAssociatedPlatform: '请选择关联站台',
|
||||
pleaseEnterLeftStopPointOffset: '请输入左向停车点偏移量',
|
||||
rightStopPointOffset: '请输入右向停车点偏移量',
|
||||
destinationCode: '请输入目的地码',
|
||||
destinationCodePointX: '请输入目的地码坐标X',
|
||||
destinationCodePointY: '请输入目的地码坐标Y',
|
||||
sectionNamePointX: '请输入区段名称坐标X',
|
||||
sectionNamePointY: '请输入区段名称坐标Y',
|
||||
logicSectionNameSort: '请选择逻辑区段名称排序',
|
||||
sectionOffsetLeft: '请输入左侧Link偏移量',
|
||||
sectionSepTypeLeft: '请选择左侧分隔符',
|
||||
sectionOffsetRight: '请输入右侧Link偏移量',
|
||||
sectionSepTypeRight: '请选择右侧分隔符',
|
||||
selectPhysicalExtentName: '请选择物理区段名称',
|
||||
|
||||
pleaseEnterSemaphoreName: '请输入信号灯名称',
|
||||
pleaseEnterSignalName: '请输入信号机唯一名称',
|
||||
pleaseEnterSignalOffset: '请输入偏移量',
|
||||
pleaseEnterSignalStation: '请输入设备集中站',
|
||||
pleaseEnterSignalPositionX: '请输入信号机x',
|
||||
pleaseEnterSignalPositionY: '请输入信号机y',
|
||||
signalButtonPositionX: '请输入按钮x',
|
||||
signalButtonPositionY: '请输入按钮y',
|
||||
signalGuidePositionX: '请输入引导信号x',
|
||||
signalGuidePositionY: '请输入引导信号y',
|
||||
pleaseEnterSemaphoreName: '请输入信号灯名称',
|
||||
pleaseEnterSignalName: '请输入信号机唯一名称',
|
||||
pleaseEnterSignalOffset: '请输入偏移量',
|
||||
pleaseEnterSignalStation: '请输入设备集中站',
|
||||
pleaseEnterSignalPositionX: '请输入信号机x',
|
||||
pleaseEnterSignalPositionY: '请输入信号机y',
|
||||
signalButtonPositionX: '请输入按钮x',
|
||||
signalButtonPositionY: '请输入按钮y',
|
||||
signalGuidePositionX: '请输入引导信号x',
|
||||
signalGuidePositionY: '请输入引导信号y',
|
||||
|
||||
stationName: '请输入车站名称',
|
||||
stationKmRange: '请输入公里标距离',
|
||||
stationKmPost: '请输入公里标名称',
|
||||
stationName: '请输入车站名称',
|
||||
stationKmRange: '请输入公里标距离',
|
||||
stationKmPost: '请输入公里标名称',
|
||||
|
||||
stationControlStationName: '请选择车站名称',
|
||||
stationControlStationCode: '请选择所属车站',
|
||||
stationControlZokContent: '请输入中控内容',
|
||||
stationControlZakContent: '请输入站控内容',
|
||||
stationControlJjzkContent: '请输入紧急站控内容',
|
||||
stationControlZzkContent: '请输入站中控内容',
|
||||
stationControlPositionX: '请输入坐标x',
|
||||
stationControlPositionY: '请输入坐标y',
|
||||
stationControlStationName: '请选择车站名称',
|
||||
stationControlStationCode: '请选择所属车站',
|
||||
stationControlZokContent: '请输入中控内容',
|
||||
stationControlZakContent: '请输入站控内容',
|
||||
stationControlJjzkContent: '请输入紧急站控内容',
|
||||
stationControlZzkContent: '请输入站中控内容',
|
||||
stationControlPositionX: '请输入坐标x',
|
||||
stationControlPositionY: '请输入坐标y',
|
||||
|
||||
pleaseReSelectDevice: '请重新选择设备',
|
||||
stationCode: '请选择关联车站',
|
||||
stationstandCountName: '请输入计数器名称',
|
||||
doorLocationType: '请选择站台方向',
|
||||
deviceStationCode: '请选择所属设备集中站',
|
||||
stationstandDirection: '请选择上下行方向',
|
||||
stationstandWidth: '请输入车站宽度',
|
||||
stationstandHeight: '请输入车站高度',
|
||||
pleaseReSelectDevice: '请重新选择设备',
|
||||
stationCode: '请选择关联车站',
|
||||
stationstandCountName: '请输入计数器名称',
|
||||
doorLocationType: '请选择站台方向',
|
||||
deviceStationCode: '请选择所属设备集中站',
|
||||
stationstandDirection: '请选择上下行方向',
|
||||
stationstandWidth: '请输入车站宽度',
|
||||
stationstandHeight: '请输入车站高度',
|
||||
|
||||
switchName: '请输入道岔名称',
|
||||
switchNamePointX: '请输入道岔名称坐标x',
|
||||
switchNamePointY: '请输入道岔名称坐标y',
|
||||
switchStationCode: '请输入设备集中站',
|
||||
switchTurnTime: '请输入道岔转换时间',
|
||||
switchTpX: '请输入时间坐标x',
|
||||
switchTpY: '请输入时间坐标y',
|
||||
switchName: '请输入道岔名称',
|
||||
switchNamePointX: '请输入道岔名称坐标x',
|
||||
switchNamePointY: '请输入道岔名称坐标y',
|
||||
switchStationCode: '请输入设备集中站',
|
||||
switchTurnTime: '请输入道岔转换时间',
|
||||
switchTpX: '请输入时间坐标x',
|
||||
switchTpY: '请输入时间坐标y',
|
||||
|
||||
selectText: '请选择Text',
|
||||
pleaseEnterContent: '请输入内容',
|
||||
textFont: '请选择文字格式',
|
||||
textFontColor: '请选择文字颜色',
|
||||
pleaseEnterGroupNumber: '请输入车组号',
|
||||
selectTrainType: '请选择车类型',
|
||||
trainPositionX: '请输入x坐标位置',
|
||||
trainPositionY: '请输入y坐标位置',
|
||||
pleaseEnterTrainNumber: '请填写车组号',
|
||||
selectText: '请选择Text',
|
||||
pleaseEnterContent: '请输入内容',
|
||||
textFont: '请选择文字格式',
|
||||
textFontColor: '请选择文字颜色',
|
||||
pleaseEnterGroupNumber: '请输入车组号',
|
||||
selectTrainType: '请选择车类型',
|
||||
trainPositionX: '请输入x坐标位置',
|
||||
trainPositionY: '请输入y坐标位置',
|
||||
pleaseEnterTrainNumber: '请填写车组号',
|
||||
|
||||
trainCode: '列车模型Code不能为空',
|
||||
pleaseEnterTrainTypeName: '请输入列车类型名称',
|
||||
trainLength: '请输入列车长度',
|
||||
safeDistance: '请输入安全距离',
|
||||
maxSafeDistance: '请输入最大安全距离',
|
||||
averageVelocity: '请输入平均速度',
|
||||
averageDeceleration: '请输入平均减速度',
|
||||
defaultVelocity: '请输入默认速度',
|
||||
maxVelocity: '请输入最大速度',
|
||||
trainCode: '列车模型Code不能为空',
|
||||
pleaseEnterTrainTypeName: '请输入列车类型名称',
|
||||
trainLength: '请输入列车长度',
|
||||
safeDistance: '请输入安全距离',
|
||||
maxSafeDistance: '请输入最大安全距离',
|
||||
averageVelocity: '请输入平均速度',
|
||||
averageDeceleration: '请输入平均减速度',
|
||||
defaultVelocity: '请输入默认速度',
|
||||
maxVelocity: '请输入最大速度',
|
||||
|
||||
trainWindowWidth: '请输入车次窗宽度',
|
||||
trainWindowHeight: '请输入车次窗高度',
|
||||
trainWindowSectionCode: '请输入关联区段',
|
||||
trainWindowWidth: '请输入车次窗宽度',
|
||||
trainWindowHeight: '请输入车次窗高度',
|
||||
trainWindowSectionCode: '请输入关联区段',
|
||||
|
||||
visible: '请选择是否可见',
|
||||
pleaseSelectStartSignal: '请选择开始信号机',
|
||||
pleaseSelectEndSignal: '请选择结束信号机',
|
||||
visible: '请选择是否可见',
|
||||
pleaseSelectStartSignal: '请选择开始信号机',
|
||||
pleaseSelectEndSignal: '请选择结束信号机',
|
||||
|
||||
pleaseEnterPathName: '请输入进路名称',
|
||||
proximitySection: '请选择接近区段',
|
||||
accessPropertyType: '请选择进路性质类型',
|
||||
autoAccessType: '请选择自动进路类型',
|
||||
physicalSegmentData: '请选择进路物理区段数据',
|
||||
pleaseEnterPathName: '请输入进路名称',
|
||||
proximitySection: '请选择接近区段',
|
||||
accessPropertyType: '请选择进路性质类型',
|
||||
autoAccessType: '请选择自动进路类型',
|
||||
physicalSegmentData: '请选择进路物理区段数据',
|
||||
|
||||
routingName: '请输入交路名称',
|
||||
startStationCode: '请选择起始车站',
|
||||
startSectionCode: '请选择起始区段',
|
||||
endStationCode: '请选择终到车站',
|
||||
endSectionCode: '请选择终到区段',
|
||||
routingName: '请输入交路名称',
|
||||
startStationCode: '请选择起始车站',
|
||||
startSectionCode: '请选择起始区段',
|
||||
endStationCode: '请选择终到车站',
|
||||
endSectionCode: '请选择终到区段',
|
||||
|
||||
selectTurnoutID: '请选择道岔ID',
|
||||
switchesCannot: '道岔不能为同一个',
|
||||
selectTurnoutID: '请选择道岔ID',
|
||||
switchesCannot: '道岔不能为同一个',
|
||||
|
||||
pleaseInputName: '请输入名称',
|
||||
pleaseInputNickName: '请输入昵称',
|
||||
pleaseSelectStatus: '请选择状态',
|
||||
pleaseInputCode: '请输入编码',
|
||||
strLength1To25: '长度在 1 到 25 个字符',
|
||||
strLengthNotExceed50: '不能超过 50 个字符',
|
||||
pleaseSelectCity: '请选择城市',
|
||||
pleaseInputName: '请输入名称',
|
||||
pleaseInputNickName: '请输入昵称',
|
||||
pleaseSelectStatus: '请选择状态',
|
||||
pleaseInputCode: '请输入编码',
|
||||
strLength1To25: '长度在 1 到 25 个字符',
|
||||
strLengthNotExceed50: '不能超过 50 个字符',
|
||||
pleaseSelectCity: '请选择城市',
|
||||
|
||||
pleaseEnterMapName: '请输入地图名称',
|
||||
pleaseChooseSkinCode: '请选择皮肤风格',
|
||||
pleaseSelectMapSource: '请选择地图来源',
|
||||
pleaseSelectAssociatedCity: '请选择关联城市',
|
||||
pleaseSelectAssociatedSkin: '请选择关联皮肤',
|
||||
pleaseEnteMapLinkWidth: '请输入地图Link宽度',
|
||||
pleaseEnterMapSectionWidth: '请输入地图区段宽度',
|
||||
organizationInput: '请输入组织或者企业名称',
|
||||
productSelect: '请选择商品',
|
||||
itemPricingInput: '请输入商品单价',
|
||||
orderTypeSelect: '请选择订单类型',
|
||||
contractNumberInput: '请输入合同编号',
|
||||
salesmanInput: '请选择销售人员',
|
||||
authorAmountInput: '请输入购买的权限个数',
|
||||
authorAmountInputError: '请输入有效权限个数',
|
||||
totalPriceInput: '请输入总价格',
|
||||
totalPriceInputError1: '请输入的价格在两位小数',
|
||||
totalPriceInputError2: '请输入有效总价格',
|
||||
monthAmountInput: '请输入购买月数',
|
||||
monthAmountInputError: '请输入有效购买月数',
|
||||
startTimePick: '请选择开始日期',
|
||||
bizTypeSelect: '请选择业务类型',
|
||||
payWaysSelect: '请选择支付方式',
|
||||
payStatusSelect: '请选择支付状态',
|
||||
goodsNameInput: '请输入商品名称',
|
||||
productTypeInput: '请选择产品类型',
|
||||
mapInput: '请选择地图',
|
||||
productInput: '请选择产品',
|
||||
lessonInput: '请选择课程',
|
||||
trialTimeInput: '请输入试用时长',
|
||||
unitOfTimeRadio: '请选择时间单位',
|
||||
goodsDescribtionInput: '请输入商品描述',
|
||||
userNameInput: '请输入用户名称',
|
||||
permissionTypeInput: '请选择权限类型',
|
||||
timeInput: '请输入时长',
|
||||
chooseUser: '请选择用户',
|
||||
pleaseInputLessonName: '请输入课程名称',
|
||||
pleaseSelectTraining: '请选择实训',
|
||||
sectionRelSwitchCode: '请选择关联道岔',
|
||||
pleaseEnterMapName: '请输入地图名称',
|
||||
pleaseChooseSkinCode: '请选择皮肤风格',
|
||||
pleaseSelectMapSource: '请选择地图来源',
|
||||
pleaseSelectAssociatedCity: '请选择关联城市',
|
||||
pleaseSelectAssociatedSkin: '请选择关联皮肤',
|
||||
pleaseEnteMapLinkWidth: '请输入地图Link宽度',
|
||||
pleaseEnterMapSectionWidth: '请输入地图区段宽度',
|
||||
organizationInput: '请输入组织或者企业名称',
|
||||
productSelect: '请选择商品',
|
||||
itemPricingInput: '请输入商品单价',
|
||||
orderTypeSelect: '请选择订单类型',
|
||||
contractNumberInput: '请输入合同编号',
|
||||
salesmanInput: '请选择销售人员',
|
||||
authorAmountInput: '请输入购买的权限个数',
|
||||
authorAmountInputError: '请输入有效权限个数',
|
||||
totalPriceInput: '请输入总价格',
|
||||
totalPriceInputError1: '请输入的价格在两位小数',
|
||||
totalPriceInputError2: '请输入有效总价格',
|
||||
monthAmountInput: '请输入购买月数',
|
||||
monthAmountInputError: '请输入有效购买月数',
|
||||
startTimePick: '请选择开始日期',
|
||||
bizTypeSelect: '请选择业务类型',
|
||||
payWaysSelect: '请选择支付方式',
|
||||
payStatusSelect: '请选择支付状态',
|
||||
goodsNameInput: '请输入商品名称',
|
||||
productTypeInput: '请选择产品类型',
|
||||
mapInput: '请选择地图',
|
||||
productInput: '请选择产品',
|
||||
lessonInput: '请选择课程',
|
||||
trialTimeInput: '请输入试用时长',
|
||||
unitOfTimeRadio: '请选择时间单位',
|
||||
goodsDescribtionInput: '请输入商品描述',
|
||||
userNameInput: '请输入用户名称',
|
||||
permissionTypeInput: '请选择权限类型',
|
||||
timeInput: '请输入时长',
|
||||
chooseUser: '请选择用户',
|
||||
pleaseInputLessonName: '请输入课程名称',
|
||||
pleaseSelectTraining: '请选择实训',
|
||||
sectionRelSwitchCode: '请选择关联道岔',
|
||||
|
||||
maxScaling: '(缩放比例最大为8级)',
|
||||
skinCodingInput: '请输入皮肤编码',
|
||||
skinDesignationInput: '请输入皮肤名称',
|
||||
coordinatesOriginInput: '请输入原点坐标',
|
||||
scalingInput: '请输入缩放比例',
|
||||
scalingInputPrompt: '请输入有效的缩放比例',
|
||||
selectImportFiles: '请选择需要导入的文件',
|
||||
speedLevelEnter1: '请输入速度等级1',
|
||||
speedLevelEnter2: '请输入速度等级2',
|
||||
speedLevelEnter3: '请输入速度等级3',
|
||||
speedLevelEnter4: '请输入速度等级4',
|
||||
drivingDirectionSelect: '请选择行驶方向',
|
||||
timeBetweenDeparturesEnter: '请输入发车间隔时间',
|
||||
stopTimeEnter: '请输入停靠时间',
|
||||
entranceStationSelect: '请选择入站口',
|
||||
exportStationSelect: '请选择出站口',
|
||||
selectDataRange: '请选择数据范围区间',
|
||||
productCodeEnter: '请输入产品编码',
|
||||
productNameEnter: '请输入产品名称',
|
||||
productDescriptionEnter: '请输入产品说明',
|
||||
trainingTypeSelect: '请选择关联实训类型',
|
||||
linkWidthInput: '请输入Link宽度',
|
||||
linkWidthInputPrompt: '请输入有效Link宽度',
|
||||
sectionWidthInput: '请输入区段宽度',
|
||||
sectionWidthInputPrompt: '请输入有效区段宽度',
|
||||
selectShowWatermark: '请选择是否水印',
|
||||
maxScaling: '(缩放比例最大为8级)',
|
||||
skinCodingInput: '请输入皮肤编码',
|
||||
skinDesignationInput: '请输入皮肤名称',
|
||||
coordinatesOriginInput: '请输入原点坐标',
|
||||
scalingInput: '请输入缩放比例',
|
||||
scalingInputPrompt: '请输入有效的缩放比例',
|
||||
selectImportFiles: '请选择需要导入的文件',
|
||||
speedLevelEnter1: '请输入速度等级1',
|
||||
speedLevelEnter2: '请输入速度等级2',
|
||||
speedLevelEnter3: '请输入速度等级3',
|
||||
speedLevelEnter4: '请输入速度等级4',
|
||||
drivingDirectionSelect: '请选择行驶方向',
|
||||
timeBetweenDeparturesEnter: '请输入发车间隔时间',
|
||||
stopTimeEnter: '请输入停靠时间',
|
||||
entranceStationSelect: '请选择入站口',
|
||||
exportStationSelect: '请选择出站口',
|
||||
selectDataRange: '请选择数据范围区间',
|
||||
productCodeEnter: '请输入产品编码',
|
||||
productNameEnter: '请输入产品名称',
|
||||
productDescriptionEnter: '请输入产品说明',
|
||||
trainingTypeSelect: '请选择关联实训类型',
|
||||
linkWidthInput: '请输入Link宽度',
|
||||
linkWidthInputPrompt: '请输入有效Link宽度',
|
||||
sectionWidthInput: '请输入区段宽度',
|
||||
sectionWidthInputPrompt: '请输入有效区段宽度',
|
||||
selectShowWatermark: '请选择是否水印',
|
||||
|
||||
courseNameEmpty: '课程名称不能为空',
|
||||
purchaseMonth: '请输入购买月数',
|
||||
accessNumber: '请输入权限数量',
|
||||
pleaseInputMapName: '请输入地图名称',
|
||||
inputTemplateRunPlan: '请选择模板运行图',
|
||||
inputSkinType: '请选择皮肤类型',
|
||||
courseNameEmpty: '课程名称不能为空',
|
||||
purchaseMonth: '请输入购买月数',
|
||||
accessNumber: '请输入权限数量',
|
||||
pleaseInputMapName: '请输入地图名称',
|
||||
inputTemplateRunPlan: '请选择模板运行图',
|
||||
inputSkinType: '请选择皮肤类型',
|
||||
|
||||
inputTrainingName: '请输入实训名称',
|
||||
inputTrainingType: '请输入实训类型',
|
||||
inputOperationType: '请输入操作类型',
|
||||
inputMinDuration: '请输入最佳用时',
|
||||
inputMaxDuration: '请输入最大用时',
|
||||
inputTrainingRemark: '请输入实训说明',
|
||||
inputOperateCode: '请输入步骤操作码',
|
||||
inputStepNo: '请输入步骤序号',
|
||||
inputStepTips: '请输入步骤提示信息',
|
||||
selectMapName: '请选择地图名称',
|
||||
selectMapProductName: '请选择地图产品名称',
|
||||
inputTime: '请输入时间',
|
||||
inputPermissionNumber: '请输入权限个数',
|
||||
permissionNumberGreater0: '权限个数必须大于0',
|
||||
enterChapterName: '请输入章节名称',
|
||||
enterChapterInstructions: '请输入章节说明',
|
||||
selectCourseName: '请选择课程名称',
|
||||
enterCourseName: '请输入课程名称',
|
||||
selectAssociatedProduct: '请选择关联产品',
|
||||
enterCourseDescription: '请输入课程说明',
|
||||
pleaseLessonIntroduction: '请输入课程简介',
|
||||
courseIdIsEmpty: '课程Id为空',
|
||||
selectCity: '请选择城市',
|
||||
enterStandardTime: '请输入标准用时',
|
||||
enterNumericValue: '请输入数字值',
|
||||
greaterThanMinTime: '必须大于最小时间',
|
||||
selectTrainingType: '请选择实训类型',
|
||||
selectOneTrainingType: '只能选择一个实训类型',
|
||||
enterProductType: '请输入产品类型',
|
||||
selectAssociatedStation: '请选择关联的车站',
|
||||
enterScale: '请输入缩放比例',
|
||||
enterXOffset: '请输入X偏移',
|
||||
enterYOffset: '请输入Y偏移',
|
||||
pleaseSelectButtonType: '请选择按钮类型',
|
||||
pleaseSelectButtonContent: '请输入内容',
|
||||
pleaseSelectTrainDir: '请选择列车所在方向',
|
||||
pleaseEnterSplit: '请输入拆分数量',
|
||||
pleaseEnterSplitNumber: '请输入合理的拆分数量',
|
||||
inputTrainingName: '请输入实训名称',
|
||||
inputTrainingType: '请输入实训类型',
|
||||
inputOperationType: '请输入操作类型',
|
||||
inputMinDuration: '请输入最佳用时',
|
||||
inputMaxDuration: '请输入最大用时',
|
||||
inputTrainingRemark: '请输入实训说明',
|
||||
inputOperateCode: '请输入步骤操作码',
|
||||
inputStepNo: '请输入步骤序号',
|
||||
inputStepTips: '请输入步骤提示信息',
|
||||
selectMapName: '请选择地图名称',
|
||||
selectMapProductName: '请选择地图产品名称',
|
||||
inputTime: '请输入时间',
|
||||
inputPermissionNumber: '请输入权限个数',
|
||||
permissionNumberGreater0: '权限个数必须大于0',
|
||||
enterChapterName: '请输入章节名称',
|
||||
enterChapterInstructions: '请输入章节说明',
|
||||
selectCourseName: '请选择课程名称',
|
||||
enterCourseName: '请输入课程名称',
|
||||
selectAssociatedProduct: '请选择关联产品',
|
||||
enterCourseDescription: '请输入课程说明',
|
||||
pleaseLessonIntroduction: '请输入课程简介',
|
||||
courseIdIsEmpty: '课程Id为空',
|
||||
selectCity: '请选择城市',
|
||||
enterStandardTime: '请输入标准用时',
|
||||
enterNumericValue: '请输入数字值',
|
||||
greaterThanMinTime: '必须大于最小时间',
|
||||
selectTrainingType: '请选择实训类型',
|
||||
selectOneTrainingType: '只能选择一个实训类型',
|
||||
enterProductType: '请输入产品类型',
|
||||
selectAssociatedStation: '请选择关联的车站',
|
||||
enterScale: '请输入缩放比例',
|
||||
enterXOffset: '请输入X偏移',
|
||||
enterYOffset: '请输入Y偏移',
|
||||
pleaseSelectButtonType: '请选择按钮类型',
|
||||
pleaseSelectButtonContent: '请输入内容',
|
||||
pleaseSelectTrainDir: '请选择列车所在方向',
|
||||
pleaseEnterSplit: '请输入拆分数量',
|
||||
pleaseEnterSplitNumber: '请输入合理的拆分数量',
|
||||
|
||||
endTimeRules: '结束时间必须大于开始时间',
|
||||
selectCourses: '请选择课程',
|
||||
selectTheMapRoute: '请选择地图线路',
|
||||
enterKeyword: '请输入关键词',
|
||||
successfullyModified: '修改成功',
|
||||
modifyTheFailure: '修改失败',
|
||||
selectTheCourseNameFirst: '请先选择课程名称',
|
||||
selectMultiplePermissions: '请选择多个权限',
|
||||
enterPermissionName: '请输入权限名称',
|
||||
pleaseSelectPermission: '请选择权限',
|
||||
pleaseSelectTemplateRunGraph: '请选择模板运行图',
|
||||
selectTheRunningDiagramToBeLoaded: '请选择需要加载的运行图',
|
||||
selectOneOrMoreDates: '选择一个或多个日期',
|
||||
selectAPlannedDateRange: '请选择计划日期范围',
|
||||
selectGroupNumber: '请选择车组号',
|
||||
selectATrainType: '请选择一个列车类型',
|
||||
enterTheServiceNumber: '请输入表号',
|
||||
enterTheTripNumber: '请输入车次号',
|
||||
enterTheTargetCode: '请输入目的地号',
|
||||
selectStation: '请选择车站',
|
||||
pleaseEnterGoodPrice: '请输入商品价格',
|
||||
enterTheNameOfTheRunGraph: '请输入运行图名称',
|
||||
chooseToPublishTheRunGraph: '请选择发布运行图',
|
||||
enterTheAlarmCode: '请输入报警器编号',
|
||||
enterTheAlarmWidth: '请输入报警器宽度',
|
||||
enterTheEscalatorFrameCode: '请输入扶梯框编号',
|
||||
enterTheEscalatorFrameWidth: '请输入扶梯框宽度',
|
||||
enterTheEscalatorFrameHeight: '请输入扶梯框高度',
|
||||
enterTheBorderWidth: '请输入边框宽度',
|
||||
selectTheDirectionOfTheArrow: '请选择箭头方向',
|
||||
enterTheArrowCode: '请输入箭头编号',
|
||||
enterTheArrowLength: '请输入箭头长度',
|
||||
enterTheArrowWidth: '请输入箭头线宽',
|
||||
enterTheArrowColor: '请输入箭头颜色',
|
||||
enterTheBackgroundWidth: '请输入背景板宽度',
|
||||
enterTheBackgroundHeight: '请输入背景板高度',
|
||||
selectTheButtonColor: '请选择按钮颜色',
|
||||
enterTheButtonCode: '请输入按钮编号',
|
||||
enterTheButtonWidth: '请输入按钮宽度',
|
||||
enterTheDigitalClockCode: '请输入电子表编号',
|
||||
enterTheDigitalClockWidth: '请输入电子表宽度',
|
||||
selectTheStartingDirection: '请选择启动方向',
|
||||
enterTheElevatorCode: '请输入电梯编号',
|
||||
enterTheElevatorWidth: '请输入电梯宽度',
|
||||
enterTheElevatorHeight: '请输入电梯高度',
|
||||
enterTheElevatorColor: '请输入电梯颜色',
|
||||
enterTheKeyCode: '请输入钥匙编号',
|
||||
enterTheKeyWidth: '请输入钥匙宽度',
|
||||
selectTheKeyDirection: '请选择钥匙朝向',
|
||||
enterTheUpperText: '请输入上侧文字',
|
||||
enterTheLowerText: '请输入下侧文字',
|
||||
enterRejectReason: '请输入驳回说明'
|
||||
endTimeRules: '结束时间必须大于开始时间',
|
||||
selectCourses: '请选择课程',
|
||||
selectTheMapRoute: '请选择地图线路',
|
||||
enterKeyword: '请输入关键词',
|
||||
successfullyModified: '修改成功',
|
||||
modifyTheFailure: '修改失败',
|
||||
selectTheCourseNameFirst: '请先选择课程名称',
|
||||
selectMultiplePermissions: '请选择多个权限',
|
||||
enterPermissionName: '请输入权限名称',
|
||||
pleaseSelectPermission: '请选择权限',
|
||||
pleaseSelectTemplateRunGraph: '请选择模板运行图',
|
||||
selectTheRunningDiagramToBeLoaded: '请选择需要加载的运行图',
|
||||
selectOneOrMoreDates: '选择一个或多个日期',
|
||||
selectAPlannedDateRange: '请选择计划日期范围',
|
||||
selectGroupNumber: '请选择车组号',
|
||||
selectATrainType: '请选择一个列车类型',
|
||||
enterTheServiceNumber: '请输入表号',
|
||||
enterTheTripNumber: '请输入车次号',
|
||||
enterTheTargetCode: '请输入目的地号',
|
||||
selectStation: '请选择车站',
|
||||
pleaseEnterGoodPrice: '请输入商品价格',
|
||||
enterTheNameOfTheRunGraph: '请输入运行图名称',
|
||||
chooseToPublishTheRunGraph: '请选择发布运行图',
|
||||
enterTheAlarmCode: '请输入报警器编号',
|
||||
enterTheAlarmWidth: '请输入报警器宽度',
|
||||
enterTheEscalatorFrameCode: '请输入扶梯框编号',
|
||||
enterTheEscalatorFrameWidth: '请输入扶梯框宽度',
|
||||
enterTheEscalatorFrameHeight: '请输入扶梯框高度',
|
||||
enterTheBorderWidth: '请输入边框宽度',
|
||||
selectTheDirectionOfTheArrow: '请选择箭头方向',
|
||||
enterTheArrowCode: '请输入箭头编号',
|
||||
enterTheArrowLength: '请输入箭头长度',
|
||||
enterTheArrowWidth: '请输入箭头线宽',
|
||||
enterTheArrowColor: '请输入箭头颜色',
|
||||
enterTheBackgroundWidth: '请输入背景板宽度',
|
||||
enterTheBackgroundHeight: '请输入背景板高度',
|
||||
selectTheButtonColor: '请选择按钮颜色',
|
||||
enterTheButtonCode: '请输入按钮编号',
|
||||
enterTheButtonWidth: '请输入按钮宽度',
|
||||
enterTheDigitalClockCode: '请输入电子表编号',
|
||||
enterTheDigitalClockWidth: '请输入电子表宽度',
|
||||
selectTheStartingDirection: '请选择启动方向',
|
||||
enterTheElevatorCode: '请输入电梯编号',
|
||||
enterTheElevatorWidth: '请输入电梯宽度',
|
||||
enterTheElevatorHeight: '请输入电梯高度',
|
||||
enterTheElevatorColor: '请输入电梯颜色',
|
||||
enterTheKeyCode: '请输入钥匙编号',
|
||||
enterTheKeyWidth: '请输入钥匙宽度',
|
||||
selectTheKeyDirection: '请选择钥匙朝向',
|
||||
enterTheUpperText: '请输入上侧文字',
|
||||
enterTheLowerText: '请输入下侧文字',
|
||||
enterRejectReason: '请输入驳回说明',
|
||||
enterTheNewsTitle: '请输入消息标题',
|
||||
enterTheNewsContent: '请输入消息内容',
|
||||
chooseNewsCanBeClosed: '请选择消息是否可关闭'
|
||||
};
|
||||
|
@ -1,108 +1,114 @@
|
||||
export default {
|
||||
scriptTitle: '剧本录制',
|
||||
saveBackground: '保存背景',
|
||||
saveData: '保存数据',
|
||||
mapList: '地图列表',
|
||||
createScript: '创建剧本',
|
||||
modifyScript: '修改剧本',
|
||||
scriptName: '剧本名称',
|
||||
addScript: '添加剧本',
|
||||
map: '所属地图',
|
||||
scriptDescription: '剧本描述',
|
||||
submit: '确定',
|
||||
scriptNameRule: '请输入剧本名称',
|
||||
scriptDescriptionRule: '请输入剧本描述',
|
||||
createScriptSuccess: '创建剧本成功',
|
||||
createScriptFail: '创建剧本失败',
|
||||
scriptDetail: '剧本详情',
|
||||
scriptRecord: '编制',
|
||||
scriptCreate: '创建',
|
||||
scriptModify: '修改',
|
||||
scriptDelete: '删除',
|
||||
getScriptFail: '获取剧本信息失败',
|
||||
createSimulationFail: '创建仿真失败',
|
||||
modifyScriptSuccess: '修改剧本成功',
|
||||
modifyScriptFail: '修改剧本失败',
|
||||
deleteScriptTip: '此操作将删除此剧本, 是否继续?',
|
||||
deleteScriptSucess: '删除成功',
|
||||
deleteScriptFail: '删除失败',
|
||||
scriptRecordTitle: '剧本编制',
|
||||
drivingPause: '暂停',
|
||||
recoverAndExecute: '恢复并执行',
|
||||
resetScript: '重置剧本',
|
||||
pauseFail: '暂停失败',
|
||||
recoverFail: '恢复失败',
|
||||
saveBackgroundSuceess: '保存背景成功',
|
||||
updateLocationFail: '更新定位失败',
|
||||
saveBackgroundFail: '保存背景失败',
|
||||
saveDataSucess: '保存数据成功',
|
||||
saveDataFail: '保存数据失败',
|
||||
clearDataTip: '此操作将会清除已保存的编制数据, 是否继续?',
|
||||
resetDataSuccess: '重置剧本成功',
|
||||
resetDataFail: '重置剧本失败',
|
||||
scriptTitle: '剧本录制',
|
||||
saveBackground: '保存背景',
|
||||
saveData: '保存数据',
|
||||
mapList: '地图列表',
|
||||
createScript: '创建剧本',
|
||||
modifyScript: '修改剧本',
|
||||
scriptName: '剧本名称',
|
||||
addScript: '添加剧本',
|
||||
map: '所属地图',
|
||||
scriptDescription: '剧本描述',
|
||||
submit: '确定',
|
||||
scriptNameRule: '请输入剧本名称',
|
||||
scriptDescriptionRule: '请输入剧本描述',
|
||||
createScriptSuccess: '创建剧本成功',
|
||||
createScriptFail: '创建剧本失败',
|
||||
scriptDetail: '剧本详情',
|
||||
scriptRecord: '编制',
|
||||
scriptCreate: '创建',
|
||||
scriptModify: '修改',
|
||||
scriptDelete: '删除',
|
||||
getScriptFail: '获取剧本信息失败',
|
||||
createSimulationFail: '创建仿真失败',
|
||||
modifyScriptSuccess: '修改剧本成功',
|
||||
modifyScriptFail: '修改剧本失败',
|
||||
deleteScriptTip: '此操作将删除此剧本, 是否继续?',
|
||||
deleteScriptSucess: '删除成功',
|
||||
deleteScriptFail: '删除失败',
|
||||
scriptRecordTitle: '剧本编制',
|
||||
drivingPause: '暂停',
|
||||
recoverAndExecute: '恢复并执行',
|
||||
resetScript: '重置剧本',
|
||||
pauseFail: '暂停失败',
|
||||
recoverFail: '恢复失败',
|
||||
saveBackgroundSuceess: '保存背景成功',
|
||||
updateLocationFail: '更新定位失败',
|
||||
saveBackgroundFail: '保存背景失败',
|
||||
saveDataSucess: '保存数据成功',
|
||||
saveDataFail: '保存数据失败',
|
||||
clearDataTip: '此操作将会清除已保存的编制数据, 是否继续?',
|
||||
resetDataSuccess: '重置剧本成功',
|
||||
resetDataFail: '重置剧本失败',
|
||||
|
||||
allRoles: '所有角色',
|
||||
actors: '演员角色',
|
||||
roleSexMale: '男',
|
||||
roleSexFemale: '女',
|
||||
selectScriptActorSuccess: '选择剧本角色成功',
|
||||
selectScriptActorFail: '选择剧本角色失败',
|
||||
cancleScriptActorSuccess: '取消剧本角色成功',
|
||||
cancleScriptActorFail: '取消剧本角色失败',
|
||||
modifyScriptActorSexSuccess: '修改剧本成员性别成功',
|
||||
modifyScriptActorSexFail: '修改剧本成员性别失败',
|
||||
allRoles: '所有角色',
|
||||
actors: '演员角色',
|
||||
roleSexMale: '男',
|
||||
roleSexFemale: '女',
|
||||
selectScriptActorSuccess: '选择剧本角色成功',
|
||||
selectScriptActorFail: '选择剧本角色失败',
|
||||
cancleScriptActorSuccess: '取消剧本角色成功',
|
||||
cancleScriptActorFail: '取消剧本角色失败',
|
||||
modifyScriptActorSexSuccess: '修改剧本成员性别成功',
|
||||
modifyScriptActorSexFail: '修改剧本成员性别失败',
|
||||
|
||||
addConversition: '添加对话',
|
||||
narrator: '讲述者',
|
||||
narratorRules: '请选择讲述者',
|
||||
receiver: '接收者',
|
||||
receiverRules: '请选择接收者',
|
||||
conversitionContent: '内容',
|
||||
addCommand: '添加指令',
|
||||
executor: '执行者',
|
||||
executorRules: '请选择执行者',
|
||||
executeCommand: '执行指令',
|
||||
executeCommandRules: '请选择执行指令',
|
||||
startStation: '起始站台',
|
||||
startStationRules: '请选择起始站台',
|
||||
endStation: '终点站台',
|
||||
endStationRules: '请选择终点站台',
|
||||
addConversition: '添加对话',
|
||||
narrator: '讲述者',
|
||||
narratorRules: '请选择讲述者',
|
||||
receiver: '接收者',
|
||||
receiverRules: '请选择接收者',
|
||||
conversitionContent: '内容',
|
||||
addCommand: '添加指令',
|
||||
executor: '执行者',
|
||||
executorRules: '请选择执行者',
|
||||
executeCommand: '执行指令',
|
||||
executeCommandRules: '请选择执行指令',
|
||||
startStation: '起始站台',
|
||||
startStationRules: '请选择起始站台',
|
||||
endStation: '终点站台',
|
||||
endStationRules: '请选择终点站台',
|
||||
drivingMode:'列车驾驶模式',
|
||||
drivingModeRules:'请选择列车驾驶模式',
|
||||
speed:'速度',
|
||||
signal:'信号机',
|
||||
speedRules:'请输入速度',
|
||||
signalRules:'请选择信号机',
|
||||
|
||||
addCommandButton: '添加指令',
|
||||
addConversitionButton: '添加对话',
|
||||
conversitionContentRules: '请输入内容',
|
||||
addCommandSucess: '添加指令成功',
|
||||
addCommandFail: '添加指令失败',
|
||||
addConversitionSuccess: '添加对话成功',
|
||||
addConversitionFail: '添加对话失败',
|
||||
modifyConversitionSuccess: '修改对话成功',
|
||||
modifyConversitionFail: '修改对话失败',
|
||||
modifyConversition: '修改对话',
|
||||
modifyConversitionButton: '修改',
|
||||
addCommandButton: '添加指令',
|
||||
addConversitionButton: '添加对话',
|
||||
conversitionContentRules: '请输入内容',
|
||||
addCommandSucess: '添加指令成功',
|
||||
addCommandFail: '添加指令失败',
|
||||
addConversitionSuccess: '添加对话成功',
|
||||
addConversitionFail: '添加对话失败',
|
||||
modifyConversitionSuccess: '修改对话成功',
|
||||
modifyConversitionFail: '修改对话失败',
|
||||
modifyConversition: '修改对话',
|
||||
modifyConversitionButton: '修改',
|
||||
|
||||
drivingByPlan: '按计划行车',
|
||||
scriptBack: '返回',
|
||||
speakTo: '对',
|
||||
executeCommandTips: '执行指令: ',
|
||||
operate: '操作',
|
||||
scriptList: '剧本列表',
|
||||
applyPublish: '申请发布',
|
||||
preview: '预览',
|
||||
status: '状态',
|
||||
applyRevoke: '撤回',
|
||||
publish: '发布',
|
||||
revokeReason: '驳回原因',
|
||||
language: '语言',
|
||||
chinese: '中文',
|
||||
english: '英文',
|
||||
publishScript: '发布剧本',
|
||||
releaseScriptSuccess: '申请发布成功',
|
||||
releaseScriptFailed: '申请发布失败',
|
||||
publishScriptSuccess: '发布成功',
|
||||
publishScriptFailed: '发布失败',
|
||||
releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
|
||||
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
|
||||
inputScriptName: '请输入剧本',
|
||||
selectMap: '请选择地图',
|
||||
inputScriptDescription: '请输入剧本描述'
|
||||
drivingByPlan: '按计划行车',
|
||||
scriptBack: '返回',
|
||||
speakTo: '对',
|
||||
executeCommandTips: '执行指令: ',
|
||||
operate: '操作',
|
||||
scriptList: '剧本列表',
|
||||
applyPublish: '申请发布',
|
||||
preview: '预览',
|
||||
status: '状态',
|
||||
applyRevoke: '撤回',
|
||||
publish: '发布',
|
||||
revokeReason: '驳回原因',
|
||||
language: '语言',
|
||||
chinese: '中文',
|
||||
english: '英文',
|
||||
publishScript: '发布剧本',
|
||||
releaseScriptSuccess: '申请发布成功',
|
||||
releaseScriptFailed: '申请发布失败',
|
||||
publishScriptSuccess: '发布成功',
|
||||
publishScriptFailed: '发布失败',
|
||||
releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
|
||||
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
|
||||
inputScriptName: '请输入剧本',
|
||||
selectMap: '请选择地图',
|
||||
inputScriptDescription: '请输入剧本描述'
|
||||
};
|
||||
|
@ -1,52 +1,57 @@
|
||||
export default {
|
||||
code: '编码',
|
||||
name: '名称',
|
||||
status: '状态',
|
||||
remarks: '备注',
|
||||
createDirectory: '创建目录',
|
||||
editDictionary: '编辑目录',
|
||||
deleteSuccess: '删除成功',
|
||||
createSuccess: '创建成功',
|
||||
updateSuccess: '更新成功',
|
||||
destory: '销 毁',
|
||||
simulationGroup: '仿真Group',
|
||||
userName: '用户名',
|
||||
skinCode: '皮肤编号',
|
||||
prdType: '产品类型',
|
||||
simulationType: '仿真类型',
|
||||
simulationGroupId: '仿真成员ID',
|
||||
productName: '产品名称',
|
||||
isError: '是否错误',
|
||||
isSuspend: '是否暂停',
|
||||
isDrivingAsplanned: '是否按计划行车',
|
||||
wellDelUserSimulation: '此操作将删除此用户仿真数据, 是否继续?',
|
||||
createDetail: '创建明细',
|
||||
editDetail: '编辑明细',
|
||||
mapName: '地图名称',
|
||||
trainingName: '实训名称',
|
||||
trainingUseTime: '实训用时',
|
||||
minute: '分',
|
||||
second: '秒',
|
||||
createSimulationTitle: '创建仿真信息',
|
||||
addSuccess: '添加成功',
|
||||
pleaseInputNames: '请输入昵称/名字/手机号',
|
||||
examUser: '考试用户',
|
||||
examScore: '考试成绩',
|
||||
examResult: '考试结果',
|
||||
examName: '试卷名称',
|
||||
wellDelExamResult: '此操作将删除此考试结果, 是否继续?',
|
||||
editExamDetail: '编辑考试详情',
|
||||
subscribeMap: '订阅地图',
|
||||
roles: '角色',
|
||||
nickname: '昵称',
|
||||
wellDelType: '此操作将删除该类型, 是否继续?',
|
||||
permission: '权限',
|
||||
editUserPermission: '编辑用户权限',
|
||||
lessonName: '课程名称',
|
||||
selectTraining: '选择实训',
|
||||
createUserTraining: '创建用户实训',
|
||||
editTrainingDetail: '编辑实训详情',
|
||||
trainingTime: '实训时长',
|
||||
subscribeToTheMapList: '订阅地图列表:',
|
||||
editSimulationDetails: '编辑仿真详情'
|
||||
code: '编码',
|
||||
name: '名称',
|
||||
status: '状态',
|
||||
remarks: '备注',
|
||||
createDirectory: '创建目录',
|
||||
editDictionary: '编辑目录',
|
||||
deleteSuccess: '删除成功',
|
||||
createSuccess: '创建成功',
|
||||
updateSuccess: '更新成功',
|
||||
destory: '销 毁',
|
||||
simulationGroup: '仿真Group',
|
||||
userName: '用户名',
|
||||
skinCode: '皮肤编号',
|
||||
prdType: '产品类型',
|
||||
simulationType: '仿真类型',
|
||||
simulationGroupId: '仿真成员ID',
|
||||
productName: '产品名称',
|
||||
isError: '是否错误',
|
||||
isSuspend: '是否暂停',
|
||||
isDrivingAsplanned: '是否按计划行车',
|
||||
wellDelUserSimulation: '此操作将删除此用户仿真数据, 是否继续?',
|
||||
createDetail: '创建明细',
|
||||
editDetail: '编辑明细',
|
||||
mapName: '地图名称',
|
||||
trainingName: '实训名称',
|
||||
trainingUseTime: '实训用时',
|
||||
minute: '分',
|
||||
second: '秒',
|
||||
createSimulationTitle: '创建仿真信息',
|
||||
addSuccess: '添加成功',
|
||||
pleaseInputNames: '请输入昵称/名字/手机号',
|
||||
examUser: '考试用户',
|
||||
examScore: '考试成绩',
|
||||
examResult: '考试结果',
|
||||
examName: '试卷名称',
|
||||
wellDelExamResult: '此操作将删除此考试结果, 是否继续?',
|
||||
editExamDetail: '编辑考试详情',
|
||||
subscribeMap: '订阅地图',
|
||||
roles: '角色',
|
||||
nickname: '昵称',
|
||||
wellDelType: '此操作将删除该类型, 是否继续?',
|
||||
permission: '权限',
|
||||
editUserPermission: '编辑用户权限',
|
||||
lessonName: '课程名称',
|
||||
selectTraining: '选择实训',
|
||||
createUserTraining: '创建用户实训',
|
||||
editTrainingDetail: '编辑实训详情',
|
||||
trainingTime: '实训时长',
|
||||
subscribeToTheMapList: '订阅地图列表:',
|
||||
editSimulationDetails: '编辑仿真详情',
|
||||
newsBulletin: '消息公告',
|
||||
newsHeadlines: '消息标题:',
|
||||
newsContent: '消息内容:',
|
||||
whetherTheNewsCanBeClosed: '消息是否可关闭:',
|
||||
push: '推送'
|
||||
};
|
||||
|
@ -219,5 +219,7 @@ export default {
|
||||
setProjectSuccess: '设置归属项目成功!',
|
||||
setProjectFail: '设置归属项目失败!',
|
||||
copyMapSuccess: '复制地图成功!',
|
||||
copyMapFail: '复制地图失败!'
|
||||
copyMapFail: '复制地图失败!',
|
||||
pushNewsSuccess: '推送消息成功!',
|
||||
pushNewsFailed: '推送消息失败!'
|
||||
};
|
||||
|
@ -1,36 +1,37 @@
|
||||
export default {
|
||||
comprehensiveTrainingManager: '综合实训管理者:',
|
||||
comprehensiveDrillRoom: '综合演练室',
|
||||
numberOfAssignableRoles: '可分配角色数量:',
|
||||
dispatcher: '调度员',
|
||||
increaseDispatchers: '增加调度人员',
|
||||
stationAttendant: '车站值班员',
|
||||
increaseStationAttendant: '增加车站值班员',
|
||||
teacher: '教员',
|
||||
increaseTeacher: '增加教员',
|
||||
universalAccount: '通号',
|
||||
increaseUniversalAccount: '增加通号',
|
||||
driver: '司机',
|
||||
increaseDriver: '增加司机',
|
||||
bigScreen: '大屏',
|
||||
increaseBigScreen: '增加大屏',
|
||||
destroyRoom: '销毁房间',
|
||||
generatingQRCode: '生成二维码',
|
||||
startSimulation: '开始仿真',
|
||||
enterSimulation: '进入仿真',
|
||||
endSimulation: '结束仿真',
|
||||
distributeTheRoomQRCode: '分发房间二维码',
|
||||
increaseIbp: '增加IBP',
|
||||
kickOutTheRoom: '踢出房间',
|
||||
sending: '发送中...',
|
||||
holdAndTalk: '按住说话',
|
||||
recording: '录音中...',
|
||||
sendText: '发送文字',
|
||||
left: '左',
|
||||
right: '右',
|
||||
realDevice: '真实设备',
|
||||
plcGatewayOnline: '[PLC网关在线]',
|
||||
plcGatewayOffline: '[PLC网关离线]',
|
||||
uplinkPlatform: '上行站台',
|
||||
downlinkPlatform: '下行站台'
|
||||
comprehensiveTrainingManager: '综合实训管理者:',
|
||||
comprehensiveDrillRoom: '综合演练室',
|
||||
numberOfAssignableRoles: '可分配角色数量:',
|
||||
dispatcher: '调度员',
|
||||
increaseDispatchers: '增加调度人员',
|
||||
stationAttendant: '车站值班员',
|
||||
increaseStationAttendant: '增加车站值班员',
|
||||
teacher: '教员',
|
||||
increaseTeacher: '增加教员',
|
||||
universalAccount: '通号',
|
||||
increaseUniversalAccount: '增加通号',
|
||||
driver: '司机',
|
||||
increaseDriver: '增加司机',
|
||||
bigScreen: '大屏',
|
||||
increaseBigScreen: '增加大屏',
|
||||
destroyRoom: '销毁房间',
|
||||
generatingQRCode: '生成二维码',
|
||||
startSimulation: '开始仿真',
|
||||
enterSimulation: '进入仿真',
|
||||
endSimulation: '结束仿真',
|
||||
distributeTheRoomQRCode: '分发房间二维码',
|
||||
increaseIbp: '增加IBP',
|
||||
kickOutTheRoom: '踢出房间',
|
||||
sending: '发送中...',
|
||||
holdAndTalk: '按住说话',
|
||||
recording: '录音中...',
|
||||
sendText: '发送文字',
|
||||
left: '左',
|
||||
right: '右',
|
||||
realDevice: '真实设备',
|
||||
plcGatewayOnline: '[PLC网关在线]',
|
||||
plcGatewayOffline: '[PLC网关离线]',
|
||||
uplinkPlatform: '上行站台',
|
||||
downlinkPlatform: '下行站台',
|
||||
ibp:'IBP'
|
||||
};
|
||||
|
@ -4,107 +4,113 @@ const deviceRender = {};
|
||||
|
||||
/** IbpText渲染配置*/
|
||||
deviceRender[deviceType.IbpText] = {
|
||||
_type: deviceType.IbpText,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.IbpText,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** SquareButton渲染配置*/
|
||||
deviceRender[deviceType.SquareButton] = {
|
||||
_type: deviceType.SquareButton,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.SquareButton,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** WarnButton渲染配置*/
|
||||
deviceRender[deviceType.WarnButton] = {
|
||||
_type: deviceType.WarnButton,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.WarnButton,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** Arrow渲染配置*/
|
||||
deviceRender[deviceType.Arrow] = {
|
||||
_type: deviceType.Arrow,
|
||||
zlevel: 1,
|
||||
z: 2
|
||||
_type: deviceType.Arrow,
|
||||
zlevel: 1,
|
||||
z: 2
|
||||
};
|
||||
|
||||
/** TipBox渲染配置*/
|
||||
deviceRender[deviceType.TipBox] = {
|
||||
_type: deviceType.TipBox,
|
||||
zlevel: 1,
|
||||
z: 3
|
||||
_type: deviceType.TipBox,
|
||||
zlevel: 1,
|
||||
z: 3
|
||||
};
|
||||
|
||||
/** BackGround渲染配置*/
|
||||
deviceRender[deviceType.Background] = {
|
||||
_type: deviceType.Background,
|
||||
zlevel: 1,
|
||||
z: 0
|
||||
_type: deviceType.Background,
|
||||
zlevel: 1,
|
||||
z: 0
|
||||
};
|
||||
|
||||
/** CircularLamp渲染配置 */
|
||||
deviceRender[deviceType.CircularLamp] = {
|
||||
_type: deviceType.CircularLamp,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.CircularLamp,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** AppendageBox渲染配置 */
|
||||
deviceRender[deviceType.AppendageBox] = {
|
||||
_type: deviceType.AppendageBox,
|
||||
zlevel: 1,
|
||||
z: 1
|
||||
_type: deviceType.AppendageBox,
|
||||
zlevel: 1,
|
||||
z: 1
|
||||
};
|
||||
|
||||
/** IbpLine渲染配置 */
|
||||
deviceRender[deviceType.IbpLine] = {
|
||||
_type: deviceType.IbpLine,
|
||||
zlevel: 1,
|
||||
z: 1
|
||||
_type: deviceType.IbpLine,
|
||||
zlevel: 1,
|
||||
z: 1
|
||||
};
|
||||
|
||||
/** Elevator 渲染配置 */
|
||||
deviceRender[deviceType.Elevator] = {
|
||||
_type: deviceType.Elevator,
|
||||
zlevel: 1,
|
||||
z: 2
|
||||
_type: deviceType.Elevator,
|
||||
zlevel: 1,
|
||||
z: 2
|
||||
};
|
||||
|
||||
/** Key 渲染配置 */
|
||||
deviceRender[deviceType.Key] = {
|
||||
_type: deviceType.Key,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.Key,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** TeleTerminal 渲染配置 */
|
||||
deviceRender[deviceType.TeleTerminal] = {
|
||||
_type: deviceType.TeleTerminal,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.TeleTerminal,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** Clock 渲染配置*/
|
||||
deviceRender[deviceType.Clock] = {
|
||||
_type: deviceType.Clock,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.Clock,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** RotateTip 渲染配置 */
|
||||
deviceRender[deviceType.RotateTip] = {
|
||||
_type: deviceType.RotateTip,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.RotateTip,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
/** Alarm */
|
||||
deviceRender[deviceType.Alarm] = {
|
||||
_type: deviceType.Alarm,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
_type: deviceType.Alarm,
|
||||
zlevel: 1,
|
||||
z: 4
|
||||
};
|
||||
|
||||
deviceRender[deviceType.CheckBox] = {
|
||||
_type: deviceType.CheckBox,
|
||||
zlevel: 10,
|
||||
z: 0
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -1,18 +1,19 @@
|
||||
const deviceType = {
|
||||
IbpText: 'IbpText',
|
||||
SquareButton: 'SquareButton',
|
||||
Arrow: 'Arrow',
|
||||
TipBox: 'TipBox',
|
||||
Background: 'Background',
|
||||
CircularLamp: 'CircularLamp',
|
||||
IbpLine: 'IbpLine',
|
||||
AppendageBox: 'AppendageBox',
|
||||
Alarm: 'Alarm',
|
||||
Elevator: 'Elevator',
|
||||
Key: 'Key',
|
||||
TeleTerminal: 'TeleTerminal',
|
||||
Clock: 'Clock',
|
||||
RotateTip: 'RotateTip'
|
||||
IbpText: 'IbpText',
|
||||
SquareButton: 'SquareButton',
|
||||
Arrow: 'Arrow',
|
||||
TipBox: 'TipBox',
|
||||
Background: 'Background',
|
||||
CircularLamp: 'CircularLamp',
|
||||
IbpLine: 'IbpLine',
|
||||
AppendageBox: 'AppendageBox',
|
||||
Alarm: 'Alarm',
|
||||
Elevator: 'Elevator',
|
||||
Key: 'Key',
|
||||
TeleTerminal: 'TeleTerminal',
|
||||
Clock: 'Clock',
|
||||
RotateTip: 'RotateTip',
|
||||
CheckBox: 'CheckBox'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -303,5 +303,25 @@ class IbpPan {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderCheckBox(model) {
|
||||
const type = model._type;
|
||||
const code = model.code;
|
||||
const oDevice = this.ibpDevice[code] || deviceFactory(type, model);
|
||||
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, model));
|
||||
delete this.ibpDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
if (!model._dispose) {
|
||||
this.ibpDevice[code] = nDevice;
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
}
|
||||
deleteCheckBox(code) {
|
||||
const oDevice = this.ibpDevice[code];
|
||||
if (oDevice) {
|
||||
delete this.ibpDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
export default IbpPan;
|
||||
|
@ -4,193 +4,282 @@ import * as eventTool from 'zrender/src/core/event';
|
||||
import store from '@/store';
|
||||
|
||||
class EventModel {
|
||||
constructor(e) {
|
||||
this.clientX = e.event.clientX;
|
||||
this.clientY = e.event.clientY;
|
||||
constructor(e) {
|
||||
this.clientX = e.event.clientX;
|
||||
this.clientY = e.event.clientY;
|
||||
|
||||
let view = e.target;
|
||||
while (view) {
|
||||
if (Object.values(deviceType).includes(view._type)) {
|
||||
this.deviceCode = view._code;
|
||||
this.deviceType = view._type;
|
||||
this.deviceModel = view.model;
|
||||
this.eventTarget = view;
|
||||
break;
|
||||
}
|
||||
view = view.parent;
|
||||
}
|
||||
}
|
||||
let view = e.target;
|
||||
while (view) {
|
||||
if (Object.values(deviceType).includes(view._type)) {
|
||||
this.deviceCode = view._code;
|
||||
this.deviceType = view._type;
|
||||
this.deviceModel = view.model;
|
||||
this.eventTarget = view;
|
||||
break;
|
||||
}
|
||||
view = view.parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MouseController extends Eventful {
|
||||
constructor(ibp) {
|
||||
super();
|
||||
this.$ibp = ibp;
|
||||
this.$zr = ibp.getZr();
|
||||
this.isAllowDragging=ibp.isAllowDragging||false;
|
||||
this.events = ibp.getEvents();
|
||||
this._dragging = false;
|
||||
this.initHandler(this.$zr);
|
||||
}
|
||||
constructor(ibp) {
|
||||
super();
|
||||
this.$ibp = ibp;
|
||||
this.$zr = ibp.getZr();
|
||||
this.isAllowDragging = ibp.isAllowDragging || false; // 是否在绘图中,仅绘图状态下可拖拽
|
||||
this.events = ibp.getEvents();
|
||||
this._dragging = false; // 是否在拖拽状态
|
||||
this.deviceList = [];
|
||||
this.rightClickPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}; // 右键点击坐标
|
||||
this.initHandler(this.$zr);
|
||||
}
|
||||
|
||||
initHandler(zr) {
|
||||
if (zr) {
|
||||
zr.on('contextmenu', this.contextmenu, this);
|
||||
zr.on('mousemove', this.moveEvent, this);
|
||||
zr.on('click', this.click, this);
|
||||
initHandler(zr) {
|
||||
if (zr) {
|
||||
zr.on('contextmenu', this.contextmenu, this);
|
||||
zr.on('mousemove', this.moveEvent, this);
|
||||
zr.on('click', this.click, this);
|
||||
|
||||
this.enable = function (opts) {
|
||||
opts = opts || {};
|
||||
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
||||
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
||||
this.enable = function (opts) {
|
||||
opts = opts || {};
|
||||
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
||||
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
||||
|
||||
this.disable();
|
||||
this.disable();
|
||||
|
||||
zr.on('mousedown', this.mousedown, this);
|
||||
zr.on('mousemove', this.mousemove, this);
|
||||
zr.on('mouseup', this.mouseup, this);
|
||||
zr.on('touchstart', this.mousedown, this);
|
||||
zr.on('touchmove', this.mousemove, this);
|
||||
zr.on('touchend', this.mouseup, this);
|
||||
};
|
||||
zr.on('mousedown', this.mousedown, this);
|
||||
zr.on('mousemove', this.mousemove, this);
|
||||
zr.on('mouseup', this.mouseup, this);
|
||||
zr.on('touchstart', this.mousedown, this);
|
||||
zr.on('touchmove', this.mousemove, this);
|
||||
zr.on('touchend', this.mouseup, this);
|
||||
};
|
||||
|
||||
this.disable = function () {
|
||||
zr.off('mousedown', this.mousedown);
|
||||
zr.off('mousemove', this.mousemove);
|
||||
zr.off('mouseup', this.mouseup);
|
||||
zr.off('touchstart', this.mousedown);
|
||||
zr.off('touchmove', this.mousemove);
|
||||
zr.off('touchend', this.mouseup);
|
||||
};
|
||||
this.disable = function () {
|
||||
zr.off('mousedown', this.mousedown);
|
||||
zr.off('mousemove', this.mousemove);
|
||||
zr.off('mouseup', this.mouseup);
|
||||
zr.off('touchstart', this.mousedown);
|
||||
zr.off('touchmove', this.mousemove);
|
||||
zr.off('touchend', this.mouseup);
|
||||
};
|
||||
|
||||
this.dispose = function () {
|
||||
zr.off('click', this.click);
|
||||
zr.off('contextmenu', this.contextmenu);
|
||||
zr.off('mousemove', this.moveEvent);
|
||||
this.disable();
|
||||
};
|
||||
this.dispose = function () {
|
||||
zr.off('click', this.click);
|
||||
zr.off('contextmenu', this.contextmenu);
|
||||
zr.off('mousemove', this.moveEvent);
|
||||
this.disable();
|
||||
};
|
||||
|
||||
this.isDragging = function () { return this._dragging; };
|
||||
}
|
||||
}
|
||||
this.isDragging = function () { return this._dragging; };
|
||||
}
|
||||
}
|
||||
|
||||
setAllowDragging(data) {
|
||||
this.isAllowDragging=data;
|
||||
}
|
||||
setAllowDragging(data) {
|
||||
this.isAllowDragging = data;
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
if (eventTool.notLeftMouse(e)) {
|
||||
return;
|
||||
}
|
||||
e.event.preventDefault();
|
||||
e.event.stopPropagation();
|
||||
const em = new EventModel(e);
|
||||
this.eventTarget = em.eventTarget;
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('pointer');
|
||||
}
|
||||
this._offsetX=e.offsetX;
|
||||
this._offsetY=e.offsetY;
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
this._dragging = true;
|
||||
}
|
||||
mousedown(e) {
|
||||
e.event.preventDefault();
|
||||
e.event.stopPropagation();
|
||||
const em = new EventModel(e);
|
||||
this.eventTarget = em.eventTarget;
|
||||
this._offsetX = e.offsetX;
|
||||
this._offsetY = e.offsetY;
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
this._dragging = true;
|
||||
if (e.which === 3) {
|
||||
this.handleMouseDownRight(e);
|
||||
} else if (e.which === 1) {
|
||||
this.handleMouseDownLeft(e);
|
||||
} else if (e.which === 2) {
|
||||
this.handleMouseDownWheel(e);
|
||||
}
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
if (eventTool.notLeftMouse(e) ||
|
||||
!this._moveOnMouseMove ||
|
||||
!this._dragging || !this.isAllowDragging
|
||||
) {
|
||||
return;
|
||||
}
|
||||
mousemove(e) {
|
||||
const oldX = this._x;
|
||||
const oldY = this._y;
|
||||
|
||||
const oldX = this._x;
|
||||
const oldY = this._y;
|
||||
const dx = e.offsetX - oldX;
|
||||
const dy = e.offsetY - oldY;
|
||||
|
||||
const dx = e.offsetX - oldX;
|
||||
const dy = e.offsetY - oldY;
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
if (e.which === 3) {
|
||||
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
|
||||
} else if (e.which === 1) {
|
||||
this.handleMouseMoveLeft(e, dx, dy, oldX, oldY);
|
||||
}
|
||||
}
|
||||
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
if (this._dragging) {
|
||||
if ((this.eventTarget && this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
return true;
|
||||
} else if (this.isAllowDragging && this.eventTarget) {
|
||||
this.eventTarget.grouper.drift(dx, dy, e);
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
mouseup(e) {
|
||||
if (eventTool.notLeftMouse(e) || !this.eventTarget ) {
|
||||
return;
|
||||
}
|
||||
if (this.deviceList.length) {
|
||||
this.deviceList.forEach(item => {
|
||||
item.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||
});
|
||||
this.deviceList = [];
|
||||
this.$ibp.deleteCheckBox('check_box');
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
this.deviceList = [];
|
||||
return;
|
||||
}
|
||||
if (this.isAllowDragging) {
|
||||
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||
this.eventTarget.dirty();
|
||||
}
|
||||
if (this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('default');
|
||||
}
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
this.deviceList = [];
|
||||
}
|
||||
|
||||
}
|
||||
contextmenu(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Contextmenu, em);
|
||||
}
|
||||
click(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Selected, em);
|
||||
}
|
||||
moveEvent(e) {
|
||||
const newEm = new EventModel(e);
|
||||
const trainDetails = store.state.map.trainDetails;
|
||||
if (trainDetails) {
|
||||
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
|
||||
var instance = (this.$ibp.getDeviceByCode(trainDetails.code) || {} ).instance;
|
||||
instance && instance.removeTrainDetail && instance.removeTrainDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) {
|
||||
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||
this.eventTarget.dirty();
|
||||
}
|
||||
// debugger;
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
// console.log('111-------');
|
||||
this.eventTarget.setCursor('default');
|
||||
}
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
}
|
||||
checkEvent(e) {
|
||||
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
|
||||
var newEm = new EventModel(e);
|
||||
if ([1, 3].includes(e.which)) {
|
||||
// 查找之前和当前鼠标选中的实例
|
||||
var oldDevice = this.$ibp.getDeviceByCode(oldEm.deviceCode) || {};
|
||||
var newDevice = this.$ibp.getDeviceByCode(newEm.deviceCode) || {};
|
||||
var oldInstance = (this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
|
||||
var newInstance = (this.$ibp.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
|
||||
|
||||
contextmenu(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Contextmenu, em);
|
||||
}
|
||||
click(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Selected, em);
|
||||
}
|
||||
moveEvent(e) {
|
||||
const newEm = new EventModel(e);
|
||||
const trainDetails = store.state.map.trainDetails;
|
||||
if (trainDetails) {
|
||||
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
|
||||
var instance = (this.$ibp.getDeviceByCode(trainDetails.code) || {} ).instance;
|
||||
instance && instance.removeTrainDetail && instance.removeTrainDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果之前和当前选中的实例不一致
|
||||
if (oldInstance != newInstance) {
|
||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||
// 视图数据设置点击标志,同步执行
|
||||
oldDevice['down'] = false;
|
||||
oldInstance.mouseEvent['mouseout'](e);
|
||||
}
|
||||
|
||||
checkEvent(e) {
|
||||
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
|
||||
var newEm = new EventModel(e);
|
||||
if ([1, 3].includes(e.which)) {
|
||||
// 查找之前和当前鼠标选中的实例
|
||||
var oldDevice = this.$ibp.getDeviceByCode(oldEm.deviceCode) || {};
|
||||
var newDevice = this.$ibp.getDeviceByCode(newEm.deviceCode) || {};
|
||||
var oldInstance = (this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
|
||||
var newInstance = (this.$ibp.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
|
||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||
newDevice['down'] = true;
|
||||
newInstance.mouseEvent['mouseover'](e);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果之前和当前选中的实例不一致
|
||||
if (oldInstance != newInstance) {
|
||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||
// 视图数据设置点击标志,同步执行
|
||||
oldDevice['down'] = false;
|
||||
oldInstance.mouseEvent['mouseout'](e);
|
||||
}
|
||||
// 保存当前实例到全局
|
||||
this.$zr.curEvent = e;
|
||||
}
|
||||
|
||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||
newDevice['down'] = true;
|
||||
newInstance.mouseEvent['mouseover'](e);
|
||||
}
|
||||
}
|
||||
|
||||
// 保存当前实例到全局
|
||||
this.$zr.curEvent = e;
|
||||
}
|
||||
|
||||
return newEm;
|
||||
}
|
||||
return newEm;
|
||||
}
|
||||
/** 处理鼠标右键按下事件 */
|
||||
handleMouseDownRight(e) {
|
||||
this.rightClickPoint.x = e.offsetX;
|
||||
this.rightClickPoint.y = e.offsetY;
|
||||
}
|
||||
/** 处理鼠标左键按下事件 */
|
||||
handleMouseDownLeft(e) {
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('pointer');
|
||||
this.$ibp.deleteCheckBox('check_box');
|
||||
} else if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
|
||||
this.handleBoundingRect(this.eventTarget);
|
||||
} else {
|
||||
this.$ibp.deleteCheckBox('check_box');
|
||||
}
|
||||
}
|
||||
/** 处理滚轮按下事件 */
|
||||
handleMouseDownWheel(e) {
|
||||
this.deviceList = [];
|
||||
Object.values(this.$ibp.ibpDevice).forEach(item => {
|
||||
if (item.instance._type !== deviceType.Background) {
|
||||
this.deviceList.push(item.instance);
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 处理右键拖动事件--- 改变选中区域大小 */
|
||||
handleMouseMoveRight(point2) {
|
||||
const point1 = this.rightClickPoint;
|
||||
const x = Math.min(point1.x, point2.x) + this.$ibp.$options.offsetX;
|
||||
const y = Math.min(point1.y, point2.y) + this.$ibp.$options.offsetY;
|
||||
const width = Math.abs(point1.x - point2.x);
|
||||
const height = Math.abs(point1.y - point2.y);
|
||||
this.$ibp.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height });
|
||||
}
|
||||
/** 处理左键拖动事件--- 图形移动 */
|
||||
handleMouseMoveLeft(e, dx, dy, oldX, oldY) {
|
||||
if (!this._moveOnMouseMove || !this._dragging || !this.isAllowDragging) {
|
||||
return;
|
||||
}
|
||||
// 选中区域图形移动
|
||||
if (this.deviceList.length) {
|
||||
this.deviceList.forEach(item => {
|
||||
item.grouper.drift(dx, dy, e);
|
||||
});
|
||||
} else if (this._dragging && this.eventTarget) { // 选中元素图形移动
|
||||
if (( this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
} else if (this.isAllowDragging) {
|
||||
this.eventTarget.grouper.drift(dx, dy, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** 通过包围盒筛选选中区域的元素 */
|
||||
handleBoundingRect(eventTarget) {
|
||||
this.deviceList = [];
|
||||
let boundingRect = eventTarget.grouper.getBoundingRect();
|
||||
boundingRect = this.createFakeBoundingRect(eventTarget, boundingRect);
|
||||
const deviceList = Object.values(this.$ibp.ibpDevice);
|
||||
const includeDeviceList = [];
|
||||
deviceList.forEach( item =>{
|
||||
if (item.instance._type !== deviceType.Background) {
|
||||
let deviceBoundingRect = item.instance.grouper.getBoundingRect();
|
||||
deviceBoundingRect = this.createFakeBoundingRect(item.instance, deviceBoundingRect);
|
||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||
includeDeviceList.push(item.instance);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.deviceList = includeDeviceList;
|
||||
}
|
||||
/** 创建假包围盒对象 */
|
||||
createFakeBoundingRect(instance, boundingRect) {
|
||||
return {
|
||||
x1: instance.model.point.x + boundingRect.x,
|
||||
y1: instance.model.point.y + boundingRect.y,
|
||||
x2: instance.model.point.x + boundingRect.width,
|
||||
y2: instance.model.point.y + boundingRect.height
|
||||
};
|
||||
}
|
||||
/** 判断元素包围盒是否在选中区域 */
|
||||
whetherInclude(boundingRect1, boundingRect2) {
|
||||
return boundingRect1.x1 <= boundingRect2.x1 && boundingRect1.y1 <= boundingRect2.y1 && boundingRect1.x2 >= boundingRect2.x2 && boundingRect1.y2 >= boundingRect2.y2;
|
||||
}
|
||||
}
|
||||
|
||||
export default MouseController;
|
||||
|
@ -1,100 +1,100 @@
|
||||
class Options {
|
||||
constructor(opts, trigger) {
|
||||
this.scaleIndex = 0;
|
||||
this.scaleList = [
|
||||
0.5, 0.6, 0.7, 0.8, 0.9,
|
||||
1, 1.2, 1.4, 1.6, 1.8,
|
||||
2, 2.2, 2.4, 2.6, 2.8,
|
||||
3, 3.2, 3.4, 3.6, 3.8,
|
||||
4, 4.2, 4.4, 4.6, 4.8,
|
||||
5, 5.2, 5.4, 5.6, 5.8,
|
||||
6, 6.2, 6.4, 6.6, 6.8,
|
||||
7, 7.2, 7.4, 7.6, 7.8,
|
||||
8, 8.2, 8.4, 8.6, 8.8
|
||||
];
|
||||
constructor(opts, trigger) {
|
||||
this.scaleIndex = 0;
|
||||
this.scaleList = [
|
||||
0.5, 0.6, 0.7, 0.8, 0.9,
|
||||
1, 1.2, 1.4, 1.6, 1.8,
|
||||
2, 2.2, 2.4, 2.6, 2.8,
|
||||
3, 3.2, 3.4, 3.6, 3.8,
|
||||
4, 4.2, 4.4, 4.6, 4.8,
|
||||
5, 5.2, 5.4, 5.6, 5.8,
|
||||
6, 6.2, 6.4, 6.6, 6.8,
|
||||
7, 7.2, 7.4, 7.6, 7.8,
|
||||
8, 8.2, 8.4, 8.6, 8.8
|
||||
];
|
||||
|
||||
if (Number.isFinite(opts.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(opts.scaleRate);
|
||||
if (idx >= 0) {
|
||||
this.scaleIndex = idx;
|
||||
}
|
||||
}
|
||||
if (Number.isFinite(opts.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(opts.scaleRate);
|
||||
if (idx >= 0) {
|
||||
this.scaleIndex = idx;
|
||||
}
|
||||
}
|
||||
|
||||
this.scaleRate = opts.scaleRate || this.scaleList[this.scaleIndex]; // 缩放比例
|
||||
this.scaleRate = opts.scaleRate || this.scaleList[this.scaleIndex]; // 缩放比例
|
||||
|
||||
this.offsetX = opts.offsetX || 0; // x偏移
|
||||
this.offsetX = opts.offsetX || 0; // x偏移
|
||||
|
||||
this.offsetY = opts.offsetY || 0; // y偏移
|
||||
this.offsetY = opts.offsetY || 0; // y偏移
|
||||
|
||||
this.throttle = opts.throttle || 100; // 刷新频率
|
||||
this.throttle = opts.throttle || 100; // 刷新频率
|
||||
|
||||
this.disabled = false;
|
||||
this.disabled = false;
|
||||
|
||||
this.moveOnMouseMove = true;
|
||||
this.moveOnMouseMove = true;
|
||||
|
||||
this.zoomOnMouseWheel = false;
|
||||
this.zoomOnMouseWheel = false;
|
||||
|
||||
this.preventDefaultMouseMove = true;
|
||||
this.preventDefaultMouseMove = true;
|
||||
|
||||
this.trigger = trigger;
|
||||
}
|
||||
this.trigger = trigger;
|
||||
}
|
||||
|
||||
update(payload) {
|
||||
if (Number.isFinite(payload.dx)) {
|
||||
this.offsetX -= payload.dx;
|
||||
}
|
||||
if (Number.isFinite(payload.dy)) {
|
||||
this.offsetY -= payload.dy;
|
||||
}
|
||||
update(payload) {
|
||||
if (Number.isFinite(payload.dx)) {
|
||||
this.offsetX -= payload.dx;
|
||||
}
|
||||
if (Number.isFinite(payload.dy)) {
|
||||
this.offsetY -= payload.dy;
|
||||
}
|
||||
|
||||
if (Number.isFinite(payload.offsetX)) {
|
||||
this.offsetX = payload.offsetX;
|
||||
}
|
||||
if (Number.isFinite(payload.offsetY)) {
|
||||
this.offsetY = payload.offsetY;
|
||||
}
|
||||
if (Number.isFinite(payload.offsetX)) {
|
||||
this.offsetX = payload.offsetX;
|
||||
}
|
||||
if (Number.isFinite(payload.offsetY)) {
|
||||
this.offsetY = payload.offsetY;
|
||||
}
|
||||
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
||||
this.scaleIndex = this.scaleIndex + payload.scale;
|
||||
}
|
||||
}
|
||||
this.scaleRate = this.scaleList[this.scaleIndex];
|
||||
}
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
||||
this.scaleIndex = this.scaleIndex + payload.scale;
|
||||
}
|
||||
}
|
||||
this.scaleRate = this.scaleList[this.scaleIndex];
|
||||
}
|
||||
|
||||
if (Number.isFinite(payload.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(payload.scaleRate);
|
||||
if (idx < 0) {
|
||||
return;
|
||||
}
|
||||
this.scaleIndex = idx;
|
||||
this.scaleRate = payload.scaleRate;
|
||||
}
|
||||
if (Number.isFinite(payload.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(payload.scaleRate);
|
||||
if (idx < 0) {
|
||||
return;
|
||||
}
|
||||
this.scaleIndex = idx;
|
||||
this.scaleRate = payload.scaleRate;
|
||||
}
|
||||
|
||||
if (payload.disabled === true || payload.disabled === false) {
|
||||
this.disabled = payload.disabled;
|
||||
}
|
||||
if (payload.disabled === true || payload.disabled === false) {
|
||||
this.disabled = payload.disabled;
|
||||
}
|
||||
|
||||
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
||||
this.moveOnMouseMove = payload.moveOnMouseMove;
|
||||
}
|
||||
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
||||
this.moveOnMouseMove = payload.moveOnMouseMove;
|
||||
}
|
||||
|
||||
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
||||
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
||||
}
|
||||
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
||||
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
||||
}
|
||||
|
||||
if (this.trigger instanceof Function) { this.trigger(this); }
|
||||
}
|
||||
if (this.trigger instanceof Function) { this.trigger(this); }
|
||||
}
|
||||
|
||||
getScaleRate(scale) {
|
||||
if (Number.isFinite(scale)) {
|
||||
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
||||
return this.scaleList[this.scaleIndex + scale];
|
||||
}
|
||||
}
|
||||
return this.scaleList[this.scaleIndex];
|
||||
}
|
||||
getScaleRate(scale) {
|
||||
if (Number.isFinite(scale)) {
|
||||
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
||||
return this.scaleList[this.scaleIndex + scale];
|
||||
}
|
||||
}
|
||||
return this.scaleList[this.scaleIndex];
|
||||
}
|
||||
}
|
||||
|
||||
export default Options;
|
||||
|
@ -6,185 +6,185 @@ import shapefactory from './shape/factory';
|
||||
import TransformHandle from './transformHandle';
|
||||
|
||||
class Painter {
|
||||
constructor(ibp) {
|
||||
// 父级实例
|
||||
this.$ibp = ibp;
|
||||
this.$ibpZr = ibp.getZr();
|
||||
constructor(ibp) {
|
||||
// 父级实例
|
||||
this.$ibp = ibp;
|
||||
this.$ibpZr = ibp.getZr();
|
||||
|
||||
// 图层数据
|
||||
this.ibpInstanceLevel = {};
|
||||
// 图层数据
|
||||
this.ibpInstanceLevel = {};
|
||||
|
||||
// 初始图层
|
||||
this.initLevels();
|
||||
// 初始图层
|
||||
this.initLevels();
|
||||
|
||||
// 视图控制器
|
||||
this.$transformHandle = new TransformHandle(this);
|
||||
}
|
||||
// 视图控制器
|
||||
this.$transformHandle = new TransformHandle(this);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 初始绘图实例
|
||||
* @param {*} dom
|
||||
* @param {*} config
|
||||
*/
|
||||
initLevels() {
|
||||
initLevels() {
|
||||
|
||||
// 添加父级图层
|
||||
this.parentLevel = new Group({ name: '__parent__' });
|
||||
this.$ibpZr.add(this.parentLevel);
|
||||
// 添加父级图层
|
||||
this.parentLevel = new Group({ name: '__parent__' });
|
||||
this.$ibpZr.add(this.parentLevel);
|
||||
|
||||
// 添加子级图层
|
||||
zrUtil.each(Object.values(deviceType), (type) => {
|
||||
const level = new Group({ name: `__${type}__` });
|
||||
this.ibpInstanceLevel[type] = level;
|
||||
this.parentLevel.add(level);
|
||||
});
|
||||
}
|
||||
// 添加子级图层
|
||||
zrUtil.each(Object.values(deviceType), (type) => {
|
||||
const level = new Group({ name: `__${type}__` });
|
||||
this.ibpInstanceLevel[type] = level;
|
||||
this.parentLevel.add(level);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 重绘视图
|
||||
* @param {*} ibpDevice
|
||||
*/
|
||||
repaint(ibpDevice) {
|
||||
// 清空视图
|
||||
this.clear();
|
||||
repaint(ibpDevice) {
|
||||
// 清空视图
|
||||
this.clear();
|
||||
|
||||
// 创建视图
|
||||
Object.values(ibpDevice).forEach(device => {
|
||||
this.add(device);
|
||||
});
|
||||
}
|
||||
// 创建视图
|
||||
Object.values(ibpDevice).forEach(device => {
|
||||
this.add(device);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 添加视图
|
||||
* @param {*} device
|
||||
*/
|
||||
add(device) {
|
||||
try {
|
||||
device = Object.assign(device, { event: this.$ibp.$mouseController });
|
||||
const instance = shapefactory(device, this.$ibp);
|
||||
if (instance) {
|
||||
device.instance = instance;
|
||||
this.$transformHandle.transformView(instance);
|
||||
this.ibpInstanceLevel[device.model._type].add(instance);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
add(device) {
|
||||
try {
|
||||
device = Object.assign(device, { event: this.$ibp.$mouseController });
|
||||
const instance = shapefactory(device, this.$ibp);
|
||||
if (instance) {
|
||||
device.instance = instance;
|
||||
this.$transformHandle.transformView(instance);
|
||||
this.ibpInstanceLevel[device.model._type].add(instance);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 删除视图
|
||||
* @param {*} device
|
||||
*/
|
||||
delete(device) {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
this.ibpInstanceLevel[device.model._type].remove(instance);
|
||||
}
|
||||
}
|
||||
delete(device) {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
this.ibpInstanceLevel[device.model._type].remove(instance);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 更新视图
|
||||
* @param {*} device
|
||||
*/
|
||||
update(device) {
|
||||
if (device) {
|
||||
if (device.model._dispose) {
|
||||
this.delete(device);
|
||||
} else {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
instance.setState(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
update(device) {
|
||||
if (device) {
|
||||
if (device.model._dispose) {
|
||||
this.delete(device);
|
||||
} else {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
instance.setState(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 更新transform变化
|
||||
* @param {*} opt
|
||||
*/
|
||||
updateTransform(opt, canvasSize) {
|
||||
this.$transformHandle.updateTransform(opt, canvasSize);
|
||||
}
|
||||
updateTransform(opt, canvasSize) {
|
||||
this.$transformHandle.updateTransform(opt, canvasSize);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 更新zrender尺寸
|
||||
* @param {*} opt
|
||||
*/
|
||||
updateZrSize(opt) {
|
||||
this.$transformHandle.updateZrSize(opt);
|
||||
}
|
||||
updateZrSize(opt) {
|
||||
this.$transformHandle.updateZrSize(opt);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 初始化电子时钟时间
|
||||
*/
|
||||
initClockTime(device, initTime) {
|
||||
device.instance.setClockTime(initTime);
|
||||
}
|
||||
/**
|
||||
initClockTime(device, initTime) {
|
||||
device.instance.setClockTime(initTime);
|
||||
}
|
||||
/**
|
||||
* 电子时钟开始跑秒或暂停
|
||||
*/
|
||||
setClockStart(device, started) {
|
||||
device.instance.setClockStart(started);
|
||||
}
|
||||
/**
|
||||
setClockStart(device, started) {
|
||||
device.instance.setClockStart(started);
|
||||
}
|
||||
/**
|
||||
* 设置图层可见
|
||||
* @param {*} code
|
||||
*/
|
||||
setLevelVisible(list) {
|
||||
zrUtil.each(Object.values(deviceType), type => {
|
||||
const level = this.ibpInstanceLevel[type];
|
||||
if (list.includes(type)) {
|
||||
level.show();
|
||||
} else {
|
||||
level.hide();
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
setLevelVisible(list) {
|
||||
zrUtil.each(Object.values(deviceType), type => {
|
||||
const level = this.ibpInstanceLevel[type];
|
||||
if (list.includes(type)) {
|
||||
level.show();
|
||||
} else {
|
||||
level.hide();
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 刷新图层
|
||||
*/
|
||||
refresh() {
|
||||
this.$ibpZr.refresh();
|
||||
}
|
||||
refresh() {
|
||||
this.$ibpZr.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 清除图层
|
||||
*/
|
||||
clearLevel(type) {
|
||||
const level = this.ibpInstanceLevel[type];
|
||||
if (level) {
|
||||
level.removeAll();
|
||||
}
|
||||
}
|
||||
clearLevel(type) {
|
||||
const level = this.ibpInstanceLevel[type];
|
||||
if (level) {
|
||||
level.removeAll();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 清除canvas
|
||||
*/
|
||||
clear() {
|
||||
zrUtil.each(Object.values(this.ibpInstanceLevel), (level) => {
|
||||
level && level.removeAll();
|
||||
}, this);
|
||||
clear() {
|
||||
zrUtil.each(Object.values(this.ibpInstanceLevel), (level) => {
|
||||
level && level.removeAll();
|
||||
}, this);
|
||||
|
||||
this.refresh();
|
||||
}
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 销毁图层
|
||||
*/
|
||||
dispose() {
|
||||
this.ibpInstanceLevel = {};
|
||||
this.parentLevel = null;
|
||||
}
|
||||
dispose() {
|
||||
this.ibpInstanceLevel = {};
|
||||
this.parentLevel = null;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 父级图层
|
||||
*/
|
||||
getParentLevel() {
|
||||
return this.parentLevel;
|
||||
}
|
||||
getParentLevel() {
|
||||
return this.parentLevel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
46
src/ibp/shape/checkBox.js
Normal file
46
src/ibp/shape/checkBox.js
Normal file
@ -0,0 +1,46 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
export default class checkBox extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.box = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: 'rgb(135,206,250,0.2)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.box);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
setSize(width, height) {
|
||||
this.model.width = width;
|
||||
this.model.height = height;
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ import Key from './key';
|
||||
import TeleTerminal from './teleTerminal';
|
||||
import Clock from './clock';
|
||||
import RotateTip from './rotateTip';
|
||||
import CheckBox from './checkBox';
|
||||
|
||||
const ibpShape = {};
|
||||
ibpShape[deviceType.Arrow] = Arrow;
|
||||
@ -29,14 +30,15 @@ ibpShape[deviceType.Key] = Key;
|
||||
ibpShape[deviceType.TeleTerminal] = TeleTerminal;
|
||||
ibpShape[deviceType.Clock] = Clock;
|
||||
ibpShape[deviceType.RotateTip] = RotateTip;
|
||||
ibpShape[deviceType.CheckBox] = CheckBox;
|
||||
|
||||
function shapefactory(device, ibp) {
|
||||
const type = device.model._type;
|
||||
const shape = ibpShape[type];
|
||||
if (shape instanceof Function) {
|
||||
// eslint-disable-next-line
|
||||
const type = device.model._type;
|
||||
const shape = ibpShape[type];
|
||||
if (shape instanceof Function) {
|
||||
// eslint-disable-next-line
|
||||
return new shape(device, ibp.style);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default shapefactory;
|
||||
|
@ -2,43 +2,44 @@ import Group from 'zrender/src/container/Group';
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
|
||||
export default class ibpLine extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper=new Group({
|
||||
id: model.code,
|
||||
position: [model.point1.x, model.point1.y]
|
||||
});
|
||||
this.ibpLine = new Line({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x1: 0,
|
||||
y1: 0,
|
||||
x2: model.point2.x-model.point1.x,
|
||||
y2: model.point2.y-model.point1.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: this.model.lineWidth,
|
||||
stroke: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.ibpLine);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point1.x += dx;
|
||||
this.model.point1.y += dy;
|
||||
this.model.point2.x += dx;
|
||||
this.model.point2.y += dy;
|
||||
}
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.model.point = this.model.point1;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point1.x, model.point1.y]
|
||||
});
|
||||
this.ibpLine = new Line({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x1: 0,
|
||||
y1: 0,
|
||||
x2: model.point2.x - model.point1.x,
|
||||
y2: model.point2.y - model.point1.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: this.model.lineWidth,
|
||||
stroke: this.model.fillColor
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.ibpLine);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point1.x += dx;
|
||||
this.model.point1.y += dy;
|
||||
this.model.point2.x += dx;
|
||||
this.model.point2.y += dy;
|
||||
}
|
||||
}
|
||||
|
@ -2,89 +2,89 @@ import deviceType from './constant/deviceType';
|
||||
import {createTransform, createBoundingRect} from './utils/parser';
|
||||
|
||||
class TransformHandle {
|
||||
constructor(painter) {
|
||||
this.$painter = painter;
|
||||
constructor(painter) {
|
||||
this.$painter = painter;
|
||||
|
||||
this.parentLevel = painter.getParentLevel();
|
||||
this.parentLevel = painter.getParentLevel();
|
||||
|
||||
this.rect = { x: 0, y: 0, width: 0, height: 0 };
|
||||
this.rect = { x: 0, y: 0, width: 0, height: 0 };
|
||||
|
||||
this.transform = createTransform({ scaleRate: 1, offsetX: 0, offsetY: 0 });
|
||||
}
|
||||
this.transform = createTransform({ scaleRate: 1, offsetX: 0, offsetY: 0 });
|
||||
}
|
||||
|
||||
checkVisible(view) {
|
||||
return createBoundingRect(view).intersect(this.rect);
|
||||
}
|
||||
checkVisible(view) {
|
||||
return createBoundingRect(view).intersect(this.rect);
|
||||
}
|
||||
|
||||
revisibleView(view) {
|
||||
if (this.checkVisible(view)||view._type === deviceType.Background) {
|
||||
view.show();
|
||||
} else {
|
||||
view.hide();
|
||||
}
|
||||
revisibleView(view) {
|
||||
if (this.checkVisible(view) || view._type === deviceType.Background) {
|
||||
view.show();
|
||||
} else {
|
||||
view.hide();
|
||||
}
|
||||
|
||||
view.dirty();
|
||||
}
|
||||
view.dirty();
|
||||
}
|
||||
|
||||
// 视图进行缩放/平移
|
||||
transformView(view) {
|
||||
if (view) {
|
||||
view.transform = this.transform;
|
||||
view.decomposeTransform();
|
||||
this.revisibleView(view);
|
||||
view.transform = '';
|
||||
}
|
||||
}
|
||||
// 视图进行缩放/平移
|
||||
transformView(view) {
|
||||
if (view) {
|
||||
view.transform = this.transform;
|
||||
view.decomposeTransform();
|
||||
this.revisibleView(view);
|
||||
view.transform = '';
|
||||
}
|
||||
}
|
||||
|
||||
// 处理所有视图缩放/平移
|
||||
transformAll() {
|
||||
this.traverse(this.transformView, this);
|
||||
}
|
||||
// 处理所有视图缩放/平移
|
||||
transformAll() {
|
||||
this.traverse(this.transformView, this);
|
||||
}
|
||||
|
||||
// 重新计算显示图形
|
||||
revisibleAll() {
|
||||
this.traverse(this.revisibleView, this);
|
||||
}
|
||||
// 重新计算显示图形
|
||||
revisibleAll() {
|
||||
this.traverse(this.revisibleView, this);
|
||||
}
|
||||
|
||||
// 更新偏移量
|
||||
updateTransform(opts, canvasSize) {
|
||||
if (canvasSize) {
|
||||
const elRect = this.parentLevel.getBoundingRect();
|
||||
const zrRect = this.rect;
|
||||
if (canvasSize.x - opts.offsetX > 0) {
|
||||
opts.offsetX = -elRect.x;
|
||||
}
|
||||
// 更新偏移量
|
||||
updateTransform(opts, canvasSize) {
|
||||
if (canvasSize) {
|
||||
const elRect = this.parentLevel.getBoundingRect();
|
||||
const zrRect = this.rect;
|
||||
if (canvasSize.x - opts.offsetX > 0) {
|
||||
opts.offsetX = -elRect.x;
|
||||
}
|
||||
|
||||
if (canvasSize.y - opts.offsetY > 0) {
|
||||
opts.offsetY = -elRect.y;
|
||||
}
|
||||
if (canvasSize.y - opts.offsetY > 0) {
|
||||
opts.offsetY = -elRect.y;
|
||||
}
|
||||
|
||||
if (elRect.x + canvasSize.width < zrRect.width) {
|
||||
opts.offsetX -= zrRect.width - (elRect.x + canvasSize.width);
|
||||
}
|
||||
if (elRect.x + canvasSize.width < zrRect.width) {
|
||||
opts.offsetX -= zrRect.width - (elRect.x + canvasSize.width);
|
||||
}
|
||||
|
||||
if (elRect.y + canvasSize.height < zrRect.height) {
|
||||
opts.offsetY -= zrRect.height - (elRect.y + canvasSize.height);
|
||||
}
|
||||
}
|
||||
this.transform = createTransform(opts);
|
||||
this.transformAll();
|
||||
}
|
||||
if (elRect.y + canvasSize.height < zrRect.height) {
|
||||
opts.offsetY -= zrRect.height - (elRect.y + canvasSize.height);
|
||||
}
|
||||
}
|
||||
this.transform = createTransform(opts);
|
||||
this.transformAll();
|
||||
}
|
||||
|
||||
// 更新画布尺寸
|
||||
updateZrSize(opts) {
|
||||
this.rect = { x: 0, y: 0, width: opts.width, height: opts.height };
|
||||
this.revisibleAll();
|
||||
}
|
||||
// 更新画布尺寸
|
||||
updateZrSize(opts) {
|
||||
this.rect = { x: 0, y: 0, width: opts.width, height: opts.height };
|
||||
this.revisibleAll();
|
||||
}
|
||||
|
||||
// 遍历group执行回调
|
||||
traverse(cb, context) {
|
||||
this.parentLevel.eachChild(level => {
|
||||
level.eachChild((view) => {
|
||||
cb.call(context, view);
|
||||
}, context);
|
||||
}, context);
|
||||
}
|
||||
// 遍历group执行回调
|
||||
traverse(cb, context) {
|
||||
this.parentLevel.eachChild(level => {
|
||||
level.eachChild((view) => {
|
||||
cb.call(context, view);
|
||||
}, context);
|
||||
}, context);
|
||||
}
|
||||
}
|
||||
|
||||
export default TransformHandle;
|
||||
|
@ -120,7 +120,7 @@ export function Jlmap3ddata(mapid,scope){
|
||||
}
|
||||
|
||||
function init3d(mapid,netdata){
|
||||
console.log(netdata)
|
||||
// console.log(netdata)
|
||||
getMapDetail(mapid).then(data => {
|
||||
jlmap3ddata.id = netdata.id;
|
||||
jlmap3ddata.mapId = mapid;
|
||||
@ -141,8 +141,8 @@ export function Jlmap3ddata(mapid,scope){
|
||||
let switchdata = JSON.parse(netdata.switchs);
|
||||
let signaldata = JSON.parse(netdata.signals);
|
||||
let standsdata = JSON.parse(netdata.stands);
|
||||
console.log(mapdata);
|
||||
assetloader.setmodellist(netdata.assets);
|
||||
// console.log(mapdata);
|
||||
assetloader.setmodellist(netdata.assets,5);
|
||||
assetloader.assetpromise(scene)
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
@ -162,7 +162,7 @@ export function Jlmap3ddata(mapid,scope){
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,scene,assetloader);
|
||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,scene,assetloader,"0");
|
||||
})
|
||||
// .then(function(data){
|
||||
// //console.log(data);
|
||||
|
@ -48,7 +48,7 @@ export function SectionList() {
|
||||
}
|
||||
}
|
||||
buildsuidao(linkdata,scope.sections,assetloader,scene);
|
||||
console.log(scope.sections.datalist);
|
||||
// console.log(scope.sections.datalist);
|
||||
//定义区分道岔组
|
||||
let switchlist = [];
|
||||
//遍历道岔数据
|
||||
@ -105,7 +105,7 @@ export function SectionList() {
|
||||
}
|
||||
}
|
||||
scope.switchs.datalist = switchlist;
|
||||
console.log(switchlist);
|
||||
// console.log(switchlist);
|
||||
//道岔贴图
|
||||
let switchmesh1;
|
||||
let switchmesh2;
|
||||
@ -142,9 +142,9 @@ export function SectionList() {
|
||||
|
||||
let switchposz = sectionA.position.z;
|
||||
let switchposx;
|
||||
if(switchlist[i].code == "Switch_135_0.16369"){
|
||||
console.log(switchlist[i]);
|
||||
}
|
||||
// if(switchlist[i].code == "Switch_135_0.16369"){
|
||||
// console.log(switchlist[i]);
|
||||
// }
|
||||
if(switchlist[i].pa[0].x>switchlist[i].pb[0].x){
|
||||
if(((switchlist[i].pc[0].y+switchlist[i].pc[1].y)/2) < switchlist[i].pa[0].y){
|
||||
if(((switchlist[i].pc[0].x+switchlist[i].pc[1].x)/2)>switchlist[i].pa[0].x){
|
||||
@ -270,7 +270,7 @@ export function SectionList() {
|
||||
|
||||
this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,switchdata,scene){
|
||||
return new Promise(function(resolve, reject){
|
||||
console.log(sectiondata);
|
||||
// console.log(sectiondata);
|
||||
scene.add(scope.sectiongroup);
|
||||
scene.add(scope.switchgroup);
|
||||
let linkdata = jlmap3ddata.linklist;
|
||||
|
@ -159,13 +159,13 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
if (trainlisttest.list[code].runMode == '02') {
|
||||
|
||||
if (trainlisttest.list[code].isStandTrack == true) {
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/25/trainlisttest.list[code].len);
|
||||
} else {
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/25/trainlisttest.list[code].len);
|
||||
}
|
||||
} else {
|
||||
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/25/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
if (code == drivingcode) {
|
||||
@ -309,7 +309,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) {
|
||||
|
||||
if (rails.linkrail[data.body[i].linkCode]) {
|
||||
console.log(trainlisttest.group);
|
||||
// console.log(trainlisttest.group);
|
||||
if(trainlisttest.group.children.length<1){
|
||||
trainlisttest.group.add(trainlisttest.list[code]);
|
||||
}
|
||||
@ -363,7 +363,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
// trainlisttest.list[code].startmark = 1;
|
||||
}else{
|
||||
trainlisttest.list[code].speeds = data.body[i].speed;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/24/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/25/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
|
||||
@ -421,7 +421,41 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
}
|
||||
}
|
||||
if (trainlisttest.list[code].status != data.body[i].directionType) {
|
||||
if (data.body[i].directionType == '02') { // 向右
|
||||
|
||||
trainlisttest.list[code].progress = 0;
|
||||
const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
|
||||
const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14];
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = rotaposz;
|
||||
}
|
||||
|
||||
trainlisttest.list[code].progress = (rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '02';
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
|
||||
} else if (data.body[i].directionType == '03') { // 向左
|
||||
trainlisttest.list[code].progress = 0;
|
||||
const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
|
||||
const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]);
|
||||
trainlisttest.list[code].rotation.y = Math.PI;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = -rotaposz;
|
||||
}
|
||||
trainlisttest.list[code].progress = 1-(rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '03';
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -485,7 +519,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft;
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].progress = data.body[i].linkOffsetPercent;
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/24/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/25/trainlisttest.list[code].len);
|
||||
}
|
||||
}else if(data.body[i].directionType == '03'){
|
||||
if(rails.linkrail[data.body[i].linkCode].lineright){
|
||||
@ -499,7 +533,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright;
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].progress = 1-data.body[i].linkOffsetPercent;
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/24/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/25/trainlisttest.list[code].len);
|
||||
}
|
||||
}
|
||||
trainlisttest.list[code].nextcode = nextcode;
|
||||
|
@ -12,6 +12,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
|
||||
if(trainmodel.speeds > 0 && trainmodel.speeds){
|
||||
let speed = null;
|
||||
// console.log(traindata.group.children[0].progress);
|
||||
if(traindata.group.children[0].progress >=0&&traindata.group.children[0].progress<=1){
|
||||
|
||||
let movecurve = trainmodel.curve;
|
||||
@ -19,8 +20,9 @@ export function UpdateTrain(camera,traindata,control){
|
||||
if(trainmodel.status == "03"){
|
||||
if(movecurve.points.length>1){
|
||||
let point = movecurve.getPointAt(traindata.group.children[0].progress);
|
||||
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.001){
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
|
||||
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||
@ -37,7 +39,8 @@ export function UpdateTrain(camera,traindata,control){
|
||||
|
||||
let offsetz = parseFloat(trainmodel.children[0].matrixWorld.elements[14]) - parseFloat(point.z);
|
||||
trainmodel.children[0].position.z += offsetz;
|
||||
//trainmodel.position.z = point.z;
|
||||
|
||||
// trainmodel.position.z = point.z;
|
||||
}
|
||||
|
||||
trainmodel.position.x = point.x;
|
||||
@ -52,7 +55,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
trainmodel.children[rs].position.z += offsetz;
|
||||
|
||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]-6)<=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]-10)<=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
|
||||
if(rs != 5){
|
||||
let asd = trainmodel.children[rs].rotalist[0];
|
||||
@ -78,8 +81,9 @@ export function UpdateTrain(camera,traindata,control){
|
||||
if(trainmodel.status == "02"){
|
||||
if(movecurve.points.length>1){
|
||||
let point = movecurve.getPointAt(trainmodel.progress);
|
||||
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.001){
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
|
||||
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||
@ -94,12 +98,13 @@ export function UpdateTrain(camera,traindata,control){
|
||||
}
|
||||
trainmodel.children[1].rotalist.push(rotas);
|
||||
let offsetz = parseFloat(point.z) - parseFloat(trainmodel.children[0].matrixWorld.elements[14]);
|
||||
trainmodel.children[0].position.z += offsetz;
|
||||
//trainmodel.position.z = point.z;
|
||||
}
|
||||
|
||||
trainmodel.children[0].position.z += offsetz;
|
||||
// trainmodel.position.z = point.z;
|
||||
}
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
|
||||
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
||||
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
@ -110,7 +115,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
trainmodel.children[rs].position.z += offsetz;
|
||||
|
||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]+6)>=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]+10)>=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
|
||||
if(rs != 5){
|
||||
let asd = trainmodel.children[rs].rotalist[0];
|
||||
@ -146,7 +151,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
trainmodel.progress = 0;
|
||||
trainmodel.len = trainmodel.nextlen;
|
||||
trainmodel.nowcode = trainmodel.nextcode;
|
||||
trainmodel.speeds = parseFloat(trainmodel.speed*10/36/24/trainmodel.len);
|
||||
trainmodel.speeds = parseFloat(trainmodel.speed*10/36/25/trainmodel.len);
|
||||
trainmodel.curve = trainmodel.nextcurve;
|
||||
|
||||
trainmodel.nextcurve = null;
|
||||
@ -178,7 +183,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
if(trainmodel.status == "03" && trainmodel.progress>0){
|
||||
if(movecurve.points.length>1){
|
||||
let point = movecurve.getPointAt(traindata.group.children[0].progress);
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.01){
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
|
||||
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||
@ -210,7 +215,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
trainmodel.children[rs].position.z += offsetz;
|
||||
|
||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]-6)<=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
if((trainmodel.children[rs].matrixWorld.elements[12]-9)<=trainmodel.children[rs].rotalist[0].posr.x){
|
||||
|
||||
if(rs != 5){
|
||||
let asd = trainmodel.children[rs].rotalist[0];
|
||||
@ -240,7 +245,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
if(movecurve.points.length>1 && trainmodel.progress>0){
|
||||
|
||||
let point = movecurve.getPointAt(trainmodel.progress);
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.01){
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.005){
|
||||
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
|
||||
|
@ -114,13 +114,13 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
||||
trainlisttest.list[code].speed = data.body[tl].v;
|
||||
if (trainlisttest.list[code].runMode == '02') {
|
||||
if (trainlisttest.list[code].isStandTrack == true) {
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/17/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/20/trainlisttest.list[code].len);
|
||||
} else {
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/20/trainlisttest.list[code].len);
|
||||
}
|
||||
} else {
|
||||
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/20/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
if (code == drivingcode) {
|
||||
@ -313,7 +313,7 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
||||
// trainlisttest.list[code].startmark = 1;
|
||||
}else{
|
||||
trainlisttest.list[code].speeds = data.body[i].speed;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/20/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
}
|
||||
@ -622,9 +622,9 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
||||
|
||||
rails.switchrail[code].locateType = "01";
|
||||
let testswitch = rails.switchrail[code];
|
||||
console.log(testswitch);
|
||||
console.log(rails.linkrail[testswitch.alink]);
|
||||
console.log(rails.linkrail[testswitch.clink]);
|
||||
// console.log(testswitch);
|
||||
// console.log(rails.linkrail[testswitch.alink]);
|
||||
// console.log(rails.linkrail[testswitch.clink]);
|
||||
if(rails.switchrail[code].directtype == "1"){
|
||||
rails.linkrail[testswitch.alink].lconnect = testswitch.blink;
|
||||
rails.linkrail[testswitch.blink].rconnect = testswitch.alink;
|
||||
|
@ -36,6 +36,7 @@ let defaultstation = {
|
||||
picUrl:"",
|
||||
assetUrl:modelurl+"/models/station/fuzhou/fuzhou.FBX"
|
||||
}
|
||||
//modelurl+"/models/station/fuzhou/fuzhou.FBX"
|
||||
//https://test.joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
||||
//https://joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
||||
//../../static/model/station/zhantai715(2).FBX
|
||||
@ -64,11 +65,12 @@ let defaultsuidao = {
|
||||
deviceType:"suidao",
|
||||
type:"suidao",
|
||||
picUrl:"",
|
||||
assetUrl:"../../static/model/suidao/suidao.FBX"
|
||||
assetUrl:modelurl+"/models/suidao/suidao.FBX"
|
||||
}
|
||||
//modelurl+"/models/suidao/suidao.FBX"
|
||||
//https://test.joylink.club/oss/models/suidao/suidao.FBX
|
||||
//https://joylink.club/oss/models/suidao/suidao.FBX
|
||||
//../../static/model/
|
||||
//../../static/model/suidao/suidao.FBX
|
||||
|
||||
let defaultautorail = {
|
||||
id:"100",
|
||||
@ -112,11 +114,16 @@ export function AssetLoader(){
|
||||
|
||||
this.name = null;
|
||||
|
||||
this.trainoffset = 0;
|
||||
|
||||
this.modellist = [];
|
||||
|
||||
this.materiallist = [];
|
||||
//初始化资源加载器
|
||||
this.setmodellist = function (data){
|
||||
this.setmodellist = function (data,trainoffset){
|
||||
if(trainoffset){
|
||||
scope.trainoffset = trainoffset;
|
||||
}
|
||||
// console.log("setmodellist");
|
||||
let defaultmodel1 = new AssetModel(defaultsignal);
|
||||
scope.modellist.push(defaultmodel1);
|
||||
@ -464,7 +471,8 @@ export function AssetLoader(){
|
||||
let name = "c"+j;
|
||||
for(let i=0;i<object.children.length;i++){
|
||||
if(object.children[i].name == name){
|
||||
object.children[i].position.x = object.children[i].position.x;
|
||||
|
||||
object.children[i].position.x = object.children[i].position.x+scope.trainoffset;
|
||||
//object.children[i].position.y = j*10;
|
||||
realtrain.add(object.children[i]);
|
||||
i--;
|
||||
|
@ -554,7 +554,7 @@ THREE.FBXLoader = ( function () {
|
||||
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
||||
parameters.side = THREE.DoubleSide;
|
||||
parameters.transparent = true;
|
||||
parameters.alphaTest = 0.7;
|
||||
// parameters.alphaTest = 0.7;
|
||||
parameters.opacity = 1;
|
||||
|
||||
}else{
|
||||
@ -567,7 +567,7 @@ THREE.FBXLoader = ( function () {
|
||||
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
||||
parameters.side = THREE.DoubleSide;
|
||||
parameters.transparent = true;
|
||||
parameters.alphaTest = 0.7;
|
||||
// parameters.alphaTest = 0.7;
|
||||
parameters.opacity = 1;
|
||||
}else{
|
||||
parameters.opacity = parseFloat( materialNode.Opacity.value );
|
||||
@ -577,7 +577,7 @@ THREE.FBXLoader = ( function () {
|
||||
if ( parameters.opacity < 1.0 ) {
|
||||
|
||||
parameters.transparent = true;
|
||||
parameters.alphaTest = 0.1;
|
||||
// parameters.alphaTest = 0.1;
|
||||
}
|
||||
|
||||
if ( materialNode.ReflectionFactor ) {
|
||||
|
@ -66,7 +66,7 @@ export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,store
|
||||
let signaldata = JSON.parse(netdata.signals);
|
||||
let standsdata = JSON.parse(netdata.stands);
|
||||
// console.log(netdata.assets);
|
||||
assetloader.setmodellist(netdata.assets);
|
||||
assetloader.setmodellist(netdata.assets,5);
|
||||
|
||||
assetloader.assetpromise(sceneload)
|
||||
.then(function(data){
|
||||
@ -75,12 +75,12 @@ export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,store
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return jlmap3ddata.stationstandlist.initpromise(mapdata.stationList,mapdata.stationStandList,sceneload,assetloader,netdata.stands,mixers,actions);
|
||||
return jlmap3ddata.stationstandlist.initpromise(mapdata.stationList,mapdata.stationStandList,sceneload,assetloader,netdata.stands,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
//console.log(assetloader);
|
||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions);
|
||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
|
@ -73,12 +73,12 @@ export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,mixer
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return jlmap3ddata.stationstandlist.initpromise(mapdata.stationList,mapdata.stationStandList,sceneload,assetloader,netdata.stands,mixers,actions);
|
||||
return jlmap3ddata.stationstandlist.initpromise(mapdata.stationList,mapdata.stationStandList,sceneload,assetloader,netdata.stands,mixers,actions,"0");
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
//console.log(assetloader);
|
||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions);
|
||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"0");
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
@ -104,7 +104,7 @@ export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,mixer
|
||||
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
|
||||
if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "suidao"){
|
||||
// scope.assetloader.modellist[mn].mesh.rotation.x = Math.PI/2;
|
||||
scope.assetloader.modellist[mn].mesh.position.y -=0.1;
|
||||
// scope.assetloader.modellist[mn].mesh.position.y -=0.1;
|
||||
// console.log(scope.assetloader.modellist[mn].mesh);
|
||||
scene.add(scope.assetloader.modellist[mn].mesh);
|
||||
}
|
||||
|
@ -23,24 +23,8 @@ export function RailList(){
|
||||
points:[],
|
||||
type:null
|
||||
};
|
||||
if(linkdata[i].rotation._z == 0){
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x+2,0,scope.linkrail[linkdata[i].code].lp.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x-2,0,scope.linkrail[linkdata[i].code].rp.z));
|
||||
scope.linkrail[linkdata[i].code].type = 0;
|
||||
}else{
|
||||
|
||||
if(linkdata[i].rotation._z>0){
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x+2.2,0,scope.linkrail[linkdata[i].code].lp.z-0.2));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x-2.2,0,scope.linkrail[linkdata[i].code].rp.z+0.2));
|
||||
scope.linkrail[linkdata[i].code].type = 1;
|
||||
}else{
|
||||
scope.linkrail[linkdata[i].code].type = 2;
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x+2.2,0,scope.linkrail[linkdata[i].code].lp.z+0.2));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x-2.2,0,scope.linkrail[linkdata[i].code].rp.z-0.2));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(let i=0;i<switchdata.length;i++){
|
||||
scope.switchrail[switchdata[i].code] = {
|
||||
alink:switchdata[i].alink,
|
||||
@ -52,64 +36,101 @@ export function RailList(){
|
||||
};
|
||||
|
||||
if(scope.linkrail[switchdata[i].blink].lp.x < switchdata[i].position.x){
|
||||
scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(switchdata[i].position.x-1,switchdata[i].position.y,switchdata[i].position.z));
|
||||
scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
if(scope.linkrail[switchdata[i].alink].type == 1){
|
||||
scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+1.1,0,scope.linkrail[switchdata[i].alink].lp.z-0.1));
|
||||
scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+2.2,0,scope.linkrail[switchdata[i].alink].lp.z-0.2));
|
||||
}else if(scope.linkrail[switchdata[i].alink].type == 2){
|
||||
scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+1.1,0,scope.linkrail[switchdata[i].alink].lp.z+0.1));
|
||||
scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+2.2,0,scope.linkrail[switchdata[i].alink].lp.z+0.2));
|
||||
}else{
|
||||
scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+2,0,scope.linkrail[switchdata[i].alink].lp.z));
|
||||
}
|
||||
scope.switchrail[switchdata[i].code].directtype = "1";
|
||||
scope.linkrail[switchdata[i].alink].lswitch = switchdata[i].code;
|
||||
scope.linkrail[switchdata[i].blink].rswitch = switchdata[i].code;
|
||||
|
||||
}else{
|
||||
scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x+1,switchdata[i].position.y,switchdata[i].position.z));
|
||||
scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
if(scope.linkrail[switchdata[i].alink].type == 1){
|
||||
scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-1.1,0,scope.linkrail[switchdata[i].alink].rp.z+0.1));
|
||||
scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-2.2,0,scope.linkrail[switchdata[i].alink].rp.z+0.2));
|
||||
}else if(scope.linkrail[switchdata[i].alink].type == 2){
|
||||
scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-1.1,0,scope.linkrail[switchdata[i].alink].rp.z-0.1));
|
||||
scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-2.2,0,scope.linkrail[switchdata[i].alink].rp.z-0.2));
|
||||
}else{
|
||||
scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-2,0,scope.linkrail[switchdata[i].alink].rp.z));
|
||||
}
|
||||
scope.switchrail[switchdata[i].code].directtype = "2";
|
||||
scope.linkrail[switchdata[i].alink].rswitch = switchdata[i].code;
|
||||
scope.linkrail[switchdata[i].blink].lswitch = switchdata[i].code;
|
||||
}
|
||||
//
|
||||
if(scope.linkrail[switchdata[i].clink].lp.x < switchdata[i].position.x){
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(switchdata[i].position.x-1,switchdata[i].position.y,switchdata[i].position.z));
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
if(scope.linkrail[switchdata[i].alink].type == 1){
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(switchdata[i].position.x+1,switchdata[i].position.y,switchdata[i].position.z-0.11));
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+1.1,0,scope.linkrail[switchdata[i].alink].lp.z-0.1));
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+2.2,0,scope.linkrail[switchdata[i].alink].lp.z-0.2));
|
||||
}else if(scope.linkrail[switchdata[i].alink].type == 2){
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(switchdata[i].position.x+1,switchdata[i].position.y,switchdata[i].position.z+0.11));
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+1.1,0,scope.linkrail[switchdata[i].alink].lp.z+0.1));
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+2.2,0,scope.linkrail[switchdata[i].alink].lp.z+0.2));
|
||||
}else{
|
||||
scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(scope.linkrail[switchdata[i].alink].lp.x+2,0,scope.linkrail[switchdata[i].alink].lp.z));
|
||||
}
|
||||
scope.switchrail[switchdata[i].code].directtype = "1";
|
||||
scope.linkrail[switchdata[i].alink].lswitch = switchdata[i].code;
|
||||
scope.linkrail[switchdata[i].clink].rswitch = switchdata[i].code;
|
||||
}else{
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x+1,switchdata[i].position.y,switchdata[i].position.z));
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
if(scope.linkrail[switchdata[i].alink].type == 1){
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x-1,switchdata[i].position.y,switchdata[i].position.z+0.11));
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-1.1,0,scope.linkrail[switchdata[i].alink].rp.z+0.1));
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-2.2,0,scope.linkrail[switchdata[i].alink].rp.z+0.2));
|
||||
}else if(scope.linkrail[switchdata[i].alink].type == 2){
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x-1,switchdata[i].position.y,switchdata[i].position.z-0.11));
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-1.1,0,scope.linkrail[switchdata[i].alink].rp.z-0.1));
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-2.2,0,scope.linkrail[switchdata[i].alink].rp.z-0.2));
|
||||
}else{
|
||||
scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(scope.linkrail[switchdata[i].alink].rp.x-2,0,scope.linkrail[switchdata[i].alink].rp.z));
|
||||
}
|
||||
scope.switchrail[switchdata[i].code].directtype = "2";
|
||||
scope.linkrail[switchdata[i].alink].rswitch = switchdata[i].code;
|
||||
scope.linkrail[switchdata[i].clink].lswitch = switchdata[i].code;
|
||||
}
|
||||
}
|
||||
|
||||
for(let i=0;i<linkdata.length;i++){
|
||||
if(linkdata[i].rotation._z == 0){
|
||||
scope.linkrail[linkdata[i].code].type = 0;
|
||||
if(scope.linkrail[linkdata[i].code].lswitch){
|
||||
let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].lswitch].position;
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
}
|
||||
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x,0,scope.linkrail[linkdata[i].code].lp.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x,0,scope.linkrail[linkdata[i].code].rp.z));
|
||||
|
||||
if(scope.linkrail[linkdata[i].code].rswitch){
|
||||
let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].rswitch].position;
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if(linkdata[i].rotation._z>0){
|
||||
let testline = new THREE.CatmullRomCurve3([
|
||||
new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x,0,scope.linkrail[linkdata[i].code].lp.z),
|
||||
new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x,0,scope.linkrail[linkdata[i].code].rp.z)
|
||||
]);
|
||||
|
||||
scope.linkrail[linkdata[i].code].type = 1;
|
||||
if(scope.linkrail[linkdata[i].code].lswitch){
|
||||
let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].lswitch].position;
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+4.5,0,switchpoint.z-0.05));
|
||||
}
|
||||
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12));
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.22));
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.82));
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.92));
|
||||
|
||||
if(scope.linkrail[linkdata[i].code].rswitch){
|
||||
let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].rswitch].position;
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-4.5,0,switchpoint.z+0.05));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
}
|
||||
|
||||
}else{
|
||||
let testline = new THREE.CatmullRomCurve3([
|
||||
new THREE.Vector3(scope.linkrail[linkdata[i].code].lp.x,0,scope.linkrail[linkdata[i].code].lp.z),
|
||||
new THREE.Vector3(scope.linkrail[linkdata[i].code].rp.x,0,scope.linkrail[linkdata[i].code].rp.z)
|
||||
]);
|
||||
scope.linkrail[linkdata[i].code].type = 2;
|
||||
if(scope.linkrail[linkdata[i].code].lswitch){
|
||||
let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].lswitch].position;
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+4.5,0,switchpoint.z+0.05));
|
||||
}
|
||||
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12));
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.22));
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.82));
|
||||
scope.linkrail[linkdata[i].code].points.push(testline.getPointAt(0.92));
|
||||
|
||||
if(scope.linkrail[linkdata[i].code].rswitch){
|
||||
let switchpoint = scope.switchrail[scope.linkrail[linkdata[i].code].rswitch].position;
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-4.5,0,switchpoint.z-0.05));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z));
|
||||
scope.linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(let i=0;i<switchdata.length;i++){
|
||||
|
||||
const ddd = storemod.getters['map/getDeviceByCode'](switchdata[i].code);
|
||||
scope.switchrail[switchdata[i].code].locateType = ddd.locateType;
|
||||
@ -123,7 +144,6 @@ export function RailList(){
|
||||
scope.linkrail[switchdata[i].alink].rconnect = switchdata[i].blink;
|
||||
scope.linkrail[switchdata[i].blink].lconnect = switchdata[i].alink;
|
||||
}
|
||||
|
||||
}else if(ddd.locateType == "02"){
|
||||
if(switchdata[i].directtype == "1"){
|
||||
scope.linkrail[switchdata[i].alink].lconnect = switchdata[i].clink;
|
||||
@ -133,10 +153,38 @@ export function RailList(){
|
||||
scope.linkrail[switchdata[i].clink].lconnect = switchdata[i].alink;
|
||||
}
|
||||
}
|
||||
|
||||
if(scope.linkrail[switchdata[i].blink].lp.x < switchdata[i].position.x){
|
||||
// scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(switchdata[i].position.x-2,switchdata[i].position.y,switchdata[i].position.z));
|
||||
// scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
// scope.linkrail[switchdata[i].blink].points.push(new THREE.Vector3(switchdata[i].position.x+1.5,switchdata[i].position.y,switchdata[i].position.z));
|
||||
//
|
||||
scope.switchrail[switchdata[i].code].directtype = "1";
|
||||
}else{
|
||||
// scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x+2,switchdata[i].position.y,switchdata[i].position.z));
|
||||
// scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
// scope.linkrail[switchdata[i].blink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x-1.5,switchdata[i].position.y,switchdata[i].position.z));
|
||||
//
|
||||
scope.switchrail[switchdata[i].code].directtype = "2";
|
||||
}
|
||||
|
||||
if(scope.linkrail[switchdata[i].clink].lp.x < switchdata[i].position.x){
|
||||
// // scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(switchdata[i].position.x-3.5,switchdata[i].position.y,switchdata[i].position.z+0.02));
|
||||
// scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
// scope.linkrail[switchdata[i].clink].points.push(new THREE.Vector3(switchdata[i].position.x+1.5,switchdata[i].position.y,switchdata[i].position.z));
|
||||
//
|
||||
scope.switchrail[switchdata[i].code].directtype = "1";
|
||||
}else{
|
||||
// // scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x+3.5,switchdata[i].position.y,switchdata[i].position.z-0.02));
|
||||
// scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x,switchdata[i].position.y,switchdata[i].position.z));
|
||||
// scope.linkrail[switchdata[i].clink].points.splice(0,0,new THREE.Vector3(switchdata[i].position.x-1.5,switchdata[i].position.y,switchdata[i].position.z));
|
||||
//
|
||||
scope.switchrail[switchdata[i].code].directtype = "2";
|
||||
}
|
||||
}
|
||||
for(let i=0;i<linkdata.length;i++){
|
||||
scope.linkrail[linkdata[i].code].lineleft = new THREE.CatmullRomCurve3(scope.linkrail[linkdata[i].code].points);
|
||||
// scope.linkrail[linkdata[i].code].lineleft.curveType = "catmullrom";
|
||||
scope.linkrail[linkdata[i].code].lineleft.curveType = "centripetal";
|
||||
// scope.linkrail[linkdata[i].code].lineleft.tension = 0.2;
|
||||
let rightpoints = [];
|
||||
scope.linkrail[linkdata[i].code].points.forEach(item=>{
|
||||
@ -145,10 +193,10 @@ export function RailList(){
|
||||
);
|
||||
rightpoints.reverse();
|
||||
scope.linkrail[linkdata[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints);
|
||||
scope.linkrail[linkdata[i].code].lineright.curveType = "chordal";
|
||||
scope.linkrail[linkdata[i].code].lineright.curveType = "centripetal";
|
||||
//
|
||||
// for(let n=0,nm=scope.linkrail[linkdata[i].code].lineleft.points.length;n<nm;n++){
|
||||
// var geometry = new THREE.CircleGeometry( 0.5, 16 );
|
||||
// var geometry = new THREE.CircleGeometry( 0.05, 16 );
|
||||
// var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||
// var circle = new THREE.Mesh( geometry, material );
|
||||
// console.log(n);
|
||||
@ -177,7 +225,7 @@ export function RailList(){
|
||||
// // Create the final object to add to the scene
|
||||
// var curveObject = new THREE.Line( geometry, material );
|
||||
//
|
||||
// curveObject.position.y = Math.random()/10;
|
||||
// curveObject.position.y = Math.random();
|
||||
// scene.add(curveObject);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ export function StationStandList() {
|
||||
|
||||
this.textlist = [];
|
||||
|
||||
this.initpromise = function(stationdata,stationstanddata,scene,assetloader,netdata,mixers,actionss){
|
||||
this.initpromise = function(stationdata,stationstanddata,scene,assetloader,netdata,mixers,actionss,mode){
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
let netstand = null;
|
||||
@ -164,25 +164,33 @@ export function StationStandList() {
|
||||
map[k].mesh.scale.x = netstand[map[k].index].scale.x;
|
||||
map[k].mesh.scale.y = netstand[map[k].index].scale.y;
|
||||
map[k].mesh.scale.z = netstand[map[k].index].scale.z;
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 271, 374, 1 );
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(stationdata[map[k].num]));
|
||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
textplane.name = stationdata[map[k].num].code;
|
||||
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 271, 374, 1 );
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(stationdata[map[k].num]));
|
||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
textplane.name = stationdata[map[k].num].code;
|
||||
textplane.position.y = 300;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
//textplane.position.x = -30;
|
||||
scope.textlist.push(textplane);
|
||||
map[k].mesh.add(textplane);
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
map[k].type = "station";
|
||||
map[k].rname = stationdata[map[k].num].runPlanName;
|
||||
map[k].kmmark = stationdata[map[k].num].kmPost;
|
||||
|
||||
textplane.position.y = 300;
|
||||
textplane.rotation.x = Math.PI/2;
|
||||
//textplane.position.x = -30;
|
||||
scope.textlist.push(textplane);
|
||||
map[k].mesh.add(textplane);
|
||||
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
|
||||
|
||||
|
||||
scope.group.add(map[k].mesh);
|
||||
}
|
||||
@ -354,9 +362,9 @@ function getTextCanvas(text){
|
||||
ctx.fillText("信息", 114,100);
|
||||
ctx.fillText("备忘", 190,100);
|
||||
|
||||
ctx.fillText("车站序号: "+text.name, 40,155);
|
||||
ctx.fillText("车站序号: "+text.name, 10,155);
|
||||
|
||||
ctx.fillText("公里标记:"+text.kmPost,40 ,256*3/4);
|
||||
ctx.fillText("公里标记:"+text.kmPost,10 ,256*3/4);
|
||||
|
||||
let data = ctx.getImageData(0, 0,256,512);
|
||||
return data;
|
||||
|
@ -12,7 +12,7 @@ export function TrainList() {
|
||||
|
||||
this.textlist = [];
|
||||
|
||||
this.initpromise = function(data,scene,assetloader,mixers,actionss){
|
||||
this.initpromise = function(data,scene,assetloader,mixers,actionss,mode){
|
||||
return new Promise(function(resolve, reject){
|
||||
//遍历列车数据
|
||||
for(let i=0;i<data.length;i++){
|
||||
@ -118,22 +118,28 @@ export function TrainList() {
|
||||
// newmesh.children[n-1].add(newmesh.children[n]);
|
||||
// }
|
||||
//创建列车字牌
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 150, 100, 1 );
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(data[i]));
|
||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
textplane.name = data[i].code;
|
||||
textplane.position.x = 0;
|
||||
textplane.position.y = 0;
|
||||
textplane.position.z = 60;
|
||||
textplane.tcode = data[i].code;
|
||||
//textplane.rotation.x = Math.PI;
|
||||
scope.textlist.push(textplane);
|
||||
newmesh.children[0].add(textplane);
|
||||
if(mode){
|
||||
if(mode == "02"){
|
||||
let textgeometry = new THREE.PlaneBufferGeometry( 150, 100, 1 );
|
||||
let textt = new THREE.CanvasTexture(getTextCanvas(data[i]));
|
||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||
textplane.name = data[i].code;
|
||||
textplane.position.x = 0;
|
||||
textplane.position.y = 0;
|
||||
textplane.position.z = 60;
|
||||
textplane.tcode = data[i].code;
|
||||
//textplane.rotation.x = Math.PI;
|
||||
scope.textlist.push(textplane);
|
||||
newmesh.children[0].add(textplane);
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
textgeometry.dispose();
|
||||
textmaterial.dispose();
|
||||
textt.dispose();
|
||||
//group.add(textplane);
|
||||
newmesh.first = false;
|
||||
newmesh.name = data[i].code;
|
||||
@ -187,24 +193,24 @@ function getTextCanvas(text){
|
||||
var canvas = document.getElementById('canvastexture');
|
||||
|
||||
canvas.width = 128;
|
||||
canvas.height = 96;
|
||||
canvas.height = 64;
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
//var bg = canvas.createPattern(img, "no-repeat");
|
||||
//ctx.fillStyle = bg;
|
||||
ctx.fillRect(0, 0,128,96);
|
||||
ctx.font = "10px Verdana";
|
||||
ctx.fillRect(0, 0,128,64);
|
||||
ctx.font = "8px Verdana";
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,128,96);
|
||||
ctx.clearRect(0,0,128,64);
|
||||
//console.log(text.groupNumber);
|
||||
ctx.drawImage(beauty,0,0,128, 96);
|
||||
ctx.fillText("车组号:"+text.groupNumber, 60,15);
|
||||
ctx.fillText("车组人员:XXX", 60,31);
|
||||
ctx.fillText("速度:XXX.XXX", 60,43);
|
||||
ctx.drawImage(beauty,0,0,128, 64);
|
||||
ctx.fillText("车组号:"+text.groupNumber, 40,10);
|
||||
ctx.fillText("车组人员:XXX", 40,20);
|
||||
// ctx.fillText("速度:XXX.XXX", 40,30);
|
||||
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
|
||||
let data = ctx.getImageData(0, 0,128,96);
|
||||
let data = ctx.getImageData(0, 0,128,64);
|
||||
return data;
|
||||
}
|
||||
|
@ -20,7 +20,8 @@ export function UpdateTrain(camera,traindata){
|
||||
if(trainmodel.status == "03"){
|
||||
if(movecurve.points.length>1){
|
||||
let point = movecurve.getPointAt(traindata.group.children[j].progress);
|
||||
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){
|
||||
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[j].progress).normalize();
|
||||
@ -46,8 +47,7 @@ export function UpdateTrain(camera,traindata){
|
||||
//trainmodel.position.z = point.z;
|
||||
}
|
||||
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
|
||||
|
||||
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
@ -84,6 +84,8 @@ export function UpdateTrain(camera,traindata){
|
||||
if(trainmodel.status == "02"){
|
||||
if(movecurve.points.length>1){
|
||||
let point = movecurve.getPointAt(trainmodel.progress);
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){
|
||||
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||
let tangent = movecurve.getTangentAt(traindata.group.children[j].progress).normalize();
|
||||
@ -103,8 +105,7 @@ export function UpdateTrain(camera,traindata){
|
||||
//trainmodel.position.z = point.z;
|
||||
}
|
||||
|
||||
trainmodel.position.x = point.x;
|
||||
trainmodel.position.y = 0;
|
||||
|
||||
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
|
||||
|
||||
for(let rs = 1;rs<6;rs++){
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -4,127 +4,132 @@ const deviceRender = {};
|
||||
|
||||
/** link渲染配置*/
|
||||
deviceRender[deviceType.Link] = {
|
||||
_type: deviceType.Link,
|
||||
zlevel: 1
|
||||
// progressive: 1
|
||||
_type: deviceType.Link,
|
||||
zlevel: 1
|
||||
// progressive: 1
|
||||
};
|
||||
|
||||
/** Section渲染配置*/
|
||||
deviceRender[deviceType.Section] = {
|
||||
_type: deviceType.Section,
|
||||
zlevel: 1
|
||||
// progressive: 2
|
||||
_type: deviceType.Section,
|
||||
zlevel: 1
|
||||
// progressive: 2
|
||||
};
|
||||
|
||||
/** Signal渲染配置*/
|
||||
deviceRender[deviceType.Signal] = {
|
||||
_type: deviceType.Signal,
|
||||
zlevel: 1
|
||||
// progressive: 3
|
||||
_type: deviceType.Signal,
|
||||
zlevel: 1
|
||||
// progressive: 3
|
||||
};
|
||||
|
||||
/** Switch渲染配置*/
|
||||
deviceRender[deviceType.Switch] = {
|
||||
_type: deviceType.Switch,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
_type: deviceType.Switch,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
};
|
||||
|
||||
/** Station渲染配置*/
|
||||
deviceRender[deviceType.Station] = {
|
||||
_type: deviceType.Station,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
_type: deviceType.Station,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
};
|
||||
|
||||
/** StationStand渲染配置*/
|
||||
deviceRender[deviceType.StationStand] = {
|
||||
_type: deviceType.StationStand,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
_type: deviceType.StationStand,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
};
|
||||
|
||||
/** StationControl渲染配置*/
|
||||
deviceRender[deviceType.StationControl] = {
|
||||
_type: deviceType.StationControl,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
_type: deviceType.StationControl,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
};
|
||||
|
||||
/** ImageControl渲染配置*/
|
||||
deviceRender[deviceType.ImageControl] = {
|
||||
_type: deviceType.ImageControl,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
_type: deviceType.ImageControl,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
};
|
||||
|
||||
/** ZcControl渲染配置*/
|
||||
deviceRender[deviceType.ZcControl] = {
|
||||
_type: deviceType.ZcControl,
|
||||
zlevel: 1
|
||||
// progressive: 6
|
||||
_type: deviceType.ZcControl,
|
||||
zlevel: 1
|
||||
// progressive: 6
|
||||
};
|
||||
|
||||
/** LcControl渲染配置*/
|
||||
deviceRender[deviceType.LcControl] = {
|
||||
_type: deviceType.LcControl,
|
||||
zlevel: 1
|
||||
// progressive: 6
|
||||
_type: deviceType.LcControl,
|
||||
zlevel: 1
|
||||
// progressive: 6
|
||||
};
|
||||
|
||||
/** LimitControl渲染配置*/
|
||||
deviceRender[deviceType.LimitControl] = {
|
||||
_type: deviceType.LimitControl,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
_type: deviceType.LimitControl,
|
||||
zlevel: 1
|
||||
// progressive: 5
|
||||
};
|
||||
|
||||
/** StationDelayUnlock渲染配置*/
|
||||
deviceRender[deviceType.StationDelayUnlock] = {
|
||||
_type: deviceType.StationDelayUnlock,
|
||||
zlevel: 1
|
||||
// progressive: 6
|
||||
_type: deviceType.StationDelayUnlock,
|
||||
zlevel: 1
|
||||
// progressive: 6
|
||||
};
|
||||
|
||||
/** Train渲染配置*/
|
||||
deviceRender[deviceType.Train] = {
|
||||
_type: deviceType.Train,
|
||||
zlevel: 1
|
||||
// progressive: 9
|
||||
_type: deviceType.Train,
|
||||
zlevel: 1
|
||||
// progressive: 9
|
||||
};
|
||||
|
||||
/** TrainWindow渲染配置*/
|
||||
deviceRender[deviceType.TrainWindow] = {
|
||||
_type: deviceType.TrainWindow,
|
||||
zlevel: 1
|
||||
// progressive: 8
|
||||
_type: deviceType.TrainWindow,
|
||||
zlevel: 1
|
||||
// progressive: 8
|
||||
};
|
||||
|
||||
/** Line渲染配置*/
|
||||
deviceRender[deviceType.Line] = {
|
||||
_type: deviceType.Line,
|
||||
zlevel: 1
|
||||
// progressive: 7
|
||||
_type: deviceType.Line,
|
||||
zlevel: 1
|
||||
// progressive: 7
|
||||
};
|
||||
|
||||
/** Text渲染配置*/
|
||||
deviceRender[deviceType.Text] = {
|
||||
_type: deviceType.Text,
|
||||
zlevel: 1
|
||||
// progressive: 7
|
||||
_type: deviceType.Text,
|
||||
zlevel: 1
|
||||
// progressive: 7
|
||||
};
|
||||
|
||||
/** TrainWindow渲染配置*/
|
||||
deviceRender[deviceType.TrainWindow] = {
|
||||
_type: deviceType.TrainWindow,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
_type: deviceType.TrainWindow,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
};
|
||||
/** Train渲染配置*/
|
||||
deviceRender[deviceType.TRain] = {
|
||||
_type: deviceType.TRain,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
_type: deviceType.TRain,
|
||||
zlevel: 1
|
||||
// progressive: 4
|
||||
};
|
||||
/** CheckBox渲染配置*/
|
||||
deviceRender[deviceType.CheckBox] = {
|
||||
_type: deviceType.CheckBox,
|
||||
zlevel: 1
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -1,22 +1,23 @@
|
||||
const deviceType = {
|
||||
Link: 'Link',
|
||||
Section: 'Section',
|
||||
Switch: 'Switch',
|
||||
Signal: 'Signal',
|
||||
ZcControl: 'ZcControl',
|
||||
LcControl: 'LcControl',
|
||||
LimitControl: 'LimitControl',
|
||||
ImageControl: 'ImageControl',
|
||||
Station: 'Station',
|
||||
StationStand: 'StationStand',
|
||||
StationControl: 'StationControl',
|
||||
StationCounter: 'StationCounter',
|
||||
ButtonControl: 'ButtonControl',
|
||||
StationDelayUnlock: 'StationDelayUnlock',
|
||||
Train: 'Train',
|
||||
TrainWindow: 'TrainWindow',
|
||||
Line: 'Line',
|
||||
Text: 'Text'
|
||||
Link: 'Link',
|
||||
Section: 'Section',
|
||||
Switch: 'Switch',
|
||||
Signal: 'Signal',
|
||||
ZcControl: 'ZcControl',
|
||||
LcControl: 'LcControl',
|
||||
LimitControl: 'LimitControl',
|
||||
ImageControl: 'ImageControl',
|
||||
Station: 'Station',
|
||||
StationStand: 'StationStand',
|
||||
StationControl: 'StationControl',
|
||||
StationCounter: 'StationCounter',
|
||||
ButtonControl: 'ButtonControl',
|
||||
StationDelayUnlock: 'StationDelayUnlock',
|
||||
Train: 'Train',
|
||||
TrainWindow: 'TrainWindow',
|
||||
Line: 'Line',
|
||||
Text: 'Text',
|
||||
CheckBox: 'CheckBox'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
80
src/jmap/keyboardController.js
Normal file
80
src/jmap/keyboardController.js
Normal file
@ -0,0 +1,80 @@
|
||||
import Eventful from 'zrender/src/mixin/Eventful';
|
||||
|
||||
class KeyboardController extends Eventful {
|
||||
constructor(jmap) {
|
||||
super();
|
||||
this.$jmap = jmap;
|
||||
this.$zr = jmap.getZr();
|
||||
this.events = jmap.getEvents();
|
||||
this.initData();
|
||||
this.initHandler(this.$zr);
|
||||
}
|
||||
|
||||
initHandler(zr) {
|
||||
if (zr) {
|
||||
var keydownHandle = this.keydown.bind(this);
|
||||
var keyupHandle = this.keyup.bind(this);
|
||||
|
||||
this.enable = function (opts) {
|
||||
opts = opts || {};
|
||||
this._keyOnDownUp = opts.keyOnDownUp || true;
|
||||
|
||||
window.addEventListener('keydown', keydownHandle, false);
|
||||
window.addEventListener('keyup', keyupHandle, false);
|
||||
};
|
||||
|
||||
this.disable = function () {
|
||||
window.removeEventListener('keydown', keydownHandle, false);
|
||||
window.removeEventListener('keyup', keyupHandle, false);
|
||||
};
|
||||
|
||||
this.dispose = function() {
|
||||
this.disable();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
initData() {
|
||||
this._keyboards = [
|
||||
{ key: 'Control', keyCode: 17, active: false },
|
||||
{ key: 'Shift', keyCode: 16, active: false },
|
||||
{ key: 'Alt', keyCode: 18, active: false }
|
||||
];
|
||||
}
|
||||
|
||||
keydown(e) {
|
||||
if (this._keyOnDownUp && !e.repeat) {
|
||||
var index = this._keyboards.findIndex(
|
||||
elem=> { return elem.keyCode == e.keyCode; }
|
||||
);
|
||||
|
||||
if (index >= 0) {
|
||||
this._keyboards[index].active = true;
|
||||
} else {
|
||||
var str = '';
|
||||
this._keyboards.forEach(elem => {
|
||||
if (elem.active) {
|
||||
str += elem.key;
|
||||
str += '_';
|
||||
}
|
||||
});
|
||||
|
||||
str += e.key.toUpperCase();
|
||||
this.trigger(this.events.Keyboard, str);
|
||||
this._keyboards.forEach(elem => { elem.active = false; });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keyup(e) {
|
||||
if (this._keyOnDownUp && !e.repeat) {
|
||||
this._keyboards.forEach(elem=> {
|
||||
if (elem.keyCode == e.keyCode) {
|
||||
elem.active = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default KeyboardController;
|
602
src/jmap/map.js
602
src/jmap/map.js
@ -4,6 +4,7 @@ import localStore from 'storejs';
|
||||
import Painter from './painter';
|
||||
import Options from './options';
|
||||
import MouseController from './mouseController';
|
||||
import KeyboardController from './keyboardController';
|
||||
import deviceState from './constant/deviceState';
|
||||
import deviceType from './constant/deviceType';
|
||||
import { selectSkinCode } from './config/deviceStyle';
|
||||
@ -14,353 +15,382 @@ const renderer = 'canvas';
|
||||
const devicePixelRatio = 1;
|
||||
|
||||
class Jlmap {
|
||||
constructor(opts) {
|
||||
// 回调事件
|
||||
this.methods = opts.methods;
|
||||
constructor(opts) {
|
||||
// 回调事件
|
||||
this.methods = opts.methods;
|
||||
|
||||
// 鼠标事件
|
||||
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom'};
|
||||
// 鼠标事件
|
||||
this.events = { __Pan: 'pan', __Zoom: 'zoom', Selected: 'selected', Contextmenu: 'contextmenu', DataZoom: 'dataZoom', Keyboard: 'keyboard'};
|
||||
|
||||
// 皮肤参数
|
||||
this.skinCode = '';
|
||||
// 皮肤参数
|
||||
this.skinCode = '';
|
||||
|
||||
// 皮肤风格
|
||||
this.style = {};
|
||||
// 皮肤风格
|
||||
this.style = {};
|
||||
|
||||
// 设备数据
|
||||
this.mapDevice = {};
|
||||
// 设备数据
|
||||
this.mapDevice = {};
|
||||
|
||||
// 默认状态
|
||||
this.defaultStateDict = this.loadDefaultState();
|
||||
// 默认状态
|
||||
this.defaultStateDict = this.loadDefaultState();
|
||||
|
||||
this.initMapInstance(opts);
|
||||
}
|
||||
this.initMapInstance(opts);
|
||||
}
|
||||
|
||||
// 初始化属性有鼠标事件 缩放等
|
||||
initMapInstance(opts) {
|
||||
const width = opts.dom.clientWidth;
|
||||
const height = opts.dom.clientHeight;
|
||||
this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel;
|
||||
// 初始化属性有鼠标事件 缩放等
|
||||
initMapInstance(opts) {
|
||||
const width = opts.dom.clientWidth;
|
||||
const height = opts.dom.clientHeight;
|
||||
this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel;
|
||||
|
||||
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
|
||||
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
|
||||
|
||||
this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
|
||||
this.$painter = new Painter(this);
|
||||
this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()});
|
||||
this.$painter.updateTransform(this.$options);
|
||||
this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
|
||||
this.$painter = new Painter(this);
|
||||
this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()});
|
||||
this.$painter.updateTransform(this.$options);
|
||||
|
||||
this.optionsHandler = this.setOptions.bind(this);
|
||||
this.optionsHandler = this.setOptions.bind(this);
|
||||
|
||||
this.$mouseController = new MouseController(this);
|
||||
this.$mouseController.enable();
|
||||
this.$mouseController = new MouseController(this);
|
||||
this.$mouseController.enable();
|
||||
|
||||
this.$mouseController.on(this.events.__Pan, this.optionsHandler);
|
||||
this.$mouseController.on(this.events.__Zoom, this.optionsHandler);
|
||||
}
|
||||
this.$mouseController.on(this.events.__Pan, this.optionsHandler);
|
||||
this.$mouseController.on(this.events.__Zoom, this.optionsHandler);
|
||||
|
||||
loadStyle(skinCode) {
|
||||
return selectSkinCode(skinCode);
|
||||
}
|
||||
this.$keyboardController = new KeyboardController(this);
|
||||
this.$keyboardController.enable();
|
||||
}
|
||||
|
||||
loadDefaultState() {
|
||||
const defaultStateDict = {};
|
||||
loadStyle(skinCode) {
|
||||
return selectSkinCode(skinCode);
|
||||
}
|
||||
|
||||
zrUtil.each(Object.keys(deviceState), (type) => {
|
||||
defaultStateDict[type] = {};
|
||||
zrUtil.each(Object.keys(deviceState[type] || {}), (state) => {
|
||||
defaultStateDict[type][state] = deviceState[type][state].Default;
|
||||
}, this);
|
||||
}, this);
|
||||
loadDefaultState() {
|
||||
const defaultStateDict = {};
|
||||
|
||||
return defaultStateDict;
|
||||
}
|
||||
zrUtil.each(Object.keys(deviceState), (type) => {
|
||||
defaultStateDict[type] = {};
|
||||
zrUtil.each(Object.keys(deviceState[type] || {}), (state) => {
|
||||
defaultStateDict[type][state] = deviceState[type][state].Default;
|
||||
}, this);
|
||||
}, this);
|
||||
|
||||
setMap(map, mapDevice) {
|
||||
// 保存皮肤类型
|
||||
if (map.skinVO) {
|
||||
this.skinCode = map.skinVO.code;
|
||||
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;
|
||||
}
|
||||
return defaultStateDict;
|
||||
}
|
||||
|
||||
// 更新视图大小
|
||||
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
||||
setMap(map, mapDevice) {
|
||||
// 保存皮肤类型
|
||||
if (map.skinVO) {
|
||||
this.skinCode = map.skinVO.code;
|
||||
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.mapDevice = mapDevice;
|
||||
// 更新视图大小
|
||||
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
||||
|
||||
// 加载对应皮肤
|
||||
this.style = this.loadStyle(this.skinCode);
|
||||
// 解析后的数据
|
||||
this.mapDevice = mapDevice;
|
||||
|
||||
// 数据加载完成 回调
|
||||
if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.mapDevice); }
|
||||
// 加载对应皮肤
|
||||
this.style = this.loadStyle(this.skinCode);
|
||||
|
||||
// 初次渲染视图
|
||||
this.$painter.repaint(this.mapDevice);
|
||||
// 数据加载完成 回调
|
||||
if (this.methods.dataLoaded instanceof Function) { this.methods.dataLoaded(this.mapDevice); }
|
||||
|
||||
// 视图加载完成 回调
|
||||
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); }
|
||||
}
|
||||
// 初次渲染视图
|
||||
this.$painter.repaint(this.mapDevice);
|
||||
|
||||
setDefaultState() {
|
||||
const list = [];
|
||||
// 视图加载完成 回调
|
||||
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); }
|
||||
}
|
||||
|
||||
Object.values(this.mapDevice).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
// 列车不需要设置默认状态
|
||||
type != deviceType.Train && list.push(Object.assign({ code, _type: type }, this.defaultStateDict[type]));
|
||||
});
|
||||
setDefaultState() {
|
||||
const list = [];
|
||||
|
||||
this.update(list);
|
||||
Object.values(this.mapDevice).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
// 列车不需要设置默认状态
|
||||
type != deviceType.Train && list.push(Object.assign({ code, _type: type }, this.defaultStateDict[type]));
|
||||
});
|
||||
|
||||
if (this.methods.stateLoaded instanceof Function) { this.methods.stateLoaded(list); }
|
||||
}
|
||||
this.update(list);
|
||||
|
||||
setOptions(opts) {
|
||||
const options = this.pullBack(opts);
|
||||
this.$options.update(options);
|
||||
this.$painter.updateTransform(this.$options);
|
||||
if (this.methods.stateLoaded instanceof Function) { this.methods.stateLoaded(list); }
|
||||
}
|
||||
|
||||
if (this.$options.disabled == true) {
|
||||
this.$mouseController.disable();
|
||||
} else {
|
||||
opts['zoomOnMouseWheel'] = this.zoomOnMouseWheel;
|
||||
this.$mouseController.enable(opts);
|
||||
}
|
||||
setOptions(opts) {
|
||||
const options = this.pullBack(opts);
|
||||
this.$options.update(options);
|
||||
this.$painter.updateTransform(this.$options);
|
||||
|
||||
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); }
|
||||
}
|
||||
if (this.$options.disabled == true) {
|
||||
this.$mouseController.disable();
|
||||
} else {
|
||||
opts['zoomOnMouseWheel'] = this.zoomOnMouseWheel;
|
||||
this.$mouseController.enable(opts);
|
||||
}
|
||||
|
||||
setCenter(deviceCode) {
|
||||
const device = this.mapDevice[deviceCode];
|
||||
if (device && device.instance) {
|
||||
var rect = createBoundingRect(device.instance);
|
||||
var dcenter = calculateDCenter(rect, { width: this.$zr.getWidth(), height: this.$zr.getHeight() });
|
||||
this.setOptions(dcenter);
|
||||
}
|
||||
}
|
||||
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); }
|
||||
}
|
||||
|
||||
setLayerVisible(layer) {
|
||||
this.$painter.setLayerVisible(layer);
|
||||
}
|
||||
setCenter(deviceCode) {
|
||||
const device = this.mapDevice[deviceCode];
|
||||
if (device && device.instance) {
|
||||
var rect = createBoundingRect(device.instance);
|
||||
var dcenter = calculateDCenter(rect, { width: this.$zr.getWidth(), height: this.$zr.getHeight() });
|
||||
this.setOptions(dcenter);
|
||||
}
|
||||
}
|
||||
|
||||
setLevelVisible(list) {
|
||||
this.$painter.setLevelVisible(list);
|
||||
}
|
||||
setLayerVisible(layer) {
|
||||
this.$painter.setLayerVisible(layer);
|
||||
}
|
||||
|
||||
render(list) {
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
const nDevice = deepAssign(oDevice || {}, elem);
|
||||
this.$painter.delete(oDevice);
|
||||
delete this.mapDevice[code];
|
||||
if (!elem._dispose) {
|
||||
this.mapDevice[code] = nDevice;
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
});
|
||||
setLevelVisible(list) {
|
||||
this.$painter.setLevelVisible(list);
|
||||
}
|
||||
|
||||
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
|
||||
}
|
||||
render(list) {
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
const nDevice = deepAssign(oDevice || {}, elem);
|
||||
this.$painter.delete(oDevice);
|
||||
delete this.mapDevice[code];
|
||||
if (!elem._dispose) {
|
||||
this.mapDevice[code] = nDevice;
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
});
|
||||
|
||||
// 中间处理
|
||||
hookHandle(oDevice, elem) {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
// 如果是延时计时,需要保存计数值到全局
|
||||
if (type === deviceType.StationCounter) {
|
||||
let val = '' + elem.val;
|
||||
if (val === '0' || !elem.val) {
|
||||
val = elem.val = localStore.get(code) || '0';
|
||||
}
|
||||
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
|
||||
}
|
||||
|
||||
localStore(code, val);
|
||||
}
|
||||
// 中间处理
|
||||
hookHandle(oDevice, elem) {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
// 如果是延时计时,需要保存计数值到全局
|
||||
if (type === deviceType.StationCounter) {
|
||||
let val = '' + elem.val;
|
||||
if (val === '0' || !elem.val) {
|
||||
val = elem.val = localStore.get(code) || '0';
|
||||
}
|
||||
|
||||
for (var prop in elem) {
|
||||
if (elem[prop] != oDevice[prop]) {
|
||||
deepAssign(oDevice, elem);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
localStore(code, val);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
for (var prop in elem) {
|
||||
if (elem[prop] != oDevice[prop]) {
|
||||
deepAssign(oDevice, elem);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 后处理
|
||||
postHandle(list) {
|
||||
list.forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
if (type == deviceType.Switch) {
|
||||
const item = this.mapDevice[code];
|
||||
if (item) {
|
||||
const sectionA = this.mapDevice[item.sectionACode];
|
||||
const sectionB = this.mapDevice[item.sectionBCode];
|
||||
const sectionC = this.mapDevice[item.sectionCCode];
|
||||
if (sectionA && sectionB && sectionC) {
|
||||
item['cutOff'] = sectionA.cutOff;
|
||||
item['sectionAstatus'] = sectionA.status;
|
||||
item['sectionBstatus'] = sectionB.status;
|
||||
item['sectionCstatus'] = sectionC.status;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
this.$painter.update(item);
|
||||
}
|
||||
// 后处理
|
||||
postHandle(list) {
|
||||
list.forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
if (type == deviceType.Switch) {
|
||||
const item = this.mapDevice[code];
|
||||
if (item) {
|
||||
const sectionA = this.mapDevice[item.sectionACode];
|
||||
const sectionB = this.mapDevice[item.sectionBCode];
|
||||
const sectionC = this.mapDevice[item.sectionCCode];
|
||||
if (sectionA && sectionB && sectionC) {
|
||||
item['cutOff'] = sectionA.cutOff;
|
||||
item['sectionAstatus'] = sectionA.status;
|
||||
item['sectionBstatus'] = sectionB.status;
|
||||
item['sectionCstatus'] = sectionC.status;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == deviceType.Section) {
|
||||
const item = this.mapDevice[code];
|
||||
if (item) {
|
||||
const swch = this.mapDevice[item.relSwitchCode];
|
||||
if (swch) {
|
||||
const sectionA = this.mapDevice[swch.sectionACode];
|
||||
const sectionB = this.mapDevice[swch.sectionBCode];
|
||||
const sectionC = this.mapDevice[swch.sectionCCode];
|
||||
if (sectionA && sectionB && sectionC) {
|
||||
swch['cutOff'] = sectionA.cutOff;
|
||||
swch['sectionAstatus'] = sectionA.status;
|
||||
swch['sectionBstatus'] = sectionB.status;
|
||||
swch['sectionCstatus'] = sectionC.status;
|
||||
}
|
||||
this.$painter.update(item);
|
||||
}
|
||||
|
||||
this.$painter.update(swch);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type == deviceType.Section) {
|
||||
const item = this.mapDevice[code];
|
||||
if (item) {
|
||||
const swch = this.mapDevice[item.relSwitchCode];
|
||||
if (swch) {
|
||||
const sectionA = this.mapDevice[swch.sectionACode];
|
||||
const sectionB = this.mapDevice[swch.sectionBCode];
|
||||
const sectionC = this.mapDevice[swch.sectionCCode];
|
||||
if (sectionA && sectionB && sectionC) {
|
||||
swch['cutOff'] = sectionA.cutOff;
|
||||
swch['sectionAstatus'] = sectionA.status;
|
||||
swch['sectionBstatus'] = sectionB.status;
|
||||
swch['sectionCstatus'] = sectionC.status;
|
||||
}
|
||||
|
||||
update(list) {
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
if (elem.dispose) {
|
||||
this.$painter.delete(oDevice);
|
||||
} else {
|
||||
if (this.hookHandle(oDevice, elem)) {
|
||||
this.$painter.update(oDevice);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.$painter.update(swch);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 状态后处理
|
||||
this.postHandle(list || []);
|
||||
update(list) {
|
||||
(list || []).forEach(elem => {
|
||||
const code = elem.code;
|
||||
const type = elem._type;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||
if (elem.dispose) {
|
||||
this.$painter.delete(oDevice);
|
||||
} else {
|
||||
if (this.hookHandle(oDevice, elem)) {
|
||||
this.$painter.update(oDevice);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }
|
||||
}
|
||||
// 状态后处理
|
||||
this.postHandle(list || []);
|
||||
|
||||
pullBack(payload) {
|
||||
if (payload.type === 'zoom') {
|
||||
const zrWidth = this.$zr.getWidth();
|
||||
const zrHeight = this.$zr.getHeight();
|
||||
const originX = payload.originX || zrWidth / 2;
|
||||
const originY = payload.originY || zrHeight / 2;
|
||||
const x = (this.$options.offsetX + originX) / this.$options.scaleRate;
|
||||
const y = (this.$options.offsetY + originY) / this.$options.scaleRate;
|
||||
const newScaleRate = this.$options.getScaleRate(payload.scale);
|
||||
const dx = originX - (x * newScaleRate - this.$options.offsetX);
|
||||
const dy = originY - (y * newScaleRate - this.$options.offsetY);
|
||||
payload.dx = dx;
|
||||
payload.dy = dy;
|
||||
}
|
||||
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }
|
||||
}
|
||||
|
||||
return payload || {};
|
||||
}
|
||||
pullBack(payload) {
|
||||
if (payload.type === 'zoom') {
|
||||
const zrWidth = this.$zr.getWidth();
|
||||
const zrHeight = this.$zr.getHeight();
|
||||
const originX = payload.originX || zrWidth / 2;
|
||||
const originY = payload.originY || zrHeight / 2;
|
||||
const x = (this.$options.offsetX + originX) / this.$options.scaleRate;
|
||||
const y = (this.$options.offsetY + originY) / this.$options.scaleRate;
|
||||
const newScaleRate = this.$options.getScaleRate(payload.scale);
|
||||
const dx = originX - (x * newScaleRate - this.$options.offsetX);
|
||||
const dy = originY - (y * newScaleRate - this.$options.offsetY);
|
||||
payload.dx = dx;
|
||||
payload.dy = dy;
|
||||
}
|
||||
|
||||
getZr() {
|
||||
return this.$zr;
|
||||
}
|
||||
return payload || {};
|
||||
}
|
||||
|
||||
getEvents() {
|
||||
return this.events;
|
||||
}
|
||||
getZr() {
|
||||
return this.$zr;
|
||||
}
|
||||
|
||||
getDeviceByCode(code) {
|
||||
return this.mapDevice[code];
|
||||
}
|
||||
getEvents() {
|
||||
return this.events;
|
||||
}
|
||||
|
||||
getShapeTipPoint(opts) {
|
||||
const device = this.mapDevice[opts.code];
|
||||
if (device) {
|
||||
return this.$painter.getShapeTipPoint(device.instance, opts);
|
||||
}
|
||||
}
|
||||
getDeviceByCode(code) {
|
||||
return this.mapDevice[code];
|
||||
}
|
||||
|
||||
resize(opt) {
|
||||
this.$zr.resize(opt);
|
||||
this.$painter.updateZrSize(opt);
|
||||
}
|
||||
getShapeTipPoint(opts) {
|
||||
const device = this.mapDevice[opts.code];
|
||||
if (device) {
|
||||
return this.$painter.getShapeTipPoint(device.instance, opts);
|
||||
}
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.$painter.refresh();
|
||||
}
|
||||
resize(opt) {
|
||||
this.$zr.resize(opt);
|
||||
this.$painter.updateZrSize(opt);
|
||||
}
|
||||
|
||||
clearTrainView() {
|
||||
this.$painter.clearLevel(deviceType.Train);
|
||||
zrUtil.each(Object.values(this.mapDevice), device => {
|
||||
if (device._type == deviceType.Train) {
|
||||
device.instance = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
refresh() {
|
||||
this.$painter.refresh();
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.skinCode = '';
|
||||
this.style = {};
|
||||
this.mapDevice = {};
|
||||
this.$painter.clear();
|
||||
}
|
||||
clearTrainView() {
|
||||
this.$painter.clearLevel(deviceType.Train);
|
||||
zrUtil.each(Object.values(this.mapDevice), device => {
|
||||
if (device._type == deviceType.Train) {
|
||||
device.instance = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.off(this.events.Pan, this.optionsHandler);
|
||||
this.off(this.events.Zoom, this.optionsHandler);
|
||||
clear() {
|
||||
this.skinCode = '';
|
||||
this.style = {};
|
||||
this.mapDevice = {};
|
||||
this.$painter.clear();
|
||||
}
|
||||
|
||||
this.clear();
|
||||
dispose() {
|
||||
this.off(this.events.Pan, this.optionsHandler);
|
||||
this.off(this.events.Zoom, this.optionsHandler);
|
||||
|
||||
this.$mouseController.dispose();
|
||||
this.$zr && zrender.dispose(this.$zr);
|
||||
this.$painter.dispose();
|
||||
}
|
||||
this.clear();
|
||||
|
||||
on(eventname, cb, context) {
|
||||
const idx = Object.values(this.events).indexOf(eventname);
|
||||
if (idx >= 0) {
|
||||
switch (eventname) {
|
||||
case this.events.Selected:
|
||||
this.$mouseController.on(this.events.Selected, cb, context);
|
||||
break;
|
||||
case this.events.Contextmenu:
|
||||
this.$mouseController.on(this.events.Contextmenu, cb, context);
|
||||
break;
|
||||
case this.events.DataZoom:
|
||||
this.$mouseController.on(this.events.DataZoom, cb, context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$mouseController.dispose();
|
||||
this.$keyboardController.dispose();
|
||||
this.$zr && zrender.dispose(this.$zr);
|
||||
this.$painter.dispose();
|
||||
}
|
||||
|
||||
off(eventname, cb) {
|
||||
const idx = Object.values(this.events).indexOf(eventname);
|
||||
if (idx >= 0) {
|
||||
switch (eventname) {
|
||||
case this.events.Selected:
|
||||
this.$mouseController.off(this.events.Selected, cb);
|
||||
break;
|
||||
case this.events.Contextmenu:
|
||||
this.$mouseController.off(this.events.Contextmenu, cb);
|
||||
break;
|
||||
case this.events.DataZoom:
|
||||
this.$mouseController.off(this.events.DataZoom, cb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
on(eventname, cb, context) {
|
||||
const idx = Object.values(this.events).indexOf(eventname);
|
||||
if (idx >= 0) {
|
||||
switch (eventname) {
|
||||
case this.events.Selected:
|
||||
this.$mouseController.on(this.events.Selected, cb, context);
|
||||
break;
|
||||
case this.events.Contextmenu:
|
||||
this.$mouseController.on(this.events.Contextmenu, cb, context);
|
||||
break;
|
||||
case this.events.DataZoom:
|
||||
this.$mouseController.on(this.events.DataZoom, cb, context);
|
||||
break;
|
||||
case this.events.Keyboard:
|
||||
this.$keyboardController.on(this.events.Keyboard, cb, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
off(eventname, cb) {
|
||||
const idx = Object.values(this.events).indexOf(eventname);
|
||||
if (idx >= 0) {
|
||||
switch (eventname) {
|
||||
case this.events.Selected:
|
||||
this.$mouseController.off(this.events.Selected, cb);
|
||||
break;
|
||||
case this.events.Contextmenu:
|
||||
this.$mouseController.off(this.events.Contextmenu, cb);
|
||||
break;
|
||||
case this.events.DataZoom:
|
||||
this.$mouseController.off(this.events.DataZoom, cb);
|
||||
break;
|
||||
case this.events.Keyboard:
|
||||
this.$keyboardController.off(this.events.keyboard, cb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderCheckBox(model) {
|
||||
const type = model._type;
|
||||
const code = model.code;
|
||||
const oDevice = this.mapDevice[code] || deviceFactory(type, model);
|
||||
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, model));
|
||||
delete this.mapDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
if (!model._dispose) {
|
||||
this.mapDevice[code] = nDevice;
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
}
|
||||
deleteCheckBox(code) {
|
||||
const oDevice = this.mapDevice[code];
|
||||
if (oDevice) {
|
||||
delete this.mapDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Jlmap;
|
||||
|
@ -4,194 +4,301 @@ import * as eventTool from 'zrender/src/core/event';
|
||||
import store from '@/store';
|
||||
|
||||
class EventModel {
|
||||
constructor(e) {
|
||||
this.clientX = e.event.clientX;
|
||||
this.clientY = e.event.clientY;
|
||||
constructor(e) {
|
||||
this.clientX = e.event.clientX;
|
||||
this.clientY = e.event.clientY;
|
||||
|
||||
let view = e.target;
|
||||
while (view) {
|
||||
if (Object.values(deviceType).includes(view._type)) {
|
||||
this.deviceCode = view._code;
|
||||
this.deviceType = view._type;
|
||||
break;
|
||||
}
|
||||
let view = e.target;
|
||||
while (view) {
|
||||
if (Object.values(deviceType).includes(view._type)) {
|
||||
this.deviceCode = view._code;
|
||||
this.deviceType = view._type;
|
||||
this.eventTarget = view;
|
||||
break;
|
||||
}
|
||||
|
||||
if (view._subType) {
|
||||
this.subType = view._subType;
|
||||
}
|
||||
if (view._val) {
|
||||
this.val = view._val;
|
||||
}
|
||||
if (view._subType) {
|
||||
this.subType = view._subType;
|
||||
}
|
||||
if (view._val) {
|
||||
this.val = view._val;
|
||||
}
|
||||
|
||||
view = view.parent;
|
||||
}
|
||||
}
|
||||
view = view.parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MouseController extends Eventful {
|
||||
constructor(jmap) {
|
||||
super();
|
||||
this.$jmap = jmap;
|
||||
this.$zr = jmap.getZr();
|
||||
this.events = jmap.getEvents();
|
||||
this.initHandler(this.$zr);
|
||||
}
|
||||
constructor(jmap) {
|
||||
super();
|
||||
this.$jmap = jmap;
|
||||
this.deviceList = [];
|
||||
this.rightClickPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}; // 右键点击坐标
|
||||
this.$zr = jmap.getZr();
|
||||
this.events = jmap.getEvents();
|
||||
this.initHandler(this.$zr);
|
||||
}
|
||||
|
||||
initHandler(zr) {
|
||||
if (zr) {
|
||||
zr.on('click', this.click, this);
|
||||
zr.on('contextmenu', this.contextmenu, this);
|
||||
zr.on('mousemove', this.moveEvent, this);
|
||||
initHandler(zr) {
|
||||
if (zr) {
|
||||
zr.on('click', this.click, this);
|
||||
zr.on('contextmenu', this.contextmenu, this);
|
||||
zr.on('mousemove', this.moveEvent, this);
|
||||
|
||||
this.enable = function (opts) {
|
||||
opts = opts || {};
|
||||
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
||||
this._zoomOnMouseWheel = opts.zoomOnMouseWheel || false;
|
||||
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
||||
this.enable = function (opts) {
|
||||
opts = opts || {};
|
||||
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
||||
this._zoomOnMouseWheel = opts.zoomOnMouseWheel || false;
|
||||
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
||||
|
||||
this.disable();
|
||||
this.disable();
|
||||
|
||||
zr.on('mousedown', this.mousedown, this);
|
||||
zr.on('mousemove', this.mousemove, this);
|
||||
zr.on('mouseup', this.mouseup, this);
|
||||
zr.on('mousewheel', this.mousewheel, this);
|
||||
};
|
||||
zr.on('mousedown', this.mousedown, this);
|
||||
zr.on('mousemove', this.mousemove, this);
|
||||
zr.on('mouseup', this.mouseup, this);
|
||||
zr.on('mousewheel', this.mousewheel, this);
|
||||
};
|
||||
|
||||
this.disable = function () {
|
||||
zr.off('mousedown', this.mousedown);
|
||||
zr.off('mousemove', this.mousemove);
|
||||
zr.off('mouseup', this.mouseup);
|
||||
zr.off('mousewheel', this.mousewheel);
|
||||
};
|
||||
this.disable = function () {
|
||||
zr.off('mousedown', this.mousedown);
|
||||
zr.off('mousemove', this.mousemove);
|
||||
zr.off('mouseup', this.mouseup);
|
||||
zr.off('mousewheel', this.mousewheel);
|
||||
};
|
||||
|
||||
this.dispose = function () {
|
||||
zr.off('click', this.click);
|
||||
zr.off('contextmenu', this.contextmenu);
|
||||
zr.off('mousemove', this.moveEvent);
|
||||
this.disable();
|
||||
};
|
||||
this.dispose = function () {
|
||||
zr.off('click', this.click);
|
||||
zr.off('contextmenu', this.contextmenu);
|
||||
zr.off('mousemove', this.moveEvent);
|
||||
this.disable();
|
||||
};
|
||||
|
||||
this.isDragging = function () { return this._dragging; };
|
||||
}
|
||||
}
|
||||
this.isDragging = function () { return this._dragging; };
|
||||
}
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
if (eventTool.notLeftMouse(e)) {
|
||||
return;
|
||||
}
|
||||
mousedown(e) {
|
||||
// if (eventTool.notLeftMouse(e)) {
|
||||
// return;
|
||||
// }
|
||||
if (e.which == 1 || e.which == 3) {
|
||||
var x = e.offsetX;
|
||||
var y = e.offsetY;
|
||||
|
||||
var x = e.offsetX;
|
||||
var y = e.offsetY;
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
this._dragging = true;
|
||||
if (e.which == 3 && this._zoomOnMouseWheel) {
|
||||
this.handleMouseDownRight(e);
|
||||
} else if (e.which == 1 && this._zoomOnMouseWheel) {
|
||||
this.handleMouseDownLeft(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
this._dragging = true;
|
||||
}
|
||||
mousemove(e) {
|
||||
// if (eventTool.notLeftMouse(e) ||
|
||||
// !this._moveOnMouseMove ||
|
||||
// !this._dragging
|
||||
// ) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
mousemove(e) {
|
||||
if (eventTool.notLeftMouse(e) ||
|
||||
!this._moveOnMouseMove ||
|
||||
!this._dragging
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const oldX = this._x;
|
||||
const oldY = this._y;
|
||||
|
||||
const oldX = this._x;
|
||||
const oldY = this._y;
|
||||
const dx = e.offsetX - oldX;
|
||||
const dy = e.offsetY - oldY;
|
||||
|
||||
const dx = e.offsetX - oldX;
|
||||
const dy = e.offsetY - oldY;
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
if (e.which == 1) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
} else if (e.which === 3 && this._zoomOnMouseWheel) {
|
||||
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
|
||||
}
|
||||
}
|
||||
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
}
|
||||
mouseup(e) {
|
||||
if (!eventTool.notLeftMouse(e)) {
|
||||
this._dragging = false;
|
||||
}
|
||||
if (this._zoomOnMouseWheel && this.$jmap.mapDevice['check_box']) {
|
||||
this.eventTarget = this.$jmap.mapDevice['check_box'].instance;
|
||||
this.handleBoundingRect(this.eventTarget);
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Selected, em);
|
||||
}
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
if (!eventTool.notLeftMouse(e)) {
|
||||
this._dragging = false;
|
||||
}
|
||||
}
|
||||
mousewheel(e) {
|
||||
const shouldZoom = this._zoomOnMouseWheel;
|
||||
const wheelDelta = e.wheelDelta;
|
||||
const originX = e.offsetX;
|
||||
const originY = e.offsetY;
|
||||
|
||||
mousewheel(e) {
|
||||
const shouldZoom = this._zoomOnMouseWheel;
|
||||
const wheelDelta = e.wheelDelta;
|
||||
const originX = e.offsetX;
|
||||
const originY = e.offsetY;
|
||||
if (wheelDelta === 0 || !shouldZoom) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (wheelDelta === 0 || !shouldZoom) {
|
||||
return;
|
||||
}
|
||||
if (shouldZoom) {
|
||||
eventTool.stop(e.event);
|
||||
let scale = 1;
|
||||
if (wheelDelta > 0) {
|
||||
scale = 1;
|
||||
} else if (wheelDelta < 0) {
|
||||
scale = -1;
|
||||
}
|
||||
|
||||
if (shouldZoom) {
|
||||
eventTool.stop(e.event);
|
||||
let scale = 1;
|
||||
if (wheelDelta > 0) {
|
||||
scale = 1;
|
||||
} else if (wheelDelta < 0) {
|
||||
scale = -1;
|
||||
}
|
||||
this.trigger(this.events.__Zoom, {type: this.events.__Zoom, scale, originX, originY });
|
||||
}
|
||||
}
|
||||
|
||||
this.trigger(this.events.__Zoom, {type: this.events.__Zoom, scale, originX, originY });
|
||||
}
|
||||
}
|
||||
click(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Selected, em);
|
||||
}
|
||||
|
||||
click(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Selected, em);
|
||||
}
|
||||
contextmenu(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Contextmenu, em);
|
||||
}
|
||||
|
||||
contextmenu(e) {
|
||||
var em = this.checkEvent(e);
|
||||
this.trigger(this.events.Contextmenu, em);
|
||||
}
|
||||
moveEvent(e) {
|
||||
const newEm = new EventModel(e);
|
||||
const trainDetails = store.state.map.trainDetails;
|
||||
if (trainDetails) {
|
||||
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
|
||||
var instance = (this.$jmap.getDeviceByCode(trainDetails.code) || {} ).instance;
|
||||
instance && instance.removeTrainDetail && instance.removeTrainDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
moveEvent(e) {
|
||||
const newEm = new EventModel(e);
|
||||
const trainDetails = store.state.map.trainDetails;
|
||||
if (trainDetails) {
|
||||
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
|
||||
var instance = (this.$jmap.getDeviceByCode(trainDetails.code) || {} ).instance;
|
||||
instance && instance.removeTrainDetail && instance.removeTrainDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
checkEvent(e) {
|
||||
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
|
||||
var newEm = new EventModel(e);
|
||||
if ([1, 3].includes(e.which)) {
|
||||
// 查找之前和当前鼠标选中的实例
|
||||
var oldDevice = this.$jmap.getDeviceByCode(oldEm.deviceCode) || {};
|
||||
var newDevice = this.$jmap.getDeviceByCode(newEm.deviceCode) || {};
|
||||
var oldInstance = (this.$jmap.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
|
||||
var newInstance = (this.$jmap.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
|
||||
|
||||
checkEvent(e) {
|
||||
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
|
||||
var newEm = new EventModel(e);
|
||||
if ([1, 3].includes(e.which)) {
|
||||
// 查找之前和当前鼠标选中的实例
|
||||
var oldDevice = this.$jmap.getDeviceByCode(oldEm.deviceCode) || {};
|
||||
var newDevice = this.$jmap.getDeviceByCode(newEm.deviceCode) || {};
|
||||
var oldInstance = (this.$jmap.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
|
||||
var newInstance = (this.$jmap.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
|
||||
// 如果之前和当前选中的实例不一致
|
||||
if (oldInstance != newInstance) {
|
||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||
// 视图数据设置点击标志,同步执行
|
||||
oldDevice['down'] = false;
|
||||
oldInstance.mouseEvent['mouseout'](e);
|
||||
}
|
||||
|
||||
// 如果之前和当前选中的实例不一致
|
||||
if (oldInstance != newInstance) {
|
||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||
// 视图数据设置点击标志,同步执行
|
||||
oldDevice['down'] = false;
|
||||
oldInstance.mouseEvent['mouseout'](e);
|
||||
}
|
||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||
newDevice['down'] = true;
|
||||
newInstance.mouseEvent['mouseover'](e);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||
newDevice['down'] = true;
|
||||
newInstance.mouseEvent['mouseover'](e);
|
||||
}
|
||||
}
|
||||
// 保存当前实例到全局
|
||||
this.$zr.curEvent = e;
|
||||
}
|
||||
|
||||
// 保存当前实例到全局
|
||||
this.$zr.curEvent = e;
|
||||
}
|
||||
return newEm;
|
||||
}
|
||||
|
||||
return newEm;
|
||||
}
|
||||
// 处理鼠标右键按下事件
|
||||
handleMouseDownRight(e) {
|
||||
this.rightClickPoint.x = e.offsetX;
|
||||
this.rightClickPoint.y = e.offsetY;
|
||||
}
|
||||
// 处理鼠标左键按下事件
|
||||
handleMouseDownLeft(e) {
|
||||
const em = new EventModel(e);
|
||||
this.eventTarget = em.eventTarget;
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
|
||||
this.handleBoundingRect(this.eventTarget);
|
||||
} else {
|
||||
this.$jmap.deleteCheckBox('check_box');
|
||||
this.eventTarget = '';
|
||||
this.deviceList = [];
|
||||
}
|
||||
}
|
||||
// 通过包围盒筛选选中区域的元素
|
||||
handleBoundingRect(eventTarget) {
|
||||
this.deviceList = [];
|
||||
const boundingRect = this.createFakeBoundingRect(eventTarget);
|
||||
const deviceList = Object.values(this.$jmap.mapDevice);
|
||||
const includeDeviceList = [];
|
||||
deviceList.forEach( item =>{
|
||||
if (item.instance._type == deviceType.Section) {
|
||||
let deviceBoundingRect = {};
|
||||
if (item.type == '03') {
|
||||
deviceBoundingRect = {
|
||||
x1: item.namePosition.x,
|
||||
y1: item.namePosition.y,
|
||||
x2: item.namePosition.x,
|
||||
y2: item.namePosition.y
|
||||
};
|
||||
} else {
|
||||
deviceBoundingRect = {
|
||||
x1: item.points[0].x,
|
||||
y1: item.points[0].y,
|
||||
x2: item.points[item.points.length - 1].x,
|
||||
y2: item.points[item.points.length - 1].y
|
||||
};
|
||||
}
|
||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||
includeDeviceList.push(item);
|
||||
}
|
||||
}
|
||||
if (item.instance._type == deviceType.Switch) {
|
||||
const deviceBoundingRect = {
|
||||
x1: item.intersection.x,
|
||||
y1: item.intersection.y,
|
||||
x2: item.intersection.x,
|
||||
y2: item.intersection.y
|
||||
};
|
||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||
includeDeviceList.push(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.deviceList = includeDeviceList;
|
||||
store.dispatch('map/setSeclectDeviceList', this.deviceList);
|
||||
}
|
||||
// 生成包围盒对象坐标
|
||||
createFakeBoundingRect(instance) {
|
||||
return {
|
||||
x1: instance.model.point.x,
|
||||
y1: instance.model.point.y,
|
||||
x2: instance.model.point.x + instance.model.width,
|
||||
y2: instance.model.point.y + instance.model.height
|
||||
};
|
||||
}
|
||||
|
||||
// 判断元素包围盒是否在选中区域
|
||||
whetherInclude(boundingRect1, boundingRect2) {
|
||||
return boundingRect1.x1 <= boundingRect2.x1 && boundingRect1.y1 <= boundingRect2.y1 && boundingRect1.x2 >= boundingRect2.x2 && boundingRect1.y2 >= boundingRect2.y2;
|
||||
}
|
||||
|
||||
// 右键拖动区域大小
|
||||
handleMouseMoveRight(point2) {
|
||||
const point1 = this.rightClickPoint;
|
||||
const x = Math.min(point1.x, point2.x) + this.$jmap.$options.offsetX;
|
||||
const y = Math.min(point1.y, point2.y) + this.$jmap.$options.offsetY;
|
||||
const width = Math.abs(point1.x - point2.x);
|
||||
const height = Math.abs(point1.y - point2.y);
|
||||
this.$jmap.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height });
|
||||
}
|
||||
}
|
||||
|
||||
export default MouseController;
|
||||
|
@ -1,100 +1,100 @@
|
||||
class Options {
|
||||
constructor(opts, trigger) {
|
||||
this.scaleIndex = 0;
|
||||
this.scaleList = [
|
||||
0.5, 0.6, 0.7, 0.8, 0.9,
|
||||
1, 1.2, 1.4, 1.6, 1.8,
|
||||
2, 2.2, 2.4, 2.6, 2.8,
|
||||
3, 3.2, 3.4, 3.6, 3.8,
|
||||
4, 4.2, 4.4, 4.6, 4.8,
|
||||
5, 5.2, 5.4, 5.6, 5.8,
|
||||
6, 6.2, 6.4, 6.6, 6.8,
|
||||
7, 7.2, 7.4, 7.6, 7.8,
|
||||
8, 8.2, 8.4, 8.6, 8.8
|
||||
];
|
||||
constructor(opts, trigger) {
|
||||
this.scaleIndex = 0;
|
||||
this.scaleList = [
|
||||
0.8, 0.9,
|
||||
1, 1.2, 1.4, 1.6, 1.8,
|
||||
2, 2.2, 2.4, 2.6, 2.8,
|
||||
3, 3.2, 3.4, 3.6, 3.8,
|
||||
4, 4.2, 4.4, 4.6, 4.8,
|
||||
5, 5.2, 5.4, 5.6, 5.8,
|
||||
6, 6.2, 6.4, 6.6, 6.8,
|
||||
7, 7.2, 7.4, 7.6, 7.8,
|
||||
8
|
||||
];
|
||||
|
||||
if (Number.isFinite(opts.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(opts.scaleRate);
|
||||
if (idx >= 0) {
|
||||
this.scaleIndex = idx;
|
||||
}
|
||||
}
|
||||
if (Number.isFinite(opts.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(opts.scaleRate);
|
||||
if (idx >= 0) {
|
||||
this.scaleIndex = idx;
|
||||
}
|
||||
}
|
||||
|
||||
this.scaleRate = opts.scaleRate || this.scaleList[this.scaleIndex]; // 缩放比例
|
||||
this.scaleRate = opts.scaleRate || this.scaleList[this.scaleIndex]; // 缩放比例
|
||||
|
||||
this.offsetX = opts.offsetX || 0; // x偏移
|
||||
this.offsetX = opts.offsetX || 0; // x偏移
|
||||
|
||||
this.offsetY = opts.offsetY || 0; // y偏移
|
||||
this.offsetY = opts.offsetY || 0; // y偏移
|
||||
|
||||
this.throttle = opts.throttle || 100; // 刷新频率
|
||||
this.throttle = opts.throttle || 100; // 刷新频率
|
||||
|
||||
this.disabled = false;
|
||||
this.disabled = false;
|
||||
|
||||
this.moveOnMouseMove = true;
|
||||
this.moveOnMouseMove = true;
|
||||
|
||||
this.zoomOnMouseWheel = false;
|
||||
this.zoomOnMouseWheel = false;
|
||||
|
||||
this.preventDefaultMouseMove = true;
|
||||
this.preventDefaultMouseMove = true;
|
||||
|
||||
this.trigger = trigger;
|
||||
}
|
||||
this.trigger = trigger;
|
||||
}
|
||||
|
||||
update(payload) {
|
||||
if (Number.isFinite(payload.dx)) {
|
||||
this.offsetX -= payload.dx;
|
||||
}
|
||||
if (Number.isFinite(payload.dy)) {
|
||||
this.offsetY -= payload.dy;
|
||||
}
|
||||
update(payload) {
|
||||
if (Number.isFinite(payload.dx)) {
|
||||
this.offsetX -= payload.dx;
|
||||
}
|
||||
if (Number.isFinite(payload.dy)) {
|
||||
this.offsetY -= payload.dy;
|
||||
}
|
||||
|
||||
if (Number.isFinite(payload.offsetX)) {
|
||||
this.offsetX = payload.offsetX;
|
||||
}
|
||||
if (Number.isFinite(payload.offsetY)) {
|
||||
this.offsetY = payload.offsetY;
|
||||
}
|
||||
if (Number.isFinite(payload.offsetX)) {
|
||||
this.offsetX = payload.offsetX;
|
||||
}
|
||||
if (Number.isFinite(payload.offsetY)) {
|
||||
this.offsetY = payload.offsetY;
|
||||
}
|
||||
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
||||
this.scaleIndex = this.scaleIndex + payload.scale;
|
||||
}
|
||||
}
|
||||
this.scaleRate = this.scaleList[this.scaleIndex];
|
||||
}
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if (Number.isFinite(payload.scale)) {
|
||||
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
||||
this.scaleIndex = this.scaleIndex + payload.scale;
|
||||
}
|
||||
}
|
||||
this.scaleRate = this.scaleList[this.scaleIndex];
|
||||
}
|
||||
|
||||
if (Number.isFinite(payload.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(payload.scaleRate);
|
||||
if (idx < 0) {
|
||||
return;
|
||||
}
|
||||
this.scaleIndex = idx;
|
||||
this.scaleRate = payload.scaleRate;
|
||||
}
|
||||
if (Number.isFinite(payload.scaleRate)) {
|
||||
const idx = this.scaleList.indexOf(payload.scaleRate);
|
||||
if (idx < 0) {
|
||||
return;
|
||||
}
|
||||
this.scaleIndex = idx;
|
||||
this.scaleRate = payload.scaleRate;
|
||||
}
|
||||
|
||||
if (payload.disabled === true || payload.disabled === false) {
|
||||
this.disabled = payload.disabled;
|
||||
}
|
||||
if (payload.disabled === true || payload.disabled === false) {
|
||||
this.disabled = payload.disabled;
|
||||
}
|
||||
|
||||
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
||||
this.moveOnMouseMove = payload.moveOnMouseMove;
|
||||
}
|
||||
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
||||
this.moveOnMouseMove = payload.moveOnMouseMove;
|
||||
}
|
||||
|
||||
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
||||
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
||||
}
|
||||
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
||||
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
||||
}
|
||||
|
||||
if (this.trigger instanceof Function) { this.trigger(this); }
|
||||
}
|
||||
if (this.trigger instanceof Function) { this.trigger(this); }
|
||||
}
|
||||
|
||||
getScaleRate(scale) {
|
||||
if (Number.isFinite(scale)) {
|
||||
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
||||
return this.scaleList[this.scaleIndex + scale];
|
||||
}
|
||||
}
|
||||
return this.scaleList[this.scaleIndex];
|
||||
}
|
||||
getScaleRate(scale) {
|
||||
if (Number.isFinite(scale)) {
|
||||
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
||||
return this.scaleList[this.scaleIndex + scale];
|
||||
}
|
||||
}
|
||||
return this.scaleList[this.scaleIndex];
|
||||
}
|
||||
}
|
||||
|
||||
export default Options;
|
||||
|
@ -6,265 +6,265 @@ import shapefactory from './shape/factory';
|
||||
import TransformHandle from './transformHandle';
|
||||
|
||||
class Painter {
|
||||
constructor(jmap) {
|
||||
// 父级实例
|
||||
this.$jmap = jmap;
|
||||
this.$zr = jmap.getZr();
|
||||
constructor(jmap) {
|
||||
// 父级实例
|
||||
this.$jmap = jmap;
|
||||
this.$zr = jmap.getZr();
|
||||
|
||||
// 图层数据
|
||||
this.mapInstanceLevel = {};
|
||||
// 图层数据
|
||||
this.mapInstanceLevel = {};
|
||||
|
||||
// 初始图层
|
||||
this.initLevels();
|
||||
// 初始图层
|
||||
this.initLevels();
|
||||
|
||||
// 视图控制器
|
||||
this.$transformHandle = new TransformHandle(this);
|
||||
}
|
||||
// 视图控制器
|
||||
this.$transformHandle = new TransformHandle(this);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 初始绘图实例
|
||||
* @param {*} dom
|
||||
* @param {*} config
|
||||
*/
|
||||
initLevels() {
|
||||
// 图层分级策略
|
||||
this.layerBranch = {};
|
||||
this.layerBranch['01'] = (type) => { return type == deviceType.Link; }; // 逻辑图层级
|
||||
this.layerBranch['02'] = (type) => { return type != deviceType.Link; }; // 物理图层级
|
||||
this.layerBranch['03'] = (type) => { return true; }; // 混合图层级
|
||||
initLevels() {
|
||||
// 图层分级策略
|
||||
this.layerBranch = {};
|
||||
this.layerBranch['01'] = (type) => { return type == deviceType.Link; }; // 逻辑图层级
|
||||
this.layerBranch['02'] = (type) => { return type != deviceType.Link; }; // 物理图层级
|
||||
this.layerBranch['03'] = (type) => { return true; }; // 混合图层级
|
||||
|
||||
// 添加父级图层
|
||||
this.parentLevel = new Group({ name: '__parent__' });
|
||||
this.$zr.add(this.parentLevel);
|
||||
// 添加父级图层
|
||||
this.parentLevel = new Group({ name: '__parent__' });
|
||||
this.$zr.add(this.parentLevel);
|
||||
|
||||
// 添加子级图层
|
||||
zrUtil.each(Object.values(deviceType), (type) => {
|
||||
const level = new Group({ name: `__${type}__` });
|
||||
this.mapInstanceLevel[type] = level;
|
||||
this.parentLevel.add(level);
|
||||
});
|
||||
// 添加子级图层
|
||||
zrUtil.each(Object.values(deviceType), (type) => {
|
||||
const level = new Group({ name: `__${type}__` });
|
||||
this.mapInstanceLevel[type] = level;
|
||||
this.parentLevel.add(level);
|
||||
});
|
||||
|
||||
// 设置默认显示图级
|
||||
this.setLayerVisible('02');
|
||||
}
|
||||
// 设置默认显示图级
|
||||
this.setLayerVisible('02');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 重绘视图
|
||||
* @param {*} mapDevice
|
||||
*/
|
||||
repaint(mapDevice) {
|
||||
// 清空视图
|
||||
this.clear();
|
||||
repaint(mapDevice) {
|
||||
// 清空视图
|
||||
this.clear();
|
||||
|
||||
// 创建视图
|
||||
Object.values(mapDevice).forEach(device => {
|
||||
this.add(device);
|
||||
});
|
||||
}
|
||||
// 创建视图
|
||||
Object.values(mapDevice).forEach(device => {
|
||||
this.add(device);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 添加视图
|
||||
* @param {*} device
|
||||
*/
|
||||
add(device) {
|
||||
try {
|
||||
const instance = shapefactory(device, this.$jmap);
|
||||
if (instance) {
|
||||
device.instance = instance;
|
||||
this.$transformHandle.transformView(instance);
|
||||
this.mapInstanceLevel[device._type].add(instance);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
add(device) {
|
||||
try {
|
||||
const instance = shapefactory(device, this.$jmap);
|
||||
if (instance) {
|
||||
device.instance = instance;
|
||||
this.$transformHandle.transformView(instance);
|
||||
this.mapInstanceLevel[device._type].add(instance);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 删除视图
|
||||
* @param {*} device
|
||||
*/
|
||||
delete(device) {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
this.mapInstanceLevel[device._type].remove(instance);
|
||||
}
|
||||
}
|
||||
delete(device) {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
this.mapInstanceLevel[device._type].remove(instance);
|
||||
}
|
||||
}
|
||||
|
||||
checkIntersect(device) {
|
||||
var intersect = false;
|
||||
var befor = device.instance;
|
||||
var train = shapefactory(device, this.$jmap);
|
||||
checkIntersect(device) {
|
||||
var intersect = false;
|
||||
var befor = device.instance;
|
||||
var train = shapefactory(device, this.$jmap);
|
||||
|
||||
this.mapInstanceLevel[deviceType.Train].eachChild(elem => {
|
||||
if (elem !== befor && elem.getBoundingRect().intersect(train.getBoundingRect())) {
|
||||
intersect = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.mapInstanceLevel[deviceType.Train].eachChild(elem => {
|
||||
if (elem !== befor && elem.getBoundingRect().intersect(train.getBoundingRect())) {
|
||||
intersect = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
return intersect;
|
||||
}
|
||||
return intersect;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 更新列车
|
||||
* @param {*} device
|
||||
*/
|
||||
updateTrain(device) {
|
||||
var oldTrainWindowModel = null;
|
||||
var instance = device.instance;
|
||||
var curModel = device;
|
||||
updateTrain(device) {
|
||||
var oldTrainWindowModel = null;
|
||||
var instance = device.instance;
|
||||
var curModel = device;
|
||||
|
||||
if (instance) {
|
||||
oldTrainWindowModel = device.trainWindowModel;
|
||||
}
|
||||
if (instance) {
|
||||
oldTrainWindowModel = device.trainWindowModel;
|
||||
}
|
||||
|
||||
if (curModel.sectionCode) {
|
||||
curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode);
|
||||
}
|
||||
if (curModel.sectionCode) {
|
||||
curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode);
|
||||
}
|
||||
|
||||
if (curModel.trainWindowCode) {
|
||||
curModel.trainWindowModel = this.$jmap.getDeviceByCode(curModel.trainWindowCode);
|
||||
}
|
||||
if (curModel.trainWindowCode) {
|
||||
curModel.trainWindowModel = this.$jmap.getDeviceByCode(curModel.trainWindowCode);
|
||||
}
|
||||
|
||||
if (instance && oldTrainWindowModel && this.checkIntersect(device)) {
|
||||
device.trainWindowModel = oldTrainWindowModel;
|
||||
}
|
||||
if (instance && oldTrainWindowModel && this.checkIntersect(device)) {
|
||||
device.trainWindowModel = oldTrainWindowModel;
|
||||
}
|
||||
|
||||
instance && this.mapInstanceLevel[deviceType.Train].remove(instance);
|
||||
this.add(device);
|
||||
}
|
||||
instance && this.mapInstanceLevel[deviceType.Train].remove(instance);
|
||||
this.add(device);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 更新视图
|
||||
* @param {*} device
|
||||
*/
|
||||
update(device) {
|
||||
if (device) {
|
||||
try {
|
||||
if (device._dispose) {
|
||||
this.delete(device);
|
||||
} else if (deviceType.Train == device._type) {
|
||||
this.updateTrain(device);
|
||||
} else {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
instance.setState(device);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
update(device) {
|
||||
if (device) {
|
||||
try {
|
||||
if (device._dispose) {
|
||||
this.delete(device);
|
||||
} else if (deviceType.Train == device._type) {
|
||||
this.updateTrain(device);
|
||||
} else {
|
||||
const instance = device.instance;
|
||||
if (instance) {
|
||||
instance.setState(device);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 更新transform变化
|
||||
* @param {*} opt
|
||||
*/
|
||||
updateTransform(opt) {
|
||||
this.$transformHandle.updateTransform(opt);
|
||||
}
|
||||
updateTransform(opt) {
|
||||
this.$transformHandle.updateTransform(opt);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 更新zrender尺寸
|
||||
* @param {*} opt
|
||||
*/
|
||||
updateZrSize(opt) {
|
||||
this.$transformHandle.updateZrSize(opt);
|
||||
}
|
||||
updateZrSize(opt) {
|
||||
this.$transformHandle.updateZrSize(opt);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 过去坐标提示位置
|
||||
* @param {*} opts
|
||||
*/
|
||||
getShapeTipPoint(instance, opts) {
|
||||
if (instance) {
|
||||
var point = instance.getShapeTipPoint(opts);
|
||||
if (point) {
|
||||
// 矩阵变换
|
||||
var transform = this.$transformHandle.transform;
|
||||
var transPoint = vector.applyTransform([], [point.x, point.y], transform);
|
||||
return {
|
||||
x: transPoint[0],
|
||||
y: transPoint[1]
|
||||
};
|
||||
}
|
||||
getShapeTipPoint(instance, opts) {
|
||||
if (instance) {
|
||||
var point = instance.getShapeTipPoint(opts);
|
||||
if (point) {
|
||||
// 矩阵变换
|
||||
var transform = this.$transformHandle.transform;
|
||||
var transPoint = vector.applyTransform([], [point.x, point.y], transform);
|
||||
return {
|
||||
x: transPoint[0],
|
||||
y: transPoint[1]
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 设置逻辑和物理图层
|
||||
* @param {*} layer
|
||||
*/
|
||||
setLayerVisible(layer) {
|
||||
zrUtil.each(Object.values(deviceType), type => {
|
||||
const level = this.mapInstanceLevel[type];
|
||||
if (this.layerBranch[layer](type)) {
|
||||
level.show();
|
||||
} else {
|
||||
level.hide();
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
setLayerVisible(layer) {
|
||||
zrUtil.each(Object.values(deviceType), type => {
|
||||
const level = this.mapInstanceLevel[type];
|
||||
if (this.layerBranch[layer](type)) {
|
||||
level.show();
|
||||
} else {
|
||||
level.hide();
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 设置图层可见
|
||||
* @param {*} code
|
||||
*/
|
||||
setLevelVisible(list) {
|
||||
zrUtil.each(Object.values(deviceType), type => {
|
||||
const level = this.mapInstanceLevel[type];
|
||||
if (list.includes(type)) {
|
||||
level.show();
|
||||
} else {
|
||||
level.hide();
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
setLevelVisible(list) {
|
||||
zrUtil.each(Object.values(deviceType), type => {
|
||||
const level = this.mapInstanceLevel[type];
|
||||
if (list.includes(type)) {
|
||||
level.show();
|
||||
} else {
|
||||
level.hide();
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 刷新图层
|
||||
*/
|
||||
refresh() {
|
||||
this.$zr.refresh();
|
||||
}
|
||||
refresh() {
|
||||
this.$zr.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 清除图层
|
||||
*/
|
||||
clearLevel(type) {
|
||||
const level = this.mapInstanceLevel[type];
|
||||
if (level) {
|
||||
level.removeAll();
|
||||
}
|
||||
}
|
||||
clearLevel(type) {
|
||||
const level = this.mapInstanceLevel[type];
|
||||
if (level) {
|
||||
level.removeAll();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 清除canvas
|
||||
*/
|
||||
clear() {
|
||||
zrUtil.each(Object.values(this.mapInstanceLevel), (level) => {
|
||||
level && level.removeAll();
|
||||
}, this);
|
||||
clear() {
|
||||
zrUtil.each(Object.values(this.mapInstanceLevel), (level) => {
|
||||
level && level.removeAll();
|
||||
}, this);
|
||||
|
||||
this.refresh();
|
||||
}
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 销毁图层
|
||||
*/
|
||||
dispose() {
|
||||
this.mapInstanceLevel = {};
|
||||
this.parentLevel = null;
|
||||
}
|
||||
dispose() {
|
||||
this.mapInstanceLevel = {};
|
||||
this.parentLevel = null;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 父级图层
|
||||
*/
|
||||
getParentLevel() {
|
||||
return this.parentLevel;
|
||||
}
|
||||
getParentLevel() {
|
||||
return this.parentLevel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,65 +5,65 @@ import Group from 'zrender/src/container/Group';
|
||||
import Image from 'zrender/src/graphic/Image';
|
||||
|
||||
export default class ImageControl extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = model.zIndex || 1;
|
||||
this.create();
|
||||
}
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = model.zIndex || 1;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.image = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
origin: {
|
||||
x: model.position.x,
|
||||
y: model.position.y
|
||||
},
|
||||
rotation: -Math.PI / 180 * model.rotate,
|
||||
style: {
|
||||
image: model.url,
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
width: model.width,
|
||||
height: model.height
|
||||
}
|
||||
});
|
||||
this.add(this.image);
|
||||
// 旋转
|
||||
if (model.rotate) {
|
||||
this.transformRotation(this.image);
|
||||
}
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.image = new Image({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
origin: {
|
||||
x: model.position.x,
|
||||
y: model.position.y
|
||||
},
|
||||
rotation: -Math.PI / 180 * model.rotate,
|
||||
style: {
|
||||
image: model.url,
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
width: model.width,
|
||||
height: model.height
|
||||
}
|
||||
});
|
||||
this.add(this.image);
|
||||
// 旋转
|
||||
if (model.rotate) {
|
||||
this.transformRotation(this.image);
|
||||
}
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
}
|
||||
setState(model) {
|
||||
}
|
||||
|
||||
// 整体图片
|
||||
transformRotation(item) {
|
||||
if (this.model.rotate) {
|
||||
const origin = [this.model.position.x, this.model.position.y];
|
||||
const rotation = -Math.PI / 180 * Number(this.model.rotate);
|
||||
item.origin = origin;
|
||||
item.rotation = rotation;
|
||||
item.dirty();
|
||||
}
|
||||
}
|
||||
// 整体图片
|
||||
transformRotation(item) {
|
||||
if (this.model.rotate) {
|
||||
const origin = [this.model.position.x, this.model.position.y];
|
||||
const rotation = -Math.PI / 180 * Number(this.model.rotate);
|
||||
item.origin = origin;
|
||||
item.rotation = rotation;
|
||||
item.dirty();
|
||||
}
|
||||
}
|
||||
|
||||
getShapeTipPoint() {
|
||||
if (this.image) {
|
||||
var distance = 2;
|
||||
var rect = this.image.getBoundingRect();
|
||||
return {
|
||||
x: rect.x + rect.width / 2,
|
||||
y: rect.y - distance
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
getShapeTipPoint() {
|
||||
if (this.image) {
|
||||
var distance = 2;
|
||||
var rect = this.image.getBoundingRect();
|
||||
return {
|
||||
x: rect.x + rect.width / 2,
|
||||
y: rect.y - distance
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -4,36 +4,36 @@ import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
// import store from '@/store';
|
||||
|
||||
class EMouse extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
if (this.device.link) {
|
||||
const rect = this.device.link.getBoundingRect();
|
||||
this.lineBorder = new Rect({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z - 1,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: '#fff',
|
||||
fill: this.device.style.transparentColor
|
||||
}
|
||||
});
|
||||
constructor(device) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
if (this.device.link) {
|
||||
const rect = this.device.link.getBoundingRect();
|
||||
this.lineBorder = new Rect({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z - 1,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: '#fff',
|
||||
fill: this.device.style.transparentColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.lineBorder);
|
||||
this.lineBorder.hide();
|
||||
}
|
||||
}
|
||||
this.add(this.lineBorder);
|
||||
this.lineBorder.hide();
|
||||
}
|
||||
}
|
||||
|
||||
mouseover(e) {
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
}
|
||||
mouseover(e) {
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
}
|
||||
mouseout(e) {
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
}
|
||||
}
|
||||
export default EMouse;
|
||||
|
@ -3,62 +3,62 @@ import Group from 'zrender/src/container/Group';
|
||||
import EMouse from './EMouse';
|
||||
|
||||
class Link extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.create();
|
||||
}
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
|
||||
let textPosition = 'insideBottom';
|
||||
if (model.lp.x !== model.rp.x && model.lp.y !== model.rp.y) {
|
||||
textPosition = model.lp.y > model.rp.y ? 'insideLeft' : 'insideRight';
|
||||
}
|
||||
// 标准link
|
||||
this.link = new Line({
|
||||
zlevel: this.zlevel,
|
||||
z: 0,
|
||||
shape: {
|
||||
x1: model.lp.x,
|
||||
y1: model.lp.y,
|
||||
x2: model.rp.x,
|
||||
y2: model.rp.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Link.linkWidth,
|
||||
stroke: style.Link.linkColor,
|
||||
text: model.name,
|
||||
textDistance: style.Link.linkWidth * 2,
|
||||
textPosition: textPosition, // 'inside',
|
||||
textAlign: 'middle',
|
||||
fontSize: style.Link.textFontSize,
|
||||
textFill: style.Link.linkTextColor,
|
||||
textStroke: style.Link.backgroundColor
|
||||
}
|
||||
});
|
||||
this.add(this.link);
|
||||
const path = window.location.href;
|
||||
if (path.includes('/map/draw')) {
|
||||
// 鼠标事件
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
let textPosition = 'insideBottom';
|
||||
if (model.lp.x !== model.rp.x && model.lp.y !== model.rp.y) {
|
||||
textPosition = model.lp.y > model.rp.y ? 'insideLeft' : 'insideRight';
|
||||
}
|
||||
// 标准link
|
||||
this.link = new Line({
|
||||
zlevel: this.zlevel,
|
||||
z: 0,
|
||||
shape: {
|
||||
x1: model.lp.x,
|
||||
y1: model.lp.y,
|
||||
x2: model.rp.x,
|
||||
y2: model.rp.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Link.linkWidth,
|
||||
stroke: style.Link.linkColor,
|
||||
text: model.name,
|
||||
textDistance: style.Link.linkWidth * 2,
|
||||
textPosition: textPosition, // 'inside',
|
||||
textAlign: 'middle',
|
||||
fontSize: style.Link.textFontSize,
|
||||
textFill: style.Link.linkTextColor,
|
||||
textStroke: style.Link.backgroundColor
|
||||
}
|
||||
});
|
||||
this.add(this.link);
|
||||
const path = window.location.href;
|
||||
if (path.includes('/map/draw')) {
|
||||
// 鼠标事件
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
}
|
||||
setState(model) {
|
||||
}
|
||||
|
||||
tipBasePoint() {
|
||||
}
|
||||
tipBasePoint() {
|
||||
}
|
||||
}
|
||||
|
||||
export default Link;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,61 +2,61 @@ import Group from 'zrender/src/container/Group';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
export default class EMouse extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.text = new Text({
|
||||
_subType: 'Text',
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z+1,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x,
|
||||
y: this.device.model.position.y + this.device.style.StationControl.lamp.offset.y + this.device.style.StationControl.lamp.radiusR + this.device.style.StationControl.text.distance-40,
|
||||
fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight,
|
||||
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
|
||||
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
|
||||
text: '填充',
|
||||
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
|
||||
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
|
||||
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
|
||||
}
|
||||
});
|
||||
constructor(device) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.text = new Text({
|
||||
_subType: 'Text',
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 1,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x,
|
||||
y: this.device.model.position.y + this.device.style.StationControl.lamp.offset.y + this.device.style.StationControl.lamp.radiusR + this.device.style.StationControl.text.distance - 40,
|
||||
fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight,
|
||||
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
|
||||
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
|
||||
text: '',
|
||||
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
|
||||
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
|
||||
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.text);
|
||||
this.text.hide();
|
||||
}
|
||||
setTextContext(text) {
|
||||
if (text) {
|
||||
this.text.setStyle('text', text);
|
||||
}
|
||||
}
|
||||
mouseover(e) {
|
||||
if (e.target) {
|
||||
let name = '';
|
||||
switch (e.target.parent._subType) {
|
||||
case 'emergency':
|
||||
name = '紧急站控';
|
||||
break;
|
||||
case 'center':
|
||||
name = '中控';
|
||||
break;
|
||||
case 'substation':
|
||||
name = '站控';
|
||||
break;
|
||||
}
|
||||
// debugger;
|
||||
this.setTextContext(name);
|
||||
this.text.show();
|
||||
}
|
||||
}
|
||||
this.add(this.text);
|
||||
this.text.hide();
|
||||
}
|
||||
setTextContext(text) {
|
||||
if (text) {
|
||||
this.text.setStyle('text', text);
|
||||
}
|
||||
}
|
||||
mouseover(e) {
|
||||
if (e.target) {
|
||||
let name = '';
|
||||
switch (e.target.parent._subType) {
|
||||
case 'emergency':
|
||||
name = '紧急站控';
|
||||
break;
|
||||
case 'center':
|
||||
name = '中控';
|
||||
break;
|
||||
case 'substation':
|
||||
name = '站控';
|
||||
break;
|
||||
}
|
||||
// debugger;
|
||||
this.setTextContext(name);
|
||||
this.text.show();
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.text.hide();
|
||||
}
|
||||
}
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.text.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,95 +4,95 @@ import Text from 'zrender/src/graphic/Text';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
class ESwName extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.create();
|
||||
}
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.model.style;
|
||||
|
||||
this.nameText = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 6,
|
||||
style: {
|
||||
x: model.nameTextX,
|
||||
y: model.nameTextY,
|
||||
fontWeight: style.Switch.text.fontWeight,
|
||||
fontSize: style.Switch.text.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.name,
|
||||
textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
|
||||
textVerticalAlign: 'middle',
|
||||
textFill: style.Switch.text.fontColor
|
||||
}
|
||||
});
|
||||
this.nameText = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 6,
|
||||
style: {
|
||||
x: model.nameTextX,
|
||||
y: model.nameTextY,
|
||||
fontWeight: style.Switch.text.fontWeight,
|
||||
fontSize: style.Switch.text.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.name,
|
||||
textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
|
||||
textVerticalAlign: 'middle',
|
||||
textFill: style.Switch.text.fontColor
|
||||
}
|
||||
});
|
||||
|
||||
const rect = this.nameText.getBoundingRect();
|
||||
let textWidth = rect.width * 0.8;
|
||||
if (model.triangle.drictx !== 1) {
|
||||
rect.x += rect.width;
|
||||
textWidth = -textWidth;
|
||||
}
|
||||
const rect = this.nameText.getBoundingRect();
|
||||
let textWidth = rect.width * 0.8;
|
||||
if (model.triangle.drictx !== 1) {
|
||||
rect.x += rect.width;
|
||||
textWidth = -textWidth;
|
||||
}
|
||||
|
||||
this.textRect = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 10,
|
||||
silent: true,
|
||||
shape: {
|
||||
x: rect.x,
|
||||
y: rect.y,
|
||||
width: textWidth,
|
||||
height: rect.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
// lineDash: [3, 3],
|
||||
stroke: style.Switch.text.borderColor,
|
||||
fill: style.transparentColor
|
||||
}
|
||||
});
|
||||
this.textRect = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 10,
|
||||
silent: true,
|
||||
shape: {
|
||||
x: rect.x,
|
||||
y: rect.y,
|
||||
width: textWidth,
|
||||
height: rect.height
|
||||
},
|
||||
style: {
|
||||
lineWidth: 0,
|
||||
// lineDash: [3, 3],
|
||||
stroke: style.Switch.text.borderColor,
|
||||
fill: style.transparentColor
|
||||
}
|
||||
});
|
||||
|
||||
const data=LangStorage.getLang() == 'en'?'Turnout section':'道岔区段名称';
|
||||
const data = LangStorage.getLang() == 'en' ? 'Turnout section' : '道岔区段名称';
|
||||
|
||||
this.arrowText = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 20,
|
||||
style: {
|
||||
x: model.arrowTextX,
|
||||
y: model.arrowTextY,
|
||||
fontSize: style.arrowFontSize,
|
||||
fontWeight: style.Switch.text.fontWeight,
|
||||
fontFamily: style.fontFamily,
|
||||
text: `${data}: ${model.sectionName}`,
|
||||
textFill: '#000',
|
||||
textAlign: 'left',
|
||||
textPadding: 3,
|
||||
textBackgroundColor: style.tipBackgroundColor
|
||||
}
|
||||
});
|
||||
this.arrowText = new Text({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z + 20,
|
||||
style: {
|
||||
x: model.arrowTextX,
|
||||
y: model.arrowTextY,
|
||||
fontSize: style.arrowFontSize,
|
||||
fontWeight: style.Switch.text.fontWeight,
|
||||
fontFamily: style.fontFamily,
|
||||
text: `${data}: ${model.sectionName}`,
|
||||
textFill: '#000',
|
||||
textAlign: 'left',
|
||||
textPadding: 3,
|
||||
textBackgroundColor: style.tipBackgroundColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.textRect);
|
||||
this.add(this.nameText);
|
||||
this.add(this.arrowText);
|
||||
this.add(this.textRect);
|
||||
this.add(this.nameText);
|
||||
this.add(this.arrowText);
|
||||
|
||||
this.arrowText.hide();
|
||||
model.nameShow ? this.nameText.show() : this.nameText.hide();
|
||||
}
|
||||
this.arrowText.hide();
|
||||
model.nameShow ? this.nameText.show() : this.nameText.hide();
|
||||
}
|
||||
|
||||
getArrowText() {
|
||||
return this.arrowText;
|
||||
}
|
||||
getArrowText() {
|
||||
return this.arrowText;
|
||||
}
|
||||
|
||||
getNameText() {
|
||||
return this.nameText;
|
||||
}
|
||||
getNameText() {
|
||||
return this.nameText;
|
||||
}
|
||||
|
||||
getTextRect() {
|
||||
return this.textRect;
|
||||
}
|
||||
getTextRect() {
|
||||
return this.textRect;
|
||||
}
|
||||
}
|
||||
|
||||
export default ESwName;
|
||||
|
@ -12,414 +12,414 @@ import ELockRect from './ELockRect';
|
||||
import EMouse from './EMouse';
|
||||
|
||||
export default class Switch extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 6;
|
||||
this.triangle = new JTriangle(model.intersection, model.skew);
|
||||
this.create();
|
||||
this.createLockRect(); // 创建单锁矩形框显示
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 6;
|
||||
this.triangle = new JTriangle(model.intersection, model.skew);
|
||||
this.create();
|
||||
this.createLockRect(); // 创建单锁矩形框显示
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
// 鼠标事件
|
||||
if (this.style.Switch.mouseOverStyle) {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
createMouseEvent() {
|
||||
// 鼠标事件
|
||||
if (this.style.Switch.mouseOverStyle) {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
create() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
|
||||
let halfWidth = style.Section.line.width / 2;
|
||||
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth*2 + 0.8;
|
||||
const swPadding = style.Switch.core.length;
|
||||
const directx = this.triangle.drictx;
|
||||
const directy = this.triangle.dricty;
|
||||
const direct = -this.triangle.drictx * this.triangle.dricty;
|
||||
const coverLength = switchWidth * 1.5;
|
||||
let halfWidth = style.Section.line.width / 2;
|
||||
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth * 2 + 0.8;
|
||||
const swPadding = style.Switch.core.length;
|
||||
const directx = this.triangle.drictx;
|
||||
const directy = this.triangle.dricty;
|
||||
const direct = -this.triangle.drictx * this.triangle.dricty;
|
||||
const coverLength = switchWidth * 1.5;
|
||||
|
||||
this.swCore = new ESwCore({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
intersectionX: model.intersection.x,
|
||||
intersectionY: model.intersection.y,
|
||||
coverLength: coverLength,
|
||||
lineWidth: switchWidth,
|
||||
triangle: this.triangle
|
||||
});
|
||||
this.swCore = new ESwCore({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
intersectionX: model.intersection.x,
|
||||
intersectionY: model.intersection.y,
|
||||
coverLength: coverLength,
|
||||
lineWidth: switchWidth,
|
||||
triangle: this.triangle
|
||||
});
|
||||
|
||||
halfWidth += 0.3;
|
||||
const point1 = [model.intersection.x - directx * halfWidth, model.intersection.y + directy * halfWidth];
|
||||
const point2 = [point1[0] + directx * switchWidth / this.triangle.getSinRate(), point1[1]];
|
||||
const point3 = [point2[0] + directx * this.triangle.getCotRate() * swPadding, point2[1] + directy * swPadding];
|
||||
const point4 = [point3[0] + direct * this.triangle.getSin(switchWidth), point3[1] - direct * this.triangle.getCos(switchWidth)];
|
||||
this.locShelter = new ESwLocal({ // 定位
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
shelterPoints: [point1, point2, point3, point4],
|
||||
cursor: 'pointer',
|
||||
triangle: this.triangle,
|
||||
onmouseover: () => { this.name.getArrowText().show(); },
|
||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||
});
|
||||
halfWidth += 0.3;
|
||||
const point1 = [model.intersection.x - directx * halfWidth, model.intersection.y + directy * halfWidth];
|
||||
const point2 = [point1[0] + directx * switchWidth / this.triangle.getSinRate(), point1[1]];
|
||||
const point3 = [point2[0] + directx * this.triangle.getCotRate() * swPadding, point2[1] + directy * swPadding];
|
||||
const point4 = [point3[0] + direct * this.triangle.getSin(switchWidth), point3[1] - direct * this.triangle.getCos(switchWidth)];
|
||||
this.locShelter = new ESwLocal({ // 定位
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
shelterPoints: [point1, point2, point3, point4],
|
||||
cursor: 'pointer',
|
||||
triangle: this.triangle,
|
||||
onmouseover: () => { this.name.getArrowText().show(); },
|
||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||
});
|
||||
|
||||
const slen = switchWidth / this.triangle.getSinRate();
|
||||
const rpoint1 = [model.intersection.x + directx * halfWidth, model.intersection.y - directy * halfWidth];
|
||||
const rpoint2 = [rpoint1[0] + directx * (swPadding + switchWidth * this.triangle.getCotRate()), rpoint1[1]];
|
||||
const rpoint3 = [rpoint2[0], rpoint2[1] + directy * switchWidth];
|
||||
const rpoint4 = [rpoint1[0] + this.triangle.getCos(slen), rpoint1[1] + this.triangle.getSin(slen)];
|
||||
const slen = switchWidth / this.triangle.getSinRate();
|
||||
const rpoint1 = [model.intersection.x + directx * halfWidth, model.intersection.y - directy * halfWidth];
|
||||
const rpoint2 = [rpoint1[0] + directx * (swPadding + switchWidth * this.triangle.getCotRate()), rpoint1[1]];
|
||||
const rpoint3 = [rpoint2[0], rpoint2[1] + directy * switchWidth];
|
||||
const rpoint4 = [rpoint1[0] + this.triangle.getCos(slen), rpoint1[1] + this.triangle.getSin(slen)];
|
||||
|
||||
const switchWidth1 = style.Section.line.width / 2 + 0.1;
|
||||
const width1 = switchWidth1 * this.triangle.getSinRate();
|
||||
const height1 = switchWidth1 * this.triangle.getCosRate();
|
||||
const width2 = (height1 + switchWidth1) / this.triangle.getTanRate();
|
||||
const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1;
|
||||
const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1];
|
||||
const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]];
|
||||
const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1];
|
||||
const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]];
|
||||
const switchWidth1 = style.Section.line.width / 2 + 0.1;
|
||||
const width1 = switchWidth1 * this.triangle.getSinRate();
|
||||
const height1 = switchWidth1 * this.triangle.getCosRate();
|
||||
const width2 = (height1 + switchWidth1) / this.triangle.getTanRate();
|
||||
const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1;
|
||||
const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1];
|
||||
const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]];
|
||||
const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1];
|
||||
const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]];
|
||||
|
||||
this.relocShelter = new ESwLnversion({ // 反位
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
shelterPoints: [rpoint1, rpoint2, rpoint3, rpoint4],
|
||||
sectionPoints: [spoint1, spoint2, spoint3, spoint4],
|
||||
cursor: 'pointer',
|
||||
halfWidth: halfWidth,
|
||||
triangle: this.triangle,
|
||||
onmouseover: () => { this.name.getArrowText().show(); },
|
||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||
});
|
||||
this.relocShelter = new ESwLnversion({ // 反位
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
shelterPoints: [rpoint1, rpoint2, rpoint3, rpoint4],
|
||||
sectionPoints: [spoint1, spoint2, spoint3, spoint4],
|
||||
cursor: 'pointer',
|
||||
halfWidth: halfWidth,
|
||||
triangle: this.triangle,
|
||||
onmouseover: () => { this.name.getArrowText().show(); },
|
||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||
});
|
||||
|
||||
this.releaseBackground = new Line({ // 区段上遮盖段
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x1: model.intersection.x - (coverLength * this.triangle.getCotRate()),
|
||||
y1: model.intersection.y,
|
||||
x2: model.intersection.x + (coverLength * this.triangle.getCotRate()),
|
||||
y2: model.intersection.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Section.line.width + style.Section.line.beyondWidth + 1,
|
||||
stroke: style.backgroundColor
|
||||
}
|
||||
});
|
||||
this.releaseBackground = new Line({ // 区段上遮盖段
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x1: model.intersection.x - (coverLength * this.triangle.getCotRate()),
|
||||
y1: model.intersection.y,
|
||||
x2: model.intersection.x + (coverLength * this.triangle.getCotRate()),
|
||||
y2: model.intersection.y
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Section.line.width + style.Section.line.beyondWidth + 1,
|
||||
stroke: style.backgroundColor
|
||||
}
|
||||
});
|
||||
|
||||
const arrowTextX = model.intersection.x + 10;
|
||||
const arrowTextY = model.intersection.y + 15;
|
||||
const nameTextX = model.namePosition.x + model.intersection.x + directx * (style.Section.line.width * 3 + style.Switch.text.offset.x) * this.triangle.getCotRate();
|
||||
const nameTextY = model.namePosition.y + model.intersection.y + style.Switch.text.offset.y * (style.Switch.text.position || directy);
|
||||
const arrowTextX = model.intersection.x + 10;
|
||||
const arrowTextY = model.intersection.y + 15;
|
||||
const nameTextX = model.namePosition.x + model.intersection.x + directx * (style.Section.line.width * 3 + style.Switch.text.offset.x) * this.triangle.getCotRate();
|
||||
const nameTextY = model.namePosition.y + model.intersection.y + style.Switch.text.offset.y * (style.Switch.text.position || directy);
|
||||
|
||||
this.name = new ESwName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
arrowTextX: arrowTextX,
|
||||
arrowTextY: arrowTextY,
|
||||
nameTextX: nameTextX,
|
||||
nameTextY: nameTextY,
|
||||
sectionName: model.sectionName,
|
||||
name: model.name,
|
||||
nameShow: style.Switch.text.show,
|
||||
triangle: this.triangle
|
||||
});
|
||||
this.name = new ESwName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
arrowTextX: arrowTextX,
|
||||
arrowTextY: arrowTextY,
|
||||
nameTextX: nameTextX,
|
||||
nameTextY: nameTextY,
|
||||
sectionName: model.sectionName,
|
||||
name: model.name,
|
||||
nameShow: style.Switch.text.show,
|
||||
triangle: this.triangle
|
||||
});
|
||||
|
||||
this.add(this.swCore); // 岔芯link
|
||||
this.add(this.locShelter);
|
||||
this.add(this.relocShelter);
|
||||
this.add(this.releaseBackground);
|
||||
this.add(this.name);
|
||||
}
|
||||
this.add(this.swCore); // 岔芯link
|
||||
this.add(this.locShelter);
|
||||
this.add(this.relocShelter);
|
||||
this.add(this.releaseBackground);
|
||||
this.add(this.name);
|
||||
}
|
||||
|
||||
createLockRect() {
|
||||
const offsetX = this.model.locateType == '01' ? 3 : 0;
|
||||
this.lockRect = new ELockRect({ // 锁定矩形
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 6,
|
||||
x: this.model.intersection.x - this.style.Switch.monolock.rectWidth / 2 + offsetX,
|
||||
y: this.model.intersection.y - this.style.Switch.monolock.rectWidth / 2,
|
||||
width: this.style.Switch.monolock.rectWidth,
|
||||
lineWidth: 1.8,
|
||||
stroke: this.style.Switch.monolock.rectBorderColor,
|
||||
fill: this.style.transparentColor
|
||||
});
|
||||
this.add(this.lockRect);
|
||||
this.lockRect.hide();
|
||||
}
|
||||
createLockRect() {
|
||||
const offsetX = this.model.locateType == '01' ? 3 : 0;
|
||||
this.lockRect = new ELockRect({ // 锁定矩形
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 6,
|
||||
x: this.model.intersection.x - this.style.Switch.monolock.rectWidth / 2 + offsetX,
|
||||
y: this.model.intersection.y - this.style.Switch.monolock.rectWidth / 2,
|
||||
width: this.style.Switch.monolock.rectWidth,
|
||||
lineWidth: 1.8,
|
||||
stroke: this.style.Switch.monolock.rectBorderColor,
|
||||
fill: this.style.transparentColor
|
||||
});
|
||||
this.add(this.lockRect);
|
||||
this.lockRect.hide();
|
||||
}
|
||||
|
||||
/** 名称动画*/
|
||||
nameTextAnimation() {
|
||||
this.name.getNameText().animateStyle(true)
|
||||
.when(0, { textFill: this.style.backgroundColor })
|
||||
.when(1000, { textFill: this.style.Switch.text.lossColor })
|
||||
.when(2000, { textFill: this.style.backgroundColor })
|
||||
.start();
|
||||
/** 名称动画*/
|
||||
nameTextAnimation() {
|
||||
this.name.getNameText().animateStyle(true)
|
||||
.when(0, { textFill: this.style.backgroundColor })
|
||||
.when(1000, { textFill: this.style.Switch.text.lossColor })
|
||||
.when(2000, { textFill: this.style.backgroundColor })
|
||||
.start();
|
||||
|
||||
this.name.getTextRect().animateStyle(true)
|
||||
.when(0, { textFill: this.style.backgroundColor })
|
||||
.when(1000, { textFill: this.style.Switch.text.borderColor })
|
||||
.when(2000, { textFill: this.style.backgroundColor })
|
||||
.start();
|
||||
}
|
||||
this.name.getTextRect().animateStyle(true)
|
||||
.when(0, { textFill: this.style.backgroundColor })
|
||||
.when(1000, { textFill: this.style.Switch.text.borderColor })
|
||||
.when(2000, { textFill: this.style.backgroundColor })
|
||||
.start();
|
||||
}
|
||||
|
||||
/** 设置岔芯是否隐藏*/
|
||||
setSwitchCoreInvisible(invisible) {
|
||||
if (invisible) {
|
||||
this.swCore.hide();
|
||||
} else {
|
||||
this.swCore.show();
|
||||
}
|
||||
}
|
||||
/** 设置岔芯是否隐藏*/
|
||||
setSwitchCoreInvisible(invisible) {
|
||||
if (invisible) {
|
||||
this.swCore.hide();
|
||||
} else {
|
||||
this.swCore.show();
|
||||
}
|
||||
}
|
||||
|
||||
/** 设置岔芯颜色*/
|
||||
setSwitchCoreColor(color) {
|
||||
this.swCore && this.swCore.setColor(color);
|
||||
}
|
||||
/** 设置岔芯颜色*/
|
||||
setSwitchCoreColor(color) {
|
||||
this.swCore && this.swCore.setColor(color);
|
||||
}
|
||||
|
||||
/** 设置道岔文字颜色*/
|
||||
setTextColor(color) {
|
||||
this.name.getNameText().setStyle({textFill: color});
|
||||
}
|
||||
/** 设置道岔文字颜色*/
|
||||
setTextColor(color) {
|
||||
this.name.getNameText().setStyle({textFill: color});
|
||||
}
|
||||
|
||||
/** 设置道岔背景颜色*/
|
||||
setTextStyle(style) {
|
||||
this.name.getNameText().setStyle(style);
|
||||
}
|
||||
/** 设置道岔背景颜色*/
|
||||
setTextStyle(style) {
|
||||
this.name.getNameText().setStyle(style);
|
||||
}
|
||||
|
||||
/** 设置道岔文字边框颜色 (道岔封锁) */
|
||||
setHasTextBorder(width) {
|
||||
this.name.getTextRect().setStyle({lineWidth: width});
|
||||
}
|
||||
/** 设置道岔文字边框颜色 (道岔封锁) */
|
||||
setHasTextBorder(width) {
|
||||
this.name.getTextRect().setStyle({lineWidth: width});
|
||||
}
|
||||
|
||||
/** 恢复状态*/
|
||||
recover() {
|
||||
this.lockRect.hide();
|
||||
this.setSwitchCoreColor(this.style.backgroundColor);
|
||||
this.name.getNameText().stopAnimation(false);
|
||||
this.swCore.stopAnimation(false);
|
||||
this.relocShelter.stopAnimation(false);
|
||||
this.relocShelter.hide();
|
||||
this.releaseBackground.hide();
|
||||
this.setHasTextBorder(0);
|
||||
}
|
||||
/** 恢复状态*/
|
||||
recover() {
|
||||
this.lockRect.hide();
|
||||
this.setSwitchCoreColor(this.style.backgroundColor);
|
||||
this.name.getNameText().stopAnimation(false);
|
||||
this.swCore.stopAnimation(false);
|
||||
this.relocShelter.stopAnimation(false);
|
||||
this.relocShelter.hide();
|
||||
this.releaseBackground.hide();
|
||||
this.setHasTextBorder(0);
|
||||
}
|
||||
|
||||
/** 定位*/
|
||||
setLocationAction() {
|
||||
this.recover();
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.locShelter.show();
|
||||
this.relocShelter.hide();
|
||||
this.setTextColor(this.style.Switch.text.locateColor);
|
||||
}
|
||||
/** 定位*/
|
||||
setLocationAction() {
|
||||
this.recover();
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.locShelter.show();
|
||||
this.relocShelter.hide();
|
||||
this.setTextColor(this.style.Switch.text.locateColor);
|
||||
}
|
||||
|
||||
/** 反位*/
|
||||
setInversionAction() {
|
||||
this.recover();
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.setTextColor(this.style.Switch.text.inversionColor);
|
||||
this.locShelter.hide();
|
||||
this.relocShelter.show();
|
||||
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
|
||||
}
|
||||
/** 反位*/
|
||||
setInversionAction() {
|
||||
this.recover();
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.setTextColor(this.style.Switch.text.inversionColor);
|
||||
this.locShelter.hide();
|
||||
this.relocShelter.show();
|
||||
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
|
||||
}
|
||||
|
||||
/** 失去*/
|
||||
setLossAction(nameFlicker) {
|
||||
this.recover();
|
||||
this.locShelter.hide();
|
||||
this.relocShelter.hide();
|
||||
this.setSwitchCoreInvisible(false);
|
||||
this.setTextColor(this.style.Switch.text.lossColor);
|
||||
nameFlicker && this.nameTextAnimation();
|
||||
}
|
||||
/** 失去*/
|
||||
setLossAction(nameFlicker) {
|
||||
this.recover();
|
||||
this.locShelter.hide();
|
||||
this.relocShelter.hide();
|
||||
this.setSwitchCoreInvisible(false);
|
||||
this.setTextColor(this.style.Switch.text.lossColor);
|
||||
nameFlicker && this.nameTextAnimation();
|
||||
}
|
||||
|
||||
/** 挤叉*/
|
||||
setForkAction() {
|
||||
this.setLossAction(true);
|
||||
this.swCore.animateStyle(item => {
|
||||
item.animateStyle(true)
|
||||
.when(0, { stroke: this.style.backgroundColor })
|
||||
.when(1000, { stroke: 'red' })
|
||||
.when(2000, { stroke: this.style.backgroundColor })
|
||||
.start();
|
||||
});
|
||||
}
|
||||
/** 挤叉*/
|
||||
setForkAction() {
|
||||
this.setLossAction(true);
|
||||
this.swCore.animateStyle(item => {
|
||||
item.animateStyle(true)
|
||||
.when(0, { stroke: this.style.backgroundColor })
|
||||
.when(1000, { stroke: 'red' })
|
||||
.when(2000, { stroke: this.style.backgroundColor })
|
||||
.start();
|
||||
});
|
||||
}
|
||||
|
||||
/** 空闲*/
|
||||
spare() {
|
||||
}
|
||||
/** 空闲*/
|
||||
spare() {
|
||||
}
|
||||
|
||||
/** 单锁*/
|
||||
setMonolock() {
|
||||
if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示
|
||||
this.lockRect.show();
|
||||
}
|
||||
switch (this.model.locateType) {
|
||||
case '01': // 定位
|
||||
this.setTextColor(this.style.Switch.monolock.locationColor); // 设置道岔名称颜色
|
||||
break;
|
||||
case '02': // 反位
|
||||
this.setTextColor(this.style.Switch.monolock.inversionColor); // 设置道岔名称颜色
|
||||
break;
|
||||
}
|
||||
}
|
||||
/** 单锁*/
|
||||
setMonolock() {
|
||||
if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示
|
||||
this.lockRect.show();
|
||||
}
|
||||
switch (this.model.locateType) {
|
||||
case '01': // 定位
|
||||
this.setTextColor(this.style.Switch.monolock.locationColor); // 设置道岔名称颜色
|
||||
break;
|
||||
case '02': // 反位
|
||||
this.setTextColor(this.style.Switch.monolock.inversionColor); // 设置道岔名称颜色
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** 封锁 */
|
||||
block() {
|
||||
if (this.style.Switch.block.nameBorderShow) {
|
||||
this.setHasTextBorder(1);
|
||||
} else if (this.style.Switch.block.contentRectShow) {
|
||||
this.lockRect.show();
|
||||
this.lockRect.setStyle({stroke: this.style.Switch.block.contentRectColor});
|
||||
}
|
||||
}
|
||||
/** 封锁 */
|
||||
block() {
|
||||
if (this.style.Switch.block.nameBorderShow) {
|
||||
this.setHasTextBorder(1);
|
||||
} else if (this.style.Switch.block.contentRectShow) {
|
||||
this.lockRect.show();
|
||||
this.lockRect.setStyle({stroke: this.style.Switch.block.contentRectColor});
|
||||
}
|
||||
}
|
||||
|
||||
/** 延时释放*/
|
||||
timeRelease() {
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.releaseBackground.show();
|
||||
}
|
||||
/** 延时释放*/
|
||||
timeRelease() {
|
||||
this.setSwitchCoreInvisible(true);
|
||||
this.releaseBackground.show();
|
||||
}
|
||||
|
||||
/** 设置道岔切除*/
|
||||
setSwitchCutOff() {
|
||||
this.setSwitchCoreInvisible(true);
|
||||
switch (this.model.locateType) {
|
||||
case '01':
|
||||
this.releaseBackground.hide();
|
||||
break;
|
||||
case '02':
|
||||
this.relocShelter.getSection().animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
/** 设置道岔切除*/
|
||||
setSwitchCutOff() {
|
||||
this.setSwitchCoreInvisible(true);
|
||||
switch (this.model.locateType) {
|
||||
case '01':
|
||||
this.releaseBackground.hide();
|
||||
break;
|
||||
case '02':
|
||||
this.relocShelter.getSection().animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sectionCutOff(section) {
|
||||
const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0);
|
||||
if (section) {
|
||||
section.animateStyle(true, [
|
||||
{ time: 0, styles: { lineWidth: lineWidth } },
|
||||
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
|
||||
{ time: 2000, styles: { lineWidth: lineWidth } }
|
||||
]);
|
||||
}
|
||||
}
|
||||
sectionCutOff(section) {
|
||||
const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0);
|
||||
if (section) {
|
||||
section.animateStyle(true, [
|
||||
{ time: 0, styles: { lineWidth: lineWidth } },
|
||||
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
|
||||
{ time: 2000, styles: { lineWidth: lineWidth } }
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
setSectionState(section, style, state) {
|
||||
if (section && !section.animators.length) {
|
||||
switch (state.sectionAstatus) {
|
||||
case '00': break;
|
||||
case '01': /** 空闲*/
|
||||
section.setStyle(style, this.style.Section.line.spareColor);
|
||||
break;
|
||||
case '02': /** 通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.communicationOccupiedColor);
|
||||
break;
|
||||
case '03': /** 非通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.unCommunicationOccupiedColor);
|
||||
break;
|
||||
case '04': /** 进路锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.routeLockColor);
|
||||
break;
|
||||
case '05': /** 故障锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.faultLockColor);
|
||||
break;
|
||||
case '06': /** 封锁*/
|
||||
section.setStyle(style, this.style.Section.line.blockColor);
|
||||
break;
|
||||
case '07': /** ATC切除*/
|
||||
section.setStyle(style, this.style.Section.line.atcExcisionColor);
|
||||
break;
|
||||
case '08': /** ATS切除*/
|
||||
section.setStyle(style, this.style.Section.line.atsExcisionColor);
|
||||
section.animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.when(2000, { fill: this.style.Section.line.atsExcisionColor })
|
||||
.start();
|
||||
break;
|
||||
case '09': /** 进路延续保护 */
|
||||
section.setStyle(style, this.style.Section.line.protectiveLockColor);
|
||||
break;
|
||||
}
|
||||
setSectionState(section, style, state) {
|
||||
if (section && !section.animators.length) {
|
||||
switch (state.sectionAstatus) {
|
||||
case '00': break;
|
||||
case '01': /** 空闲*/
|
||||
section.setStyle(style, this.style.Section.line.spareColor);
|
||||
break;
|
||||
case '02': /** 通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.communicationOccupiedColor);
|
||||
break;
|
||||
case '03': /** 非通信车占用*/
|
||||
section.setStyle(style, this.style.Section.line.unCommunicationOccupiedColor);
|
||||
break;
|
||||
case '04': /** 进路锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.routeLockColor);
|
||||
break;
|
||||
case '05': /** 故障锁闭*/
|
||||
section.setStyle(style, this.style.Section.line.faultLockColor);
|
||||
break;
|
||||
case '06': /** 封锁*/
|
||||
section.setStyle(style, this.style.Section.line.blockColor);
|
||||
break;
|
||||
case '07': /** ATC切除*/
|
||||
section.setStyle(style, this.style.Section.line.atcExcisionColor);
|
||||
break;
|
||||
case '08': /** ATS切除*/
|
||||
section.setStyle(style, this.style.Section.line.atsExcisionColor);
|
||||
section.animateStyle(true)
|
||||
.when(1000, { fill: this.style.backgroundColor })
|
||||
.when(2000, { fill: this.style.Section.line.atsExcisionColor })
|
||||
.start();
|
||||
break;
|
||||
case '09': /** 进路延续保护 */
|
||||
section.setStyle(style, this.style.Section.line.protectiveLockColor);
|
||||
break;
|
||||
}
|
||||
|
||||
if (state.cutOff) {
|
||||
this.sectionCutOff(section);
|
||||
}
|
||||
}
|
||||
if (state.cutOff) {
|
||||
this.sectionCutOff(section);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
setLocateType(model) {
|
||||
switch (model.locateType) {
|
||||
case '01':
|
||||
this.setLocationAction(); /** 定位*/
|
||||
break;
|
||||
case '02':
|
||||
this.setInversionAction(); /** 反位*/
|
||||
break;
|
||||
case '03':
|
||||
this.setLossAction(true); /** 失去*/
|
||||
break;
|
||||
case '04':
|
||||
this.setForkAction(); /** 挤岔*/
|
||||
break;
|
||||
default:
|
||||
this.setLocationAction();
|
||||
}
|
||||
}
|
||||
setLocateType(model) {
|
||||
switch (model.locateType) {
|
||||
case '01':
|
||||
this.setLocationAction(); /** 定位*/
|
||||
break;
|
||||
case '02':
|
||||
this.setInversionAction(); /** 反位*/
|
||||
break;
|
||||
case '03':
|
||||
this.setLossAction(true); /** 失去*/
|
||||
break;
|
||||
case '04':
|
||||
this.setForkAction(); /** 挤岔*/
|
||||
break;
|
||||
default:
|
||||
this.setLocationAction();
|
||||
}
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
this.setLocateType(model);
|
||||
setState(model) {
|
||||
this.setLocateType(model);
|
||||
|
||||
switch (model.status) {
|
||||
case '01':
|
||||
this.spare(); /** 空闲*/
|
||||
break;
|
||||
case '10':
|
||||
this.setMonolock(); /** 单锁*/
|
||||
break;
|
||||
case '13':
|
||||
this.timeRelease(); /** 延时释放*/
|
||||
break;
|
||||
case '14':
|
||||
this.block(); /** 封锁*/
|
||||
break;
|
||||
}
|
||||
switch (model.status) {
|
||||
case '01':
|
||||
this.spare(); /** 空闲*/
|
||||
break;
|
||||
case '10':
|
||||
this.setMonolock(); /** 单锁*/
|
||||
break;
|
||||
case '13':
|
||||
this.timeRelease(); /** 延时释放*/
|
||||
break;
|
||||
case '14':
|
||||
this.block(); /** 封锁*/
|
||||
break;
|
||||
}
|
||||
|
||||
/** 区段切除*/
|
||||
if (model.cutOff) {
|
||||
this.setSwitchCutOff();
|
||||
}
|
||||
}
|
||||
/** 区段切除*/
|
||||
if (model.cutOff) {
|
||||
this.setSwitchCutOff();
|
||||
}
|
||||
}
|
||||
|
||||
getBoundingRect() {
|
||||
return this.name.getBoundingRect();
|
||||
}
|
||||
getBoundingRect() {
|
||||
return this.name.getBoundingRect();
|
||||
}
|
||||
|
||||
getShapeTipPoint() {
|
||||
const text = this.name.getNameText();
|
||||
if (text) {
|
||||
const rect = text.getBoundingRect();
|
||||
return {
|
||||
x: rect.x + rect.width / 2,
|
||||
y: rect.y
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
getShapeTipPoint() {
|
||||
const text = this.name.getNameText();
|
||||
if (text) {
|
||||
const rect = text.getBoundingRect();
|
||||
return {
|
||||
x: rect.x + rect.width / 2,
|
||||
y: rect.y
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
46
src/jmap/shape/checkBox/checkBox.js
Normal file
46
src/jmap/shape/checkBox/checkBox.js
Normal file
@ -0,0 +1,46 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
export default class checkBox extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this.model = model;
|
||||
this._type = model._type;
|
||||
this._code = model.code;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = model.z;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.box = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: 'rgb(135,206,250,0.2)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.box);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
setSize(width, height) {
|
||||
this.model.width = width;
|
||||
this.model.height = height;
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ import TrainWindow from './TrainWindow/index.js';
|
||||
import Train from './Train/index.js';
|
||||
import Line from './Line/index.js';
|
||||
import Text2 from './Text/index.js';
|
||||
import CheckBox from './checkBox/checkBox.js';
|
||||
|
||||
/** 图库*/
|
||||
const mapShape = {};
|
||||
@ -38,14 +39,15 @@ mapShape[deviceType.TrainWindow] = TrainWindow;
|
||||
mapShape[deviceType.Train] = Train;
|
||||
mapShape[deviceType.Line] = Line;
|
||||
mapShape[deviceType.Text] = Text2;
|
||||
mapShape[deviceType.CheckBox] = CheckBox;
|
||||
|
||||
function shapefactory(device, jmap) {
|
||||
const type = device._type;
|
||||
const shape = mapShape[type];
|
||||
if (shape instanceof Function) {
|
||||
// eslint-disable-next-line
|
||||
const type = device._type;
|
||||
const shape = mapShape[type];
|
||||
if (shape instanceof Function) {
|
||||
// eslint-disable-next-line
|
||||
return new shape(device, jmap.style);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default shapefactory;
|
||||
|
@ -19,94 +19,94 @@
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -21,7 +21,7 @@
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
@ -76,7 +76,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
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();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -19,94 +19,94 @@
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -21,7 +21,7 @@
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
@ -76,7 +76,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
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();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -19,94 +19,94 @@
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -21,7 +21,7 @@
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
title: '线路类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
@ -76,7 +76,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.runPlanName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '加载日期',
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '运行图计划表';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
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();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -22,386 +22,386 @@ import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'SectionMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SectionControl,
|
||||
SectionCmdControl,
|
||||
SpeedCmdControl,
|
||||
TrainCreate,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionAxisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.axisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuTrain: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.createTrain'),
|
||||
handler: this.newTrain,
|
||||
disabledCallback: MenuDisabledState.Section.newTrain
|
||||
}
|
||||
],
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain];
|
||||
}
|
||||
name: 'SectionMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SectionControl,
|
||||
SectionCmdControl,
|
||||
SpeedCmdControl,
|
||||
TrainCreate,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionAxisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.axisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuTrain: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.createTrain'),
|
||||
handler: this.newTrain,
|
||||
disabledCallback: MenuDisabledState.Section.newTrain
|
||||
}
|
||||
],
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain];
|
||||
}
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 故障解锁
|
||||
fault() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.fault.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 切除
|
||||
split() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.split.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 激活
|
||||
active() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.active.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段计轴预复位
|
||||
axlePreReset() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.axlePreReset.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段解锁
|
||||
lock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.lock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段封锁
|
||||
unlock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.unlock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置速度
|
||||
setSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.setSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消速度
|
||||
cancelSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
const tempData = response.data;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 新建列车
|
||||
newTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.newtrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainCreate.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 故障解锁
|
||||
fault() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.fault.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 切除
|
||||
split() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.split.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 激活
|
||||
active() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.active.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段计轴预复位
|
||||
axlePreReset() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.axlePreReset.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段解锁
|
||||
lock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.lock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段封锁
|
||||
unlock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.unlock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置速度
|
||||
setSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.setSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消速度
|
||||
cancelSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
const tempData = response.data;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 新建列车
|
||||
newTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.newtrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainCreate.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -26,463 +26,463 @@ import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StandControl,
|
||||
StandDetail,
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.detainTrain'),
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.detainTrain'),
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainAll'),
|
||||
handler: this.cancelDetainTrainAll,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setStopTime'),
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StandControl,
|
||||
StandDetail,
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.detainTrain'),
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.detainTrain'),
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainAll'),
|
||||
handler: this.cancelDetainTrainAll,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setStopTime'),
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 全线取消扣车
|
||||
cancelDetainTrainAll() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置停站时间
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 全线取消扣车
|
||||
cancelDetainTrainAll() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置停站时间
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 查询站台状态
|
||||
detail() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 查询站台状态
|
||||
detail() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -19,94 +19,94 @@
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('menu.runGraphName')
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('menu.runGraphName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.skinType'),
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('menu.runGraphName')
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('menu.runGraphName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.lineCode'),
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('menu.selectTemplateRunGraph');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
this.doClose();
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.pleaseSelectTemplateRunGraph'));
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('menu.selectTemplateRunGraph');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
this.doClose();
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.pleaseSelectTemplateRunGraph'));
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -21,7 +21,7 @@
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
@ -54,7 +54,7 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.skinType'),
|
||||
title: this.$t('menu.lineCode'),
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
@ -76,7 +76,7 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
getLineCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
},
|
||||
|
@ -16,126 +16,126 @@
|
||||
|
||||
<script>
|
||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('menu.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.runGraphName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.loadDate'),
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
name: 'ManagePlanList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('menu.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.runGraphName'),
|
||||
prop: 'templatePlanId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.loadDate'),
|
||||
prop: 'loadTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '100',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('menu.operationChartSchedule');
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('menu.operationChartSchedule');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadPageData();
|
||||
},
|
||||
methods: {
|
||||
loadPageData() {
|
||||
this.mapList = [];
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
this.templatePlanList = [];
|
||||
listAllTempLateRunPlan().then(resp => {
|
||||
this.templatePlanList = resp.data;
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
}
|
||||
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
if (this.$store.state.user.id) {
|
||||
params['userId'] = this.$store.state.user.id;
|
||||
}
|
||||
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm(this.$t('tip.deleteTheRunningGraphLoadedTheNextDay'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success(this.$t('global.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox(this.$t('global.failDelete'));
|
||||
});
|
||||
}).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();
|
||||
}
|
||||
}
|
||||
return getRunPlanLoadList(params);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm(this.$t('tip.deleteTheRunningGraphLoadedTheNextDay'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlanLoad(row.id).then(response => {
|
||||
this.$message.success(this.$t('global.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox(this.$t('global.failDelete'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleCreateRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||
},
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(()=> { this.reloadTable(); });
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -1,364 +1,364 @@
|
||||
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
/** 边缘高度*/
|
||||
EdgeHeight: 3,
|
||||
/** 边缘高度*/
|
||||
EdgeHeight: 3,
|
||||
|
||||
/** 间隔高度*/
|
||||
CoordMultiple: 3,
|
||||
/** 间隔高度*/
|
||||
CoordMultiple: 3,
|
||||
|
||||
/** 偏移时间*/
|
||||
TranslationTime: 60 * 60 * 2,
|
||||
/** 偏移时间*/
|
||||
TranslationTime: 60 * 60 * 2,
|
||||
|
||||
/** excel解析配置*/
|
||||
ExcelConfig: {
|
||||
beginRow: 1,
|
||||
beginCol: 0,
|
||||
// fieldNum: 10,
|
||||
columns: {
|
||||
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
||||
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
||||
}
|
||||
},
|
||||
/** excel解析配置*/
|
||||
ExcelConfig: {
|
||||
beginRow: 1,
|
||||
beginCol: 0,
|
||||
// fieldNum: 10,
|
||||
columns: {
|
||||
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
||||
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
||||
}
|
||||
},
|
||||
|
||||
/** 解析exal数据转换为Json后台数据*/
|
||||
importData(Sheet, JsonData) {
|
||||
const dataList = convertSheetToList(Sheet, true);
|
||||
const needList = Object.keys(this.ExcelConfig.columns);
|
||||
const tripObj = { upTrack: '', downTrack: '' };
|
||||
if (dataList && dataList.length) {
|
||||
const tIndex = dataList.findIndex(it => { return it[0]; });
|
||||
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
||||
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
||||
var isContinue = true;
|
||||
/** 解析exal数据转换为Json后台数据*/
|
||||
importData(Sheet, JsonData) {
|
||||
const dataList = convertSheetToList(Sheet, true);
|
||||
const needList = Object.keys(this.ExcelConfig.columns);
|
||||
const tripObj = { upTrack: '', downTrack: '' };
|
||||
if (dataList && dataList.length && dataList[1] && dataList[0]) {
|
||||
const tIndex = dataList.findIndex(it => { return it[0]; });
|
||||
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
||||
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
||||
var isContinue = true;
|
||||
|
||||
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
||||
isContinue = false;
|
||||
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
||||
isContinue = false;
|
||||
|
||||
var title = dataList[colIndex][0];
|
||||
var value = dataList[colIndex][rowIndex];
|
||||
var title = dataList[colIndex][0];
|
||||
var value = dataList[colIndex][rowIndex];
|
||||
|
||||
if (title && value) {
|
||||
// 数据列解析
|
||||
isContinue = true;
|
||||
var titleStr = `${title}`.replace(/\s*/g, '');
|
||||
var valueStr = `${value}`.replace(/\s*/g, '');
|
||||
if (title && value) {
|
||||
// 数据列解析
|
||||
isContinue = true;
|
||||
var titleStr = `${title}`.replace(/\s*/g, '');
|
||||
var valueStr = `${value}`.replace(/\s*/g, '');
|
||||
|
||||
// 取需要的字段
|
||||
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
||||
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
||||
}
|
||||
}
|
||||
// 取需要的字段
|
||||
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
||||
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/** 解析二维数组为json对象*/
|
||||
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
||||
const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
||||
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨]+)/; // 06:10:00 ▲
|
||||
const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
|
||||
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/** 解析二维数组为json对象*/
|
||||
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
||||
const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
||||
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨]+)/; // 06:10:00 ▲
|
||||
const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
|
||||
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
||||
|
||||
dataList.forEach((elem, i) => {
|
||||
var begin = -1;
|
||||
/** 跳过名称所在的行*/
|
||||
if (i != tIndex && elem && elem.length > 0) {
|
||||
elem.forEach((item, j) => {
|
||||
/** 过滤空值*/
|
||||
if (item) {
|
||||
var value = `${item}`.trim();
|
||||
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
||||
/** 匹配到开始位置或者结束位置*/
|
||||
if (reg0.test(value)) {
|
||||
if (begin == -1) {
|
||||
begin = value; // 设置初始索引
|
||||
JsonData.push({
|
||||
code: reg0.exec(value)[1],
|
||||
arrivalList: []
|
||||
});
|
||||
} else if (begin === value) {
|
||||
begin = -1; // 清空初始索引
|
||||
}
|
||||
} else if (begin !== -1) {
|
||||
/** 匹配到中间位置*/
|
||||
var begTime, endTime;
|
||||
var runFlag = JsonData[JsonData.length - 1].code[2];
|
||||
var stationName = title.replace(/\s/, '');
|
||||
var need = false;
|
||||
var flag = false;
|
||||
if (reg1.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg1.exec(value);
|
||||
dataList.forEach((elem, i) => {
|
||||
var begin = -1;
|
||||
/** 跳过名称所在的行*/
|
||||
if (i != tIndex && elem && elem.length > 0) {
|
||||
elem.forEach((item, j) => {
|
||||
/** 过滤空值*/
|
||||
if (item) {
|
||||
var value = `${item}`.trim();
|
||||
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
||||
/** 匹配到开始位置或者结束位置*/
|
||||
if (reg0.test(value)) {
|
||||
if (begin == -1) {
|
||||
begin = value; // 设置初始索引
|
||||
JsonData.push({
|
||||
code: reg0.exec(value)[1],
|
||||
arrivalList: []
|
||||
});
|
||||
} else if (begin === value) {
|
||||
begin = -1; // 清空初始索引
|
||||
}
|
||||
} else if (begin !== -1) {
|
||||
/** 匹配到中间位置*/
|
||||
var begTime, endTime;
|
||||
var runFlag = JsonData[JsonData.length - 1].code[2];
|
||||
var stationName = title.replace(/\s/, '');
|
||||
var need = false;
|
||||
var flag = false;
|
||||
if (reg1.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg1.exec(value);
|
||||
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg2.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg2.exec(value);
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg2.test(value)) {
|
||||
/** 含有特殊字符的时间格式*/
|
||||
[, begTime, endTime] = reg2.exec(value);
|
||||
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
begTime = reg4.test(begTime) ? '' : begTime;
|
||||
endTime = reg4.test(endTime) ? '' : endTime;
|
||||
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg3.test(value)) {
|
||||
/** 正常时间格式*/
|
||||
[, begTime, endTime] = reg3.exec(value);
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, true];
|
||||
} else if (reg3.test(value)) {
|
||||
/** 正常时间格式*/
|
||||
[, begTime, endTime] = reg3.exec(value);
|
||||
|
||||
/** 如果只存在一个数据时,则开始和结束设置一样*/
|
||||
endTime = endTime || begTime;
|
||||
/** 如果只存在一个数据时,则开始和结束设置一样*/
|
||||
endTime = endTime || begTime;
|
||||
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
/** 下行方向时间互换*/
|
||||
if (runFlag === '2') {
|
||||
[begTime, endTime] = [endTime, begTime];
|
||||
}
|
||||
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, false];
|
||||
}
|
||||
/** 设置标志*/
|
||||
[need, flag] = [true, false];
|
||||
}
|
||||
|
||||
/** 添加json数据*/
|
||||
if (need) { // 储存非空 数据
|
||||
var stationObj = {
|
||||
stationName: stationName
|
||||
};
|
||||
/** 添加json数据*/
|
||||
if (need) { // 储存非空 数据
|
||||
var stationObj = {
|
||||
stationName: stationName
|
||||
};
|
||||
|
||||
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
||||
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
||||
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
||||
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
JsonData.forEach(item => {
|
||||
item['upTrack'] = tripObj.upTrack;
|
||||
item['downTrack'] = tripObj.downTrack;
|
||||
});
|
||||
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
||||
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
||||
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
||||
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
JsonData.forEach(item => {
|
||||
item['upTrack'] = tripObj.upTrack;
|
||||
item['downTrack'] = tripObj.downTrack;
|
||||
});
|
||||
|
||||
return JsonData;
|
||||
},
|
||||
return JsonData;
|
||||
},
|
||||
|
||||
/** 将后台数据解析成图表*/
|
||||
convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) {
|
||||
var models = [];
|
||||
/** 将后台数据解析成图表*/
|
||||
convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) {
|
||||
var models = [];
|
||||
|
||||
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
|
||||
/** 按服务遍历数据*/
|
||||
data.serviceNumberDataList.forEach((service) => {
|
||||
/** 按车次遍历数据*/
|
||||
var isBackup = true;
|
||||
var opt = { name: '', markPointData: [], data: [] };
|
||||
if (service.tripNumberDataList && service.tripNumberDataList.length) {
|
||||
service.tripNumberDataList.forEach((train, j) => {
|
||||
var pointdata = {};
|
||||
var idx = 0;
|
||||
var lastPoint = null;
|
||||
var nextPoint = null;
|
||||
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
|
||||
/** 按服务遍历数据*/
|
||||
data.serviceNumberDataList.forEach((service) => {
|
||||
/** 按车次遍历数据*/
|
||||
var isBackup = true;
|
||||
var opt = { name: '', markPointData: [], data: [] };
|
||||
if (service.tripNumberDataList && service.tripNumberDataList.length) {
|
||||
service.tripNumberDataList.forEach((train, j) => {
|
||||
var pointdata = {};
|
||||
var idx = 0;
|
||||
var lastPoint = null;
|
||||
var nextPoint = null;
|
||||
|
||||
/** 创建标记点名称和坐标*/
|
||||
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
|
||||
pointdata.color = '#000' || lineStyle.color;
|
||||
pointdata.directionCode = train.directionCode;
|
||||
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
|
||||
/** 创建标记点名称和坐标*/
|
||||
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
|
||||
pointdata.color = '#000' || lineStyle.color;
|
||||
pointdata.directionCode = train.directionCode;
|
||||
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
|
||||
|
||||
/** 给服务对象添加服务名称和标记点*/
|
||||
opt.name = '' + service.serviceNumber;
|
||||
opt.markPointData.push(createMartPoint(pointdata));
|
||||
/** 给服务对象添加服务名称和标记点*/
|
||||
opt.name = '' + service.serviceNumber;
|
||||
opt.markPointData.push(createMartPoint(pointdata));
|
||||
|
||||
/** 计算非折返点车次点坐标集合*/
|
||||
train.stationTimeList.forEach((elem, index) => {
|
||||
idx = index;
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
|
||||
});
|
||||
/** 计算非折返点车次点坐标集合*/
|
||||
train.stationTimeList.forEach((elem, index) => {
|
||||
idx = index;
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
|
||||
});
|
||||
|
||||
/** 计算折返点车次坐标点集合*/
|
||||
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
|
||||
lastPoint = train.stationTimeList[idx];
|
||||
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
}
|
||||
/** 计算折返点车次坐标点集合*/
|
||||
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
|
||||
lastPoint = train.stationTimeList[idx];
|
||||
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
|
||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||
}
|
||||
|
||||
/** 如果是备用车,按车次添加线*/
|
||||
if (train.backup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
opt.name += j;
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
opt = { name: '', markPointData: [], data: [] };
|
||||
}
|
||||
}
|
||||
/** 如果是备用车,按车次添加线*/
|
||||
if (train.backup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
opt.name += j;
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
opt = { name: '', markPointData: [], data: [] };
|
||||
}
|
||||
}
|
||||
|
||||
isBackup = train.backup;
|
||||
});
|
||||
isBackup = train.backup;
|
||||
});
|
||||
|
||||
// 不是备用车,按服务添加线
|
||||
if (!isBackup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return models;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
// 不是备用车,按服务添加线
|
||||
if (!isBackup) {
|
||||
/** 创建一条完成的服务数据*/
|
||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||
if (model) {
|
||||
models.push(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return models;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
|
||||
/** 更新数据并解析成图表*/
|
||||
updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
/** 判断此条记录的服务号是否存在*/
|
||||
if (!runPlanData[elem.serviceNumber]) {
|
||||
/** 创建一个新服务号标记*/
|
||||
runPlanData[elem.serviceNumber] = {};
|
||||
/** 更新数据并解析成图表*/
|
||||
updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
/** 判断此条记录的服务号是否存在*/
|
||||
if (!runPlanData[elem.serviceNumber]) {
|
||||
/** 创建一个新服务号标记*/
|
||||
runPlanData[elem.serviceNumber] = {};
|
||||
|
||||
/** 不存在此服务号,则需要创建一条新的line*/
|
||||
series.push(createSeriesModel({
|
||||
zlevel: 1,
|
||||
name: `run${elem.serviceNumber}`,
|
||||
data: [],
|
||||
markPointData: []
|
||||
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
|
||||
}
|
||||
/** 不存在此服务号,则需要创建一条新的line*/
|
||||
series.push(createSeriesModel({
|
||||
zlevel: 1,
|
||||
name: `run${elem.serviceNumber}`,
|
||||
data: [],
|
||||
markPointData: []
|
||||
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
|
||||
}
|
||||
|
||||
/** 添加数据*/
|
||||
series.forEach(serie => {
|
||||
/** 找到服务号所在图数据的位置*/
|
||||
if (serie.name == `run${elem.serviceNumber}`) {
|
||||
/** 添加车组号记录标记*/
|
||||
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
|
||||
}
|
||||
/** 添加数据*/
|
||||
series.forEach(serie => {
|
||||
/** 找到服务号所在图数据的位置*/
|
||||
if (serie.name == `run${elem.serviceNumber}`) {
|
||||
/** 添加车组号记录标记*/
|
||||
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
|
||||
}
|
||||
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
|
||||
return parseInt(a.secondTime) - parseInt(b.secondTime);
|
||||
});
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
|
||||
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
|
||||
return parseInt(a.secondTime) - parseInt(b.secondTime);
|
||||
});
|
||||
|
||||
/** 如果此记录车组号的数据为第一条时,则打上标签*/
|
||||
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
|
||||
serie.markPoint.data.push(createMartPoint({
|
||||
directionCode: elem.directionCode,
|
||||
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
|
||||
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
|
||||
color: lineStyle.color || '#000'
|
||||
}));
|
||||
}
|
||||
/** 如果此记录车组号的数据为第一条时,则打上标签*/
|
||||
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
|
||||
serie.markPoint.data.push(createMartPoint({
|
||||
directionCode: elem.directionCode,
|
||||
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
|
||||
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
|
||||
color: lineStyle.color || '#000'
|
||||
}));
|
||||
}
|
||||
|
||||
/** 计算折返点*/
|
||||
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.directionCode];
|
||||
if (serie.data.length > 0) {
|
||||
var lastPoint = serie.data[serie.data.length - 1];
|
||||
if (lastPoint[2] !== nextPoint[2]) {
|
||||
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
}
|
||||
}
|
||||
/** 计算折返点*/
|
||||
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.directionCode];
|
||||
if (serie.data.length > 0) {
|
||||
var lastPoint = serie.data[serie.data.length - 1];
|
||||
if (lastPoint[2] !== nextPoint[2]) {
|
||||
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||
}
|
||||
}
|
||||
|
||||
/** 添加车组号数据到对应的服务图数据中*/
|
||||
serie.data.push(nextPoint);
|
||||
/** 添加车组号数据到对应的服务图数据中*/
|
||||
serie.data.push(nextPoint);
|
||||
|
||||
/** 保证原始数据排序*/
|
||||
serie.data.sort((a, b) => {
|
||||
return parseInt(a[0]) - parseInt(b[0]);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
/** 保证原始数据排序*/
|
||||
serie.data.sort((a, b) => {
|
||||
return parseInt(a[0]) - parseInt(b[0]);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return series;
|
||||
},
|
||||
return series;
|
||||
},
|
||||
|
||||
/** 将后台数据转换为试图序列模型*/
|
||||
convertStationsToMap(stations) {
|
||||
var map = {};
|
||||
if (stations && stations.length) {
|
||||
stations.forEach((elem, index) => {
|
||||
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
}
|
||||
/** 将后台数据转换为试图序列模型*/
|
||||
convertStationsToMap(stations) {
|
||||
var map = {};
|
||||
if (stations && stations.length) {
|
||||
stations.forEach((elem, index) => {
|
||||
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
}
|
||||
|
||||
return map;
|
||||
},
|
||||
/** 初始化Y轴*/
|
||||
initializeYaxis(stations) {
|
||||
return createMarkLineModels(stations, (elem, index) => {
|
||||
return this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
},
|
||||
return map;
|
||||
},
|
||||
/** 初始化Y轴*/
|
||||
initializeYaxis(stations) {
|
||||
return createMarkLineModels(stations, (elem, index) => {
|
||||
return this.EdgeHeight + index * this.CoordMultiple;
|
||||
});
|
||||
},
|
||||
|
||||
/** 计算y轴最小值*/
|
||||
computedYaxisMinValue() {
|
||||
return 0;
|
||||
},
|
||||
/** 计算y轴最小值*/
|
||||
computedYaxisMinValue() {
|
||||
return 0;
|
||||
},
|
||||
|
||||
/** 计算y轴最大值*/
|
||||
computedYaxisMaxValue(stations) {
|
||||
return this.EdgeHeight * 2 + (stations.length - 1) * this.CoordMultiple;
|
||||
},
|
||||
/** 计算y轴最大值*/
|
||||
computedYaxisMaxValue(stations) {
|
||||
return this.EdgeHeight * 2 + (stations.length - 1) * this.CoordMultiple;
|
||||
},
|
||||
|
||||
/** 格式化y轴数据*/
|
||||
computedFormatYAxis(stations, params) {
|
||||
var yText = '';
|
||||
var index = Math.floor((parseInt(params.value) - this.EdgeHeight) / this.CoordMultiple);
|
||||
if (index >= 0 && index < stations.length) {
|
||||
yText = stations[index].kmRange + 'm';
|
||||
}
|
||||
return yText;
|
||||
},
|
||||
/** 格式化y轴数据*/
|
||||
computedFormatYAxis(stations, params) {
|
||||
var yText = '';
|
||||
var index = Math.floor((parseInt(params.value) - this.EdgeHeight) / this.CoordMultiple);
|
||||
if (index >= 0 && index < stations.length) {
|
||||
yText = stations[index].kmRange + 'm';
|
||||
}
|
||||
return yText;
|
||||
},
|
||||
|
||||
/** 根据方向计算y折返偏移量*/
|
||||
getYvalueByDirectionCode(defaultVlue, directionCode) {
|
||||
if (directionCode === '1') {
|
||||
defaultVlue -= this.EdgeHeight / 2;
|
||||
} else if (directionCode === '2') {
|
||||
defaultVlue += this.EdgeHeight / 2;
|
||||
}
|
||||
/** 根据方向计算y折返偏移量*/
|
||||
getYvalueByDirectionCode(defaultVlue, directionCode) {
|
||||
if (directionCode === '1') {
|
||||
defaultVlue -= this.EdgeHeight / 2;
|
||||
} else if (directionCode === '2') {
|
||||
defaultVlue += this.EdgeHeight / 2;
|
||||
}
|
||||
|
||||
return defaultVlue;
|
||||
},
|
||||
return defaultVlue;
|
||||
},
|
||||
|
||||
/** 根据elem计算y值*/
|
||||
getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) {
|
||||
var defaultVlue = 0;
|
||||
var station = stations.find(it => { return it.code == elem.stationCode; });
|
||||
if (station) {
|
||||
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
||||
if (isSpecial) {
|
||||
defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode);
|
||||
}
|
||||
}
|
||||
/** 根据elem计算y值*/
|
||||
getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) {
|
||||
var defaultVlue = 0;
|
||||
var station = stations.find(it => { return it.code == elem.stationCode; });
|
||||
if (station) {
|
||||
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
||||
if (isSpecial) {
|
||||
defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode);
|
||||
}
|
||||
}
|
||||
|
||||
return defaultVlue;
|
||||
}
|
||||
return defaultVlue;
|
||||
}
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user