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>
|
<script>
|
||||||
import { handleToken } from '@/utils/auth';
|
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 DeomonTopic from '@/views/demonstration/deomonTopic';
|
||||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||||
import { ProjectIcon } from '@/scripts/ConstDic';
|
import { ProjectIcon } from '@/scripts/ConstDic';
|
||||||
@ -47,6 +47,7 @@ export default {
|
|||||||
if (!this.$route.path.includes('/login') && this.$route.path != '/404') {
|
if (!this.$route.path.includes('/login') && this.$route.path != '/404') {
|
||||||
const header = { group: '', 'X-Token': handleToken() };
|
const header = { group: '', 'X-Token': handleToken() };
|
||||||
creatSubscribe(perpetualTopic, header);
|
creatSubscribe(perpetualTopic, header);
|
||||||
|
creatSubscribe(commonTopic, header);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -59,9 +59,9 @@ export function putLessonOffLine(id) {
|
|||||||
/**
|
/**
|
||||||
* 获取地图产品下的课程列表
|
* 获取地图产品下的课程列表
|
||||||
*/
|
*/
|
||||||
export function getCommodityProductLesson(prdCode) {
|
export function getCommodityProductLesson(prdId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/lesson/${prdCode}/list`,
|
url: `/api/lesson/${prdId}/list`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,18 @@ export function getPublishMapList(params) {
|
|||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/** 获取所有可用地图列表*/
|
||||||
|
export function getPublishMapListOnline() {
|
||||||
|
return request({
|
||||||
|
url: '/api/map/listOnline',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** 根据皮肤获取发布地图列表*/
|
/** 根据皮肤获取发布地图列表*/
|
||||||
export function getPublishMapListBySkinCode(skinCode) {
|
export function getPublishMapListByLineCode(lineCode) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/map/${skinCode}/list`,
|
url: `/api/map/${lineCode}/list`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -33,7 +40,7 @@ export function getPublishMapDetailById(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取发布地图列表*/
|
/** 获取发布地图列表(不包含项目线路)*/
|
||||||
export function listPublishMap(params) {
|
export function listPublishMap(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/map/list`,
|
url: `/api/map/list`,
|
||||||
|
@ -2,194 +2,186 @@ import request from '@/utils/request';
|
|||||||
|
|
||||||
/** 清除实训数据*/
|
/** 清除实训数据*/
|
||||||
export function clearTraining(args) {
|
export function clearTraining(args) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${args.id}`,
|
url: `/api/training/${args.id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 开始实训*/
|
/** 开始实训*/
|
||||||
export function startTraining(args, group) {
|
export function startTraining(args, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${args.id}/start`,
|
url: `/api/training/${args.id}/start`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
group
|
group
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 实训结束*/
|
/** 实训结束*/
|
||||||
export function endTraining(args, group) {
|
export function endTraining(args, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${args.lessonId}/${args.id}/end`,
|
url: `/api/training/${args.lessonId}/${args.id}/end`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
mode: args.mode,
|
mode: args.mode,
|
||||||
usedTime: args.usedTime,
|
usedTime: args.usedTime,
|
||||||
group
|
group
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 发送步骤数据*/
|
/** 发送步骤数据*/
|
||||||
export function sendTrainingNextStep(data, group) {
|
export function sendTrainingNextStep(data, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${data.trainingId}/nextStep`,
|
url: `/api/training/${data.trainingId}/nextStep`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data.operate,
|
data: data.operate,
|
||||||
params: {
|
params: {
|
||||||
group
|
group
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
/** 获取实训树*/
|
|
||||||
export function getTrainingTree() {
|
|
||||||
return request({
|
|
||||||
url: `/api/training/tree`,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取章节基本信息*/
|
/** 获取章节基本信息*/
|
||||||
export function getTrainingDetail(trainingId) {
|
export function getTrainingDetail(trainingId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${trainingId}`,
|
url: `/api/training/${trainingId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加实训*/
|
/** 添加实训*/
|
||||||
export function addTraining(data) {
|
export function addTraining(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/training',
|
url: '/api/training',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 更新实训*/
|
/** 更新实训*/
|
||||||
export function updateTraining(data) {
|
export function updateTraining(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${data.id}`,
|
url: `/api/training/${data.id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 保存实训初始状态*/
|
/** 保存实训初始状态*/
|
||||||
export function saveTrainingInitStatus(data, group) {
|
export function saveTrainingInitStatus(data, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${data.id}/detailSave?group=${group}`,
|
url: `/api/training/${data.id}/detailSave?group=${group}`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 保存实训步骤数据*/
|
/** 保存实训步骤数据*/
|
||||||
export function saveTrainingStepsData(data) {
|
export function saveTrainingStepsData(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${data.id}/stepsSave`,
|
url: `/api/training/${data.id}/stepsSave`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取实训步骤数据*/
|
/** 获取实训步骤数据*/
|
||||||
export function getTrainingStepsDetail(trainingId, params) {
|
export function getTrainingStepsDetail(trainingId, params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/${trainingId}/detail`,
|
url: `/api/training/${trainingId}/detail`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询实训列表*/
|
/** 查询实训列表*/
|
||||||
export function pageQueryTraining(params) {
|
export function pageQueryTraining(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/pagedQuery`,
|
url: `/api/training/pagedQuery`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 自动生成实训操作*/
|
/** 自动生成实训操作*/
|
||||||
export function addAutoTraining(data) {
|
export function addAutoTraining(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/generate`,
|
url: `/api/training/generate`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改自动删除实训操作*/
|
/** 修改自动删除实训操作*/
|
||||||
export function updateAutoTraining(data) {
|
export function updateAutoTraining(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/batchUpdateGenerate`,
|
url: `/api/training/batchUpdateGenerate`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除自动生成实训*/
|
/** 删除自动生成实训*/
|
||||||
export function deleteAutoTraining(params) {
|
export function deleteAutoTraining(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/generate`,
|
url: `/api/training/generate`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取用户实训列表*/
|
/** 获取用户实训列表*/
|
||||||
export function getTrainingList(data) {
|
export function getTrainingList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/list`,
|
url: `/api/training/list`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sendCommand(group, command) {
|
export function sendCommand(group, command) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/deviceChange?group=${group}`,
|
url: `/api/training/deviceChange?group=${group}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: {
|
data: {
|
||||||
param: command.val,
|
param: command.val,
|
||||||
type: command.type,
|
type: command.type,
|
||||||
code: command.code,
|
code: command.code,
|
||||||
operation: command.operation
|
operation: command.operation
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateLesson(data) {
|
export function updateLesson(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/userTraining/${data.id}`,
|
url: `/api/training/userTraining/${data.id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 添加用户实训数据
|
// 添加用户实训数据
|
||||||
export function addUserTraining(data) {
|
export function addUserTraining(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/userTraining`,
|
url: `/api/training/userTraining`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 更新用户实训数据
|
// 更新用户实训数据
|
||||||
export function putUserTraining(data) {
|
export function putUserTraining(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/userTraining/${data.id}`,
|
url: `/api/training/userTraining/${data.id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 清除实训数据
|
// 清除实训数据
|
||||||
export function deleteUserTraining(statsId) {
|
export function deleteUserTraining(statsId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/training/userTraining/${statsId}`,
|
url: `/api/training/userTraining/${statsId}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,125 +3,115 @@ import request from '@/utils/request';
|
|||||||
|
|
||||||
/** 分页获取课程权限数据*/
|
/** 分页获取课程权限数据*/
|
||||||
export function getLessonPermissonPageList(params) {
|
export function getLessonPermissonPageList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/permission',
|
url: '/api/permission',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 创建课程权限*/
|
/** 创建课程权限*/
|
||||||
export function createLessonPermisson(data) {
|
export function createLessonPermisson(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/permission',
|
url: '/api/permission',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取权限详情*/
|
/** 获取权限详情*/
|
||||||
export function getPermissonDetail(id) {
|
export function getPermissonDetail(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/permission/${id}/package`,
|
url: `/api/permission/${id}/package`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改权限*/
|
/** 修改权限*/
|
||||||
export function putPermissonDetail(data) {
|
export function putPermissonDetail(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/permission/${data.id}`,
|
url: `/api/permission/${data.id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 一键生成所有权限*/
|
/** 一键生成所有权限*/
|
||||||
export function postPermissonList(mapId) {
|
export function postPermissonList(mapId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/permission/${mapId}/generate`,
|
url: `/api/permission/${mapId}/generate`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取用户某课程某段时间内可用的权限数量*/
|
/** 获取用户某课程某段时间内可用的权限数量*/
|
||||||
export function getTotalRemains(params) {
|
export function getTotalRemains(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/userPermission/totalRemains',
|
url: '/api/userPermission/totalRemains',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 设置权限失效或有效*/
|
/** 设置权限失效或有效*/
|
||||||
export function setLessonPermisson(data) {
|
export function setLessonPermisson(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/userPermission/${data.id}/status`,
|
url: `/api/userPermission/${data.id}/status`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置权限失效或有效*/
|
/** 设置权限失效或有效*/
|
||||||
export function getPermissionList(id) {
|
export function getPermissionList(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/permission/${id}`,
|
url: `/api/permission/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询仿真权限列表
|
|
||||||
*/
|
|
||||||
export function queryPermissionSimulation(data) {
|
|
||||||
return request({
|
|
||||||
url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取大屏权限列表*/
|
/** 获取大屏权限列表*/
|
||||||
export function queryPermissionScreen() {
|
export function queryPermissionScreen() {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/userPermission/bigScreen`,
|
url: `/api/userPermission/bigScreen`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户权限列表
|
* 用户权限列表
|
||||||
*/
|
*/
|
||||||
export function listPermision(params) {
|
export function listPermision(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/userPermission`,
|
url: `/api/userPermission`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人权限列表
|
* 个人权限列表
|
||||||
*/
|
*/
|
||||||
export function listUserPermision(params) {
|
export function listUserPermision(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/userPermission/my`,
|
url: `/api/userPermission/my`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 用户权限列表 */
|
/** 用户权限列表 */
|
||||||
export function getDistribute(id) {
|
export function getDistribute(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/${id}`,
|
url: `/api/distribute/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置权限所有者 */
|
/** 设置权限所有者 */
|
||||||
export function putPermissionOwner(data) {
|
export function putPermissionOwner(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/userPermission/${data.id}/owner`,
|
url: `/api/userPermission/${data.id}/owner`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data.owner
|
data: data.owner
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -2,140 +2,159 @@ import request from '@/utils/request';
|
|||||||
|
|
||||||
/** 权限转增*/
|
/** 权限转增*/
|
||||||
export function getLessons(data) {
|
export function getLessons(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/distribute/getLessons',
|
url: '/api/distribute/getLessons',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限分发*/
|
/** 权限分发*/
|
||||||
export function giveLessons(data) {
|
export function giveLessons(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/distribute/distribute',
|
url: '/api/distribute/distribute',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限转增*/
|
/** 权限转增*/
|
||||||
export function permissionTurnAdd(data) {
|
export function permissionTurnAdd(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/distribute/transfer',
|
url: '/api/distribute/transfer',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 从订单分发权限(获取二维码)*/
|
/** 从订单分发权限(获取二维码)*/
|
||||||
export function postDistribute(data) {
|
export function postDistribute(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/${data.code}/distribute`,
|
url: `/api/distribute/${data.code}/distribute`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限获取*/
|
/** 权限获取*/
|
||||||
export function getPermission(state) {
|
export function getPermission(state) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/getPermission?state=${state}`,
|
url: `/api/distribute/getPermission?state=${state}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 接收课程权限*/
|
/** 接收课程权限*/
|
||||||
export function receiveLessons(data) {
|
export function receiveLessons(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/distribute/receiveLessons',
|
url: '/api/distribute/receiveLessons',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 考试权限分发*/
|
/** 考试权限分发*/
|
||||||
export function giveExams(data) {
|
export function giveExams(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/giveExams`,
|
url: `/api/distribute/giveExams`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限打包分页查询*/
|
/** 权限打包分页查询*/
|
||||||
export function listPackagePermission(params) {
|
export function listPackagePermission(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/distribute',
|
url: '/api/distribute',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打包权限*/
|
/** 打包权限*/
|
||||||
export function packagePermissionDistribute(data) {
|
export function packagePermissionDistribute(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/givePermission/package`,
|
url: `/api/distribute/givePermission/package`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限回收*/
|
/** 权限回收*/
|
||||||
export function restorePackagePermission(id) {
|
export function restorePackagePermission(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/${id}/restore`,
|
url: `/api/distribute/${id}/restore`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 生成打包权限二维码*/
|
/** 生成打包权限二维码*/
|
||||||
export function getPackageQrCode(params) {
|
export function getPackageQrCode(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/package/qrCode`,
|
url: `/api/distribute/package/qrCode`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限分发打包详情*/
|
/** 权限分发打包详情*/
|
||||||
export function getPermissionPackageDetail(id, params) {
|
export function getPermissionPackageDetail(id, params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/package/${id}/detail`,
|
url: `/api/distribute/package/${id}/detail`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限分发打包*/
|
/** 权限分发打包*/
|
||||||
export function permissionDistributePackage(data) {
|
export function permissionDistributePackage(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/package`,
|
url: `/api/distribute/package`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 权限分发解包*/
|
/** 权限分发解包*/
|
||||||
export function permissionDistributeUnPackage(permissionId) {
|
export function permissionDistributeUnPackage(permissionId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/${permissionId}/unPackage`,
|
url: `/api/distribute/${permissionId}/unPackage`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询可打包的权限分发*/
|
/** 查询可打包的权限分发*/
|
||||||
export function listCanPackagePermission(params) {
|
export function listCanPackagePermission(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/package`,
|
url: `/api/distribute/package`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置权限分发列表 权限失效
|
// 设置权限分发列表 权限失效
|
||||||
export function setCommodityStatus(id) {
|
export function setCommodityStatus(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/distribute/${id}/invalid`,
|
url: `/api/distribute/${id}/invalid`,
|
||||||
method: 'get'
|
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';
|
import request from '@/utils/request';
|
||||||
|
|
||||||
/** 分页查询皮肤*/
|
/** 分页查询真实线路*/
|
||||||
export function getSkinCodePageList(params) {
|
export function getSkinCodePageList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/realLine`,
|
url: `/api/realLine`,
|
||||||
@ -9,7 +9,7 @@ export function getSkinCodePageList(params) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加皮肤*/
|
/** 添加真实线路*/
|
||||||
export function addSkinCode(data) {
|
export function addSkinCode(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/realLine`,
|
url: `/api/realLine`,
|
||||||
@ -18,7 +18,7 @@ export function addSkinCode(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除皮肤*/
|
/** 删除真实线路*/
|
||||||
export function delSkinCode(id) {
|
export function delSkinCode(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/realLine/${id}`,
|
url: `/api/realLine/${id}`,
|
||||||
@ -26,7 +26,7 @@ export function delSkinCode(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询地图皮肤 */
|
/** 根据id查询真实线路 */
|
||||||
export function querySkinCode(id) {
|
export function querySkinCode(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/realLine/${id}`,
|
url: `/api/realLine/${id}`,
|
||||||
@ -34,7 +34,7 @@ export function querySkinCode(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改地图皮肤*/
|
/** 修改真实线路*/
|
||||||
export function updateSkinCode(data) {
|
export function updateSkinCode(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/realLine/${data.id}`,
|
url: `/api/realLine/${data.id}`,
|
||||||
@ -52,7 +52,7 @@ export function updateSkinCodeByCode(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询皮肤是否存在*/
|
/** 检查code是否存在*/
|
||||||
export function querySkinCodeExistByCode(code) {
|
export function querySkinCodeExistByCode(code) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/realLine/${code}/exist`,
|
url: `/api/realLine/${code}/exist`,
|
||||||
@ -60,8 +60,8 @@ export function querySkinCodeExistByCode(code) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取皮肤列表*/
|
/** 获取真实线路列表*/
|
||||||
export function getSkinCodeList() {
|
export function getLineCodeList() {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/realLine/list`,
|
url: `/api/realLine/list`,
|
||||||
method: 'get'
|
method: 'get'
|
@ -9,9 +9,9 @@ export function getPublishMapTree(cityCode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 获取产品详细内容*/
|
/** 获取产品详细内容*/
|
||||||
export function getProductDetail(prdCode) {
|
export function getProductDetail(prdId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/mapPrd/${prdCode}`,
|
url: `/api/mapPrd/${prdId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -72,9 +72,9 @@ export function getCommodityMapProduct(mapId) {
|
|||||||
/**
|
/**
|
||||||
* 获取地图下的产品详情
|
* 获取地图下的产品详情
|
||||||
*/
|
*/
|
||||||
export function getMapProductDetail(prdCode) {
|
export function getMapProductDetail(prdId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/mapPrd/${prdCode}`,
|
url: `/api/mapPrd/${prdId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -106,8 +106,7 @@ export function getPlaceholderList(data) {
|
|||||||
url: `/api/operate/placeholder`,
|
url: `/api/operate/placeholder`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
trainingType: data.trainingType,
|
trainingType: data.trainingType
|
||||||
skinCode: data.skinCode
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
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) {
|
export function getQuestPageList(mapId, params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${mapId}/list`,
|
url: `/api/script/draft/${mapId}/list`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 创建任务 */
|
/** 创建任务 */
|
||||||
export function createQuest(data) {
|
export function createQuest(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft`,
|
url: `/api/script/draft`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 根据任务id删除任务 */
|
/** 根据任务id删除任务 */
|
||||||
export function deleteQuest(id) {
|
export function deleteQuest(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${id}`,
|
url: `/api/script/draft/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 根据id查询任务基础信息 */
|
/** 根据id查询任务基础信息 */
|
||||||
export function getQuestById(id) {
|
export function getQuestById(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${id}`,
|
url: `/api/script/draft/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 根据id查询任务详情信息 */
|
/** 根据id查询任务详情信息 */
|
||||||
export function getQuestByIdList(id) {
|
export function getQuestByIdList(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${id}/detail`,
|
url: `/api/script/draft/${id}/detail`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 更新任务基本信息 */
|
/** 更新任务基本信息 */
|
||||||
export function updateQuest(id, data) {
|
export function updateQuest(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${id}`,
|
url: `/api/script/draft/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 分页查找上线的仿真任务*/
|
/** 分页查找上线的仿真任务*/
|
||||||
export function getQuestPageListOnline(params) {
|
export function getQuestPageListOnline(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/quest/paging/online`,
|
url: `/api/quest/paging/online`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 剧本发布 */
|
/** 剧本发布 */
|
||||||
export function publishQuest(id, data) {
|
export function publishQuest(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${id}/publish`,
|
url: `/api/script/draft/${id}/publish`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 剧本撤销发布 */
|
/** 剧本撤销发布 */
|
||||||
export function retractQuest(id, data) {
|
export function retractQuest(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${id}/retract`,
|
url: `/api/script/draft/${id}/retract`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,5 @@
|
|||||||
import request from '@/utils/request';
|
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) {
|
export function queryRunPlanList(mapId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/runPlan/template/${mapId}/list`,
|
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) {
|
export function getRpListByMapId(mapId) {
|
||||||
return request({
|
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) {
|
export function getRunPlanLoadList(params) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -2,78 +2,78 @@ import request from '@/utils/request';
|
|||||||
|
|
||||||
/** 获取故障规则列表*/
|
/** 获取故障规则列表*/
|
||||||
export function getFailureGenerateRules(params) {
|
export function getFailureGenerateRules(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/failureGenerateRules`,
|
url: `/api/simulation/failureGenerateRules`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置自动故障*/
|
/** 设置自动故障*/
|
||||||
export function setFailureMode(data, group) {
|
export function setFailureMode(data, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/failureMode`,
|
url: `/api/simulation/${group}/failureMode`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仿真系统按计划行车
|
* 仿真系统按计划行车
|
||||||
*/
|
*/
|
||||||
export function runDiagramStart(params, group) {
|
export function runDiagramStart(params, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/start`,
|
url: `/api/simulation/${group}/start`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仿真系统结束计划行车
|
* 仿真系统结束计划行车
|
||||||
*/
|
*/
|
||||||
export function runDiagramOver(group) {
|
export function runDiagramOver(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/over`,
|
url: `/api/simulation/${group}/over`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退出仿真系统
|
* 退出仿真系统
|
||||||
*/
|
*/
|
||||||
export function runDiagramQuit(group) {
|
export function runDiagramQuit(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/quit`,
|
url: `/api/simulation/${group}/quit`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取仿真系统时间*/
|
/** 获取仿真系统时间*/
|
||||||
export function runDiagramGetTime(group) {
|
export function runDiagramGetTime(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/systemTime`,
|
url: `/api/simulation/${group}/systemTime`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看是否开始按计划行车
|
// 查看是否开始按计划行车
|
||||||
export function runDiagramIsStart(group) {
|
export function runDiagramIsStart(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/isRunPlanStart`,
|
url: `/api/simulation/${group}/isRunPlanStart`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仿真系统CBTC
|
* 仿真系统CBTC
|
||||||
* @param {*} mapId
|
* @param {*} mapId
|
||||||
*/
|
*/
|
||||||
export function simulationNotify({ mapId, code }) {
|
export function simulationNotify({ mapId, mapPrdId }) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${mapId}/${code}`,
|
url: `/api/simulation/${mapId}/${mapPrdId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,10 +81,10 @@ export function simulationNotify({ mapId, code }) {
|
|||||||
* @param {*} mapId
|
* @param {*} mapId
|
||||||
*/
|
*/
|
||||||
export function bitScreenNotify({ mapId }) {
|
export function bitScreenNotify({ mapId }) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/bigScreen/${mapId}`,
|
url: `/api/simulation/bigScreen/${mapId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,10 +92,10 @@ export function bitScreenNotify({ mapId }) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
*/
|
*/
|
||||||
export function trainingNotify({ trainingId }) {
|
export function trainingNotify({ trainingId }) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/training/${trainingId}`,
|
url: `/api/simulation/training/${trainingId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,334 +103,334 @@ export function trainingNotify({ trainingId }) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
*/
|
*/
|
||||||
export function examNotify({ examId }) {
|
export function examNotify({ examId }) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/exam/${examId}`,
|
url: `/api/simulation/exam/${examId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取用户实训列表*/
|
/** 获取用户实训列表*/
|
||||||
export function getSimulationList(data) {
|
export function getSimulationList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/stats`,
|
url: `/api/simulation/stats`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加用户仿真数据*/
|
/** 添加用户仿真数据*/
|
||||||
export function postSimulationStats(data) {
|
export function postSimulationStats(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/stats`,
|
url: `/api/simulation/stats`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 更新用户仿真数据*/
|
/** 更新用户仿真数据*/
|
||||||
export function putSimulationStats(data) {
|
export function putSimulationStats(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${data.id}/stats`,
|
url: `/api/simulation/${data.id}/stats`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除用户仿真数据*/
|
/** 删除用户仿真数据*/
|
||||||
export function deleteSimulationStats(statsId) {
|
export function deleteSimulationStats(statsId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${statsId}`,
|
url: `/api/simulation/${statsId}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取用户鼠标左键选中的设备信息*/
|
/** 获取用户鼠标左键选中的设备信息*/
|
||||||
export function letfMouseSelectDevice(deviceCode, group) {
|
export function letfMouseSelectDevice(deviceCode, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/device/${deviceCode}`,
|
url: `/api/simulation/${group}/device/${deviceCode}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取每日运行图*/
|
/** 获取每日运行图*/
|
||||||
export function getEveryDayRunPlanData(group) {
|
export function getEveryDayRunPlanData(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/runPlan`,
|
url: `/api/simulation/${group}/runPlan`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 录制脚本仿真*/
|
/** 录制脚本仿真*/
|
||||||
export function scriptRecordNotify(scriptId) {
|
export function scriptRecordNotify(scriptId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/scriptWrite/${scriptId}`,
|
url: `/api/simulation/scriptWrite/${scriptId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 保存剧本背景*/
|
/** 保存剧本背景*/
|
||||||
export function saveScriptScenes(group) {
|
export function saveScriptScenes(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/scenes`,
|
url: `/api/simulation/${group}/scriptWrite/scenes`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 保存录制任务数据*/
|
/** 保存录制任务数据*/
|
||||||
export function saveScriptData(group) {
|
export function saveScriptData(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 更新任务地图定位信息*/
|
/** 更新任务地图定位信息*/
|
||||||
export function updateMapLocation(group, data) {
|
export function updateMapLocation(group, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/mapLocation`,
|
url: `/api/simulation/${group}/scriptWrite/mapLocation`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取剧本编制的所有成员角色*/
|
/** 获取剧本编制的所有成员角色*/
|
||||||
export function getScriptMemberData(group) {
|
export function getScriptMemberData(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/members`,
|
url: `/api/simulation/${group}/scriptWrite/members`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取剧本出演成员角色 */
|
/** 获取剧本出演成员角色 */
|
||||||
export function getScriptPlayMember(group) {
|
export function getScriptPlayMember(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/players`,
|
url: `/api/simulation/${group}/scriptWrite/players`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消剧本演出成员角色 */
|
/** 取消剧本演出成员角色 */
|
||||||
export function cancleScriptMembers(group, data) {
|
export function cancleScriptMembers(group, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/removePlayers`,
|
url: `/api/simulation/${group}/scriptWrite/removePlayers`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 选择剧本演出成员角色 */
|
/** 选择剧本演出成员角色 */
|
||||||
export function selectScriptMembers(group, data) {
|
export function selectScriptMembers(group, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/choosePlayers`,
|
url: `/api/simulation/${group}/scriptWrite/choosePlayers`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改剧本演出成员性别 */
|
/** 修改剧本演出成员性别 */
|
||||||
export function modifyScriptMemberSex(group, playerId, data) {
|
export function modifyScriptMemberSex(group, playerId, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
|
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 清除仿真剧本数据*/
|
/** 清除仿真剧本数据*/
|
||||||
export function dumpScriptData(group) {
|
export function dumpScriptData(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询录制剧本步骤*/
|
/** 查询录制剧本步骤*/
|
||||||
export function queryScriptStep(group) {
|
export function queryScriptStep(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptRecordStage`,
|
url: `/api/simulation/${group}/scriptRecordStage`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取指定时间里可加载列车的个数*/
|
/** 获取指定时间里可加载列车的个数*/
|
||||||
export function getDesignatedTimeTrainNum(params, group) {
|
export function getDesignatedTimeTrainNum(params, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/plan/trainNum`,
|
url: `/api/simulation/${group}/plan/trainNum`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 添加剧本动作 */
|
/** 添加剧本动作 */
|
||||||
export function addScriptAction(group, data) {
|
export function addScriptAction(group, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/action`,
|
url: `/api/simulation/${group}/scriptWrite/action`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除剧本动作 */
|
/** 删除剧本动作 */
|
||||||
export function deleteScriptAction(group, actionId) {
|
export function deleteScriptAction(group, actionId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改剧本动作 */
|
/** 修改剧本动作 */
|
||||||
export function modifyScriptAction(group, actionId, data) {
|
export function modifyScriptAction(group, actionId, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 分页查询存在的仿真 */
|
/** 分页查询存在的仿真 */
|
||||||
export function getExistingSimulation(params) {
|
export function getExistingSimulation(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/manage/page`,
|
url: `/api/simulation/manage/page`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除存在的仿真 */
|
/** 删除存在的仿真 */
|
||||||
export function deleteExistingSimulation(group) {
|
export function deleteExistingSimulation(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/manage/${group}`,
|
url: `/api/simulation/manage/${group}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 根据设备类型获取设备列表 */
|
/** 根据设备类型获取设备列表 */
|
||||||
export function getDeviceCodeByDeviceType(group, params) {
|
export function getDeviceCodeByDeviceType(group, params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/deviceType/devices`,
|
url: `/api/simulation/${group}/deviceType/devices`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取任务录制的数据 */
|
/** 获取任务录制的数据 */
|
||||||
export function getScriptRecord(group) {
|
export function getScriptRecord(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite`,
|
url: `/api/simulation/${group}/scriptWrite`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 加载任务*/
|
/** 加载任务*/
|
||||||
export function loadQuest(questId, memberId, group) {
|
export function loadQuest(questId, memberId, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/quest/${questId}?memberId=${memberId}`,
|
url: `/api/simulation/${group}/quest/${questId}?memberId=${memberId}`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 加载剧本 */
|
/** 加载剧本 */
|
||||||
export function loadScript(scriptId, memberId, group) {
|
export function loadScript(scriptId, memberId, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `api/simulation/${group}/script/${scriptId}?memberId=${memberId}`,
|
url: `api/simulation/${group}/script/${scriptId}?memberId=${memberId}`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 退出剧本*/
|
/** 退出剧本*/
|
||||||
export function quitScript(group) {
|
export function quitScript(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/script`,
|
url: `/api/simulation/${group}/script`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 退出任务*/
|
/** 退出任务*/
|
||||||
export function quitQuest(group) {
|
export function quitQuest(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/quest`,
|
url: `/api/simulation/${group}/quest`,
|
||||||
method: 'put'
|
method: 'put'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 根据group获取仿真对象*/
|
/** 根据group获取仿真对象*/
|
||||||
export function getSimulationInfo(group) {
|
export function getSimulationInfo(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}`,
|
url: `/api/simulation/${group}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取可用的设备指令*/
|
/** 获取可用的设备指令*/
|
||||||
export function getAvailableDeviceCommand(params) {
|
export function getAvailableDeviceCommand(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/deviceCommand/available`,
|
url: `/api/simulation/deviceCommand/available`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 保存/修改任务剧本*/
|
/** 保存/修改任务剧本*/
|
||||||
export function saveTaskScript(group, data) {
|
export function saveTaskScript(group, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/questRecord/script`,
|
url: `/api/simulation/${group}/questRecord/script`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 暂停剧本编制的仿真 */
|
/** 暂停剧本编制的仿真 */
|
||||||
export function scriptPause(group) {
|
export function scriptPause(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/pause`,
|
url: `/api/simulation/${group}/scriptWrite/pause`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 恢复仿真运行并执行刚编辑的剧本动作 */
|
/** 恢复仿真运行并执行刚编辑的剧本动作 */
|
||||||
export function executeScript(group) {
|
export function executeScript(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/scriptWrite/execute`,
|
url: `/api/simulation/${group}/scriptWrite/execute`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 生成用户自己的当日运行图*/
|
/** 生成用户自己的当日运行图*/
|
||||||
export function generateDayRunPlan(planId, group) {
|
export function generateDayRunPlan(planId, group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
|
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 创建派班计划仿真*/
|
/** 创建派班计划仿真*/
|
||||||
export function schedulingNotify(params) {
|
export function schedulingNotify(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/scheduling/simulation`,
|
url: `/api/scheduling/simulation`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取PLC网关 */
|
/** 获取PLC网关 */
|
||||||
export function getPlcGateway(group) {
|
export function getPlcGateway(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/plcGateway`,
|
url: `/api/simulation/${group}/plcGateway`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理ibp盘事件 */
|
/** 处理ibp盘事件 */
|
||||||
export function handlerIbpEvent(group, data) {
|
export function handlerIbpEvent(group, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/${group}/ibp/event`,
|
url: `/api/simulation/${group}/ibp/event`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 预览脚本仿真*/
|
/** 预览脚本仿真*/
|
||||||
export function scriptDraftRecordNotify(scriptId) {
|
export function scriptDraftRecordNotify(scriptId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/simulation/scriptDraft/${scriptId}`,
|
url: `/api/simulation/scriptDraft/${scriptId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,15 +9,6 @@ export function getTrainingSystemList(cityCode, params) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function querySystemByTypeAndPrdCode(params, prodCode) {
|
|
||||||
/** 根据系统类型和地图产品code查询系统的内容(课程、章节、考试)*/
|
|
||||||
return request({
|
|
||||||
url: `/api/mapSystem/queryByTypeAndPrdCode/${prodCode}`,
|
|
||||||
method: 'get',
|
|
||||||
params
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getTrainingSystemListByMapId(mapId) {
|
export function getTrainingSystemListByMapId(mapId) {
|
||||||
/** 根据mapId去获取其子系统 */
|
/** 根据mapId去获取其子系统 */
|
||||||
return request({
|
return request({
|
||||||
|
@ -87,132 +87,133 @@
|
|||||||
<script>
|
<script>
|
||||||
import { checkRectCollision } from '@/utils/index';
|
import { checkRectCollision } from '@/utils/index';
|
||||||
export default {
|
export default {
|
||||||
name: 'PopMenu',
|
name: 'PopMenu',
|
||||||
props: {
|
props: {
|
||||||
menu: {
|
menu: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
show: false,
|
||||||
defaultFontSize: 14,
|
defaultFontSize: 14,
|
||||||
tPosition: {
|
tPosition: {
|
||||||
x: -1000,
|
x: -1000,
|
||||||
y: -1000
|
y: -1000
|
||||||
},
|
},
|
||||||
height: 'auto'
|
height: 'auto'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
width() {
|
width() {
|
||||||
let fontNum = 0;
|
let fontNum = 0;
|
||||||
let newLabel='';
|
let newLabel = '';
|
||||||
this.menu.forEach(elem => {
|
this.menu.forEach(elem => {
|
||||||
newLabel = elem.label && elem.label.replace(/[^\u0000-\u00ff]/g, 'aa');
|
newLabel = elem.label && elem.label.replace(/[^\u0000-\u00ff]/g, 'aa');
|
||||||
if (elem.label && newLabel.length > fontNum) {
|
if (elem.label && newLabel.length > fontNum) {
|
||||||
fontNum=newLabel.length;
|
fontNum = newLabel.length;
|
||||||
// fontNum = elem.label.length;
|
// fontNum = elem.label.length;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var width = fontNum/2 * this.defaultFontSize + 60 + 'px';
|
var width = fontNum / 2 * this.defaultFontSize + 60 + 'px';
|
||||||
// if(this.$t('global.lanuage')==='en'){
|
// if(this.$t('global.lanuage')==='en'){
|
||||||
// width = fontNum/2 * this.defaultFontSize + 40 + 'px';
|
// width = fontNum/2 * this.defaultFontSize + 40 + 'px';
|
||||||
// }
|
// }
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resetShowPosition(point) {
|
resetShowPosition(point) {
|
||||||
if (point) {
|
console.log(point);
|
||||||
this.show = true;
|
if (point) {
|
||||||
const self = this;
|
this.show = true;
|
||||||
this.$nextTick(() => {
|
const self = this;
|
||||||
const gutter = 3;
|
this.$nextTick(() => {
|
||||||
// 位置
|
const gutter = 3;
|
||||||
const height = self.$el.clientHeight;
|
// 位置
|
||||||
const width = self.$el.clientWidth;
|
const height = self.$el.clientHeight;
|
||||||
let px = 0;
|
const width = self.$el.clientWidth;
|
||||||
let py = 0;
|
let px = 0;
|
||||||
if (point.x + width > document.documentElement.clientWidth) {
|
let py = 0;
|
||||||
px = document.documentElement.clientWidth - width - gutter;
|
if (point.x + width > document.documentElement.clientWidth) {
|
||||||
} else {
|
px = document.documentElement.clientWidth - width - gutter;
|
||||||
px = point.x;
|
} else {
|
||||||
}
|
px = point.x;
|
||||||
if (point.y + height > document.documentElement.clientHeight) {
|
}
|
||||||
py = document.documentElement.clientHeight - height - gutter;
|
if (point.y + height > document.documentElement.clientHeight) {
|
||||||
} else {
|
py = document.documentElement.clientHeight - height - gutter;
|
||||||
py = point.y;
|
} else {
|
||||||
}
|
py = point.y;
|
||||||
// 处理和提示框重叠问题
|
}
|
||||||
const popTipDialog = document.getElementById('pop_tip_dialog');
|
// 处理和提示框重叠问题
|
||||||
if (popTipDialog) {
|
const popTipDialog = document.getElementById('pop_tip_dialog');
|
||||||
const tipRect = {
|
if (popTipDialog) {
|
||||||
point: { x: popTipDialog.offsetLeft, y: popTipDialog.offsetTop },
|
const tipRect = {
|
||||||
width: popTipDialog.offsetWidth,
|
point: { x: popTipDialog.offsetLeft, y: popTipDialog.offsetTop },
|
||||||
height: popTipDialog.offsetHeight
|
width: popTipDialog.offsetWidth,
|
||||||
};
|
height: popTipDialog.offsetHeight
|
||||||
const menuRect = {
|
};
|
||||||
point: { x: px, y: py },
|
const menuRect = {
|
||||||
width: self.$el.offsetWidth,
|
point: { x: px, y: py },
|
||||||
height: self.$el.offsetHeight
|
width: self.$el.offsetWidth,
|
||||||
};
|
height: self.$el.offsetHeight
|
||||||
const collision = checkRectCollision(tipRect, menuRect);
|
};
|
||||||
// 若重叠,调整位置
|
const collision = checkRectCollision(tipRect, menuRect);
|
||||||
if (collision) {
|
// 若重叠,调整位置
|
||||||
px = tipRect.point.x + tipRect.width + gutter;
|
if (collision) {
|
||||||
if (px + width > document.documentElement.clientWidth) {
|
px = tipRect.point.x + tipRect.width + gutter;
|
||||||
px = tipRect.point.x - menuRect.width - gutter;
|
if (px + width > document.documentElement.clientWidth) {
|
||||||
}
|
px = tipRect.point.x - menuRect.width - gutter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.tPosition.x = px;
|
}
|
||||||
self.tPosition.y = py;
|
self.tPosition.x = px;
|
||||||
});
|
self.tPosition.y = py;
|
||||||
}
|
});
|
||||||
},
|
}
|
||||||
close() {
|
},
|
||||||
this.show = false;
|
close() {
|
||||||
// 关闭时立即影藏popover组件
|
this.show = false;
|
||||||
const popoverList = document.getElementsByClassName('el-popover');
|
// 关闭时立即影藏popover组件
|
||||||
for (let i = 0; i < popoverList.length; i++) {
|
const popoverList = document.getElementsByClassName('el-popover');
|
||||||
popoverList[i].style.display = 'none';
|
for (let i = 0; i < popoverList.length; i++) {
|
||||||
}
|
popoverList[i].style.display = 'none';
|
||||||
},
|
}
|
||||||
checkIfDisabled(menuObj) {
|
},
|
||||||
return menuObj.disabled === true;
|
checkIfDisabled(menuObj) {
|
||||||
},
|
return menuObj.disabled === true;
|
||||||
isShow(menuObj) {
|
},
|
||||||
if (typeof (menuObj.show) === 'undefined') {
|
isShow(menuObj) {
|
||||||
return true;
|
if (typeof (menuObj.show) === 'undefined') {
|
||||||
} else {
|
return true;
|
||||||
return menuObj.show;
|
} else {
|
||||||
}
|
return menuObj.show;
|
||||||
},
|
}
|
||||||
calculateSubWidth(item) {
|
},
|
||||||
const children = item.children;
|
calculateSubWidth(item) {
|
||||||
let width = 0;
|
const children = item.children;
|
||||||
let fontNum = 0;
|
let width = 0;
|
||||||
children.forEach(elem => {
|
let fontNum = 0;
|
||||||
if (elem.label.length > fontNum) {
|
children.forEach(elem => {
|
||||||
fontNum = elem.label.length;
|
if (elem.label.length > fontNum) {
|
||||||
}
|
fontNum = elem.label.length;
|
||||||
});
|
}
|
||||||
width = fontNum * this.defaultFontSize + 20 + 'px';
|
});
|
||||||
return width;
|
width = fontNum * this.defaultFontSize + 20 + 'px';
|
||||||
},
|
return width;
|
||||||
openLoadFile(item) {
|
},
|
||||||
const obj = this.$refs[item.label][0];
|
openLoadFile(item) {
|
||||||
if (obj.files) {
|
const obj = this.$refs[item.label][0];
|
||||||
const file = obj.files[0];
|
if (obj.files) {
|
||||||
item.handler(file);
|
const file = obj.files[0];
|
||||||
obj.value = '';
|
item.handler(file);
|
||||||
}
|
obj.value = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="formModel[item.prop]"
|
v-model="formModel[item.prop]"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autosize='item.isAutoSize||false'
|
:autosize="item.isAutoSize||false"
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
:style="{width: item.tooltip ? 'calc(100% - 50px)' : '100%'}"
|
:style="{width: item.tooltip ? 'calc(100% - 50px)' : '100%'}"
|
||||||
@ -114,6 +114,7 @@
|
|||||||
:key="option.value"
|
:key="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
|
:disabled="option.disabled"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -132,6 +133,7 @@
|
|||||||
:key="option.value"
|
:key="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
|
:disabled="option.disabled"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -147,6 +149,7 @@
|
|||||||
:key="option.value"
|
:key="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
|
:disabled="option.disabled"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -163,6 +166,7 @@
|
|||||||
:key="option.value"
|
:key="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
|
:disabled="option.disabled"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -178,6 +182,7 @@
|
|||||||
:key="option.value"
|
:key="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value"
|
||||||
|
:disabled="option.disabled"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -233,52 +238,52 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'DataForm',
|
name: 'DataForm',
|
||||||
props: {
|
props: {
|
||||||
form: {
|
form: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
formModel: {
|
formModel: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line vue/require-default-prop
|
// eslint-disable-next-line vue/require-default-prop
|
||||||
rules: {
|
rules: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default() {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkFieldType(field, type) {
|
checkFieldType(field, type) {
|
||||||
if (field.hasOwnProperty('show')) {
|
if (field.hasOwnProperty('show')) {
|
||||||
return field.type === type && field.show;
|
return field.type === type && field.show;
|
||||||
} else {
|
} else {
|
||||||
return field.type === type;
|
return field.type === type;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
validateForm(callback) {
|
validateForm(callback) {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
callback();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
},
|
},
|
||||||
clearValidate() {
|
clearValidate() {
|
||||||
this.$refs.form.clearValidate();
|
this.$refs.form.clearValidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
@ -152,329 +152,332 @@
|
|||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'QueryForm',
|
name: 'QueryForm',
|
||||||
props: {
|
props: {
|
||||||
queryList: {
|
queryList: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: function() {
|
default: function() {
|
||||||
return { actions: [] };
|
return { actions: [] };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
beforeQuery: {
|
beforeQuery: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default(val) {
|
default(val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
canQuery: {
|
canQuery: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
leftSpan: {
|
leftSpan: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default() {
|
default() {
|
||||||
return 18;
|
return 18;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
columnNum: 4,
|
columnNum: 4,
|
||||||
queryObject: {},
|
queryObject: {},
|
||||||
queryFlag: this.canQuery,
|
queryFlag: this.canQuery,
|
||||||
exportFlag: false,
|
exportFlag: false,
|
||||||
resetShow: true,
|
resetShow: true,
|
||||||
formModel: {},
|
formModel: {},
|
||||||
modelFields: [],
|
modelFields: [],
|
||||||
ossConfig: {
|
ossConfig: {
|
||||||
accessKeyId: 'LTAIuLzS7VK3mV8d',
|
accessKeyId: 'LTAIuLzS7VK3mV8d',
|
||||||
accessKeySecret: '7F7aWIi3ymq3J7uGxs9M2c2DnfSiF3',
|
accessKeySecret: '7F7aWIi3ymq3J7uGxs9M2c2DnfSiF3',
|
||||||
bucket: 'kfexcel'
|
bucket: 'kfexcel'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rowColumnList() {
|
rowColumnList() {
|
||||||
const alocateColumnNum = function(field) {
|
const alocateColumnNum = function(field) {
|
||||||
let need = 1;
|
let need = 1;
|
||||||
switch (field.type) {
|
switch (field.type) {
|
||||||
case 'daterange':
|
case 'daterange':
|
||||||
need = 2;
|
need = 2;
|
||||||
break;
|
break;
|
||||||
case 'timerange':
|
case 'timerange':
|
||||||
need = 2;
|
need = 2;
|
||||||
break;
|
break;
|
||||||
case 'datetimerange':
|
case 'datetimerange':
|
||||||
need = 2;
|
need = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
field.columnNeed = need;
|
field.columnNeed = need;
|
||||||
return need;
|
return need;
|
||||||
};
|
};
|
||||||
const objNumList = [];
|
const objNumList = [];
|
||||||
let tempColumnNum = 0;
|
let tempColumnNum = 0;
|
||||||
let rowColumnNum = 0;
|
let rowColumnNum = 0;
|
||||||
for (const item in this.queryObject) {
|
for (const item in this.queryObject) {
|
||||||
var colNum = alocateColumnNum(this.queryObject[item]);
|
var colNum = alocateColumnNum(this.queryObject[item]);
|
||||||
tempColumnNum = tempColumnNum + colNum;
|
tempColumnNum = tempColumnNum + colNum;
|
||||||
if (tempColumnNum > this.columnNum) {
|
if (tempColumnNum > this.columnNum) {
|
||||||
objNumList.push(rowColumnNum);
|
objNumList.push(rowColumnNum);
|
||||||
rowColumnNum = 1;
|
rowColumnNum = 1;
|
||||||
tempColumnNum = colNum;
|
tempColumnNum = colNum;
|
||||||
} else if (tempColumnNum === this.columnNum) {
|
} else if (tempColumnNum === this.columnNum) {
|
||||||
objNumList.push(++rowColumnNum);
|
objNumList.push(++rowColumnNum);
|
||||||
rowColumnNum = 0;
|
rowColumnNum = 0;
|
||||||
tempColumnNum = 0;
|
tempColumnNum = 0;
|
||||||
} else {
|
} else {
|
||||||
++rowColumnNum;
|
++rowColumnNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tempColumnNum > 0 && rowColumnNum > 0) {
|
if (tempColumnNum > 0 && rowColumnNum > 0) {
|
||||||
objNumList.push(rowColumnNum);
|
objNumList.push(rowColumnNum);
|
||||||
}
|
}
|
||||||
return objNumList;
|
return objNumList;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'queryForm.queryObject': function(newVal) {
|
'queryForm.queryObject': function(newVal) {
|
||||||
this.initPageData();
|
this.initPageData();
|
||||||
},
|
},
|
||||||
canQuery(newVal) {
|
canQuery(newVal) {
|
||||||
this.queryFlag = newVal;
|
this.queryFlag = newVal;
|
||||||
},
|
},
|
||||||
formModel: {
|
formModel: {
|
||||||
handler: function(form) {
|
handler: function(form) {
|
||||||
if (form) {
|
if (form) {
|
||||||
localStore.set(this.$route.path, form);
|
localStore.set(this.$route.path, form);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initPageData();
|
this.initPageData();
|
||||||
this.initQueryModel();
|
this.initQueryModel();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取默认查询参数
|
// 获取默认查询参数
|
||||||
initQueryModel() {
|
initQueryModel() {
|
||||||
this.formModel = localStore.get(this.$route.path) || this.formModel;
|
this.formModel = localStore.get(this.$route.path) || this.formModel;
|
||||||
if (typeof this.queryForm.initLoadCallback === 'function') {
|
if (typeof this.queryForm.initLoadCallback === 'function') {
|
||||||
this.queryForm.initLoadCallback(this.formModel);
|
this.queryForm.initLoadCallback(this.formModel);
|
||||||
}
|
}
|
||||||
this.query();
|
this.query();
|
||||||
},
|
},
|
||||||
// 初始化页面数据
|
// 初始化页面数据
|
||||||
initPageData() {
|
initPageData() {
|
||||||
this.modelFields = [];
|
this.modelFields = [];
|
||||||
this.exportFlag = this.queryForm.canExport;
|
this.exportFlag = this.queryForm.canExport;
|
||||||
this.resetShow = this.queryForm.reset;
|
this.resetShow = this.queryForm.reset;
|
||||||
this.buildQueryField();
|
this.buildQueryField();
|
||||||
this.buildForm();
|
this.buildForm();
|
||||||
},
|
},
|
||||||
// 构建查询表单对象、显示的查询对象
|
// 构建查询表单对象、显示的查询对象
|
||||||
buildForm() {
|
buildForm() {
|
||||||
// 获取表单Field的默认值
|
// 获取表单Field的默认值
|
||||||
const getDefaultValueByField = function(field) {
|
const getDefaultValueByField = function(field) {
|
||||||
let defaultValue = '';
|
let defaultValue = '';
|
||||||
switch (field.type) {
|
switch (field.type) {
|
||||||
case 'select':
|
case 'select':
|
||||||
if (field.config.multiple) {
|
if (field.config.multiple) {
|
||||||
defaultValue = [];
|
defaultValue = [];
|
||||||
} else {
|
} else {
|
||||||
defaultValue = '';
|
defaultValue = '';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'daterange':
|
case 'daterange':
|
||||||
defaultValue = [];
|
defaultValue = [];
|
||||||
break;
|
break;
|
||||||
case 'timerange':
|
case 'timerange':
|
||||||
defaultValue = [];
|
defaultValue = [];
|
||||||
break;
|
break;
|
||||||
case 'datetimerange':
|
case 'datetimerange':
|
||||||
defaultValue = [];
|
defaultValue = [];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
};
|
};
|
||||||
// 构建查询表单对象、显示的查询对象
|
// 构建查询表单对象、显示的查询对象
|
||||||
const queryObject = {};
|
const queryObject = {};
|
||||||
const model = {};
|
const model = {};
|
||||||
for (const item in this.queryForm.queryObject) {
|
for (const item in this.queryForm.queryObject) {
|
||||||
if (this.queryForm.queryObject.show === false) {
|
if (this.queryForm.queryObject.show === false) {
|
||||||
continue;
|
continue;
|
||||||
} else if (this.queryForm.queryObject.visible === false) {
|
} else if (this.queryForm.queryObject.visible === false) {
|
||||||
model[item] = this.queryForm.queryObject[item].value;
|
model[item] = this.queryForm.queryObject[item].value;
|
||||||
} else {
|
} else {
|
||||||
queryObject[item] = this.queryForm.queryObject[item];
|
queryObject[item] = this.queryForm.queryObject[item];
|
||||||
model[item] = this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
|
model[item] = this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.queryObject = queryObject;
|
this.queryObject = queryObject;
|
||||||
this.formModel = model;
|
this.formModel = model;
|
||||||
},
|
},
|
||||||
// 构建查询fieldName列表
|
// 构建查询fieldName列表
|
||||||
buildQueryField() {
|
buildQueryField() {
|
||||||
const fields = [];
|
const fields = [];
|
||||||
for (const item in this.queryForm.queryObject) {
|
for (const item in this.queryForm.queryObject) {
|
||||||
if (this.queryForm.queryObject.show === false) {
|
if (this.queryForm.queryObject.show === false) {
|
||||||
continue;
|
continue;
|
||||||
} else if (this.queryForm.queryObject.visible === false) {
|
} else if (this.queryForm.queryObject.visible === false) {
|
||||||
fields.push({ field: item });
|
fields.push({ field: item });
|
||||||
} else {
|
} else {
|
||||||
const type = this.queryForm.queryObject[item].type;
|
const type = this.queryForm.queryObject[item].type;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
fields.push({ field: item });
|
fields.push({ field: item });
|
||||||
break;
|
break;
|
||||||
case 'date':
|
case 'date':
|
||||||
fields.push({ field: item });
|
fields.push({ field: item });
|
||||||
break;
|
break;
|
||||||
case 'daterange':
|
case 'daterange':
|
||||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||||
break;
|
break;
|
||||||
case 'time':
|
case 'time':
|
||||||
fields.push({ field: item });
|
fields.push({ field: item });
|
||||||
break;
|
break;
|
||||||
case 'timerange':
|
case 'timerange':
|
||||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||||
break;
|
break;
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
fields.push({ field: item });
|
fields.push({ field: item });
|
||||||
break;
|
break;
|
||||||
case 'datetimerange':
|
case 'datetimerange':
|
||||||
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
fields.push({ field: item, subFields: this.queryForm.queryObject[item].fieldsName });
|
||||||
break;
|
break;
|
||||||
case 'select':
|
case 'select':
|
||||||
fields.push({ field: item });
|
fields.push({ field: item });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.modelFields = fields;
|
this.modelFields = fields;
|
||||||
},
|
},
|
||||||
checkColumnIndex(rowIndex, objIndex) {
|
checkColumnIndex(rowIndex, objIndex) {
|
||||||
var flag = false;
|
var flag = false;
|
||||||
if (rowIndex === 0) {
|
if (rowIndex === 0) {
|
||||||
if (objIndex >= 0 && objIndex < this.rowColumnList[rowIndex]) {
|
if (objIndex >= 0 && objIndex < this.rowColumnList[rowIndex]) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let objNum = 0;
|
let objNum = 0;
|
||||||
for (var i = 0; i < rowIndex; ++i) {
|
for (var i = 0; i < rowIndex; ++i) {
|
||||||
objNum += this.rowColumnList[i];
|
objNum += this.rowColumnList[i];
|
||||||
}
|
}
|
||||||
if (objIndex >= objNum && objIndex < objNum + this.rowColumnList[rowIndex]) {
|
if (objIndex >= objNum && objIndex < objNum + this.rowColumnList[rowIndex]) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return flag;
|
return flag;
|
||||||
},
|
},
|
||||||
checkFieldType(field, type, name) {
|
checkFieldType(field, type, name) {
|
||||||
if (field.type === type) {
|
if (field.type === type) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleTreeListChildren(treeList) {
|
handleTreeListChildren(treeList) {
|
||||||
const traverse = function(list) {
|
const traverse = function(list) {
|
||||||
if (list && list.length > 0) {
|
if (list && list.length > 0) {
|
||||||
list.forEach(element => {
|
list.forEach(element => {
|
||||||
if (element.children != null && element.children.length > 0) {
|
if (element.children != null && element.children.length > 0) {
|
||||||
traverse(element.children);
|
traverse(element.children);
|
||||||
} else if (element.children != null && element.children.length === 0) {
|
} else if (element.children != null && element.children.length === 0) {
|
||||||
element.children = null;
|
element.children = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (treeList && treeList.length > 0) {
|
if (treeList && treeList.length > 0) {
|
||||||
traverse(treeList);
|
traverse(treeList);
|
||||||
return treeList;
|
return treeList;
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 重置操作
|
// 重置操作
|
||||||
doClean() {
|
doClean() {
|
||||||
this.initPageData();
|
this.initPageData();
|
||||||
this.query();
|
this.query();
|
||||||
},
|
},
|
||||||
// 导出操作
|
// 导出操作
|
||||||
doExport() {
|
doExport() {
|
||||||
this.doExportFront();
|
this.doExportFront();
|
||||||
},
|
},
|
||||||
// 前端方式导出
|
// 前端方式导出
|
||||||
doExportFront() {
|
doExportFront() {
|
||||||
const resultData = this.prepareQueryData();
|
const resultData = this.prepareQueryData();
|
||||||
if (resultData === false) {
|
if (resultData === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit('queryExport', resultData);
|
this.$emit('queryExport', resultData);
|
||||||
},
|
},
|
||||||
// 将表单对象转换为查询对象
|
// 将表单对象转换为查询对象
|
||||||
prepareQueryData() {
|
prepareQueryData() {
|
||||||
let resultData = {};
|
let resultData = {};
|
||||||
// 将formModel转换为查询对象
|
// 将formModel转换为查询对象
|
||||||
for (const item in this.formModel) {
|
for (const item in this.formModel) {
|
||||||
for (var i = 0; i < this.modelFields.length; ++i) {
|
for (var i = 0; i < this.modelFields.length; ++i) {
|
||||||
if (item === this.modelFields[i].field) {
|
if (item === this.modelFields[i].field) {
|
||||||
if (this.modelFields[i].type === 'treeSelect') {
|
if (this.modelFields[i].type === 'treeSelect') {
|
||||||
const qo = this.queryForm.queryObject[item];
|
const qo = this.queryForm.queryObject[item];
|
||||||
const nodeKey = qo.treeConfig.nodeKey ? qo.treeConfig.nodeKey : 'id';
|
const nodeKey = qo.treeConfig.nodeKey ? qo.treeConfig.nodeKey : 'id';
|
||||||
const tmpIds = [];
|
const tmpIds = [];
|
||||||
for (var v = 0; v < this.formModel[item].length; ++v) {
|
for (var v = 0; v < this.formModel[item].length; ++v) {
|
||||||
tmpIds[v] = this.formModel[item][v][nodeKey];
|
tmpIds[v] = this.formModel[item][v][nodeKey];
|
||||||
}
|
}
|
||||||
resultData[item] = tmpIds;
|
resultData[item] = tmpIds;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (this.modelFields[i].subFields) {
|
if (this.modelFields[i].subFields) {
|
||||||
for (var j = 0; j < this.modelFields[i].subFields.length; ++j) {
|
for (var j = 0; j < this.modelFields[i].subFields.length; ++j) {
|
||||||
if (this.formModel[item] && this.formModel[item].length > j) {
|
if (this.formModel[item] && this.formModel[item].length > j) {
|
||||||
resultData[this.modelFields[i].subFields[j]] = this.formModel[item][j];
|
resultData[this.modelFields[i].subFields[j]] = this.formModel[item][j];
|
||||||
} else {
|
} else {
|
||||||
resultData[this.modelFields[i].subFields[j]] = '';
|
resultData[this.modelFields[i].subFields[j]] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
resultData[item] = this.formModel[item];
|
resultData[item] = this.formModel[item];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 对所有的数据进行trim操作
|
// 对所有的数据进行trim操作
|
||||||
for (const item in resultData) {
|
for (const item in resultData) {
|
||||||
if (resultData[item] && resultData[item].trim) {
|
if (resultData[item] && resultData[item].trim) {
|
||||||
resultData[item] = resultData[item].trim();
|
resultData[item] = resultData[item].trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 查询前数据处理
|
// 查询前数据处理
|
||||||
resultData = this.beforeQuery(resultData);
|
resultData = this.beforeQuery(resultData);
|
||||||
return resultData;
|
return resultData;
|
||||||
},
|
},
|
||||||
query() {
|
query() {
|
||||||
const resultData = this.prepareQueryData();
|
const resultData = this.prepareQueryData();
|
||||||
if (resultData === false) {
|
if (resultData === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit('query', resultData);
|
this.$emit('query', resultData);
|
||||||
},
|
},
|
||||||
selectChange(row, form) {
|
selectChange(row, form) {
|
||||||
if (row.change) {
|
if (row.change) {
|
||||||
row.change(form);
|
row.change(form);
|
||||||
}
|
}
|
||||||
}
|
if ( typeof row.selectChange === 'function') {
|
||||||
}
|
row.selectChange && row.selectChange(form);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -10,6 +10,7 @@ export default {
|
|||||||
deleteFailed: 'Failed to delete',
|
deleteFailed: 'Failed to delete',
|
||||||
exportFailed: 'Export Execution Exceptions',
|
exportFailed: 'Export Execution Exceptions',
|
||||||
getListFailed: 'Failed to retrieve list data',
|
getListFailed: 'Failed to retrieve list data',
|
||||||
|
getPermissionListFailed: 'Failed to get permission list',
|
||||||
getDistributeQrcodeFailed: 'Failure to obtain permission to distribute two-dimensional code',
|
getDistributeQrcodeFailed: 'Failure to obtain permission to distribute two-dimensional code',
|
||||||
obtainMaxNumberFailed: 'Failed to obtain the maximum number of user privileges',
|
obtainMaxNumberFailed: 'Failed to obtain the maximum number of user privileges',
|
||||||
getTransferQrcodeFailed: 'Failure to obtain permission to transfer two-dimensional code',
|
getTransferQrcodeFailed: 'Failure to obtain permission to transfer two-dimensional code',
|
||||||
@ -102,5 +103,6 @@ export default {
|
|||||||
connectToRealDeviceFailed: 'Connect to real device failed!',
|
connectToRealDeviceFailed: 'Connect to real device failed!',
|
||||||
getRealDeviceListFailed: 'Get real device list failed!',
|
getRealDeviceListFailed: 'Get real device list failed!',
|
||||||
deleteRealDeviceFailed: 'Delete real device 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',
|
america: 'America',
|
||||||
companyInfo:'Beijing Jiulian Technology Co., Ltd',
|
companyInfo:'Beijing Jiulian Technology Co., Ltd',
|
||||||
companyTel:'Tel: +86 13289398171',
|
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',
|
explanation: 'Explanation',
|
||||||
courseDetails: 'Course details',
|
courseDetails: 'Course details',
|
||||||
courseTree: 'Course tree:',
|
courseTree: 'Course tree:',
|
||||||
mapName:'Map Name'
|
mapName:'Map Name',
|
||||||
|
copy: 'Copy'
|
||||||
};
|
};
|
||||||
|
@ -88,6 +88,7 @@ export default {
|
|||||||
button: 'button',
|
button: 'button',
|
||||||
|
|
||||||
mapName: 'Name of the map:',
|
mapName: 'Name of the map:',
|
||||||
|
skinName: 'Skin style:',
|
||||||
selectCity: 'city:',
|
selectCity: 'city:',
|
||||||
offsetXColon: 'X Offset:',
|
offsetXColon: 'X Offset:',
|
||||||
offsetYColon: 'Y Offset:',
|
offsetYColon: 'Y Offset:',
|
||||||
@ -375,6 +376,7 @@ export default {
|
|||||||
pointSystem2: 'TwoPointSystem',
|
pointSystem2: 'TwoPointSystem',
|
||||||
pointSystem5: 'FivePointSystem',
|
pointSystem5: 'FivePointSystem',
|
||||||
skinType: 'SkinType',
|
skinType: 'SkinType',
|
||||||
|
lineCode:'Line Type',
|
||||||
turnoverTime: 'TurnoverTime',
|
turnoverTime: 'TurnoverTime',
|
||||||
productList: 'ProductList',
|
productList: 'ProductList',
|
||||||
belongsToMapName: 'BelongsToMapName',
|
belongsToMapName: 'BelongsToMapName',
|
||||||
@ -543,5 +545,6 @@ export default {
|
|||||||
|
|
||||||
horizontal: 'Horizontal',
|
horizontal: 'Horizontal',
|
||||||
vertical: 'Vertical',
|
vertical: 'Vertical',
|
||||||
piece: 'piece'
|
piece: 'piece',
|
||||||
|
setStationCode: 'Batch set up centralized station'
|
||||||
};
|
};
|
||||||
|
@ -492,5 +492,6 @@ export default {
|
|||||||
sourceTrainWindow: 'Source train window',
|
sourceTrainWindow: 'Source train window',
|
||||||
trainWindow: 'Train window',
|
trainWindow: 'Train window',
|
||||||
targetTrainWindow: 'Target train window',
|
targetTrainWindow: 'Target train window',
|
||||||
category: 'category'
|
category: 'category',
|
||||||
|
lineCode:'Line Type'
|
||||||
};
|
};
|
||||||
|
@ -1,35 +1,40 @@
|
|||||||
export default {
|
export default {
|
||||||
permissionPack: 'Package',
|
permissionPack: 'Package',
|
||||||
setSuccess: 'Set successfully',
|
setSuccess: 'Set successfully',
|
||||||
isSureSetBelonger: 'Are you sure to set {name} to be the owner of the permission?',
|
isSureSetBelonger: 'Are you sure to set {name} to be the owner of the permission?',
|
||||||
setBelonger: 'Set Owner',
|
setBelonger: 'Set Owner',
|
||||||
lessonName: 'Lesson Name',
|
lessonName: 'Lesson Name',
|
||||||
mapName: 'Map Name',
|
mapName: 'Map Name',
|
||||||
mapProductName: 'Product Name',
|
mapProductName: 'Product Name',
|
||||||
permissionType: 'Permission Type',
|
permissionType: 'Permission Type',
|
||||||
permissionStatus: 'Permission Status',
|
permissionStatus: 'Permission Status',
|
||||||
permissionUseType: 'Public/Private',
|
permissionUseType: 'Public/Private',
|
||||||
permissionTotal: 'Total',
|
permissionTotal: 'Total',
|
||||||
permissionRemains: 'Remains',
|
permissionRemains: 'Remains',
|
||||||
isForever: 'Permanent',
|
isForever: 'Permanent',
|
||||||
startTime: 'Start Time',
|
startTime: 'Start Time',
|
||||||
endTime: 'End Time',
|
endTime: 'End Time',
|
||||||
belonger: 'Owner',
|
belonger: 'Owner',
|
||||||
userList: 'User List',
|
userList: 'User List',
|
||||||
customPackageRules: 'Custom packaging rules',
|
customPackageRules: 'Custom packaging rules',
|
||||||
addRules: 'Add rules',
|
addRules: 'Add rules',
|
||||||
package: 'Pack',
|
package: 'Pack',
|
||||||
getQrcode: 'Get qr code',
|
getQrcode: 'Get qr code',
|
||||||
hasExitRule: 'This type rule already exists',
|
hasExitRule: 'This type rule already exists',
|
||||||
pleaseAddRule: 'Please add rules',
|
pleaseAddRule: 'Please add rules',
|
||||||
selectDate: 'Select time',
|
selectDate: 'Select time',
|
||||||
addPermissionPackageRule: 'Add authority packaging rules',
|
addPermissionPackageRule: 'Add authority packaging rules',
|
||||||
editPermissionPackageRule: 'edit authority packaging rule',
|
editPermissionPackageRule: 'edit authority packaging rule',
|
||||||
restPermissionMaxNumber: '(maximum number of remaining permissions: {0})',
|
restPermissionMaxNumber: '(maximum number of remaining permissions: {0})',
|
||||||
pleaseSelectTransferPermission: 'Select transfer permissions',
|
pleaseSelectTransferPermission: 'Select transfer permissions',
|
||||||
permissionName: 'Permission Name',
|
permissionName: 'Permission Name',
|
||||||
private: 'Private',
|
private: 'Private',
|
||||||
public: 'Public',
|
public: 'Public',
|
||||||
userName: 'User Name',
|
userName: 'User Name',
|
||||||
statusType: 'Status Type'
|
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',
|
theBelongsProjectCannotBeEmpty: 'The belongs project cannot be empty',
|
||||||
pleaseSelectTheBelongsProject: 'Please select the belongs project',
|
pleaseSelectTheBelongsProject: 'Please select the belongs project',
|
||||||
copyMapAs: 'Copy map as',
|
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 {
|
export default {
|
||||||
homePage: 'Home',
|
homePage: 'Home',
|
||||||
|
|
||||||
mapManage: 'Map',
|
mapManage: 'Map',
|
||||||
skinManage: 'Skin management',
|
skinManage: 'Skin management',
|
||||||
mapDraw: 'Map draw',
|
mapDraw: 'Map draw',
|
||||||
runPlanManage: 'Run plan',
|
runPlanManage: 'Run plan',
|
||||||
productEdit: 'Product editor',
|
productEdit: 'Product editor',
|
||||||
|
|
||||||
designhomePage: 'Public map',
|
designhomePage: 'Public map',
|
||||||
designUserPage: 'Personal map',
|
designUserPage: 'Personal map',
|
||||||
|
|
||||||
lessaonManage: 'Lesson',
|
lessaonManage: 'Lesson',
|
||||||
lessonEdit: 'Lesson editor',
|
lessonEdit: 'Lesson editor',
|
||||||
trainingRecord: 'Trainning recording',
|
trainingRecord: 'Trainning recording',
|
||||||
trainingRule: 'Training rules',
|
trainingRule: 'Training rules',
|
||||||
trainingManage: 'Training management',
|
trainingManage: 'Training management',
|
||||||
taskManage: 'Task management',
|
taskManage: 'Task management',
|
||||||
scriptManage: 'Script',
|
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',
|
permissionManage: 'Permission',
|
||||||
selfPermission: 'My Permission',
|
selfPermission: 'My Permission',
|
||||||
|
|
||||||
pulishManage: 'Publication',
|
pulishManage: 'Publication',
|
||||||
publishMapManage: 'Publishing map management',
|
publishMapManage: 'Publishing map management',
|
||||||
productStateManage: 'Product state management',
|
productStateManage: 'Product state management',
|
||||||
publishLessonManage: 'Publishing lesson management',
|
publishLessonManage: 'Publishing lesson management',
|
||||||
runPlanTemplateManage: 'Template plan management',
|
runPlanTemplateManage: 'Template plan management',
|
||||||
runPlanCommonManage: 'Loading Plan Managemen',
|
runPlanCommonManage: 'Loading Plan Managemen',
|
||||||
runPlanEveryDayManage: 'Daily plan Management',
|
runPlanEveryDayManage: 'Daily plan Management',
|
||||||
examRuleManage: 'Management of examination rules',
|
examRuleManage: 'Management of examination rules',
|
||||||
|
|
||||||
orderAuthorityManage: 'Order&Authority',
|
orderAuthorityManage: 'Order&Authority',
|
||||||
commodityManage: 'Commodity management',
|
commodityManage: 'Commodity management',
|
||||||
orderManage: 'Order management',
|
orderManage: 'Order management',
|
||||||
authorityManage: 'authority management',
|
authorityManage: 'authority management',
|
||||||
authorityTransferManage: 'Privilege distribution management',
|
authorityTransferManage: 'Privilege distribution management',
|
||||||
userRulesManage: 'User Rights Statistics',
|
userRulesManage: 'User Rights Statistics',
|
||||||
addCommodity: 'Adding goods',
|
addCommodity: 'Adding goods',
|
||||||
addOrder: 'Adding orders',
|
addOrder: 'Adding orders',
|
||||||
addCoursePermissions: 'Adding course permissions',
|
addCoursePermissions: 'Adding course permissions',
|
||||||
|
|
||||||
systemManage: 'System',
|
systemManage: 'System',
|
||||||
dataDictionary: 'Data dictionary',
|
dataDictionary: 'Data dictionary',
|
||||||
dataDictionaryDetails: 'Data dictionary details',
|
dataDictionaryDetails: 'Data dictionary details',
|
||||||
userManage: 'user management',
|
userManage: 'user management',
|
||||||
cacheManage: 'cache management',
|
cacheManage: 'cache management',
|
||||||
userTrainingManage: 'User training management',
|
userTrainingManage: 'User training management',
|
||||||
userExamManage: 'User examination management',
|
userExamManage: 'User examination management',
|
||||||
userSimulationManage: 'User simulation management',
|
userSimulationManage: 'User simulation management',
|
||||||
existingSimulation: 'Existence simulation management',
|
existingSimulation: 'Existence simulation management',
|
||||||
ibpDraw: 'Ibp Draw',
|
ibpDraw: 'Ibp Draw',
|
||||||
trainingPlatform: 'trainingPlatform',
|
trainingPlatform: 'trainingPlatform',
|
||||||
releaseApplication: 'Release application',
|
releaseApplication: 'Release application',
|
||||||
courseApplication: 'Course release application',
|
courseApplication: 'Course release application',
|
||||||
scriptReleaseApplication: 'Script release application',
|
scriptReleaseApplication: 'Script release application',
|
||||||
runGraphReleaseApplication: 'Run graph release application',
|
runGraphReleaseApplication: 'Run graph release application',
|
||||||
subsystemGeneration: 'Subsystem generation'
|
subsystemGeneration: 'Subsystem generation',
|
||||||
|
newsBulletin: 'New bulletin'
|
||||||
};
|
};
|
||||||
|
@ -1,314 +1,319 @@
|
|||||||
export default {
|
export default {
|
||||||
pleaseSelect: 'Please select',
|
pleaseSelect: 'Please select',
|
||||||
selectEquipment: 'Please select equipment',
|
selectEquipment: 'Please select equipment',
|
||||||
deviceTypeNotNull: 'The device type code cannot be empty',
|
deviceTypeNotNull: 'The device type code cannot be empty',
|
||||||
operationTypeNotNull: 'The opcode cannot be empty',
|
operationTypeNotNull: 'The opcode cannot be empty',
|
||||||
tipsNotNull: 'The prompt message cannot be empty',
|
tipsNotNull: 'The prompt message cannot be empty',
|
||||||
pleaseSelectEncoding: 'Please select a unique encoding',
|
pleaseSelectEncoding: 'Please select a unique encoding',
|
||||||
pleaseEnterStatusSignal: 'Please enter the name of the status signal',
|
pleaseEnterStatusSignal: 'Please enter the name of the status signal',
|
||||||
pleaseEnterXCoordinate: 'Please enter the x coordinate',
|
pleaseEnterXCoordinate: 'Please enter the x coordinate',
|
||||||
pleaseEnterYCoordinate: 'Please enter the y coordinate',
|
pleaseEnterYCoordinate: 'Please enter the y coordinate',
|
||||||
|
|
||||||
pleaseSelectLine: 'Please select a Line',
|
pleaseSelectLine: 'Please select a Line',
|
||||||
pleaseSelectLineType: 'Select type Line',
|
pleaseSelectLineType: 'Select type Line',
|
||||||
pleaseSelectLineWidth: 'Please enter line width',
|
pleaseSelectLineWidth: 'Please enter line width',
|
||||||
pleaseSelectCity: 'Please select city',
|
pleaseSelectCity: 'Please select city',
|
||||||
|
|
||||||
linkXCoordinate: 'Please enter the Link x coordinate',
|
linkXCoordinate: 'Please enter the Link x coordinate',
|
||||||
linkYCoordinate: 'Please enter the Link y coordinate',
|
linkYCoordinate: 'Please enter the Link y coordinate',
|
||||||
linkEnterLength: 'Please enter display length',
|
linkEnterLength: 'Please enter display length',
|
||||||
linkEnterDisplayLength: 'Please enter the true length',
|
linkEnterDisplayLength: 'Please enter the true length',
|
||||||
|
|
||||||
linkSelectBase: 'Select the base Link',
|
linkSelectBase: 'Select the base Link',
|
||||||
linkEnterLeft: 'Please enter the left forward Link',
|
linkEnterLeft: 'Please enter the left forward Link',
|
||||||
linkEnterRight: 'Please enter the forward Link on the right',
|
linkEnterRight: 'Please enter the forward Link on the right',
|
||||||
linkSelectName: 'Enter the Link name',
|
linkSelectName: 'Enter the Link name',
|
||||||
linkSelectDisplayLength: 'Please enter the actual length of the Link',
|
linkSelectDisplayLength: 'Please enter the actual length of the Link',
|
||||||
|
|
||||||
lengthShow: 'According to the length of the:',
|
lengthShow: 'According to the length of the:',
|
||||||
lengthFact: 'The real length:',
|
lengthFact: 'The real length:',
|
||||||
color: 'color:',
|
color: 'color:',
|
||||||
|
|
||||||
pointX: 'Coordinates x:',
|
pointX: 'Coordinates x:',
|
||||||
pointY: 'Coordinates y:',
|
pointY: 'Coordinates y:',
|
||||||
direct: 'The direction of:',
|
direct: 'The direction of:',
|
||||||
basisLink: 'Based on the Link:',
|
basisLink: 'Based on the Link:',
|
||||||
sectionRelSwitchCode: 'sectionRelSwitchCode',
|
sectionRelSwitchCode: 'sectionRelSwitchCode',
|
||||||
|
|
||||||
pleaseSelectSectionName: 'Select the section name',
|
pleaseSelectSectionName: 'Select the section name',
|
||||||
pleaseFillOffset: 'Please fill in the offset',
|
pleaseSelectSection: 'Select the section',
|
||||||
pleaseFillValue: 'Please fill in the value',
|
pleaseSelectStationCode: 'Select the section station code',
|
||||||
pleaseSelectLeftSectionName: 'Please select the left section name',
|
pleaseFillOffset: 'Please fill in the offset',
|
||||||
pleaseSelectRightSectionName: 'Select the right section name',
|
pleaseFillValue: 'Please fill in the value',
|
||||||
pleaseEnterYValue: 'Please enter the coordinate Y value',
|
pleaseSelectLeftSectionName: 'Please select the left section name',
|
||||||
pleaseEnterSectionType: 'Please enter the section type',
|
pleaseSelectRightSectionName: 'Select the right section name',
|
||||||
pleaseEnterSectionName: 'Please enter a section name',
|
pleaseEnterYValue: 'Please enter the coordinate Y value',
|
||||||
pleaseSelectAssociatedPlatform: 'Please select the associated platform',
|
pleaseEnterSectionType: 'Please enter the section type',
|
||||||
pleaseEnterLeftStopPointOffset: 'Please enter left stop point offset',
|
pleaseEnterSectionName: 'Please enter a section name',
|
||||||
rightStopPointOffset: 'Please enter an offset to the right stop point',
|
pleaseSelectAssociatedPlatform: 'Please select the associated platform',
|
||||||
destinationCode: 'Please enter destination code',
|
pleaseEnterLeftStopPointOffset: 'Please enter left stop point offset',
|
||||||
destinationCodePointX: 'Please enter destination code coordinate X',
|
rightStopPointOffset: 'Please enter an offset to the right stop point',
|
||||||
destinationCodePointY: 'Please enter destination code coordinate Y',
|
destinationCode: 'Please enter destination code',
|
||||||
sectionNamePointX: 'Please enter the section name coordinate X',
|
destinationCodePointX: 'Please enter destination code coordinate X',
|
||||||
sectionNamePointY: 'Please enter the section name coordinate Y',
|
destinationCodePointY: 'Please enter destination code coordinate Y',
|
||||||
logicSectionNameSort: 'Select logical extent name sort',
|
sectionNamePointX: 'Please enter the section name coordinate X',
|
||||||
sectionOffsetLeft: 'Please enter the left Link offset',
|
sectionNamePointY: 'Please enter the section name coordinate Y',
|
||||||
sectionSepTypeLeft: 'Please select the left separator',
|
logicSectionNameSort: 'Select logical extent name sort',
|
||||||
sectionOffsetRight: 'Please enter the right Link offset',
|
sectionOffsetLeft: 'Please enter the left Link offset',
|
||||||
sectionSepTypeRight: 'Select the right separator',
|
sectionSepTypeLeft: 'Please select the left separator',
|
||||||
selectPhysicalExtentName: 'Select the physical extent name',
|
sectionOffsetRight: 'Please enter the right Link offset',
|
||||||
|
sectionSepTypeRight: 'Select the right separator',
|
||||||
|
selectPhysicalExtentName: 'Select the physical extent name',
|
||||||
|
|
||||||
pleaseEnterSemaphoreName: 'Please enter a semaphore name',
|
pleaseEnterSemaphoreName: 'Please enter a semaphore name',
|
||||||
pleaseEnterSignalName: 'Please enter a unique name for the signal',
|
pleaseEnterSignalName: 'Please enter a unique name for the signal',
|
||||||
pleaseEnterSignalOffset: 'Please enter an offset',
|
pleaseEnterSignalOffset: 'Please enter an offset',
|
||||||
pleaseEnterSignalStation: 'Please enter device central station',
|
pleaseEnterSignalStation: 'Please enter device central station',
|
||||||
pleaseEnterSignalPositionX: 'Please input signal x',
|
pleaseEnterSignalPositionX: 'Please input signal x',
|
||||||
pleaseEnterSignalPositionY: 'Please input signal y',
|
pleaseEnterSignalPositionY: 'Please input signal y',
|
||||||
signalButtonPositionX: 'Please enter button x',
|
signalButtonPositionX: 'Please enter button x',
|
||||||
signalButtonPositionY: 'Please enter button y',
|
signalButtonPositionY: 'Please enter button y',
|
||||||
signalGuidePositionX: 'Please enter the boot signal x',
|
signalGuidePositionX: 'Please enter the boot signal x',
|
||||||
signalGuidePositionY: 'Please enter the boot signal y',
|
signalGuidePositionY: 'Please enter the boot signal y',
|
||||||
|
|
||||||
stationName: 'Please enter station name',
|
stationName: 'Please enter station name',
|
||||||
stationKmRange: 'Please enter kilometer mark distance',
|
stationKmRange: 'Please enter kilometer mark distance',
|
||||||
stationKmPost: 'Please enter the name of the kilometer mark',
|
stationKmPost: 'Please enter the name of the kilometer mark',
|
||||||
|
|
||||||
stationControlStationName: 'Please select the station name',
|
stationControlStationName: 'Please select the station name',
|
||||||
stationControlStationCode: 'Please select your station',
|
stationControlStationCode: 'Please select your station',
|
||||||
stationControlZokContent: 'Please enter the content of central control',
|
stationControlZokContent: 'Please enter the content of central control',
|
||||||
stationControlZakContent: 'Please enter the content of station control',
|
stationControlZakContent: 'Please enter the content of station control',
|
||||||
stationControlJjzkContent: 'Please enter emergency station control',
|
stationControlJjzkContent: 'Please enter emergency station control',
|
||||||
stationControlZzkContent: 'Please input the content of station central control',
|
stationControlZzkContent: 'Please input the content of station central control',
|
||||||
stationControlPositionX: 'Please enter coordinate x',
|
stationControlPositionX: 'Please enter coordinate x',
|
||||||
stationControlPositionY: 'Please enter coordinate y',
|
stationControlPositionY: 'Please enter coordinate y',
|
||||||
|
|
||||||
pleaseReSelectDevice: 'Please re-select the device',
|
pleaseReSelectDevice: 'Please re-select the device',
|
||||||
stationCode: 'Please select the associated station',
|
stationCode: 'Please select the associated station',
|
||||||
stationstandCountName: 'Please enter a counter name',
|
stationstandCountName: 'Please enter a counter name',
|
||||||
doorLocationType: 'Please choose the platform direction',
|
doorLocationType: 'Please choose the platform direction',
|
||||||
deviceStationCode: 'Please select your own centralized station',
|
deviceStationCode: 'Please select your own centralized station',
|
||||||
stationstandDirection: 'Please choose the upstream and downstream direction',
|
stationstandDirection: 'Please choose the upstream and downstream direction',
|
||||||
stationstandWidth: 'Please enter station width',
|
stationstandWidth: 'Please enter station width',
|
||||||
stationstandHeight: 'Please enter station height',
|
stationstandHeight: 'Please enter station height',
|
||||||
|
|
||||||
switchName: 'Please enter the switch name',
|
switchName: 'Please enter the switch name',
|
||||||
switchNamePointX: 'Please enter switch name coordinate x',
|
switchNamePointX: 'Please enter switch name coordinate x',
|
||||||
switchNamePointY: 'Please enter switch name coordinate y',
|
switchNamePointY: 'Please enter switch name coordinate y',
|
||||||
switchStationCode: 'Please enter device central station',
|
switchStationCode: 'Please enter device central station',
|
||||||
switchTurnTime: 'Please enter switch time',
|
switchTurnTime: 'Please enter switch time',
|
||||||
switchTpX: 'Please enter the time coordinate x',
|
switchTpX: 'Please enter the time coordinate x',
|
||||||
switchTpY: 'Please enter the time coordinate y',
|
switchTpY: 'Please enter the time coordinate y',
|
||||||
|
|
||||||
selectText: 'Please select the Text',
|
selectText: 'Please select the Text',
|
||||||
pleaseEnterContent: 'Please enter content',
|
pleaseEnterContent: 'Please enter content',
|
||||||
textFont: 'Please select the text format',
|
textFont: 'Please select the text format',
|
||||||
textFontColor: 'Please select the text color',
|
textFontColor: 'Please select the text color',
|
||||||
pleaseEnterGroupNumber: 'Please enter the group number',
|
pleaseEnterGroupNumber: 'Please enter the group number',
|
||||||
selectTrainType: 'Please select car type',
|
selectTrainType: 'Please select car type',
|
||||||
trainPositionX: 'Please enter the x position',
|
trainPositionX: 'Please enter the x position',
|
||||||
trainPositionY: 'Please enter the y position',
|
trainPositionY: 'Please enter the y position',
|
||||||
pleaseEnterTrainNumber: 'Please fill in the group number',
|
pleaseEnterTrainNumber: 'Please fill in the group number',
|
||||||
|
|
||||||
trainCode: 'The train model Code cannot be empty',
|
trainCode: 'The train model Code cannot be empty',
|
||||||
pleaseEnterTrainTypeName: 'Please enter train type name',
|
pleaseEnterTrainTypeName: 'Please enter train type name',
|
||||||
trainLength: 'Please enter train length',
|
trainLength: 'Please enter train length',
|
||||||
safeDistance: 'Please enter a safe distance',
|
safeDistance: 'Please enter a safe distance',
|
||||||
maxSafeDistance: 'Please enter the maximum safe distance',
|
maxSafeDistance: 'Please enter the maximum safe distance',
|
||||||
averageVelocity: 'Please enter average speed',
|
averageVelocity: 'Please enter average speed',
|
||||||
averageDeceleration: 'Please enter average deceleration',
|
averageDeceleration: 'Please enter average deceleration',
|
||||||
defaultVelocity: 'Please enter the default speed',
|
defaultVelocity: 'Please enter the default speed',
|
||||||
maxVelocity: 'Please enter the maximum speed',
|
maxVelocity: 'Please enter the maximum speed',
|
||||||
|
|
||||||
trainWindowWidth: 'Please enter the number window width',
|
trainWindowWidth: 'Please enter the number window width',
|
||||||
trainWindowHeight: 'Please enter the number window height',
|
trainWindowHeight: 'Please enter the number window height',
|
||||||
trainWindowSectionCode: 'Please enter the association section',
|
trainWindowSectionCode: 'Please enter the association section',
|
||||||
|
|
||||||
visible: 'Please select whether it is visible',
|
visible: 'Please select whether it is visible',
|
||||||
pleaseSelectStartSignal: 'Please select start signal',
|
pleaseSelectStartSignal: 'Please select start signal',
|
||||||
pleaseSelectEndSignal: 'Please select end signal',
|
pleaseSelectEndSignal: 'Please select end signal',
|
||||||
|
|
||||||
pleaseEnterPathName: 'Please enter the path name',
|
pleaseEnterPathName: 'Please enter the path name',
|
||||||
proximitySection: 'Please select the proximity section',
|
proximitySection: 'Please select the proximity section',
|
||||||
accessPropertyType: 'Please select the access property type',
|
accessPropertyType: 'Please select the access property type',
|
||||||
autoAccessType: 'Please select auto - access type',
|
autoAccessType: 'Please select auto - access type',
|
||||||
physicalSegmentData: 'Select access physical segment data',
|
physicalSegmentData: 'Select access physical segment data',
|
||||||
|
|
||||||
routingName: 'Please enter the traffic name',
|
routingName: 'Please enter the traffic name',
|
||||||
startStationCode: 'Please select the starting station',
|
startStationCode: 'Please select the starting station',
|
||||||
startSectionCode: 'Select the start section',
|
startSectionCode: 'Select the start section',
|
||||||
endStationCode: 'Please choose the terminal',
|
endStationCode: 'Please choose the terminal',
|
||||||
endSectionCode: 'Please select end to section',
|
endSectionCode: 'Please select end to section',
|
||||||
|
|
||||||
selectTurnoutID: 'Please select the turnout ID',
|
selectTurnoutID: 'Please select the turnout ID',
|
||||||
switchesCannot: 'Switches cannot be identical',
|
switchesCannot: 'Switches cannot be identical',
|
||||||
|
|
||||||
pleaseInputName: 'Please enter name',
|
pleaseInputName: 'Please enter name',
|
||||||
pleaseInputNickName: 'Please enter nickName',
|
pleaseInputNickName: 'Please enter nickName',
|
||||||
pleaseSelectStatus: 'Please select state',
|
pleaseSelectStatus: 'Please select state',
|
||||||
pleaseInputCode: 'Please enter code',
|
pleaseInputCode: 'Please enter code',
|
||||||
strLength1To25: 'The length is between 1 and 25 characters',
|
strLength1To25: 'The length is between 1 and 25 characters',
|
||||||
strLengthNotExceed50: 'No more than 50 characters',
|
strLengthNotExceed50: 'No more than 50 characters',
|
||||||
|
|
||||||
pleaseEnterMapName: 'Please enter a map name',
|
pleaseEnterMapName: 'Please enter a map name',
|
||||||
pleaseChooseSkinCode: 'Please choose skin style',
|
pleaseChooseSkinCode: 'Please choose skin style',
|
||||||
pleaseSelectMapSource: 'Please select the map source',
|
pleaseSelectMapSource: 'Please select the map source',
|
||||||
pleaseSelectAssociatedCity: 'Please select the associated city',
|
pleaseSelectAssociatedCity: 'Please select the associated city',
|
||||||
pleaseSelectAssociatedSkin: 'Please select associated skin',
|
pleaseSelectAssociatedSkin: 'Please select associated skin',
|
||||||
pleaseEnteMapLinkWidth: 'Please enter map Link width',
|
pleaseEnteMapLinkWidth: 'Please enter map Link width',
|
||||||
pleaseEnterMapSectionWidth: 'Please enter map section width',
|
pleaseEnterMapSectionWidth: 'Please enter map section width',
|
||||||
|
|
||||||
organizationInput: 'Please enter the name of the organization or business',
|
organizationInput: 'Please enter the name of the organization or business',
|
||||||
productSelect: 'Please select products',
|
productSelect: 'Please select products',
|
||||||
itemPricingInput: 'Please enter unit price',
|
itemPricingInput: 'Please enter unit price',
|
||||||
orderTypeSelect: 'Please select the order type',
|
orderTypeSelect: 'Please select the order type',
|
||||||
contractNumberInput: 'Please enter the contract number',
|
contractNumberInput: 'Please enter the contract number',
|
||||||
salesmanInput: 'Please select a salesperson',
|
salesmanInput: 'Please select a salesperson',
|
||||||
authorAmountInput: 'Please enter the number of permissions to purchase',
|
authorAmountInput: 'Please enter the number of permissions to purchase',
|
||||||
authorAmountInputError: 'Please enter the number of valid permissions',
|
authorAmountInputError: 'Please enter the number of valid permissions',
|
||||||
totalPriceInput: 'Please enter the total price',
|
totalPriceInput: 'Please enter the total price',
|
||||||
totalPriceInputError1: 'Please enter the price in two decimal places',
|
totalPriceInputError1: 'Please enter the price in two decimal places',
|
||||||
totalPriceInputError2: 'Please enter valid total price',
|
totalPriceInputError2: 'Please enter valid total price',
|
||||||
monthAmountInput: 'Please enter purchase month',
|
monthAmountInput: 'Please enter purchase month',
|
||||||
monthAmountInputError: 'Please enter valid months of purchase',
|
monthAmountInputError: 'Please enter valid months of purchase',
|
||||||
startTimePick: 'Please select a start date',
|
startTimePick: 'Please select a start date',
|
||||||
bizTypeSelect: 'Select a business type',
|
bizTypeSelect: 'Select a business type',
|
||||||
payWaysSelect: 'Please select payment method',
|
payWaysSelect: 'Please select payment method',
|
||||||
payStatusSelect: 'Please select payment status',
|
payStatusSelect: 'Please select payment status',
|
||||||
goodsNameInput: 'Please enter product name',
|
goodsNameInput: 'Please enter product name',
|
||||||
productTypeInput: 'Please select product type',
|
productTypeInput: 'Please select product type',
|
||||||
mapInput: 'Please select map',
|
mapInput: 'Please select map',
|
||||||
productInput: 'Please select product',
|
productInput: 'Please select product',
|
||||||
lessonInput: 'Please select courses',
|
lessonInput: 'Please select courses',
|
||||||
trialTimeInput: 'Please enter trial duration',
|
trialTimeInput: 'Please enter trial duration',
|
||||||
unitOfTimeRadio: 'Please select a time unit',
|
unitOfTimeRadio: 'Please select a time unit',
|
||||||
goodsDescribtionInput: 'Please enter product description',
|
goodsDescribtionInput: 'Please enter product description',
|
||||||
userNameInput: 'Please enter user name',
|
userNameInput: 'Please enter user name',
|
||||||
permissionTypeInput: 'Please select the permission type',
|
permissionTypeInput: 'Please select the permission type',
|
||||||
timeInput: 'Please enter the time',
|
timeInput: 'Please enter the time',
|
||||||
chooseUser: 'Please select the user',
|
chooseUser: 'Please select the user',
|
||||||
pleaseInputLessonName: 'Please enter the course name',
|
pleaseInputLessonName: 'Please enter the course name',
|
||||||
pleaseSelectTraining: 'Please select training',
|
pleaseSelectTraining: 'Please select training',
|
||||||
|
|
||||||
maxScaling: '(The maximum scale is 8 steps)',
|
maxScaling: '(The maximum scale is 8 steps)',
|
||||||
skinCodingInput: 'Please enter skin code',
|
skinCodingInput: 'Please enter skin code',
|
||||||
skinDesignationInput: 'Please enter skin name',
|
skinDesignationInput: 'Please enter skin name',
|
||||||
coordinatesOriginInput: 'Please enter the origin coordinates',
|
coordinatesOriginInput: 'Please enter the origin coordinates',
|
||||||
scalingInput: 'Please enter the scale',
|
scalingInput: 'Please enter the scale',
|
||||||
scalingInputPrompt: 'Please enter a valid scale',
|
scalingInputPrompt: 'Please enter a valid scale',
|
||||||
selectImportFiles: 'Select the file you want to import',
|
selectImportFiles: 'Select the file you want to import',
|
||||||
speedLevelEnter1: 'Please enter speed level 1',
|
speedLevelEnter1: 'Please enter speed level 1',
|
||||||
speedLevelEnter2: 'Please enter speed level 2',
|
speedLevelEnter2: 'Please enter speed level 2',
|
||||||
speedLevelEnter3: 'Please enter speed level 3',
|
speedLevelEnter3: 'Please enter speed level 3',
|
||||||
speedLevelEnter4: 'Please enter speed level 4',
|
speedLevelEnter4: 'Please enter speed level 4',
|
||||||
drivingDirectionSelect: 'Please choose your driving direction',
|
drivingDirectionSelect: 'Please choose your driving direction',
|
||||||
timeBetweenDeparturesEnter: 'Please enter the interval',
|
timeBetweenDeparturesEnter: 'Please enter the interval',
|
||||||
stopTimeEnter: 'Please enter the docking time',
|
stopTimeEnter: 'Please enter the docking time',
|
||||||
entranceStationSelect: 'Please select the entrance',
|
entranceStationSelect: 'Please select the entrance',
|
||||||
exportStationSelect: 'Please select the exit gate',
|
exportStationSelect: 'Please select the exit gate',
|
||||||
selectDataRange: 'Please select the data range range',
|
selectDataRange: 'Please select the data range range',
|
||||||
productCodeEnter: 'Please enter the product code',
|
productCodeEnter: 'Please enter the product code',
|
||||||
productNameEnter: 'Please enter product name',
|
productNameEnter: 'Please enter product name',
|
||||||
productDescriptionEnter: 'Please enter product description',
|
productDescriptionEnter: 'Please enter product description',
|
||||||
trainingTypeSelect: 'Please select the associated training type',
|
trainingTypeSelect: 'Please select the associated training type',
|
||||||
linkWidthInput: 'Please enter Link width',
|
linkWidthInput: 'Please enter Link width',
|
||||||
linkWidthInputPrompt: 'Please enter a valid Link width',
|
linkWidthInputPrompt: 'Please enter a valid Link width',
|
||||||
sectionWidthInput: 'Please enter section width',
|
sectionWidthInput: 'Please enter section width',
|
||||||
sectionWidthInputPrompt: 'Please enter a valid segment width',
|
sectionWidthInputPrompt: 'Please enter a valid segment width',
|
||||||
selectShowWatermark: 'Select whether or not to watermark',
|
selectShowWatermark: 'Select whether or not to watermark',
|
||||||
pleaseInputMapName: 'Please enter a new name for the map',
|
pleaseInputMapName: 'Please enter a new name for the map',
|
||||||
inputTemplateRunPlan: 'Please select the template run plan',
|
inputTemplateRunPlan: 'Please select the template run plan',
|
||||||
inputSkinType: 'Please select skin type',
|
inputSkinType: 'Please select skin type',
|
||||||
inputOperateCode: 'Please enter the step code',
|
inputOperateCode: 'Please enter the step code',
|
||||||
inputStepNo: 'Please enter the step number',
|
inputStepNo: 'Please enter the step number',
|
||||||
inputStepTips: 'Please enter step number. Please enter step prompt',
|
inputStepTips: 'Please enter step number. Please enter step prompt',
|
||||||
selectMapName: 'Please select a map name',
|
selectMapName: 'Please select a map name',
|
||||||
selectMapProductName: 'Please select map product name',
|
selectMapProductName: 'Please select map product name',
|
||||||
inputTime: 'Please enter time',
|
inputTime: 'Please enter time',
|
||||||
inputPermissionNumber: 'Please enter the number of permissions',
|
inputPermissionNumber: 'Please enter the number of permissions',
|
||||||
permissionNumberGreater0: 'The number of permissions must be greater than 0',
|
permissionNumberGreater0: 'The number of permissions must be greater than 0',
|
||||||
enterChapterName: 'Please enter chapter name',
|
enterChapterName: 'Please enter chapter name',
|
||||||
enterChapterInstructions: 'Please enter chapter instructions',
|
enterChapterInstructions: 'Please enter chapter instructions',
|
||||||
selectCourseName: 'Please select the course name',
|
selectCourseName: 'Please select the course name',
|
||||||
enterCourseName: 'Please enter the course name',
|
enterCourseName: 'Please enter the course name',
|
||||||
selectAssociatedProduct: 'Please select the associated product',
|
selectAssociatedProduct: 'Please select the associated product',
|
||||||
enterCourseDescription: 'Please enter the course description',
|
enterCourseDescription: 'Please enter the course description',
|
||||||
pleaseLessonIntroduction: 'Please enter the course description',
|
pleaseLessonIntroduction: 'Please enter the course description',
|
||||||
courseIdIsEmpty: 'Course Id is empty',
|
courseIdIsEmpty: 'Course Id is empty',
|
||||||
selectCity: 'Please select city',
|
selectCity: 'Please select city',
|
||||||
enterStandardTime: 'Please enter standard time',
|
enterStandardTime: 'Please enter standard time',
|
||||||
enterNumericValue: 'Please enter a numeric value',
|
enterNumericValue: 'Please enter a numeric value',
|
||||||
greaterThanMinTime: 'Must be greater than the minimum time',
|
greaterThanMinTime: 'Must be greater than the minimum time',
|
||||||
selectTrainingType: 'Please select training type',
|
selectTrainingType: 'Please select training type',
|
||||||
selectOneTrainingType: 'Only one training type can be selected',
|
selectOneTrainingType: 'Only one training type can be selected',
|
||||||
enterProductType: 'Please enter product type',
|
enterProductType: 'Please enter product type',
|
||||||
selectAssociatedStation: 'Please select the associated station',
|
selectAssociatedStation: 'Please select the associated station',
|
||||||
pleaseSelectTrainDir: 'Please select the direction of the train',
|
pleaseSelectTrainDir: 'Please select the direction of the train',
|
||||||
pleaseEnterSplit: 'Please enter the split number',
|
pleaseEnterSplit: 'Please enter the split number',
|
||||||
pleaseEnterSplitNumber: 'Please enter a reasonable number of split',
|
pleaseEnterSplitNumber: 'Please enter a reasonable number of split',
|
||||||
enterScale: 'Please enter the zoom ratio',
|
enterScale: 'Please enter the zoom ratio',
|
||||||
enterXOffset: 'Please enter X offset',
|
enterXOffset: 'Please enter X offset',
|
||||||
enterYOffset: 'Please enter Y offset',
|
enterYOffset: 'Please enter Y offset',
|
||||||
pleaseSelectButtonType: 'Please select the button type',
|
pleaseSelectButtonType: 'Please select the button type',
|
||||||
pleaseSelectButtonContent: 'Please enter the content',
|
pleaseSelectButtonContent: 'Please enter the content',
|
||||||
endTimeRules: 'The end time must be greater than the start time.',
|
endTimeRules: 'The end time must be greater than the start time.',
|
||||||
selectCourses: 'Please select courses',
|
selectCourses: 'Please select courses',
|
||||||
selectTheMapRoute: 'Please select the map route.',
|
selectTheMapRoute: 'Please select the map route.',
|
||||||
enterKeyword: 'Please enter a keyword',
|
enterKeyword: 'Please enter a keyword',
|
||||||
successfullyModified: 'Successfully modified',
|
successfullyModified: 'Successfully modified',
|
||||||
modifyTheFailure: 'Modify the failure',
|
modifyTheFailure: 'Modify the failure',
|
||||||
selectTheCourseNameFirst: 'Please select the course name first',
|
selectTheCourseNameFirst: 'Please select the course name first',
|
||||||
selectMultiplePermissions: 'Please select multiple permissions',
|
selectMultiplePermissions: 'Please select multiple permissions',
|
||||||
enterPermissionName: 'Please enter a permission name',
|
enterPermissionName: 'Please enter a permission name',
|
||||||
pleaseSelectPermission: 'Please select permission',
|
pleaseSelectPermission: 'Please select permission',
|
||||||
pleaseSelectTemplateRunGraph: 'Please select a template to run the diagram',
|
pleaseSelectTemplateRunGraph: 'Please select a template to run the diagram',
|
||||||
selectTheRunningDiagramToBeLoaded: 'Please select the running diagram to be loaded',
|
selectTheRunningDiagramToBeLoaded: 'Please select the running diagram to be loaded',
|
||||||
selectOneOrMoreDates: 'Select one or more dates',
|
selectOneOrMoreDates: 'Select one or more dates',
|
||||||
selectAPlannedDateRange: 'Please select a planned date range',
|
selectAPlannedDateRange: 'Please select a planned date range',
|
||||||
selectGroupNumber: 'Please select group number',
|
selectGroupNumber: 'Please select group number',
|
||||||
selectATrainType: 'Please select a train type',
|
selectATrainType: 'Please select a train type',
|
||||||
enterTheServiceNumber: 'Please enter the service number',
|
enterTheServiceNumber: 'Please enter the service number',
|
||||||
enterTheTripNumber: 'Please enter the trip number',
|
enterTheTripNumber: 'Please enter the trip number',
|
||||||
enterTheTargetCode: 'Please enter the target code',
|
enterTheTargetCode: 'Please enter the target code',
|
||||||
selectStation: 'Please select station',
|
selectStation: 'Please select station',
|
||||||
inputTrainingName: 'Please input training name',
|
inputTrainingName: 'Please input training name',
|
||||||
inputTrainingRemark: 'Please input training remark',
|
inputTrainingRemark: 'Please input training remark',
|
||||||
inputTrainingType: 'Please input training type',
|
inputTrainingType: 'Please input training type',
|
||||||
inputOperationType: 'Please input operation type',
|
inputOperationType: 'Please input operation type',
|
||||||
inputMinDuration: 'Please input best duration',
|
inputMinDuration: 'Please input best duration',
|
||||||
inputMaxDuration: 'Please input max duration',
|
inputMaxDuration: 'Please input max duration',
|
||||||
accessNumber: 'Please input the number of permissions',
|
accessNumber: 'Please input the number of permissions',
|
||||||
courseNameEmpty: 'Course name cannot be empty',
|
courseNameEmpty: 'Course name cannot be empty',
|
||||||
purchaseMonth: 'Please input the number of months to buy',
|
purchaseMonth: 'Please input the number of months to buy',
|
||||||
pleaseEnterGoodPrice: 'Please enter the price of the goods',
|
pleaseEnterGoodPrice: 'Please enter the price of the goods',
|
||||||
enterTheNameOfTheRunGraph: 'Please enter the name of the run graph',
|
enterTheNameOfTheRunGraph: 'Please enter the name of the run graph',
|
||||||
chooseToPublishTheRunGraph: 'Please choose to publish the run chart',
|
chooseToPublishTheRunGraph: 'Please choose to publish the run chart',
|
||||||
enterTheAlarmCode: 'Please enter the alarm code',
|
enterTheAlarmCode: 'Please enter the alarm code',
|
||||||
enterTheAlarmWidth: 'Please enter the alarm width',
|
enterTheAlarmWidth: 'Please enter the alarm width',
|
||||||
enterTheEscalatorFrameCode: 'Please enter the escalator frame code',
|
enterTheEscalatorFrameCode: 'Please enter the escalator frame code',
|
||||||
enterTheEscalatorFrameWidth: 'Please enter the escalator frame width',
|
enterTheEscalatorFrameWidth: 'Please enter the escalator frame width',
|
||||||
enterTheEscalatorFrameHeight: 'Please enter the escalator frame height',
|
enterTheEscalatorFrameHeight: 'Please enter the escalator frame height',
|
||||||
enterTheBorderWidth: 'Please enter the border width',
|
enterTheBorderWidth: 'Please enter the border width',
|
||||||
selectTheDirectionOfTheArrow: 'Please select the direction of the arrow',
|
selectTheDirectionOfTheArrow: 'Please select the direction of the arrow',
|
||||||
enterTheArrowCode: 'Please enter the arrow code',
|
enterTheArrowCode: 'Please enter the arrow code',
|
||||||
enterTheArrowLength: 'Please enter the arrow length',
|
enterTheArrowLength: 'Please enter the arrow length',
|
||||||
enterTheArrowWidth: 'Please enter the arrow width',
|
enterTheArrowWidth: 'Please enter the arrow width',
|
||||||
enterTheArrowColor: 'Please enter the arrow color',
|
enterTheArrowColor: 'Please enter the arrow color',
|
||||||
enterTheBackgroundWidth: 'Please enter the background width',
|
enterTheBackgroundWidth: 'Please enter the background width',
|
||||||
enterTheBackgroundHeight: 'Please enter the background height',
|
enterTheBackgroundHeight: 'Please enter the background height',
|
||||||
selectTheButtonColor: 'Please select the button color',
|
selectTheButtonColor: 'Please select the button color',
|
||||||
enterTheButtonCode: 'Please enter the button code',
|
enterTheButtonCode: 'Please enter the button code',
|
||||||
enterTheButtonWidth: 'Please enter the button width',
|
enterTheButtonWidth: 'Please enter the button width',
|
||||||
enterTheDigitalClockCode: 'Please enter the digital clock code',
|
enterTheDigitalClockCode: 'Please enter the digital clock code',
|
||||||
enterTheDigitalClockWidth: 'Please enter the digital clock width',
|
enterTheDigitalClockWidth: 'Please enter the digital clock width',
|
||||||
selectTheStartingDirection: 'Please select the starting direction',
|
selectTheStartingDirection: 'Please select the starting direction',
|
||||||
enterTheElevatorCode: 'Please enter the elevator code',
|
enterTheElevatorCode: 'Please enter the elevator code',
|
||||||
enterTheElevatorWidth: 'Please enter the elevator width',
|
enterTheElevatorWidth: 'Please enter the elevator width',
|
||||||
enterTheElevatorHeight: 'Please enter the elevator height',
|
enterTheElevatorHeight: 'Please enter the elevator height',
|
||||||
enterTheElevatorColor: 'Please enter the elevator color',
|
enterTheElevatorColor: 'Please enter the elevator color',
|
||||||
enterTheKeyCode: 'Please enter the key code',
|
enterTheKeyCode: 'Please enter the key code',
|
||||||
enterTheKeyWidth: 'Please enter the key width',
|
enterTheKeyWidth: 'Please enter the key width',
|
||||||
enterTheKeyDirection: 'Please select the key direction',
|
enterTheKeyDirection: 'Please select the key direction',
|
||||||
enterTheUpperText: 'Please enter the upper text',
|
enterTheUpperText: 'Please enter the upper text',
|
||||||
enterTheLowerText: 'Please enter the lower text',
|
enterTheLowerText: 'Please enter the lower text',
|
||||||
enterRejectReason: 'Please enter reject reason'
|
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 {
|
export default {
|
||||||
scriptTitle: 'Task Recording',
|
scriptTitle: 'Task Recording',
|
||||||
saveBackground: 'Save Background',
|
saveBackground: 'Save Background',
|
||||||
saveData: 'Save Data',
|
saveData: 'Save Data',
|
||||||
mapList: 'Map List',
|
mapList: 'Map List',
|
||||||
createScript: 'Create Script',
|
createScript: 'Create Script',
|
||||||
modifyScript: 'Modify Script',
|
modifyScript: 'Modify Script',
|
||||||
scriptName: 'Script Name',
|
scriptName: 'Script Name',
|
||||||
addScript: 'Add Script',
|
addScript: 'Add Script',
|
||||||
map: 'Map',
|
map: 'Map',
|
||||||
scriptDescription: 'Script Description',
|
scriptDescription: 'Script Description',
|
||||||
submit: 'submit',
|
submit: 'submit',
|
||||||
scriptNameRule: 'Please input script name',
|
scriptNameRule: 'Please input script name',
|
||||||
scriptDescriptionRule: 'Please input script description',
|
scriptDescriptionRule: 'Please input script description',
|
||||||
createScriptSuccess: 'Create script success',
|
createScriptSuccess: 'Create script success',
|
||||||
createScriptFail: 'Create script failure',
|
createScriptFail: 'Create script failure',
|
||||||
scriptDetail: 'Script Detail',
|
scriptDetail: 'Script Detail',
|
||||||
scriptRecord: 'Edit',
|
scriptRecord: 'Edit',
|
||||||
scriptCreate: 'Create',
|
scriptCreate: 'Create',
|
||||||
scriptModify: 'Modify',
|
scriptModify: 'Modify',
|
||||||
scriptDelete: 'Delete',
|
scriptDelete: 'Delete',
|
||||||
getScriptFail: 'Get script information failure',
|
getScriptFail: 'Get script information failure',
|
||||||
createSimulationFail: 'Create simulation failure',
|
createSimulationFail: 'Create simulation failure',
|
||||||
modifyScriptSuccess: 'Modify script success',
|
modifyScriptSuccess: 'Modify script success',
|
||||||
modifyScriptFail: 'Modify script failure',
|
modifyScriptFail: 'Modify script failure',
|
||||||
deleteScriptTip: 'This action will delete this script, whether to continue?',
|
deleteScriptTip: 'This action will delete this script, whether to continue?',
|
||||||
deleteScriptSucess: 'delete script sucess',
|
deleteScriptSucess: 'delete script sucess',
|
||||||
deleteScriptFail: 'delete script failure',
|
deleteScriptFail: 'delete script failure',
|
||||||
scriptRecordTitle: 'Script Record',
|
scriptRecordTitle: 'Script Record',
|
||||||
drivingPause: 'Pause',
|
drivingPause: 'Pause',
|
||||||
recoverAndExecute: 'Recover And Execute',
|
recoverAndExecute: 'Recover And Execute',
|
||||||
resetScript: 'Reset Script',
|
resetScript: 'Reset Script',
|
||||||
pauseFail: 'Pause failure',
|
pauseFail: 'Pause failure',
|
||||||
recoverFail: 'Recover failure',
|
recoverFail: 'Recover failure',
|
||||||
saveBackgroundSuceess: 'Save background suceess',
|
saveBackgroundSuceess: 'Save background suceess',
|
||||||
updateLocationFail: 'update location failure',
|
updateLocationFail: 'update location failure',
|
||||||
saveBackgroundFail: 'Save background failure',
|
saveBackgroundFail: 'Save background failure',
|
||||||
saveDataSucess: 'Save data sucess',
|
saveDataSucess: 'Save data sucess',
|
||||||
saveDataFail: 'Save data failure',
|
saveDataFail: 'Save data failure',
|
||||||
clearDataTip: 'This action will clear the saved script data, whether to continue?',
|
clearDataTip: 'This action will clear the saved script data, whether to continue?',
|
||||||
resetDataSuccess: 'Reset script success',
|
resetDataSuccess: 'Reset script success',
|
||||||
resetDataFail: 'Reset script failure',
|
resetDataFail: 'Reset script failure',
|
||||||
|
|
||||||
allRoles: 'All Roles',
|
allRoles: 'All Roles',
|
||||||
actors: 'Actor Role',
|
actors: 'Actor Role',
|
||||||
roleSexMale: 'Male',
|
roleSexMale: 'Male',
|
||||||
roleSexFemale: 'Female',
|
roleSexFemale: 'Female',
|
||||||
selectScriptActorSuccess: 'Select script actor success',
|
selectScriptActorSuccess: 'Select script actor success',
|
||||||
selectScriptActorFail: 'Select script actor failure',
|
selectScriptActorFail: 'Select script actor failure',
|
||||||
cancleScriptActorSuccess: 'Cancle script actor success',
|
cancleScriptActorSuccess: 'Cancle script actor success',
|
||||||
cancleScriptActorFail: 'Cancle script actor failure',
|
cancleScriptActorFail: 'Cancle script actor failure',
|
||||||
modifyScriptActorSexSuccess: 'Modify script actor sex success',
|
modifyScriptActorSexSuccess: 'Modify script actor sex success',
|
||||||
modifyScriptActorSexFail: 'Modify script actor sex failure',
|
modifyScriptActorSexFail: 'Modify script actor sex failure',
|
||||||
|
|
||||||
addConversition: 'Add Dialogue',
|
addConversition: 'Add Dialogue',
|
||||||
narrator: 'Sender',
|
narrator: 'Sender',
|
||||||
narratorRules: 'Please select Sender',
|
narratorRules: 'Please select Sender',
|
||||||
receiver: 'Receiver',
|
receiver: 'Receiver',
|
||||||
receiverRules: 'Please select receiver',
|
receiverRules: 'Please select receiver',
|
||||||
conversitionContent: 'Content',
|
conversitionContent: 'Content',
|
||||||
addCommand: 'Add Command',
|
addCommand: 'Add Command',
|
||||||
executor: 'Executor',
|
executor: 'Executor',
|
||||||
executorRules: 'Please select executor',
|
executorRules: 'Please select executor',
|
||||||
executeCommand: 'Command',
|
executeCommand: 'Command',
|
||||||
executeCommandRules: 'Please select execute command',
|
executeCommandRules: 'Please select execute command',
|
||||||
startStation: 'Start Station',
|
startStation: 'Start Station',
|
||||||
startStationRules: 'Please select start station ',
|
startStationRules: 'Please select start station ',
|
||||||
endStation: 'End Station',
|
endStation: 'End Station',
|
||||||
endStationRules: 'Please select 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',
|
addCommandButton: 'Add Command',
|
||||||
addConversitionButton: 'Add Dialogue',
|
addConversitionButton: 'Add Dialogue',
|
||||||
conversitionContentRules: 'Please input content',
|
conversitionContentRules: 'Please input content',
|
||||||
addCommandSucess: 'Add command sucess',
|
addCommandSucess: 'Add command sucess',
|
||||||
addCommandFail: 'Add command failure',
|
addCommandFail: 'Add command failure',
|
||||||
addConversitionSuccess: 'Add dialogue success',
|
addConversitionSuccess: 'Add dialogue success',
|
||||||
addConversitionFail: 'Add dialogue failure',
|
addConversitionFail: 'Add dialogue failure',
|
||||||
modifyConversitionSuccess: 'Modify conversition success',
|
modifyConversitionSuccess: 'Modify conversition success',
|
||||||
modifyConversitionFail: 'Modify conversition failure',
|
modifyConversitionFail: 'Modify conversition failure',
|
||||||
modifyConversition: 'Modify Conversition',
|
modifyConversition: 'Modify Conversition',
|
||||||
modifyConversitionButton: 'modify',
|
modifyConversitionButton: 'modify',
|
||||||
drivingByPlan: 'Driving By Plan',
|
drivingByPlan: 'Driving By Plan',
|
||||||
scriptBack: 'Back',
|
scriptBack: 'Back',
|
||||||
speakTo: 'to',
|
speakTo: 'to',
|
||||||
executeCommandTips: 'execute command: ',
|
executeCommandTips: 'execute command: ',
|
||||||
operate: 'Operate',
|
operate: 'Operate',
|
||||||
scriptList: 'Script List',
|
scriptList: 'Script List',
|
||||||
applyPublish: 'Apply for release',
|
applyPublish: 'Apply for release',
|
||||||
preview: 'Preview',
|
preview: 'Preview',
|
||||||
status: 'Status',
|
status: 'Status',
|
||||||
applyRevoke: 'Revoke',
|
applyRevoke: 'Revoke',
|
||||||
publish: 'Publish',
|
publish: 'Publish',
|
||||||
revokeReason: 'Revoke explanation',
|
revokeReason: 'Revoke explanation',
|
||||||
language: 'language',
|
language: 'language',
|
||||||
chinese: 'Chinese Simplified',
|
chinese: 'Chinese Simplified',
|
||||||
english: 'English',
|
english: 'English',
|
||||||
publishScript: 'Publish Script',
|
publishScript: 'Publish Script',
|
||||||
releaseScriptSuccess: 'release script success',
|
releaseScriptSuccess: 'release script success',
|
||||||
releaseScriptFailed: 'release script failed',
|
releaseScriptFailed: 'release script failed',
|
||||||
publishScriptSuccess: 'Publish Script Success',
|
publishScriptSuccess: 'Publish Script Success',
|
||||||
publishScriptFailed: 'Publish Script Failed',
|
publishScriptFailed: 'Publish Script Failed',
|
||||||
releaseScriptTip: 'This action will apply to release script, whether to continue?',
|
releaseScriptTip: 'This action will apply to release script, whether to continue?',
|
||||||
revokeScriptTip: 'This action will undo release script, whether to continue?',
|
revokeScriptTip: 'This action will undo release script, whether to continue?',
|
||||||
inputScriptName: 'Please input script name',
|
inputScriptName: 'Please input script name',
|
||||||
selectMap: 'Please select map',
|
selectMap: 'Please select map',
|
||||||
inputScriptDescription: 'Please input script description'
|
inputScriptDescription: 'Please input script description'
|
||||||
};
|
};
|
||||||
|
@ -1,52 +1,57 @@
|
|||||||
export default {
|
export default {
|
||||||
code: 'Code',
|
code: 'Code',
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
status: 'Status',
|
status: 'Status',
|
||||||
remarks: 'Remarks',
|
remarks: 'Remarks',
|
||||||
createDirectory: 'Create dictionary',
|
createDirectory: 'Create dictionary',
|
||||||
editDictionary: 'Edit dictionary',
|
editDictionary: 'Edit dictionary',
|
||||||
deleteSuccess: 'Successful deletion',
|
deleteSuccess: 'Successful deletion',
|
||||||
createSuccess: 'Create successful',
|
createSuccess: 'Create successful',
|
||||||
updateSuccess: 'Update successful',
|
updateSuccess: 'Update successful',
|
||||||
destory: 'Destory',
|
destory: 'Destory',
|
||||||
simulationGroup: 'Simulation Group',
|
simulationGroup: 'Simulation Group',
|
||||||
userName: 'User Name',
|
userName: 'User Name',
|
||||||
skinCode: 'Skin Code',
|
skinCode: 'Skin Code',
|
||||||
prdType: 'Product Type',
|
prdType: 'Product Type',
|
||||||
simulationType: 'Simulation Type',
|
simulationType: 'Simulation Type',
|
||||||
simulationGroupId: 'Simulation Member ID',
|
simulationGroupId: 'Simulation Member ID',
|
||||||
productName: 'Product Name',
|
productName: 'Product Name',
|
||||||
isError: 'Is Error',
|
isError: 'Is Error',
|
||||||
isSuspend: 'Is Suspend',
|
isSuspend: 'Is Suspend',
|
||||||
isDrivingAsplanned: 'Whether to drive as planned',
|
isDrivingAsplanned: 'Whether to drive as planned',
|
||||||
wellDelUserSimulation: 'This operation will delete the user simulation data. Do you want to continue?',
|
wellDelUserSimulation: 'This operation will delete the user simulation data. Do you want to continue?',
|
||||||
createDetail: 'Create details',
|
createDetail: 'Create details',
|
||||||
editDetail: 'Editorial details',
|
editDetail: 'Editorial details',
|
||||||
mapName: 'Map Name',
|
mapName: 'Map Name',
|
||||||
trainingName: 'Training Name',
|
trainingName: 'Training Name',
|
||||||
trainingUseTime: 'Training Time',
|
trainingUseTime: 'Training Time',
|
||||||
minute: 'Minute',
|
minute: 'Minute',
|
||||||
second: 'Second',
|
second: 'Second',
|
||||||
createSimulationTitle: 'Create Simulation Information',
|
createSimulationTitle: 'Create Simulation Information',
|
||||||
addSuccess: 'Added Successfully',
|
addSuccess: 'Added Successfully',
|
||||||
pleaseInputNames: 'Please enter your nickname/name/cell phone number',
|
pleaseInputNames: 'Please enter your nickname/name/cell phone number',
|
||||||
examUser: 'Examination Users',
|
examUser: 'Examination Users',
|
||||||
examScore: 'Examination Score',
|
examScore: 'Examination Score',
|
||||||
examResult: 'Examination Results',
|
examResult: 'Examination Results',
|
||||||
examName: 'Paper Name',
|
examName: 'Paper Name',
|
||||||
wellDelExamResult: 'This operation will delete the test result. Do you want to continue?',
|
wellDelExamResult: 'This operation will delete the test result. Do you want to continue?',
|
||||||
editExamDetail: 'Edit exam details',
|
editExamDetail: 'Edit exam details',
|
||||||
subscribeMap: 'Subscribe',
|
subscribeMap: 'Subscribe',
|
||||||
roles: 'Roles',
|
roles: 'Roles',
|
||||||
nickname: 'Nickname',
|
nickname: 'Nickname',
|
||||||
wellDelType: 'This operation will delete the type. Do you want to continue?',
|
wellDelType: 'This operation will delete the type. Do you want to continue?',
|
||||||
permission: 'Permission',
|
permission: 'Permission',
|
||||||
editUserPermission: 'Edit User Rights',
|
editUserPermission: 'Edit User Rights',
|
||||||
lessonName: 'Lesson Name',
|
lessonName: 'Lesson Name',
|
||||||
selectTraining: 'Selection Training',
|
selectTraining: 'Selection Training',
|
||||||
createUserTraining: 'Creating User Training',
|
createUserTraining: 'Creating User Training',
|
||||||
editTrainingDetail: 'Editor Training Details',
|
editTrainingDetail: 'Editor Training Details',
|
||||||
trainingTime: 'Training duration',
|
trainingTime: 'Training duration',
|
||||||
subscribeToTheMapList: 'Subscribe to the map list:',
|
subscribeToTheMapList: 'Subscribe to the map list:',
|
||||||
editSimulationDetails: 'Edit simulation details'
|
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!',
|
setProjectSuccess: 'Set belongs project success!',
|
||||||
setProjectFail: 'Set belongs project fail!',
|
setProjectFail: 'Set belongs project fail!',
|
||||||
copyMapSuccess: 'Copy map success!',
|
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 {
|
export default {
|
||||||
comprehensiveTrainingManager: 'Comprehensive training manager:',
|
comprehensiveTrainingManager: 'Comprehensive training manager:',
|
||||||
comprehensiveDrillRoom: 'Comprehensive drill room',
|
comprehensiveDrillRoom: 'Comprehensive drill room',
|
||||||
numberOfAssignableRoles: 'Number of assignable roles:',
|
numberOfAssignableRoles: 'Number of assignable roles:',
|
||||||
dispatcher: 'Dispatcher',
|
dispatcher: 'Dispatcher',
|
||||||
increaseDispatchers: 'Increase dispatchers',
|
increaseDispatchers: 'Increase dispatchers',
|
||||||
stationAttendant: 'Station attendant',
|
stationAttendant: 'Station attendant',
|
||||||
increaseStationAttendant: 'Increase station attendant',
|
increaseStationAttendant: 'Increase station attendant',
|
||||||
teacher: 'Teacher',
|
teacher: 'Teacher',
|
||||||
increaseTeacher: 'Increase teacher',
|
increaseTeacher: 'Increase teacher',
|
||||||
universalAccount: 'Universal Account',
|
universalAccount: 'Universal Account',
|
||||||
increaseUniversalAccount: 'Increase universal account',
|
increaseUniversalAccount: 'Increase universal account',
|
||||||
driver: 'Driver',
|
driver: 'Driver',
|
||||||
increaseDriver: 'Increase driver',
|
increaseDriver: 'Increase driver',
|
||||||
bigScreen: 'Big screen',
|
bigScreen: 'Big screen',
|
||||||
increaseBigScreen: 'Increase big screen',
|
increaseBigScreen: 'Increase big screen',
|
||||||
destroyRoom: 'Destroy room',
|
destroyRoom: 'Destroy room',
|
||||||
generatingQRCode: 'Generating QRCode',
|
generatingQRCode: 'Generating QRCode',
|
||||||
startSimulation: 'Start simulation',
|
startSimulation: 'Start simulation',
|
||||||
enterSimulation: 'Enter simulation',
|
enterSimulation: 'Enter simulation',
|
||||||
endSimulation: 'End Simulation',
|
endSimulation: 'End Simulation',
|
||||||
distributeTheRoomQRCode: 'Distribute the room QR code',
|
distributeTheRoomQRCode: 'Distribute the room QR code',
|
||||||
increaseIbp: 'increase IBP',
|
increaseIbp: 'increase IBP',
|
||||||
kickOutTheRoom: 'Kick out the room',
|
kickOutTheRoom: 'Kick out the room',
|
||||||
sending: 'sending...',
|
sending: 'sending...',
|
||||||
holdAndTalk: 'Hold and talk',
|
holdAndTalk: 'Hold and talk',
|
||||||
recording: 'recording...',
|
recording: 'recording...',
|
||||||
sendText: 'Send text',
|
sendText: 'Send text',
|
||||||
left: 'left',
|
left: 'left',
|
||||||
right: 'right',
|
right: 'right',
|
||||||
realDevice: 'Real device',
|
realDevice: 'Real device',
|
||||||
plcGatewayOnline: '[PLC gateway online]',
|
plcGatewayOnline: '[PLC gateway online]',
|
||||||
plcGatewayOffline: '[PLC gateway offline]',
|
plcGatewayOffline: '[PLC gateway offline]',
|
||||||
uplinkPlatform: 'Uplink platform',
|
uplinkPlatform: 'Uplink platform',
|
||||||
downlinkPlatform: 'Downlink platform'
|
downlinkPlatform: 'Downlink platform',
|
||||||
|
ibp:'IBP'
|
||||||
};
|
};
|
||||||
|
@ -10,6 +10,7 @@ export default {
|
|||||||
deleteFailed: '删除失败',
|
deleteFailed: '删除失败',
|
||||||
exportFailed: '导出执行异常',
|
exportFailed: '导出执行异常',
|
||||||
getListFailed: '获取列表数据失败',
|
getListFailed: '获取列表数据失败',
|
||||||
|
getPermissionListFailed: '获取权限列表数据失败',
|
||||||
getDistributeQrcodeFailed: '获取权限分发二维码失败',
|
getDistributeQrcodeFailed: '获取权限分发二维码失败',
|
||||||
obtainMaxNumberFailed: '获取用户最大权限个数失败',
|
obtainMaxNumberFailed: '获取用户最大权限个数失败',
|
||||||
getTransferQrcodeFailed: '获取权限转赠二维码失败',
|
getTransferQrcodeFailed: '获取权限转赠二维码失败',
|
||||||
@ -102,5 +103,6 @@ export default {
|
|||||||
connectToRealDeviceFailed: '关联真实设备失败!',
|
connectToRealDeviceFailed: '关联真实设备失败!',
|
||||||
getRealDeviceListFailed: '获取真实设备列表失败!',
|
getRealDeviceListFailed: '获取真实设备列表失败!',
|
||||||
deleteRealDeviceFailed: '删除真实设备失败!',
|
deleteRealDeviceFailed: '删除真实设备失败!',
|
||||||
checkTheValidityFirst: '请先进行有效性检查!'
|
checkTheValidityFirst: '请先进行有效性检查!',
|
||||||
|
permissionAtLeast:'至少有一种权限的数量大于0'
|
||||||
};
|
};
|
||||||
|
@ -196,5 +196,6 @@ export default {
|
|||||||
america: '美国',
|
america: '美国',
|
||||||
companyInfo:'北京玖琏科技有限公司',
|
companyInfo:'北京玖琏科技有限公司',
|
||||||
companyTel:'联系电话: 13289398171',
|
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';
|
import designPlatform from './designPlatform';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...cnLocale,
|
...cnLocale,
|
||||||
map,
|
map,
|
||||||
global,
|
global,
|
||||||
router,
|
router,
|
||||||
lesson,
|
lesson,
|
||||||
error,
|
error,
|
||||||
teach,
|
teach,
|
||||||
rules,
|
rules,
|
||||||
scriptRecord,
|
scriptRecord,
|
||||||
tip,
|
tip,
|
||||||
system,
|
system,
|
||||||
orderAuthor,
|
orderAuthor,
|
||||||
publish,
|
publish,
|
||||||
permission,
|
permission,
|
||||||
replay,
|
replay,
|
||||||
planMonitor,
|
planMonitor,
|
||||||
screenMonitor,
|
screenMonitor,
|
||||||
demonstration,
|
demonstration,
|
||||||
exam,
|
exam,
|
||||||
dashboard,
|
dashboard,
|
||||||
jlmap3d,
|
jlmap3d,
|
||||||
display,
|
display,
|
||||||
joinTraining,
|
joinTraining,
|
||||||
trainRoom,
|
trainRoom,
|
||||||
menu,
|
menu,
|
||||||
ibp,
|
ibp,
|
||||||
approval,
|
approval,
|
||||||
systemGenerate,
|
systemGenerate,
|
||||||
login,
|
login,
|
||||||
designPlatform
|
designPlatform
|
||||||
};
|
};
|
||||||
|
@ -119,6 +119,7 @@ export default {
|
|||||||
explanation: '驳回说明',
|
explanation: '驳回说明',
|
||||||
courseDetails: '课程详情',
|
courseDetails: '课程详情',
|
||||||
courseTree: '课程树:',
|
courseTree: '课程树:',
|
||||||
mapName:'地图名称'
|
mapName:'地图名称',
|
||||||
|
copy: '复制'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -488,6 +488,7 @@ export default {
|
|||||||
sourceTrainWindow: '源车次窗',
|
sourceTrainWindow: '源车次窗',
|
||||||
trainWindow: '车次窗',
|
trainWindow: '车次窗',
|
||||||
targetTrainWindow: '目的车次窗',
|
targetTrainWindow: '目的车次窗',
|
||||||
category: '类别'
|
category: '类别',
|
||||||
|
lineCode:'线路类型'
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,42 +1,48 @@
|
|||||||
export default {
|
export default {
|
||||||
permissionPack: '权限打包',
|
permissionPack: '权限打包',
|
||||||
setSuccess: '设置成功',
|
setSuccess: '设置成功',
|
||||||
isSureSetBelonger: '是否确定设置{name}为权限所属人?',
|
isSureSetBelonger: '是否确定设置{name}为权限所属人?',
|
||||||
setBelonger: '设置归属人',
|
setBelonger: '设置归属人',
|
||||||
lessonName: '课程名称',
|
lessonName: '课程名称',
|
||||||
mapName: '地图名称',
|
mapName: '地图名称',
|
||||||
mapProductName: '产品名称',
|
mapProductName: '产品名称',
|
||||||
permissionType: '权限类型',
|
permissionType: '权限类型',
|
||||||
permissionStatus: '权限状态',
|
permissionStatus: '权限状态',
|
||||||
permissionUseType: '公用/专用',
|
permissionUseType: '公用/专用',
|
||||||
permissionTotal: '权限总数',
|
permissionTotal: '权限总数',
|
||||||
permissionRemains: '剩余权限',
|
permissionRemains: '剩余权限',
|
||||||
isForever: '是否永久',
|
isForever: '是否永久',
|
||||||
startTime: '开始时间',
|
startTime: '开始时间',
|
||||||
endTime: '结束时间',
|
endTime: '结束时间',
|
||||||
belonger: '归属人',
|
belonger: '归属人',
|
||||||
userList: '用户列表',
|
userList: '用户列表',
|
||||||
customPackageRules: '定制打包规则',
|
customPackageRules: '定制打包规则',
|
||||||
addRules: '添加规则',
|
addRules: '添加规则',
|
||||||
package: '打包',
|
package: '打包',
|
||||||
getQrcode: '获取二维码',
|
getQrcode: '获取二维码',
|
||||||
hasExitRule: '已存在此类型规则',
|
hasExitRule: '已存在此类型规则',
|
||||||
pleaseAddRule: '请添加规则',
|
pleaseAddRule: '请添加规则',
|
||||||
selectDate: '选择时间',
|
selectDate: '选择时间',
|
||||||
addPermissionPackageRule: '增加权限打包规则',
|
addPermissionPackageRule: '增加权限打包规则',
|
||||||
editPermissionPackageRule: '编辑权限打包规则',
|
editPermissionPackageRule: '编辑权限打包规则',
|
||||||
restPermissionMaxNumber: '(剩余最大权限个数:{0})',
|
restPermissionMaxNumber: '(剩余最大权限个数:{0})',
|
||||||
pleaseSelectTransferPermission: '选择转赠权限',
|
pleaseSelectTransferPermission: '选择转赠权限',
|
||||||
permissionName: '权限名称',
|
permissionName: '权限名称',
|
||||||
private: '专用',
|
private: '专用',
|
||||||
public: '公用',
|
public: '公用',
|
||||||
selectPermission: '选择权限',
|
selectPermission: '选择权限',
|
||||||
createOrder: '创建订单',
|
createOrder: '创建订单',
|
||||||
checkCode: '查看二维码',
|
checkCode: '查看二维码',
|
||||||
goodsName: '商品名称',
|
goodsName: '商品名称',
|
||||||
price: '价格',
|
price: '价格',
|
||||||
permissionList: '查看权限列表',
|
permissionList: '查看权限列表',
|
||||||
lastShep: '上一步',
|
lastShep: '上一步',
|
||||||
userName: '用户名称',
|
userName: '用户名称',
|
||||||
statusType: '状态类型'
|
statusType: '状态类型',
|
||||||
|
isPackage:'是否万能',
|
||||||
|
numOfDistribute:'分发权限数量',
|
||||||
|
numOfTransfer:'转赠权限数量',
|
||||||
|
transferTips:'一次可以领取多个权限,领到的权限可以继续转赠',
|
||||||
|
distributeTips:'一次只能领取一个权限,领到的权限是专用权限,不可再次分发'
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -123,5 +123,8 @@ export default {
|
|||||||
theBelongsProjectCannotBeEmpty: '所属项目不能为空',
|
theBelongsProjectCannotBeEmpty: '所属项目不能为空',
|
||||||
pleaseSelectTheBelongsProject: '请选择归属项目',
|
pleaseSelectTheBelongsProject: '请选择归属项目',
|
||||||
copyMapAs: '复制地图为',
|
copyMapAs: '复制地图为',
|
||||||
whetherToCopyData: '是否复制数据'
|
whetherToCopyData: '是否复制数据',
|
||||||
|
copy:'复制',
|
||||||
|
lineType:'线路类型',
|
||||||
|
belongsToMap: '所属地图'
|
||||||
};
|
};
|
||||||
|
@ -5,6 +5,7 @@ export default {
|
|||||||
designUserPage: '个人地图',
|
designUserPage: '个人地图',
|
||||||
|
|
||||||
mapManage: '地图管理',
|
mapManage: '地图管理',
|
||||||
|
skinManage: '皮肤管理',
|
||||||
mapDraw: '地图绘制',
|
mapDraw: '地图绘制',
|
||||||
runPlanManage: '运行图管理',
|
runPlanManage: '运行图管理',
|
||||||
productEdit: '产品编辑',
|
productEdit: '产品编辑',
|
||||||
@ -67,5 +68,6 @@ export default {
|
|||||||
courseApplication: '课程发布申请',
|
courseApplication: '课程发布申请',
|
||||||
scriptReleaseApplication: '剧本发布申请',
|
scriptReleaseApplication: '剧本发布申请',
|
||||||
runGraphReleaseApplication: '运行图发布申请',
|
runGraphReleaseApplication: '运行图发布申请',
|
||||||
subsystemGeneration: '子系统生成'
|
subsystemGeneration: '子系统生成',
|
||||||
|
newsBulletin: '消息公告'
|
||||||
};
|
};
|
||||||
|
@ -1,316 +1,321 @@
|
|||||||
export default {
|
export default {
|
||||||
pleaseSelect: '请选择',
|
pleaseSelect: '请选择',
|
||||||
selectEquipment: '请选择设备',
|
selectEquipment: '请选择设备',
|
||||||
deviceTypeNotNull: '设备类型码不能为空',
|
deviceTypeNotNull: '设备类型码不能为空',
|
||||||
operationTypeNotNull: '操作码不能为空',
|
operationTypeNotNull: '操作码不能为空',
|
||||||
tipsNotNull: '提示信息不能为空',
|
tipsNotNull: '提示信息不能为空',
|
||||||
pleaseSelectEncoding: '请选择唯一编码',
|
pleaseSelectEncoding: '请选择唯一编码',
|
||||||
pleaseEnterStatusSignal: '请输入状态信号名称',
|
pleaseEnterStatusSignal: '请输入状态信号名称',
|
||||||
pleaseEnterXCoordinate: '请输入x坐标',
|
pleaseEnterXCoordinate: '请输入x坐标',
|
||||||
pleaseEnterYCoordinate: '请输入y坐标',
|
pleaseEnterYCoordinate: '请输入y坐标',
|
||||||
|
|
||||||
pleaseSelectLine: '请选择Line',
|
pleaseSelectLine: '请选择Line',
|
||||||
pleaseSelectLineType: '请选择Line类型',
|
pleaseSelectLineType: '请选择Line类型',
|
||||||
pleaseSelectLineWidth: '请输入线条宽度',
|
pleaseSelectLineWidth: '请输入线条宽度',
|
||||||
|
|
||||||
linkXCoordinate: '请输入Link x坐标',
|
linkXCoordinate: '请输入Link x坐标',
|
||||||
linkYCoordinate: '请输入Link y坐标',
|
linkYCoordinate: '请输入Link y坐标',
|
||||||
linkEnterLength: '请输入显示长度',
|
linkEnterLength: '请输入显示长度',
|
||||||
linkEnterDisplayLength: '请输入真实长度',
|
linkEnterDisplayLength: '请输入真实长度',
|
||||||
|
|
||||||
linkSelectBase: '请选择基础Link',
|
linkSelectBase: '请选择基础Link',
|
||||||
linkEnterLeft: '请输入左侧正向Link',
|
linkEnterLeft: '请输入左侧正向Link',
|
||||||
linkEnterRight: '请输入右侧正向Link',
|
linkEnterRight: '请输入右侧正向Link',
|
||||||
linkSelectName: '请输入Link名称',
|
linkSelectName: '请输入Link名称',
|
||||||
linkSelectDisplayLength: '请输入Link实际长度',
|
linkSelectDisplayLength: '请输入Link实际长度',
|
||||||
|
|
||||||
lengthShow: '显示长度:',
|
lengthShow: '显示长度:',
|
||||||
lengthFact: '真实长度:',
|
lengthFact: '真实长度:',
|
||||||
color: '颜色:',
|
color: '颜色:',
|
||||||
|
|
||||||
pointX: '坐标 x:',
|
pointX: '坐标 x:',
|
||||||
pointY: '坐标 y:',
|
pointY: '坐标 y:',
|
||||||
direct: '方向:',
|
direct: '方向:',
|
||||||
basisLink: '基础Link:',
|
basisLink: '基础Link:',
|
||||||
|
|
||||||
pleaseSelectSectionName: '请选择区段名称',
|
pleaseSelectSectionName: '请选择区段名称',
|
||||||
pleaseFillOffset: '请填写偏移量',
|
pleaseSelectSection: '请选择区段',
|
||||||
pleaseFillValue: '请填写数值',
|
pleaseSelectStationCode: '请选择设备集中站',
|
||||||
pleaseSelectLeftSectionName: '请选择左侧区段名称',
|
pleaseFillOffset: '请填写偏移量',
|
||||||
pleaseSelectRightSectionName: '请选择右侧区段名称',
|
pleaseFillValue: '请填写数值',
|
||||||
pleaseEnterYValue: '请输入坐标Y值',
|
pleaseSelectLeftSectionName: '请选择左侧区段名称',
|
||||||
pleaseEnterSectionType: '请输入区段类型',
|
pleaseSelectRightSectionName: '请选择右侧区段名称',
|
||||||
pleaseEnterSectionName: '请输入区段名称',
|
pleaseEnterYValue: '请输入坐标Y值',
|
||||||
pleaseSelectAssociatedPlatform: '请选择关联站台',
|
pleaseEnterSectionType: '请输入区段类型',
|
||||||
pleaseEnterLeftStopPointOffset: '请输入左向停车点偏移量',
|
pleaseEnterSectionName: '请输入区段名称',
|
||||||
rightStopPointOffset: '请输入右向停车点偏移量',
|
pleaseSelectAssociatedPlatform: '请选择关联站台',
|
||||||
destinationCode: '请输入目的地码',
|
pleaseEnterLeftStopPointOffset: '请输入左向停车点偏移量',
|
||||||
destinationCodePointX: '请输入目的地码坐标X',
|
rightStopPointOffset: '请输入右向停车点偏移量',
|
||||||
destinationCodePointY: '请输入目的地码坐标Y',
|
destinationCode: '请输入目的地码',
|
||||||
sectionNamePointX: '请输入区段名称坐标X',
|
destinationCodePointX: '请输入目的地码坐标X',
|
||||||
sectionNamePointY: '请输入区段名称坐标Y',
|
destinationCodePointY: '请输入目的地码坐标Y',
|
||||||
logicSectionNameSort: '请选择逻辑区段名称排序',
|
sectionNamePointX: '请输入区段名称坐标X',
|
||||||
sectionOffsetLeft: '请输入左侧Link偏移量',
|
sectionNamePointY: '请输入区段名称坐标Y',
|
||||||
sectionSepTypeLeft: '请选择左侧分隔符',
|
logicSectionNameSort: '请选择逻辑区段名称排序',
|
||||||
sectionOffsetRight: '请输入右侧Link偏移量',
|
sectionOffsetLeft: '请输入左侧Link偏移量',
|
||||||
sectionSepTypeRight: '请选择右侧分隔符',
|
sectionSepTypeLeft: '请选择左侧分隔符',
|
||||||
selectPhysicalExtentName: '请选择物理区段名称',
|
sectionOffsetRight: '请输入右侧Link偏移量',
|
||||||
|
sectionSepTypeRight: '请选择右侧分隔符',
|
||||||
|
selectPhysicalExtentName: '请选择物理区段名称',
|
||||||
|
|
||||||
pleaseEnterSemaphoreName: '请输入信号灯名称',
|
pleaseEnterSemaphoreName: '请输入信号灯名称',
|
||||||
pleaseEnterSignalName: '请输入信号机唯一名称',
|
pleaseEnterSignalName: '请输入信号机唯一名称',
|
||||||
pleaseEnterSignalOffset: '请输入偏移量',
|
pleaseEnterSignalOffset: '请输入偏移量',
|
||||||
pleaseEnterSignalStation: '请输入设备集中站',
|
pleaseEnterSignalStation: '请输入设备集中站',
|
||||||
pleaseEnterSignalPositionX: '请输入信号机x',
|
pleaseEnterSignalPositionX: '请输入信号机x',
|
||||||
pleaseEnterSignalPositionY: '请输入信号机y',
|
pleaseEnterSignalPositionY: '请输入信号机y',
|
||||||
signalButtonPositionX: '请输入按钮x',
|
signalButtonPositionX: '请输入按钮x',
|
||||||
signalButtonPositionY: '请输入按钮y',
|
signalButtonPositionY: '请输入按钮y',
|
||||||
signalGuidePositionX: '请输入引导信号x',
|
signalGuidePositionX: '请输入引导信号x',
|
||||||
signalGuidePositionY: '请输入引导信号y',
|
signalGuidePositionY: '请输入引导信号y',
|
||||||
|
|
||||||
stationName: '请输入车站名称',
|
stationName: '请输入车站名称',
|
||||||
stationKmRange: '请输入公里标距离',
|
stationKmRange: '请输入公里标距离',
|
||||||
stationKmPost: '请输入公里标名称',
|
stationKmPost: '请输入公里标名称',
|
||||||
|
|
||||||
stationControlStationName: '请选择车站名称',
|
stationControlStationName: '请选择车站名称',
|
||||||
stationControlStationCode: '请选择所属车站',
|
stationControlStationCode: '请选择所属车站',
|
||||||
stationControlZokContent: '请输入中控内容',
|
stationControlZokContent: '请输入中控内容',
|
||||||
stationControlZakContent: '请输入站控内容',
|
stationControlZakContent: '请输入站控内容',
|
||||||
stationControlJjzkContent: '请输入紧急站控内容',
|
stationControlJjzkContent: '请输入紧急站控内容',
|
||||||
stationControlZzkContent: '请输入站中控内容',
|
stationControlZzkContent: '请输入站中控内容',
|
||||||
stationControlPositionX: '请输入坐标x',
|
stationControlPositionX: '请输入坐标x',
|
||||||
stationControlPositionY: '请输入坐标y',
|
stationControlPositionY: '请输入坐标y',
|
||||||
|
|
||||||
pleaseReSelectDevice: '请重新选择设备',
|
pleaseReSelectDevice: '请重新选择设备',
|
||||||
stationCode: '请选择关联车站',
|
stationCode: '请选择关联车站',
|
||||||
stationstandCountName: '请输入计数器名称',
|
stationstandCountName: '请输入计数器名称',
|
||||||
doorLocationType: '请选择站台方向',
|
doorLocationType: '请选择站台方向',
|
||||||
deviceStationCode: '请选择所属设备集中站',
|
deviceStationCode: '请选择所属设备集中站',
|
||||||
stationstandDirection: '请选择上下行方向',
|
stationstandDirection: '请选择上下行方向',
|
||||||
stationstandWidth: '请输入车站宽度',
|
stationstandWidth: '请输入车站宽度',
|
||||||
stationstandHeight: '请输入车站高度',
|
stationstandHeight: '请输入车站高度',
|
||||||
|
|
||||||
switchName: '请输入道岔名称',
|
switchName: '请输入道岔名称',
|
||||||
switchNamePointX: '请输入道岔名称坐标x',
|
switchNamePointX: '请输入道岔名称坐标x',
|
||||||
switchNamePointY: '请输入道岔名称坐标y',
|
switchNamePointY: '请输入道岔名称坐标y',
|
||||||
switchStationCode: '请输入设备集中站',
|
switchStationCode: '请输入设备集中站',
|
||||||
switchTurnTime: '请输入道岔转换时间',
|
switchTurnTime: '请输入道岔转换时间',
|
||||||
switchTpX: '请输入时间坐标x',
|
switchTpX: '请输入时间坐标x',
|
||||||
switchTpY: '请输入时间坐标y',
|
switchTpY: '请输入时间坐标y',
|
||||||
|
|
||||||
selectText: '请选择Text',
|
selectText: '请选择Text',
|
||||||
pleaseEnterContent: '请输入内容',
|
pleaseEnterContent: '请输入内容',
|
||||||
textFont: '请选择文字格式',
|
textFont: '请选择文字格式',
|
||||||
textFontColor: '请选择文字颜色',
|
textFontColor: '请选择文字颜色',
|
||||||
pleaseEnterGroupNumber: '请输入车组号',
|
pleaseEnterGroupNumber: '请输入车组号',
|
||||||
selectTrainType: '请选择车类型',
|
selectTrainType: '请选择车类型',
|
||||||
trainPositionX: '请输入x坐标位置',
|
trainPositionX: '请输入x坐标位置',
|
||||||
trainPositionY: '请输入y坐标位置',
|
trainPositionY: '请输入y坐标位置',
|
||||||
pleaseEnterTrainNumber: '请填写车组号',
|
pleaseEnterTrainNumber: '请填写车组号',
|
||||||
|
|
||||||
trainCode: '列车模型Code不能为空',
|
trainCode: '列车模型Code不能为空',
|
||||||
pleaseEnterTrainTypeName: '请输入列车类型名称',
|
pleaseEnterTrainTypeName: '请输入列车类型名称',
|
||||||
trainLength: '请输入列车长度',
|
trainLength: '请输入列车长度',
|
||||||
safeDistance: '请输入安全距离',
|
safeDistance: '请输入安全距离',
|
||||||
maxSafeDistance: '请输入最大安全距离',
|
maxSafeDistance: '请输入最大安全距离',
|
||||||
averageVelocity: '请输入平均速度',
|
averageVelocity: '请输入平均速度',
|
||||||
averageDeceleration: '请输入平均减速度',
|
averageDeceleration: '请输入平均减速度',
|
||||||
defaultVelocity: '请输入默认速度',
|
defaultVelocity: '请输入默认速度',
|
||||||
maxVelocity: '请输入最大速度',
|
maxVelocity: '请输入最大速度',
|
||||||
|
|
||||||
trainWindowWidth: '请输入车次窗宽度',
|
trainWindowWidth: '请输入车次窗宽度',
|
||||||
trainWindowHeight: '请输入车次窗高度',
|
trainWindowHeight: '请输入车次窗高度',
|
||||||
trainWindowSectionCode: '请输入关联区段',
|
trainWindowSectionCode: '请输入关联区段',
|
||||||
|
|
||||||
visible: '请选择是否可见',
|
visible: '请选择是否可见',
|
||||||
pleaseSelectStartSignal: '请选择开始信号机',
|
pleaseSelectStartSignal: '请选择开始信号机',
|
||||||
pleaseSelectEndSignal: '请选择结束信号机',
|
pleaseSelectEndSignal: '请选择结束信号机',
|
||||||
|
|
||||||
pleaseEnterPathName: '请输入进路名称',
|
pleaseEnterPathName: '请输入进路名称',
|
||||||
proximitySection: '请选择接近区段',
|
proximitySection: '请选择接近区段',
|
||||||
accessPropertyType: '请选择进路性质类型',
|
accessPropertyType: '请选择进路性质类型',
|
||||||
autoAccessType: '请选择自动进路类型',
|
autoAccessType: '请选择自动进路类型',
|
||||||
physicalSegmentData: '请选择进路物理区段数据',
|
physicalSegmentData: '请选择进路物理区段数据',
|
||||||
|
|
||||||
routingName: '请输入交路名称',
|
routingName: '请输入交路名称',
|
||||||
startStationCode: '请选择起始车站',
|
startStationCode: '请选择起始车站',
|
||||||
startSectionCode: '请选择起始区段',
|
startSectionCode: '请选择起始区段',
|
||||||
endStationCode: '请选择终到车站',
|
endStationCode: '请选择终到车站',
|
||||||
endSectionCode: '请选择终到区段',
|
endSectionCode: '请选择终到区段',
|
||||||
|
|
||||||
selectTurnoutID: '请选择道岔ID',
|
selectTurnoutID: '请选择道岔ID',
|
||||||
switchesCannot: '道岔不能为同一个',
|
switchesCannot: '道岔不能为同一个',
|
||||||
|
|
||||||
pleaseInputName: '请输入名称',
|
pleaseInputName: '请输入名称',
|
||||||
pleaseInputNickName: '请输入昵称',
|
pleaseInputNickName: '请输入昵称',
|
||||||
pleaseSelectStatus: '请选择状态',
|
pleaseSelectStatus: '请选择状态',
|
||||||
pleaseInputCode: '请输入编码',
|
pleaseInputCode: '请输入编码',
|
||||||
strLength1To25: '长度在 1 到 25 个字符',
|
strLength1To25: '长度在 1 到 25 个字符',
|
||||||
strLengthNotExceed50: '不能超过 50 个字符',
|
strLengthNotExceed50: '不能超过 50 个字符',
|
||||||
pleaseSelectCity: '请选择城市',
|
pleaseSelectCity: '请选择城市',
|
||||||
|
|
||||||
pleaseEnterMapName: '请输入地图名称',
|
pleaseEnterMapName: '请输入地图名称',
|
||||||
pleaseChooseSkinCode: '请选择皮肤风格',
|
pleaseChooseSkinCode: '请选择皮肤风格',
|
||||||
pleaseSelectMapSource: '请选择地图来源',
|
pleaseSelectMapSource: '请选择地图来源',
|
||||||
pleaseSelectAssociatedCity: '请选择关联城市',
|
pleaseSelectAssociatedCity: '请选择关联城市',
|
||||||
pleaseSelectAssociatedSkin: '请选择关联皮肤',
|
pleaseSelectAssociatedSkin: '请选择关联皮肤',
|
||||||
pleaseEnteMapLinkWidth: '请输入地图Link宽度',
|
pleaseEnteMapLinkWidth: '请输入地图Link宽度',
|
||||||
pleaseEnterMapSectionWidth: '请输入地图区段宽度',
|
pleaseEnterMapSectionWidth: '请输入地图区段宽度',
|
||||||
organizationInput: '请输入组织或者企业名称',
|
organizationInput: '请输入组织或者企业名称',
|
||||||
productSelect: '请选择商品',
|
productSelect: '请选择商品',
|
||||||
itemPricingInput: '请输入商品单价',
|
itemPricingInput: '请输入商品单价',
|
||||||
orderTypeSelect: '请选择订单类型',
|
orderTypeSelect: '请选择订单类型',
|
||||||
contractNumberInput: '请输入合同编号',
|
contractNumberInput: '请输入合同编号',
|
||||||
salesmanInput: '请选择销售人员',
|
salesmanInput: '请选择销售人员',
|
||||||
authorAmountInput: '请输入购买的权限个数',
|
authorAmountInput: '请输入购买的权限个数',
|
||||||
authorAmountInputError: '请输入有效权限个数',
|
authorAmountInputError: '请输入有效权限个数',
|
||||||
totalPriceInput: '请输入总价格',
|
totalPriceInput: '请输入总价格',
|
||||||
totalPriceInputError1: '请输入的价格在两位小数',
|
totalPriceInputError1: '请输入的价格在两位小数',
|
||||||
totalPriceInputError2: '请输入有效总价格',
|
totalPriceInputError2: '请输入有效总价格',
|
||||||
monthAmountInput: '请输入购买月数',
|
monthAmountInput: '请输入购买月数',
|
||||||
monthAmountInputError: '请输入有效购买月数',
|
monthAmountInputError: '请输入有效购买月数',
|
||||||
startTimePick: '请选择开始日期',
|
startTimePick: '请选择开始日期',
|
||||||
bizTypeSelect: '请选择业务类型',
|
bizTypeSelect: '请选择业务类型',
|
||||||
payWaysSelect: '请选择支付方式',
|
payWaysSelect: '请选择支付方式',
|
||||||
payStatusSelect: '请选择支付状态',
|
payStatusSelect: '请选择支付状态',
|
||||||
goodsNameInput: '请输入商品名称',
|
goodsNameInput: '请输入商品名称',
|
||||||
productTypeInput: '请选择产品类型',
|
productTypeInput: '请选择产品类型',
|
||||||
mapInput: '请选择地图',
|
mapInput: '请选择地图',
|
||||||
productInput: '请选择产品',
|
productInput: '请选择产品',
|
||||||
lessonInput: '请选择课程',
|
lessonInput: '请选择课程',
|
||||||
trialTimeInput: '请输入试用时长',
|
trialTimeInput: '请输入试用时长',
|
||||||
unitOfTimeRadio: '请选择时间单位',
|
unitOfTimeRadio: '请选择时间单位',
|
||||||
goodsDescribtionInput: '请输入商品描述',
|
goodsDescribtionInput: '请输入商品描述',
|
||||||
userNameInput: '请输入用户名称',
|
userNameInput: '请输入用户名称',
|
||||||
permissionTypeInput: '请选择权限类型',
|
permissionTypeInput: '请选择权限类型',
|
||||||
timeInput: '请输入时长',
|
timeInput: '请输入时长',
|
||||||
chooseUser: '请选择用户',
|
chooseUser: '请选择用户',
|
||||||
pleaseInputLessonName: '请输入课程名称',
|
pleaseInputLessonName: '请输入课程名称',
|
||||||
pleaseSelectTraining: '请选择实训',
|
pleaseSelectTraining: '请选择实训',
|
||||||
sectionRelSwitchCode: '请选择关联道岔',
|
sectionRelSwitchCode: '请选择关联道岔',
|
||||||
|
|
||||||
maxScaling: '(缩放比例最大为8级)',
|
maxScaling: '(缩放比例最大为8级)',
|
||||||
skinCodingInput: '请输入皮肤编码',
|
skinCodingInput: '请输入皮肤编码',
|
||||||
skinDesignationInput: '请输入皮肤名称',
|
skinDesignationInput: '请输入皮肤名称',
|
||||||
coordinatesOriginInput: '请输入原点坐标',
|
coordinatesOriginInput: '请输入原点坐标',
|
||||||
scalingInput: '请输入缩放比例',
|
scalingInput: '请输入缩放比例',
|
||||||
scalingInputPrompt: '请输入有效的缩放比例',
|
scalingInputPrompt: '请输入有效的缩放比例',
|
||||||
selectImportFiles: '请选择需要导入的文件',
|
selectImportFiles: '请选择需要导入的文件',
|
||||||
speedLevelEnter1: '请输入速度等级1',
|
speedLevelEnter1: '请输入速度等级1',
|
||||||
speedLevelEnter2: '请输入速度等级2',
|
speedLevelEnter2: '请输入速度等级2',
|
||||||
speedLevelEnter3: '请输入速度等级3',
|
speedLevelEnter3: '请输入速度等级3',
|
||||||
speedLevelEnter4: '请输入速度等级4',
|
speedLevelEnter4: '请输入速度等级4',
|
||||||
drivingDirectionSelect: '请选择行驶方向',
|
drivingDirectionSelect: '请选择行驶方向',
|
||||||
timeBetweenDeparturesEnter: '请输入发车间隔时间',
|
timeBetweenDeparturesEnter: '请输入发车间隔时间',
|
||||||
stopTimeEnter: '请输入停靠时间',
|
stopTimeEnter: '请输入停靠时间',
|
||||||
entranceStationSelect: '请选择入站口',
|
entranceStationSelect: '请选择入站口',
|
||||||
exportStationSelect: '请选择出站口',
|
exportStationSelect: '请选择出站口',
|
||||||
selectDataRange: '请选择数据范围区间',
|
selectDataRange: '请选择数据范围区间',
|
||||||
productCodeEnter: '请输入产品编码',
|
productCodeEnter: '请输入产品编码',
|
||||||
productNameEnter: '请输入产品名称',
|
productNameEnter: '请输入产品名称',
|
||||||
productDescriptionEnter: '请输入产品说明',
|
productDescriptionEnter: '请输入产品说明',
|
||||||
trainingTypeSelect: '请选择关联实训类型',
|
trainingTypeSelect: '请选择关联实训类型',
|
||||||
linkWidthInput: '请输入Link宽度',
|
linkWidthInput: '请输入Link宽度',
|
||||||
linkWidthInputPrompt: '请输入有效Link宽度',
|
linkWidthInputPrompt: '请输入有效Link宽度',
|
||||||
sectionWidthInput: '请输入区段宽度',
|
sectionWidthInput: '请输入区段宽度',
|
||||||
sectionWidthInputPrompt: '请输入有效区段宽度',
|
sectionWidthInputPrompt: '请输入有效区段宽度',
|
||||||
selectShowWatermark: '请选择是否水印',
|
selectShowWatermark: '请选择是否水印',
|
||||||
|
|
||||||
courseNameEmpty: '课程名称不能为空',
|
courseNameEmpty: '课程名称不能为空',
|
||||||
purchaseMonth: '请输入购买月数',
|
purchaseMonth: '请输入购买月数',
|
||||||
accessNumber: '请输入权限数量',
|
accessNumber: '请输入权限数量',
|
||||||
pleaseInputMapName: '请输入地图名称',
|
pleaseInputMapName: '请输入地图名称',
|
||||||
inputTemplateRunPlan: '请选择模板运行图',
|
inputTemplateRunPlan: '请选择模板运行图',
|
||||||
inputSkinType: '请选择皮肤类型',
|
inputSkinType: '请选择皮肤类型',
|
||||||
|
|
||||||
inputTrainingName: '请输入实训名称',
|
inputTrainingName: '请输入实训名称',
|
||||||
inputTrainingType: '请输入实训类型',
|
inputTrainingType: '请输入实训类型',
|
||||||
inputOperationType: '请输入操作类型',
|
inputOperationType: '请输入操作类型',
|
||||||
inputMinDuration: '请输入最佳用时',
|
inputMinDuration: '请输入最佳用时',
|
||||||
inputMaxDuration: '请输入最大用时',
|
inputMaxDuration: '请输入最大用时',
|
||||||
inputTrainingRemark: '请输入实训说明',
|
inputTrainingRemark: '请输入实训说明',
|
||||||
inputOperateCode: '请输入步骤操作码',
|
inputOperateCode: '请输入步骤操作码',
|
||||||
inputStepNo: '请输入步骤序号',
|
inputStepNo: '请输入步骤序号',
|
||||||
inputStepTips: '请输入步骤提示信息',
|
inputStepTips: '请输入步骤提示信息',
|
||||||
selectMapName: '请选择地图名称',
|
selectMapName: '请选择地图名称',
|
||||||
selectMapProductName: '请选择地图产品名称',
|
selectMapProductName: '请选择地图产品名称',
|
||||||
inputTime: '请输入时间',
|
inputTime: '请输入时间',
|
||||||
inputPermissionNumber: '请输入权限个数',
|
inputPermissionNumber: '请输入权限个数',
|
||||||
permissionNumberGreater0: '权限个数必须大于0',
|
permissionNumberGreater0: '权限个数必须大于0',
|
||||||
enterChapterName: '请输入章节名称',
|
enterChapterName: '请输入章节名称',
|
||||||
enterChapterInstructions: '请输入章节说明',
|
enterChapterInstructions: '请输入章节说明',
|
||||||
selectCourseName: '请选择课程名称',
|
selectCourseName: '请选择课程名称',
|
||||||
enterCourseName: '请输入课程名称',
|
enterCourseName: '请输入课程名称',
|
||||||
selectAssociatedProduct: '请选择关联产品',
|
selectAssociatedProduct: '请选择关联产品',
|
||||||
enterCourseDescription: '请输入课程说明',
|
enterCourseDescription: '请输入课程说明',
|
||||||
pleaseLessonIntroduction: '请输入课程简介',
|
pleaseLessonIntroduction: '请输入课程简介',
|
||||||
courseIdIsEmpty: '课程Id为空',
|
courseIdIsEmpty: '课程Id为空',
|
||||||
selectCity: '请选择城市',
|
selectCity: '请选择城市',
|
||||||
enterStandardTime: '请输入标准用时',
|
enterStandardTime: '请输入标准用时',
|
||||||
enterNumericValue: '请输入数字值',
|
enterNumericValue: '请输入数字值',
|
||||||
greaterThanMinTime: '必须大于最小时间',
|
greaterThanMinTime: '必须大于最小时间',
|
||||||
selectTrainingType: '请选择实训类型',
|
selectTrainingType: '请选择实训类型',
|
||||||
selectOneTrainingType: '只能选择一个实训类型',
|
selectOneTrainingType: '只能选择一个实训类型',
|
||||||
enterProductType: '请输入产品类型',
|
enterProductType: '请输入产品类型',
|
||||||
selectAssociatedStation: '请选择关联的车站',
|
selectAssociatedStation: '请选择关联的车站',
|
||||||
enterScale: '请输入缩放比例',
|
enterScale: '请输入缩放比例',
|
||||||
enterXOffset: '请输入X偏移',
|
enterXOffset: '请输入X偏移',
|
||||||
enterYOffset: '请输入Y偏移',
|
enterYOffset: '请输入Y偏移',
|
||||||
pleaseSelectButtonType: '请选择按钮类型',
|
pleaseSelectButtonType: '请选择按钮类型',
|
||||||
pleaseSelectButtonContent: '请输入内容',
|
pleaseSelectButtonContent: '请输入内容',
|
||||||
pleaseSelectTrainDir: '请选择列车所在方向',
|
pleaseSelectTrainDir: '请选择列车所在方向',
|
||||||
pleaseEnterSplit: '请输入拆分数量',
|
pleaseEnterSplit: '请输入拆分数量',
|
||||||
pleaseEnterSplitNumber: '请输入合理的拆分数量',
|
pleaseEnterSplitNumber: '请输入合理的拆分数量',
|
||||||
|
|
||||||
endTimeRules: '结束时间必须大于开始时间',
|
endTimeRules: '结束时间必须大于开始时间',
|
||||||
selectCourses: '请选择课程',
|
selectCourses: '请选择课程',
|
||||||
selectTheMapRoute: '请选择地图线路',
|
selectTheMapRoute: '请选择地图线路',
|
||||||
enterKeyword: '请输入关键词',
|
enterKeyword: '请输入关键词',
|
||||||
successfullyModified: '修改成功',
|
successfullyModified: '修改成功',
|
||||||
modifyTheFailure: '修改失败',
|
modifyTheFailure: '修改失败',
|
||||||
selectTheCourseNameFirst: '请先选择课程名称',
|
selectTheCourseNameFirst: '请先选择课程名称',
|
||||||
selectMultiplePermissions: '请选择多个权限',
|
selectMultiplePermissions: '请选择多个权限',
|
||||||
enterPermissionName: '请输入权限名称',
|
enterPermissionName: '请输入权限名称',
|
||||||
pleaseSelectPermission: '请选择权限',
|
pleaseSelectPermission: '请选择权限',
|
||||||
pleaseSelectTemplateRunGraph: '请选择模板运行图',
|
pleaseSelectTemplateRunGraph: '请选择模板运行图',
|
||||||
selectTheRunningDiagramToBeLoaded: '请选择需要加载的运行图',
|
selectTheRunningDiagramToBeLoaded: '请选择需要加载的运行图',
|
||||||
selectOneOrMoreDates: '选择一个或多个日期',
|
selectOneOrMoreDates: '选择一个或多个日期',
|
||||||
selectAPlannedDateRange: '请选择计划日期范围',
|
selectAPlannedDateRange: '请选择计划日期范围',
|
||||||
selectGroupNumber: '请选择车组号',
|
selectGroupNumber: '请选择车组号',
|
||||||
selectATrainType: '请选择一个列车类型',
|
selectATrainType: '请选择一个列车类型',
|
||||||
enterTheServiceNumber: '请输入表号',
|
enterTheServiceNumber: '请输入表号',
|
||||||
enterTheTripNumber: '请输入车次号',
|
enterTheTripNumber: '请输入车次号',
|
||||||
enterTheTargetCode: '请输入目的地号',
|
enterTheTargetCode: '请输入目的地号',
|
||||||
selectStation: '请选择车站',
|
selectStation: '请选择车站',
|
||||||
pleaseEnterGoodPrice: '请输入商品价格',
|
pleaseEnterGoodPrice: '请输入商品价格',
|
||||||
enterTheNameOfTheRunGraph: '请输入运行图名称',
|
enterTheNameOfTheRunGraph: '请输入运行图名称',
|
||||||
chooseToPublishTheRunGraph: '请选择发布运行图',
|
chooseToPublishTheRunGraph: '请选择发布运行图',
|
||||||
enterTheAlarmCode: '请输入报警器编号',
|
enterTheAlarmCode: '请输入报警器编号',
|
||||||
enterTheAlarmWidth: '请输入报警器宽度',
|
enterTheAlarmWidth: '请输入报警器宽度',
|
||||||
enterTheEscalatorFrameCode: '请输入扶梯框编号',
|
enterTheEscalatorFrameCode: '请输入扶梯框编号',
|
||||||
enterTheEscalatorFrameWidth: '请输入扶梯框宽度',
|
enterTheEscalatorFrameWidth: '请输入扶梯框宽度',
|
||||||
enterTheEscalatorFrameHeight: '请输入扶梯框高度',
|
enterTheEscalatorFrameHeight: '请输入扶梯框高度',
|
||||||
enterTheBorderWidth: '请输入边框宽度',
|
enterTheBorderWidth: '请输入边框宽度',
|
||||||
selectTheDirectionOfTheArrow: '请选择箭头方向',
|
selectTheDirectionOfTheArrow: '请选择箭头方向',
|
||||||
enterTheArrowCode: '请输入箭头编号',
|
enterTheArrowCode: '请输入箭头编号',
|
||||||
enterTheArrowLength: '请输入箭头长度',
|
enterTheArrowLength: '请输入箭头长度',
|
||||||
enterTheArrowWidth: '请输入箭头线宽',
|
enterTheArrowWidth: '请输入箭头线宽',
|
||||||
enterTheArrowColor: '请输入箭头颜色',
|
enterTheArrowColor: '请输入箭头颜色',
|
||||||
enterTheBackgroundWidth: '请输入背景板宽度',
|
enterTheBackgroundWidth: '请输入背景板宽度',
|
||||||
enterTheBackgroundHeight: '请输入背景板高度',
|
enterTheBackgroundHeight: '请输入背景板高度',
|
||||||
selectTheButtonColor: '请选择按钮颜色',
|
selectTheButtonColor: '请选择按钮颜色',
|
||||||
enterTheButtonCode: '请输入按钮编号',
|
enterTheButtonCode: '请输入按钮编号',
|
||||||
enterTheButtonWidth: '请输入按钮宽度',
|
enterTheButtonWidth: '请输入按钮宽度',
|
||||||
enterTheDigitalClockCode: '请输入电子表编号',
|
enterTheDigitalClockCode: '请输入电子表编号',
|
||||||
enterTheDigitalClockWidth: '请输入电子表宽度',
|
enterTheDigitalClockWidth: '请输入电子表宽度',
|
||||||
selectTheStartingDirection: '请选择启动方向',
|
selectTheStartingDirection: '请选择启动方向',
|
||||||
enterTheElevatorCode: '请输入电梯编号',
|
enterTheElevatorCode: '请输入电梯编号',
|
||||||
enterTheElevatorWidth: '请输入电梯宽度',
|
enterTheElevatorWidth: '请输入电梯宽度',
|
||||||
enterTheElevatorHeight: '请输入电梯高度',
|
enterTheElevatorHeight: '请输入电梯高度',
|
||||||
enterTheElevatorColor: '请输入电梯颜色',
|
enterTheElevatorColor: '请输入电梯颜色',
|
||||||
enterTheKeyCode: '请输入钥匙编号',
|
enterTheKeyCode: '请输入钥匙编号',
|
||||||
enterTheKeyWidth: '请输入钥匙宽度',
|
enterTheKeyWidth: '请输入钥匙宽度',
|
||||||
selectTheKeyDirection: '请选择钥匙朝向',
|
selectTheKeyDirection: '请选择钥匙朝向',
|
||||||
enterTheUpperText: '请输入上侧文字',
|
enterTheUpperText: '请输入上侧文字',
|
||||||
enterTheLowerText: '请输入下侧文字',
|
enterTheLowerText: '请输入下侧文字',
|
||||||
enterRejectReason: '请输入驳回说明'
|
enterRejectReason: '请输入驳回说明',
|
||||||
|
enterTheNewsTitle: '请输入消息标题',
|
||||||
|
enterTheNewsContent: '请输入消息内容',
|
||||||
|
chooseNewsCanBeClosed: '请选择消息是否可关闭'
|
||||||
};
|
};
|
||||||
|
@ -1,108 +1,114 @@
|
|||||||
export default {
|
export default {
|
||||||
scriptTitle: '剧本录制',
|
scriptTitle: '剧本录制',
|
||||||
saveBackground: '保存背景',
|
saveBackground: '保存背景',
|
||||||
saveData: '保存数据',
|
saveData: '保存数据',
|
||||||
mapList: '地图列表',
|
mapList: '地图列表',
|
||||||
createScript: '创建剧本',
|
createScript: '创建剧本',
|
||||||
modifyScript: '修改剧本',
|
modifyScript: '修改剧本',
|
||||||
scriptName: '剧本名称',
|
scriptName: '剧本名称',
|
||||||
addScript: '添加剧本',
|
addScript: '添加剧本',
|
||||||
map: '所属地图',
|
map: '所属地图',
|
||||||
scriptDescription: '剧本描述',
|
scriptDescription: '剧本描述',
|
||||||
submit: '确定',
|
submit: '确定',
|
||||||
scriptNameRule: '请输入剧本名称',
|
scriptNameRule: '请输入剧本名称',
|
||||||
scriptDescriptionRule: '请输入剧本描述',
|
scriptDescriptionRule: '请输入剧本描述',
|
||||||
createScriptSuccess: '创建剧本成功',
|
createScriptSuccess: '创建剧本成功',
|
||||||
createScriptFail: '创建剧本失败',
|
createScriptFail: '创建剧本失败',
|
||||||
scriptDetail: '剧本详情',
|
scriptDetail: '剧本详情',
|
||||||
scriptRecord: '编制',
|
scriptRecord: '编制',
|
||||||
scriptCreate: '创建',
|
scriptCreate: '创建',
|
||||||
scriptModify: '修改',
|
scriptModify: '修改',
|
||||||
scriptDelete: '删除',
|
scriptDelete: '删除',
|
||||||
getScriptFail: '获取剧本信息失败',
|
getScriptFail: '获取剧本信息失败',
|
||||||
createSimulationFail: '创建仿真失败',
|
createSimulationFail: '创建仿真失败',
|
||||||
modifyScriptSuccess: '修改剧本成功',
|
modifyScriptSuccess: '修改剧本成功',
|
||||||
modifyScriptFail: '修改剧本失败',
|
modifyScriptFail: '修改剧本失败',
|
||||||
deleteScriptTip: '此操作将删除此剧本, 是否继续?',
|
deleteScriptTip: '此操作将删除此剧本, 是否继续?',
|
||||||
deleteScriptSucess: '删除成功',
|
deleteScriptSucess: '删除成功',
|
||||||
deleteScriptFail: '删除失败',
|
deleteScriptFail: '删除失败',
|
||||||
scriptRecordTitle: '剧本编制',
|
scriptRecordTitle: '剧本编制',
|
||||||
drivingPause: '暂停',
|
drivingPause: '暂停',
|
||||||
recoverAndExecute: '恢复并执行',
|
recoverAndExecute: '恢复并执行',
|
||||||
resetScript: '重置剧本',
|
resetScript: '重置剧本',
|
||||||
pauseFail: '暂停失败',
|
pauseFail: '暂停失败',
|
||||||
recoverFail: '恢复失败',
|
recoverFail: '恢复失败',
|
||||||
saveBackgroundSuceess: '保存背景成功',
|
saveBackgroundSuceess: '保存背景成功',
|
||||||
updateLocationFail: '更新定位失败',
|
updateLocationFail: '更新定位失败',
|
||||||
saveBackgroundFail: '保存背景失败',
|
saveBackgroundFail: '保存背景失败',
|
||||||
saveDataSucess: '保存数据成功',
|
saveDataSucess: '保存数据成功',
|
||||||
saveDataFail: '保存数据失败',
|
saveDataFail: '保存数据失败',
|
||||||
clearDataTip: '此操作将会清除已保存的编制数据, 是否继续?',
|
clearDataTip: '此操作将会清除已保存的编制数据, 是否继续?',
|
||||||
resetDataSuccess: '重置剧本成功',
|
resetDataSuccess: '重置剧本成功',
|
||||||
resetDataFail: '重置剧本失败',
|
resetDataFail: '重置剧本失败',
|
||||||
|
|
||||||
allRoles: '所有角色',
|
allRoles: '所有角色',
|
||||||
actors: '演员角色',
|
actors: '演员角色',
|
||||||
roleSexMale: '男',
|
roleSexMale: '男',
|
||||||
roleSexFemale: '女',
|
roleSexFemale: '女',
|
||||||
selectScriptActorSuccess: '选择剧本角色成功',
|
selectScriptActorSuccess: '选择剧本角色成功',
|
||||||
selectScriptActorFail: '选择剧本角色失败',
|
selectScriptActorFail: '选择剧本角色失败',
|
||||||
cancleScriptActorSuccess: '取消剧本角色成功',
|
cancleScriptActorSuccess: '取消剧本角色成功',
|
||||||
cancleScriptActorFail: '取消剧本角色失败',
|
cancleScriptActorFail: '取消剧本角色失败',
|
||||||
modifyScriptActorSexSuccess: '修改剧本成员性别成功',
|
modifyScriptActorSexSuccess: '修改剧本成员性别成功',
|
||||||
modifyScriptActorSexFail: '修改剧本成员性别失败',
|
modifyScriptActorSexFail: '修改剧本成员性别失败',
|
||||||
|
|
||||||
addConversition: '添加对话',
|
addConversition: '添加对话',
|
||||||
narrator: '讲述者',
|
narrator: '讲述者',
|
||||||
narratorRules: '请选择讲述者',
|
narratorRules: '请选择讲述者',
|
||||||
receiver: '接收者',
|
receiver: '接收者',
|
||||||
receiverRules: '请选择接收者',
|
receiverRules: '请选择接收者',
|
||||||
conversitionContent: '内容',
|
conversitionContent: '内容',
|
||||||
addCommand: '添加指令',
|
addCommand: '添加指令',
|
||||||
executor: '执行者',
|
executor: '执行者',
|
||||||
executorRules: '请选择执行者',
|
executorRules: '请选择执行者',
|
||||||
executeCommand: '执行指令',
|
executeCommand: '执行指令',
|
||||||
executeCommandRules: '请选择执行指令',
|
executeCommandRules: '请选择执行指令',
|
||||||
startStation: '起始站台',
|
startStation: '起始站台',
|
||||||
startStationRules: '请选择起始站台',
|
startStationRules: '请选择起始站台',
|
||||||
endStation: '终点站台',
|
endStation: '终点站台',
|
||||||
endStationRules: '请选择终点站台',
|
endStationRules: '请选择终点站台',
|
||||||
|
drivingMode:'列车驾驶模式',
|
||||||
|
drivingModeRules:'请选择列车驾驶模式',
|
||||||
|
speed:'速度',
|
||||||
|
signal:'信号机',
|
||||||
|
speedRules:'请输入速度',
|
||||||
|
signalRules:'请选择信号机',
|
||||||
|
|
||||||
addCommandButton: '添加指令',
|
addCommandButton: '添加指令',
|
||||||
addConversitionButton: '添加对话',
|
addConversitionButton: '添加对话',
|
||||||
conversitionContentRules: '请输入内容',
|
conversitionContentRules: '请输入内容',
|
||||||
addCommandSucess: '添加指令成功',
|
addCommandSucess: '添加指令成功',
|
||||||
addCommandFail: '添加指令失败',
|
addCommandFail: '添加指令失败',
|
||||||
addConversitionSuccess: '添加对话成功',
|
addConversitionSuccess: '添加对话成功',
|
||||||
addConversitionFail: '添加对话失败',
|
addConversitionFail: '添加对话失败',
|
||||||
modifyConversitionSuccess: '修改对话成功',
|
modifyConversitionSuccess: '修改对话成功',
|
||||||
modifyConversitionFail: '修改对话失败',
|
modifyConversitionFail: '修改对话失败',
|
||||||
modifyConversition: '修改对话',
|
modifyConversition: '修改对话',
|
||||||
modifyConversitionButton: '修改',
|
modifyConversitionButton: '修改',
|
||||||
|
|
||||||
drivingByPlan: '按计划行车',
|
drivingByPlan: '按计划行车',
|
||||||
scriptBack: '返回',
|
scriptBack: '返回',
|
||||||
speakTo: '对',
|
speakTo: '对',
|
||||||
executeCommandTips: '执行指令: ',
|
executeCommandTips: '执行指令: ',
|
||||||
operate: '操作',
|
operate: '操作',
|
||||||
scriptList: '剧本列表',
|
scriptList: '剧本列表',
|
||||||
applyPublish: '申请发布',
|
applyPublish: '申请发布',
|
||||||
preview: '预览',
|
preview: '预览',
|
||||||
status: '状态',
|
status: '状态',
|
||||||
applyRevoke: '撤回',
|
applyRevoke: '撤回',
|
||||||
publish: '发布',
|
publish: '发布',
|
||||||
revokeReason: '驳回原因',
|
revokeReason: '驳回原因',
|
||||||
language: '语言',
|
language: '语言',
|
||||||
chinese: '中文',
|
chinese: '中文',
|
||||||
english: '英文',
|
english: '英文',
|
||||||
publishScript: '发布剧本',
|
publishScript: '发布剧本',
|
||||||
releaseScriptSuccess: '申请发布成功',
|
releaseScriptSuccess: '申请发布成功',
|
||||||
releaseScriptFailed: '申请发布失败',
|
releaseScriptFailed: '申请发布失败',
|
||||||
publishScriptSuccess: '发布成功',
|
publishScriptSuccess: '发布成功',
|
||||||
publishScriptFailed: '发布失败',
|
publishScriptFailed: '发布失败',
|
||||||
releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
|
releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
|
||||||
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
|
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?',
|
||||||
inputScriptName: '请输入剧本',
|
inputScriptName: '请输入剧本',
|
||||||
selectMap: '请选择地图',
|
selectMap: '请选择地图',
|
||||||
inputScriptDescription: '请输入剧本描述'
|
inputScriptDescription: '请输入剧本描述'
|
||||||
};
|
};
|
||||||
|
@ -1,52 +1,57 @@
|
|||||||
export default {
|
export default {
|
||||||
code: '编码',
|
code: '编码',
|
||||||
name: '名称',
|
name: '名称',
|
||||||
status: '状态',
|
status: '状态',
|
||||||
remarks: '备注',
|
remarks: '备注',
|
||||||
createDirectory: '创建目录',
|
createDirectory: '创建目录',
|
||||||
editDictionary: '编辑目录',
|
editDictionary: '编辑目录',
|
||||||
deleteSuccess: '删除成功',
|
deleteSuccess: '删除成功',
|
||||||
createSuccess: '创建成功',
|
createSuccess: '创建成功',
|
||||||
updateSuccess: '更新成功',
|
updateSuccess: '更新成功',
|
||||||
destory: '销 毁',
|
destory: '销 毁',
|
||||||
simulationGroup: '仿真Group',
|
simulationGroup: '仿真Group',
|
||||||
userName: '用户名',
|
userName: '用户名',
|
||||||
skinCode: '皮肤编号',
|
skinCode: '皮肤编号',
|
||||||
prdType: '产品类型',
|
prdType: '产品类型',
|
||||||
simulationType: '仿真类型',
|
simulationType: '仿真类型',
|
||||||
simulationGroupId: '仿真成员ID',
|
simulationGroupId: '仿真成员ID',
|
||||||
productName: '产品名称',
|
productName: '产品名称',
|
||||||
isError: '是否错误',
|
isError: '是否错误',
|
||||||
isSuspend: '是否暂停',
|
isSuspend: '是否暂停',
|
||||||
isDrivingAsplanned: '是否按计划行车',
|
isDrivingAsplanned: '是否按计划行车',
|
||||||
wellDelUserSimulation: '此操作将删除此用户仿真数据, 是否继续?',
|
wellDelUserSimulation: '此操作将删除此用户仿真数据, 是否继续?',
|
||||||
createDetail: '创建明细',
|
createDetail: '创建明细',
|
||||||
editDetail: '编辑明细',
|
editDetail: '编辑明细',
|
||||||
mapName: '地图名称',
|
mapName: '地图名称',
|
||||||
trainingName: '实训名称',
|
trainingName: '实训名称',
|
||||||
trainingUseTime: '实训用时',
|
trainingUseTime: '实训用时',
|
||||||
minute: '分',
|
minute: '分',
|
||||||
second: '秒',
|
second: '秒',
|
||||||
createSimulationTitle: '创建仿真信息',
|
createSimulationTitle: '创建仿真信息',
|
||||||
addSuccess: '添加成功',
|
addSuccess: '添加成功',
|
||||||
pleaseInputNames: '请输入昵称/名字/手机号',
|
pleaseInputNames: '请输入昵称/名字/手机号',
|
||||||
examUser: '考试用户',
|
examUser: '考试用户',
|
||||||
examScore: '考试成绩',
|
examScore: '考试成绩',
|
||||||
examResult: '考试结果',
|
examResult: '考试结果',
|
||||||
examName: '试卷名称',
|
examName: '试卷名称',
|
||||||
wellDelExamResult: '此操作将删除此考试结果, 是否继续?',
|
wellDelExamResult: '此操作将删除此考试结果, 是否继续?',
|
||||||
editExamDetail: '编辑考试详情',
|
editExamDetail: '编辑考试详情',
|
||||||
subscribeMap: '订阅地图',
|
subscribeMap: '订阅地图',
|
||||||
roles: '角色',
|
roles: '角色',
|
||||||
nickname: '昵称',
|
nickname: '昵称',
|
||||||
wellDelType: '此操作将删除该类型, 是否继续?',
|
wellDelType: '此操作将删除该类型, 是否继续?',
|
||||||
permission: '权限',
|
permission: '权限',
|
||||||
editUserPermission: '编辑用户权限',
|
editUserPermission: '编辑用户权限',
|
||||||
lessonName: '课程名称',
|
lessonName: '课程名称',
|
||||||
selectTraining: '选择实训',
|
selectTraining: '选择实训',
|
||||||
createUserTraining: '创建用户实训',
|
createUserTraining: '创建用户实训',
|
||||||
editTrainingDetail: '编辑实训详情',
|
editTrainingDetail: '编辑实训详情',
|
||||||
trainingTime: '实训时长',
|
trainingTime: '实训时长',
|
||||||
subscribeToTheMapList: '订阅地图列表:',
|
subscribeToTheMapList: '订阅地图列表:',
|
||||||
editSimulationDetails: '编辑仿真详情'
|
editSimulationDetails: '编辑仿真详情',
|
||||||
|
newsBulletin: '消息公告',
|
||||||
|
newsHeadlines: '消息标题:',
|
||||||
|
newsContent: '消息内容:',
|
||||||
|
whetherTheNewsCanBeClosed: '消息是否可关闭:',
|
||||||
|
push: '推送'
|
||||||
};
|
};
|
||||||
|
@ -219,5 +219,7 @@ export default {
|
|||||||
setProjectSuccess: '设置归属项目成功!',
|
setProjectSuccess: '设置归属项目成功!',
|
||||||
setProjectFail: '设置归属项目失败!',
|
setProjectFail: '设置归属项目失败!',
|
||||||
copyMapSuccess: '复制地图成功!',
|
copyMapSuccess: '复制地图成功!',
|
||||||
copyMapFail: '复制地图失败!'
|
copyMapFail: '复制地图失败!',
|
||||||
|
pushNewsSuccess: '推送消息成功!',
|
||||||
|
pushNewsFailed: '推送消息失败!'
|
||||||
};
|
};
|
||||||
|
@ -1,36 +1,37 @@
|
|||||||
export default {
|
export default {
|
||||||
comprehensiveTrainingManager: '综合实训管理者:',
|
comprehensiveTrainingManager: '综合实训管理者:',
|
||||||
comprehensiveDrillRoom: '综合演练室',
|
comprehensiveDrillRoom: '综合演练室',
|
||||||
numberOfAssignableRoles: '可分配角色数量:',
|
numberOfAssignableRoles: '可分配角色数量:',
|
||||||
dispatcher: '调度员',
|
dispatcher: '调度员',
|
||||||
increaseDispatchers: '增加调度人员',
|
increaseDispatchers: '增加调度人员',
|
||||||
stationAttendant: '车站值班员',
|
stationAttendant: '车站值班员',
|
||||||
increaseStationAttendant: '增加车站值班员',
|
increaseStationAttendant: '增加车站值班员',
|
||||||
teacher: '教员',
|
teacher: '教员',
|
||||||
increaseTeacher: '增加教员',
|
increaseTeacher: '增加教员',
|
||||||
universalAccount: '通号',
|
universalAccount: '通号',
|
||||||
increaseUniversalAccount: '增加通号',
|
increaseUniversalAccount: '增加通号',
|
||||||
driver: '司机',
|
driver: '司机',
|
||||||
increaseDriver: '增加司机',
|
increaseDriver: '增加司机',
|
||||||
bigScreen: '大屏',
|
bigScreen: '大屏',
|
||||||
increaseBigScreen: '增加大屏',
|
increaseBigScreen: '增加大屏',
|
||||||
destroyRoom: '销毁房间',
|
destroyRoom: '销毁房间',
|
||||||
generatingQRCode: '生成二维码',
|
generatingQRCode: '生成二维码',
|
||||||
startSimulation: '开始仿真',
|
startSimulation: '开始仿真',
|
||||||
enterSimulation: '进入仿真',
|
enterSimulation: '进入仿真',
|
||||||
endSimulation: '结束仿真',
|
endSimulation: '结束仿真',
|
||||||
distributeTheRoomQRCode: '分发房间二维码',
|
distributeTheRoomQRCode: '分发房间二维码',
|
||||||
increaseIbp: '增加IBP',
|
increaseIbp: '增加IBP',
|
||||||
kickOutTheRoom: '踢出房间',
|
kickOutTheRoom: '踢出房间',
|
||||||
sending: '发送中...',
|
sending: '发送中...',
|
||||||
holdAndTalk: '按住说话',
|
holdAndTalk: '按住说话',
|
||||||
recording: '录音中...',
|
recording: '录音中...',
|
||||||
sendText: '发送文字',
|
sendText: '发送文字',
|
||||||
left: '左',
|
left: '左',
|
||||||
right: '右',
|
right: '右',
|
||||||
realDevice: '真实设备',
|
realDevice: '真实设备',
|
||||||
plcGatewayOnline: '[PLC网关在线]',
|
plcGatewayOnline: '[PLC网关在线]',
|
||||||
plcGatewayOffline: '[PLC网关离线]',
|
plcGatewayOffline: '[PLC网关离线]',
|
||||||
uplinkPlatform: '上行站台',
|
uplinkPlatform: '上行站台',
|
||||||
downlinkPlatform: '下行站台'
|
downlinkPlatform: '下行站台',
|
||||||
|
ibp:'IBP'
|
||||||
};
|
};
|
||||||
|
@ -4,107 +4,113 @@ const deviceRender = {};
|
|||||||
|
|
||||||
/** IbpText渲染配置*/
|
/** IbpText渲染配置*/
|
||||||
deviceRender[deviceType.IbpText] = {
|
deviceRender[deviceType.IbpText] = {
|
||||||
_type: deviceType.IbpText,
|
_type: deviceType.IbpText,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** SquareButton渲染配置*/
|
/** SquareButton渲染配置*/
|
||||||
deviceRender[deviceType.SquareButton] = {
|
deviceRender[deviceType.SquareButton] = {
|
||||||
_type: deviceType.SquareButton,
|
_type: deviceType.SquareButton,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** WarnButton渲染配置*/
|
/** WarnButton渲染配置*/
|
||||||
deviceRender[deviceType.WarnButton] = {
|
deviceRender[deviceType.WarnButton] = {
|
||||||
_type: deviceType.WarnButton,
|
_type: deviceType.WarnButton,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Arrow渲染配置*/
|
/** Arrow渲染配置*/
|
||||||
deviceRender[deviceType.Arrow] = {
|
deviceRender[deviceType.Arrow] = {
|
||||||
_type: deviceType.Arrow,
|
_type: deviceType.Arrow,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 2
|
z: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
/** TipBox渲染配置*/
|
/** TipBox渲染配置*/
|
||||||
deviceRender[deviceType.TipBox] = {
|
deviceRender[deviceType.TipBox] = {
|
||||||
_type: deviceType.TipBox,
|
_type: deviceType.TipBox,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 3
|
z: 3
|
||||||
};
|
};
|
||||||
|
|
||||||
/** BackGround渲染配置*/
|
/** BackGround渲染配置*/
|
||||||
deviceRender[deviceType.Background] = {
|
deviceRender[deviceType.Background] = {
|
||||||
_type: deviceType.Background,
|
_type: deviceType.Background,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 0
|
z: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
/** CircularLamp渲染配置 */
|
/** CircularLamp渲染配置 */
|
||||||
deviceRender[deviceType.CircularLamp] = {
|
deviceRender[deviceType.CircularLamp] = {
|
||||||
_type: deviceType.CircularLamp,
|
_type: deviceType.CircularLamp,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** AppendageBox渲染配置 */
|
/** AppendageBox渲染配置 */
|
||||||
deviceRender[deviceType.AppendageBox] = {
|
deviceRender[deviceType.AppendageBox] = {
|
||||||
_type: deviceType.AppendageBox,
|
_type: deviceType.AppendageBox,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 1
|
z: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** IbpLine渲染配置 */
|
/** IbpLine渲染配置 */
|
||||||
deviceRender[deviceType.IbpLine] = {
|
deviceRender[deviceType.IbpLine] = {
|
||||||
_type: deviceType.IbpLine,
|
_type: deviceType.IbpLine,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 1
|
z: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Elevator 渲染配置 */
|
/** Elevator 渲染配置 */
|
||||||
deviceRender[deviceType.Elevator] = {
|
deviceRender[deviceType.Elevator] = {
|
||||||
_type: deviceType.Elevator,
|
_type: deviceType.Elevator,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 2
|
z: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Key 渲染配置 */
|
/** Key 渲染配置 */
|
||||||
deviceRender[deviceType.Key] = {
|
deviceRender[deviceType.Key] = {
|
||||||
_type: deviceType.Key,
|
_type: deviceType.Key,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** TeleTerminal 渲染配置 */
|
/** TeleTerminal 渲染配置 */
|
||||||
deviceRender[deviceType.TeleTerminal] = {
|
deviceRender[deviceType.TeleTerminal] = {
|
||||||
_type: deviceType.TeleTerminal,
|
_type: deviceType.TeleTerminal,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Clock 渲染配置*/
|
/** Clock 渲染配置*/
|
||||||
deviceRender[deviceType.Clock] = {
|
deviceRender[deviceType.Clock] = {
|
||||||
_type: deviceType.Clock,
|
_type: deviceType.Clock,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** RotateTip 渲染配置 */
|
/** RotateTip 渲染配置 */
|
||||||
deviceRender[deviceType.RotateTip] = {
|
deviceRender[deviceType.RotateTip] = {
|
||||||
_type: deviceType.RotateTip,
|
_type: deviceType.RotateTip,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Alarm */
|
/** Alarm */
|
||||||
deviceRender[deviceType.Alarm] = {
|
deviceRender[deviceType.Alarm] = {
|
||||||
_type: deviceType.Alarm,
|
_type: deviceType.Alarm,
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
z: 4
|
z: 4
|
||||||
|
};
|
||||||
|
|
||||||
|
deviceRender[deviceType.CheckBox] = {
|
||||||
|
_type: deviceType.CheckBox,
|
||||||
|
zlevel: 10,
|
||||||
|
z: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
export default deviceRender;
|
export default deviceRender;
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
const deviceType = {
|
const deviceType = {
|
||||||
IbpText: 'IbpText',
|
IbpText: 'IbpText',
|
||||||
SquareButton: 'SquareButton',
|
SquareButton: 'SquareButton',
|
||||||
Arrow: 'Arrow',
|
Arrow: 'Arrow',
|
||||||
TipBox: 'TipBox',
|
TipBox: 'TipBox',
|
||||||
Background: 'Background',
|
Background: 'Background',
|
||||||
CircularLamp: 'CircularLamp',
|
CircularLamp: 'CircularLamp',
|
||||||
IbpLine: 'IbpLine',
|
IbpLine: 'IbpLine',
|
||||||
AppendageBox: 'AppendageBox',
|
AppendageBox: 'AppendageBox',
|
||||||
Alarm: 'Alarm',
|
Alarm: 'Alarm',
|
||||||
Elevator: 'Elevator',
|
Elevator: 'Elevator',
|
||||||
Key: 'Key',
|
Key: 'Key',
|
||||||
TeleTerminal: 'TeleTerminal',
|
TeleTerminal: 'TeleTerminal',
|
||||||
Clock: 'Clock',
|
Clock: 'Clock',
|
||||||
RotateTip: 'RotateTip'
|
RotateTip: 'RotateTip',
|
||||||
|
CheckBox: 'CheckBox'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default deviceType;
|
export default deviceType;
|
||||||
|
@ -303,5 +303,25 @@ class IbpPan {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderCheckBox(model) {
|
||||||
|
const type = model._type;
|
||||||
|
const code = model.code;
|
||||||
|
const oDevice = this.ibpDevice[code] || deviceFactory(type, model);
|
||||||
|
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, model));
|
||||||
|
delete this.ibpDevice[code];
|
||||||
|
this.$painter.delete(oDevice);
|
||||||
|
if (!model._dispose) {
|
||||||
|
this.ibpDevice[code] = nDevice;
|
||||||
|
this.$painter.add(nDevice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
deleteCheckBox(code) {
|
||||||
|
const oDevice = this.ibpDevice[code];
|
||||||
|
if (oDevice) {
|
||||||
|
delete this.ibpDevice[code];
|
||||||
|
this.$painter.delete(oDevice);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export default IbpPan;
|
export default IbpPan;
|
||||||
|
@ -4,193 +4,282 @@ import * as eventTool from 'zrender/src/core/event';
|
|||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
|
||||||
class EventModel {
|
class EventModel {
|
||||||
constructor(e) {
|
constructor(e) {
|
||||||
this.clientX = e.event.clientX;
|
this.clientX = e.event.clientX;
|
||||||
this.clientY = e.event.clientY;
|
this.clientY = e.event.clientY;
|
||||||
|
|
||||||
let view = e.target;
|
let view = e.target;
|
||||||
while (view) {
|
while (view) {
|
||||||
if (Object.values(deviceType).includes(view._type)) {
|
if (Object.values(deviceType).includes(view._type)) {
|
||||||
this.deviceCode = view._code;
|
this.deviceCode = view._code;
|
||||||
this.deviceType = view._type;
|
this.deviceType = view._type;
|
||||||
this.deviceModel = view.model;
|
this.deviceModel = view.model;
|
||||||
this.eventTarget = view;
|
this.eventTarget = view;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
view = view.parent;
|
view = view.parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MouseController extends Eventful {
|
class MouseController extends Eventful {
|
||||||
constructor(ibp) {
|
constructor(ibp) {
|
||||||
super();
|
super();
|
||||||
this.$ibp = ibp;
|
this.$ibp = ibp;
|
||||||
this.$zr = ibp.getZr();
|
this.$zr = ibp.getZr();
|
||||||
this.isAllowDragging=ibp.isAllowDragging||false;
|
this.isAllowDragging = ibp.isAllowDragging || false; // 是否在绘图中,仅绘图状态下可拖拽
|
||||||
this.events = ibp.getEvents();
|
this.events = ibp.getEvents();
|
||||||
this._dragging = false;
|
this._dragging = false; // 是否在拖拽状态
|
||||||
this.initHandler(this.$zr);
|
this.deviceList = [];
|
||||||
}
|
this.rightClickPoint = {
|
||||||
|
x: 0,
|
||||||
|
y: 0
|
||||||
|
}; // 右键点击坐标
|
||||||
|
this.initHandler(this.$zr);
|
||||||
|
}
|
||||||
|
|
||||||
initHandler(zr) {
|
initHandler(zr) {
|
||||||
if (zr) {
|
if (zr) {
|
||||||
zr.on('contextmenu', this.contextmenu, this);
|
zr.on('contextmenu', this.contextmenu, this);
|
||||||
zr.on('mousemove', this.moveEvent, this);
|
zr.on('mousemove', this.moveEvent, this);
|
||||||
zr.on('click', this.click, this);
|
zr.on('click', this.click, this);
|
||||||
|
|
||||||
this.enable = function (opts) {
|
this.enable = function (opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
||||||
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
||||||
|
|
||||||
this.disable();
|
this.disable();
|
||||||
|
|
||||||
zr.on('mousedown', this.mousedown, this);
|
zr.on('mousedown', this.mousedown, this);
|
||||||
zr.on('mousemove', this.mousemove, this);
|
zr.on('mousemove', this.mousemove, this);
|
||||||
zr.on('mouseup', this.mouseup, this);
|
zr.on('mouseup', this.mouseup, this);
|
||||||
zr.on('touchstart', this.mousedown, this);
|
zr.on('touchstart', this.mousedown, this);
|
||||||
zr.on('touchmove', this.mousemove, this);
|
zr.on('touchmove', this.mousemove, this);
|
||||||
zr.on('touchend', this.mouseup, this);
|
zr.on('touchend', this.mouseup, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.disable = function () {
|
this.disable = function () {
|
||||||
zr.off('mousedown', this.mousedown);
|
zr.off('mousedown', this.mousedown);
|
||||||
zr.off('mousemove', this.mousemove);
|
zr.off('mousemove', this.mousemove);
|
||||||
zr.off('mouseup', this.mouseup);
|
zr.off('mouseup', this.mouseup);
|
||||||
zr.off('touchstart', this.mousedown);
|
zr.off('touchstart', this.mousedown);
|
||||||
zr.off('touchmove', this.mousemove);
|
zr.off('touchmove', this.mousemove);
|
||||||
zr.off('touchend', this.mouseup);
|
zr.off('touchend', this.mouseup);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.dispose = function () {
|
this.dispose = function () {
|
||||||
zr.off('click', this.click);
|
zr.off('click', this.click);
|
||||||
zr.off('contextmenu', this.contextmenu);
|
zr.off('contextmenu', this.contextmenu);
|
||||||
zr.off('mousemove', this.moveEvent);
|
zr.off('mousemove', this.moveEvent);
|
||||||
this.disable();
|
this.disable();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.isDragging = function () { return this._dragging; };
|
this.isDragging = function () { return this._dragging; };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setAllowDragging(data) {
|
setAllowDragging(data) {
|
||||||
this.isAllowDragging=data;
|
this.isAllowDragging = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
mousedown(e) {
|
mousedown(e) {
|
||||||
if (eventTool.notLeftMouse(e)) {
|
e.event.preventDefault();
|
||||||
return;
|
e.event.stopPropagation();
|
||||||
}
|
const em = new EventModel(e);
|
||||||
e.event.preventDefault();
|
this.eventTarget = em.eventTarget;
|
||||||
e.event.stopPropagation();
|
this._offsetX = e.offsetX;
|
||||||
const em = new EventModel(e);
|
this._offsetY = e.offsetY;
|
||||||
this.eventTarget = em.eventTarget;
|
this._x = e.offsetX;
|
||||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
this._y = e.offsetY;
|
||||||
this.eventTarget.setCursor('pointer');
|
this._dragging = true;
|
||||||
}
|
if (e.which === 3) {
|
||||||
this._offsetX=e.offsetX;
|
this.handleMouseDownRight(e);
|
||||||
this._offsetY=e.offsetY;
|
} else if (e.which === 1) {
|
||||||
this._x = e.offsetX;
|
this.handleMouseDownLeft(e);
|
||||||
this._y = e.offsetY;
|
} else if (e.which === 2) {
|
||||||
this._dragging = true;
|
this.handleMouseDownWheel(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mousemove(e) {
|
mousemove(e) {
|
||||||
if (eventTool.notLeftMouse(e) ||
|
const oldX = this._x;
|
||||||
!this._moveOnMouseMove ||
|
const oldY = this._y;
|
||||||
!this._dragging || !this.isAllowDragging
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const oldX = this._x;
|
const dx = e.offsetX - oldX;
|
||||||
const oldY = this._y;
|
const dy = e.offsetY - oldY;
|
||||||
|
|
||||||
const dx = e.offsetX - oldX;
|
this._x = e.offsetX;
|
||||||
const dy = e.offsetY - oldY;
|
this._y = e.offsetY;
|
||||||
|
if (e.which === 3) {
|
||||||
|
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
|
||||||
|
} else if (e.which === 1) {
|
||||||
|
this.handleMouseMoveLeft(e, dx, dy, oldX, oldY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this._x = e.offsetX;
|
mouseup(e) {
|
||||||
this._y = e.offsetY;
|
if (eventTool.notLeftMouse(e) || !this.eventTarget ) {
|
||||||
if (this._dragging) {
|
return;
|
||||||
if ((this.eventTarget && this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
|
}
|
||||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
if (this.deviceList.length) {
|
||||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
this.deviceList.forEach(item => {
|
||||||
return true;
|
item.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||||
} else if (this.isAllowDragging && this.eventTarget) {
|
});
|
||||||
this.eventTarget.grouper.drift(dx, dy, e);
|
this.deviceList = [];
|
||||||
}
|
this.$ibp.deleteCheckBox('check_box');
|
||||||
} else {
|
this.eventTarget = '';
|
||||||
return true;
|
this._dragging = false;
|
||||||
}
|
this.deviceList = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.isAllowDragging) {
|
||||||
|
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||||
|
this.eventTarget.dirty();
|
||||||
|
}
|
||||||
|
if (this.eventTarget._type === deviceType.Background) {
|
||||||
|
this.eventTarget.setCursor('default');
|
||||||
|
}
|
||||||
|
this.eventTarget = '';
|
||||||
|
this._dragging = false;
|
||||||
|
this.deviceList = [];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
contextmenu(e) {
|
||||||
|
var em = this.checkEvent(e);
|
||||||
|
this.trigger(this.events.Contextmenu, em);
|
||||||
|
}
|
||||||
|
click(e) {
|
||||||
|
var em = this.checkEvent(e);
|
||||||
|
this.trigger(this.events.Selected, em);
|
||||||
|
}
|
||||||
|
moveEvent(e) {
|
||||||
|
const newEm = new EventModel(e);
|
||||||
|
const trainDetails = store.state.map.trainDetails;
|
||||||
|
if (trainDetails) {
|
||||||
|
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
|
||||||
|
var instance = (this.$ibp.getDeviceByCode(trainDetails.code) || {} ).instance;
|
||||||
|
instance && instance.removeTrainDetail && instance.removeTrainDetail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mouseup(e) {
|
checkEvent(e) {
|
||||||
if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) {
|
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
|
||||||
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
var newEm = new EventModel(e);
|
||||||
this.eventTarget.dirty();
|
if ([1, 3].includes(e.which)) {
|
||||||
}
|
// 查找之前和当前鼠标选中的实例
|
||||||
// debugger;
|
var oldDevice = this.$ibp.getDeviceByCode(oldEm.deviceCode) || {};
|
||||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
var newDevice = this.$ibp.getDeviceByCode(newEm.deviceCode) || {};
|
||||||
// console.log('111-------');
|
var oldInstance = (this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
|
||||||
this.eventTarget.setCursor('default');
|
var newInstance = (this.$ibp.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
|
||||||
}
|
|
||||||
this.eventTarget = '';
|
|
||||||
this._dragging = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
contextmenu(e) {
|
// 如果之前和当前选中的实例不一致
|
||||||
var em = this.checkEvent(e);
|
if (oldInstance != newInstance) {
|
||||||
this.trigger(this.events.Contextmenu, em);
|
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||||
}
|
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||||
click(e) {
|
// 视图数据设置点击标志,同步执行
|
||||||
var em = this.checkEvent(e);
|
oldDevice['down'] = false;
|
||||||
this.trigger(this.events.Selected, em);
|
oldInstance.mouseEvent['mouseout'](e);
|
||||||
}
|
}
|
||||||
moveEvent(e) {
|
|
||||||
const newEm = new EventModel(e);
|
|
||||||
const trainDetails = store.state.map.trainDetails;
|
|
||||||
if (trainDetails) {
|
|
||||||
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
|
|
||||||
var instance = (this.$ibp.getDeviceByCode(trainDetails.code) || {} ).instance;
|
|
||||||
instance && instance.removeTrainDetail && instance.removeTrainDetail();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
checkEvent(e) {
|
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||||
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
|
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||||
var newEm = new EventModel(e);
|
newDevice['down'] = true;
|
||||||
if ([1, 3].includes(e.which)) {
|
newInstance.mouseEvent['mouseover'](e);
|
||||||
// 查找之前和当前鼠标选中的实例
|
}
|
||||||
var oldDevice = this.$ibp.getDeviceByCode(oldEm.deviceCode) || {};
|
}
|
||||||
var newDevice = this.$ibp.getDeviceByCode(newEm.deviceCode) || {};
|
|
||||||
var oldInstance = (this.$ibp.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
|
|
||||||
var newInstance = (this.$ibp.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
|
|
||||||
|
|
||||||
// 如果之前和当前选中的实例不一致
|
// 保存当前实例到全局
|
||||||
if (oldInstance != newInstance) {
|
this.$zr.curEvent = e;
|
||||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
}
|
||||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
|
||||||
// 视图数据设置点击标志,同步执行
|
|
||||||
oldDevice['down'] = false;
|
|
||||||
oldInstance.mouseEvent['mouseout'](e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
return newEm;
|
||||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
}
|
||||||
newDevice['down'] = true;
|
/** 处理鼠标右键按下事件 */
|
||||||
newInstance.mouseEvent['mouseover'](e);
|
handleMouseDownRight(e) {
|
||||||
}
|
this.rightClickPoint.x = e.offsetX;
|
||||||
}
|
this.rightClickPoint.y = e.offsetY;
|
||||||
|
}
|
||||||
// 保存当前实例到全局
|
/** 处理鼠标左键按下事件 */
|
||||||
this.$zr.curEvent = e;
|
handleMouseDownLeft(e) {
|
||||||
}
|
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||||
|
this.eventTarget.setCursor('pointer');
|
||||||
return newEm;
|
this.$ibp.deleteCheckBox('check_box');
|
||||||
}
|
} else if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
|
||||||
|
this.handleBoundingRect(this.eventTarget);
|
||||||
|
} else {
|
||||||
|
this.$ibp.deleteCheckBox('check_box');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 处理滚轮按下事件 */
|
||||||
|
handleMouseDownWheel(e) {
|
||||||
|
this.deviceList = [];
|
||||||
|
Object.values(this.$ibp.ibpDevice).forEach(item => {
|
||||||
|
if (item.instance._type !== deviceType.Background) {
|
||||||
|
this.deviceList.push(item.instance);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 处理右键拖动事件--- 改变选中区域大小 */
|
||||||
|
handleMouseMoveRight(point2) {
|
||||||
|
const point1 = this.rightClickPoint;
|
||||||
|
const x = Math.min(point1.x, point2.x) + this.$ibp.$options.offsetX;
|
||||||
|
const y = Math.min(point1.y, point2.y) + this.$ibp.$options.offsetY;
|
||||||
|
const width = Math.abs(point1.x - point2.x);
|
||||||
|
const height = Math.abs(point1.y - point2.y);
|
||||||
|
this.$ibp.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height });
|
||||||
|
}
|
||||||
|
/** 处理左键拖动事件--- 图形移动 */
|
||||||
|
handleMouseMoveLeft(e, dx, dy, oldX, oldY) {
|
||||||
|
if (!this._moveOnMouseMove || !this._dragging || !this.isAllowDragging) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 选中区域图形移动
|
||||||
|
if (this.deviceList.length) {
|
||||||
|
this.deviceList.forEach(item => {
|
||||||
|
item.grouper.drift(dx, dy, e);
|
||||||
|
});
|
||||||
|
} 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;
|
export default MouseController;
|
||||||
|
@ -1,100 +1,100 @@
|
|||||||
class Options {
|
class Options {
|
||||||
constructor(opts, trigger) {
|
constructor(opts, trigger) {
|
||||||
this.scaleIndex = 0;
|
this.scaleIndex = 0;
|
||||||
this.scaleList = [
|
this.scaleList = [
|
||||||
0.5, 0.6, 0.7, 0.8, 0.9,
|
0.5, 0.6, 0.7, 0.8, 0.9,
|
||||||
1, 1.2, 1.4, 1.6, 1.8,
|
1, 1.2, 1.4, 1.6, 1.8,
|
||||||
2, 2.2, 2.4, 2.6, 2.8,
|
2, 2.2, 2.4, 2.6, 2.8,
|
||||||
3, 3.2, 3.4, 3.6, 3.8,
|
3, 3.2, 3.4, 3.6, 3.8,
|
||||||
4, 4.2, 4.4, 4.6, 4.8,
|
4, 4.2, 4.4, 4.6, 4.8,
|
||||||
5, 5.2, 5.4, 5.6, 5.8,
|
5, 5.2, 5.4, 5.6, 5.8,
|
||||||
6, 6.2, 6.4, 6.6, 6.8,
|
6, 6.2, 6.4, 6.6, 6.8,
|
||||||
7, 7.2, 7.4, 7.6, 7.8,
|
7, 7.2, 7.4, 7.6, 7.8,
|
||||||
8, 8.2, 8.4, 8.6, 8.8
|
8, 8.2, 8.4, 8.6, 8.8
|
||||||
];
|
];
|
||||||
|
|
||||||
if (Number.isFinite(opts.scaleRate)) {
|
if (Number.isFinite(opts.scaleRate)) {
|
||||||
const idx = this.scaleList.indexOf(opts.scaleRate);
|
const idx = this.scaleList.indexOf(opts.scaleRate);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
this.scaleIndex = idx;
|
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) {
|
update(payload) {
|
||||||
if (Number.isFinite(payload.dx)) {
|
if (Number.isFinite(payload.dx)) {
|
||||||
this.offsetX -= payload.dx;
|
this.offsetX -= payload.dx;
|
||||||
}
|
}
|
||||||
if (Number.isFinite(payload.dy)) {
|
if (Number.isFinite(payload.dy)) {
|
||||||
this.offsetY -= payload.dy;
|
this.offsetY -= payload.dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isFinite(payload.offsetX)) {
|
if (Number.isFinite(payload.offsetX)) {
|
||||||
this.offsetX = payload.offsetX;
|
this.offsetX = payload.offsetX;
|
||||||
}
|
}
|
||||||
if (Number.isFinite(payload.offsetY)) {
|
if (Number.isFinite(payload.offsetY)) {
|
||||||
this.offsetY = payload.offsetY;
|
this.offsetY = payload.offsetY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isFinite(payload.scale)) {
|
if (Number.isFinite(payload.scale)) {
|
||||||
if (Number.isFinite(payload.scale)) {
|
if (Number.isFinite(payload.scale)) {
|
||||||
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
||||||
this.scaleIndex = this.scaleIndex + payload.scale;
|
this.scaleIndex = this.scaleIndex + payload.scale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.scaleRate = this.scaleList[this.scaleIndex];
|
this.scaleRate = this.scaleList[this.scaleIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isFinite(payload.scaleRate)) {
|
if (Number.isFinite(payload.scaleRate)) {
|
||||||
const idx = this.scaleList.indexOf(payload.scaleRate);
|
const idx = this.scaleList.indexOf(payload.scaleRate);
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.scaleIndex = idx;
|
this.scaleIndex = idx;
|
||||||
this.scaleRate = payload.scaleRate;
|
this.scaleRate = payload.scaleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload.disabled === true || payload.disabled === false) {
|
if (payload.disabled === true || payload.disabled === false) {
|
||||||
this.disabled = payload.disabled;
|
this.disabled = payload.disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
||||||
this.moveOnMouseMove = payload.moveOnMouseMove;
|
this.moveOnMouseMove = payload.moveOnMouseMove;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
||||||
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.trigger instanceof Function) { this.trigger(this); }
|
if (this.trigger instanceof Function) { this.trigger(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
getScaleRate(scale) {
|
getScaleRate(scale) {
|
||||||
if (Number.isFinite(scale)) {
|
if (Number.isFinite(scale)) {
|
||||||
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
||||||
return this.scaleList[this.scaleIndex + scale];
|
return this.scaleList[this.scaleIndex + scale];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.scaleList[this.scaleIndex];
|
return this.scaleList[this.scaleIndex];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Options;
|
export default Options;
|
||||||
|
@ -6,185 +6,185 @@ import shapefactory from './shape/factory';
|
|||||||
import TransformHandle from './transformHandle';
|
import TransformHandle from './transformHandle';
|
||||||
|
|
||||||
class Painter {
|
class Painter {
|
||||||
constructor(ibp) {
|
constructor(ibp) {
|
||||||
// 父级实例
|
// 父级实例
|
||||||
this.$ibp = ibp;
|
this.$ibp = ibp;
|
||||||
this.$ibpZr = ibp.getZr();
|
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 {*} dom
|
||||||
* @param {*} config
|
* @param {*} config
|
||||||
*/
|
*/
|
||||||
initLevels() {
|
initLevels() {
|
||||||
|
|
||||||
// 添加父级图层
|
// 添加父级图层
|
||||||
this.parentLevel = new Group({ name: '__parent__' });
|
this.parentLevel = new Group({ name: '__parent__' });
|
||||||
this.$ibpZr.add(this.parentLevel);
|
this.$ibpZr.add(this.parentLevel);
|
||||||
|
|
||||||
// 添加子级图层
|
// 添加子级图层
|
||||||
zrUtil.each(Object.values(deviceType), (type) => {
|
zrUtil.each(Object.values(deviceType), (type) => {
|
||||||
const level = new Group({ name: `__${type}__` });
|
const level = new Group({ name: `__${type}__` });
|
||||||
this.ibpInstanceLevel[type] = level;
|
this.ibpInstanceLevel[type] = level;
|
||||||
this.parentLevel.add(level);
|
this.parentLevel.add(level);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重绘视图
|
* 重绘视图
|
||||||
* @param {*} ibpDevice
|
* @param {*} ibpDevice
|
||||||
*/
|
*/
|
||||||
repaint(ibpDevice) {
|
repaint(ibpDevice) {
|
||||||
// 清空视图
|
// 清空视图
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
||||||
// 创建视图
|
// 创建视图
|
||||||
Object.values(ibpDevice).forEach(device => {
|
Object.values(ibpDevice).forEach(device => {
|
||||||
this.add(device);
|
this.add(device);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加视图
|
* 添加视图
|
||||||
* @param {*} device
|
* @param {*} device
|
||||||
*/
|
*/
|
||||||
add(device) {
|
add(device) {
|
||||||
try {
|
try {
|
||||||
device = Object.assign(device, { event: this.$ibp.$mouseController });
|
device = Object.assign(device, { event: this.$ibp.$mouseController });
|
||||||
const instance = shapefactory(device, this.$ibp);
|
const instance = shapefactory(device, this.$ibp);
|
||||||
if (instance) {
|
if (instance) {
|
||||||
device.instance = instance;
|
device.instance = instance;
|
||||||
this.$transformHandle.transformView(instance);
|
this.$transformHandle.transformView(instance);
|
||||||
this.ibpInstanceLevel[device.model._type].add(instance);
|
this.ibpInstanceLevel[device.model._type].add(instance);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除视图
|
* 删除视图
|
||||||
* @param {*} device
|
* @param {*} device
|
||||||
*/
|
*/
|
||||||
delete(device) {
|
delete(device) {
|
||||||
const instance = device.instance;
|
const instance = device.instance;
|
||||||
if (instance) {
|
if (instance) {
|
||||||
this.ibpInstanceLevel[device.model._type].remove(instance);
|
this.ibpInstanceLevel[device.model._type].remove(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新视图
|
* 更新视图
|
||||||
* @param {*} device
|
* @param {*} device
|
||||||
*/
|
*/
|
||||||
update(device) {
|
update(device) {
|
||||||
if (device) {
|
if (device) {
|
||||||
if (device.model._dispose) {
|
if (device.model._dispose) {
|
||||||
this.delete(device);
|
this.delete(device);
|
||||||
} else {
|
} else {
|
||||||
const instance = device.instance;
|
const instance = device.instance;
|
||||||
if (instance) {
|
if (instance) {
|
||||||
instance.setState(device);
|
instance.setState(device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新transform变化
|
* 更新transform变化
|
||||||
* @param {*} opt
|
* @param {*} opt
|
||||||
*/
|
*/
|
||||||
updateTransform(opt, canvasSize) {
|
updateTransform(opt, canvasSize) {
|
||||||
this.$transformHandle.updateTransform(opt, canvasSize);
|
this.$transformHandle.updateTransform(opt, canvasSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新zrender尺寸
|
* 更新zrender尺寸
|
||||||
* @param {*} opt
|
* @param {*} opt
|
||||||
*/
|
*/
|
||||||
updateZrSize(opt) {
|
updateZrSize(opt) {
|
||||||
this.$transformHandle.updateZrSize(opt);
|
this.$transformHandle.updateZrSize(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化电子时钟时间
|
* 初始化电子时钟时间
|
||||||
*/
|
*/
|
||||||
initClockTime(device, initTime) {
|
initClockTime(device, initTime) {
|
||||||
device.instance.setClockTime(initTime);
|
device.instance.setClockTime(initTime);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 电子时钟开始跑秒或暂停
|
* 电子时钟开始跑秒或暂停
|
||||||
*/
|
*/
|
||||||
setClockStart(device, started) {
|
setClockStart(device, started) {
|
||||||
device.instance.setClockStart(started);
|
device.instance.setClockStart(started);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 设置图层可见
|
* 设置图层可见
|
||||||
* @param {*} code
|
* @param {*} code
|
||||||
*/
|
*/
|
||||||
setLevelVisible(list) {
|
setLevelVisible(list) {
|
||||||
zrUtil.each(Object.values(deviceType), type => {
|
zrUtil.each(Object.values(deviceType), type => {
|
||||||
const level = this.ibpInstanceLevel[type];
|
const level = this.ibpInstanceLevel[type];
|
||||||
if (list.includes(type)) {
|
if (list.includes(type)) {
|
||||||
level.show();
|
level.show();
|
||||||
} else {
|
} else {
|
||||||
level.hide();
|
level.hide();
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新图层
|
* 刷新图层
|
||||||
*/
|
*/
|
||||||
refresh() {
|
refresh() {
|
||||||
this.$ibpZr.refresh();
|
this.$ibpZr.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除图层
|
* 清除图层
|
||||||
*/
|
*/
|
||||||
clearLevel(type) {
|
clearLevel(type) {
|
||||||
const level = this.ibpInstanceLevel[type];
|
const level = this.ibpInstanceLevel[type];
|
||||||
if (level) {
|
if (level) {
|
||||||
level.removeAll();
|
level.removeAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除canvas
|
* 清除canvas
|
||||||
*/
|
*/
|
||||||
clear() {
|
clear() {
|
||||||
zrUtil.each(Object.values(this.ibpInstanceLevel), (level) => {
|
zrUtil.each(Object.values(this.ibpInstanceLevel), (level) => {
|
||||||
level && level.removeAll();
|
level && level.removeAll();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 销毁图层
|
* 销毁图层
|
||||||
*/
|
*/
|
||||||
dispose() {
|
dispose() {
|
||||||
this.ibpInstanceLevel = {};
|
this.ibpInstanceLevel = {};
|
||||||
this.parentLevel = null;
|
this.parentLevel = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父级图层
|
* 父级图层
|
||||||
*/
|
*/
|
||||||
getParentLevel() {
|
getParentLevel() {
|
||||||
return this.parentLevel;
|
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 TeleTerminal from './teleTerminal';
|
||||||
import Clock from './clock';
|
import Clock from './clock';
|
||||||
import RotateTip from './rotateTip';
|
import RotateTip from './rotateTip';
|
||||||
|
import CheckBox from './checkBox';
|
||||||
|
|
||||||
const ibpShape = {};
|
const ibpShape = {};
|
||||||
ibpShape[deviceType.Arrow] = Arrow;
|
ibpShape[deviceType.Arrow] = Arrow;
|
||||||
@ -29,14 +30,15 @@ ibpShape[deviceType.Key] = Key;
|
|||||||
ibpShape[deviceType.TeleTerminal] = TeleTerminal;
|
ibpShape[deviceType.TeleTerminal] = TeleTerminal;
|
||||||
ibpShape[deviceType.Clock] = Clock;
|
ibpShape[deviceType.Clock] = Clock;
|
||||||
ibpShape[deviceType.RotateTip] = RotateTip;
|
ibpShape[deviceType.RotateTip] = RotateTip;
|
||||||
|
ibpShape[deviceType.CheckBox] = CheckBox;
|
||||||
|
|
||||||
function shapefactory(device, ibp) {
|
function shapefactory(device, ibp) {
|
||||||
const type = device.model._type;
|
const type = device.model._type;
|
||||||
const shape = ibpShape[type];
|
const shape = ibpShape[type];
|
||||||
if (shape instanceof Function) {
|
if (shape instanceof Function) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
return new shape(device, ibp.style);
|
return new shape(device, ibp.style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default shapefactory;
|
export default shapefactory;
|
||||||
|
@ -2,43 +2,44 @@ import Group from 'zrender/src/container/Group';
|
|||||||
import Line from 'zrender/src/graphic/shape/Line';
|
import Line from 'zrender/src/graphic/shape/Line';
|
||||||
|
|
||||||
export default class ibpLine extends Group {
|
export default class ibpLine extends Group {
|
||||||
constructor(device) {
|
constructor(device) {
|
||||||
super();
|
super();
|
||||||
this.model = device.model;
|
this.model = device.model;
|
||||||
this._type = device.model._type;
|
this._type = device.model._type;
|
||||||
this._code = device.model.code;
|
this._code = device.model.code;
|
||||||
this.zlevel = device.model.zlevel;
|
this.zlevel = device.model.zlevel;
|
||||||
this.z = device.model.z;
|
this.model.point = this.model.point1;
|
||||||
this.create();
|
this.z = device.model.z;
|
||||||
}
|
this.create();
|
||||||
create() {
|
}
|
||||||
const model = this.model;
|
create() {
|
||||||
this.grouper=new Group({
|
const model = this.model;
|
||||||
id: model.code,
|
this.grouper = new Group({
|
||||||
position: [model.point1.x, model.point1.y]
|
id: model.code,
|
||||||
});
|
position: [model.point1.x, model.point1.y]
|
||||||
this.ibpLine = new Line({
|
});
|
||||||
zlevel: model.zlevel,
|
this.ibpLine = new Line({
|
||||||
z: model.z,
|
zlevel: model.zlevel,
|
||||||
draggable: false,
|
z: model.z,
|
||||||
shape: {
|
draggable: false,
|
||||||
x1: 0,
|
shape: {
|
||||||
y1: 0,
|
x1: 0,
|
||||||
x2: model.point2.x-model.point1.x,
|
y1: 0,
|
||||||
y2: model.point2.y-model.point1.y
|
x2: model.point2.x - model.point1.x,
|
||||||
},
|
y2: model.point2.y - model.point1.y
|
||||||
style: {
|
},
|
||||||
lineWidth: this.model.lineWidth,
|
style: {
|
||||||
stroke: this.model.fillColor
|
lineWidth: this.model.lineWidth,
|
||||||
}
|
stroke: this.model.fillColor
|
||||||
});
|
}
|
||||||
this.grouper.add(this.ibpLine);
|
});
|
||||||
this.add(this.grouper);
|
this.grouper.add(this.ibpLine);
|
||||||
}
|
this.add(this.grouper);
|
||||||
setModel(dx, dy) {
|
}
|
||||||
this.model.point1.x += dx;
|
setModel(dx, dy) {
|
||||||
this.model.point1.y += dy;
|
this.model.point1.x += dx;
|
||||||
this.model.point2.x += dx;
|
this.model.point1.y += dy;
|
||||||
this.model.point2.y += dy;
|
this.model.point2.x += dx;
|
||||||
}
|
this.model.point2.y += dy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,89 +2,89 @@ import deviceType from './constant/deviceType';
|
|||||||
import {createTransform, createBoundingRect} from './utils/parser';
|
import {createTransform, createBoundingRect} from './utils/parser';
|
||||||
|
|
||||||
class TransformHandle {
|
class TransformHandle {
|
||||||
constructor(painter) {
|
constructor(painter) {
|
||||||
this.$painter = 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) {
|
checkVisible(view) {
|
||||||
return createBoundingRect(view).intersect(this.rect);
|
return createBoundingRect(view).intersect(this.rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
revisibleView(view) {
|
revisibleView(view) {
|
||||||
if (this.checkVisible(view)||view._type === deviceType.Background) {
|
if (this.checkVisible(view) || view._type === deviceType.Background) {
|
||||||
view.show();
|
view.show();
|
||||||
} else {
|
} else {
|
||||||
view.hide();
|
view.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
view.dirty();
|
view.dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 视图进行缩放/平移
|
// 视图进行缩放/平移
|
||||||
transformView(view) {
|
transformView(view) {
|
||||||
if (view) {
|
if (view) {
|
||||||
view.transform = this.transform;
|
view.transform = this.transform;
|
||||||
view.decomposeTransform();
|
view.decomposeTransform();
|
||||||
this.revisibleView(view);
|
this.revisibleView(view);
|
||||||
view.transform = '';
|
view.transform = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理所有视图缩放/平移
|
// 处理所有视图缩放/平移
|
||||||
transformAll() {
|
transformAll() {
|
||||||
this.traverse(this.transformView, this);
|
this.traverse(this.transformView, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重新计算显示图形
|
// 重新计算显示图形
|
||||||
revisibleAll() {
|
revisibleAll() {
|
||||||
this.traverse(this.revisibleView, this);
|
this.traverse(this.revisibleView, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新偏移量
|
// 更新偏移量
|
||||||
updateTransform(opts, canvasSize) {
|
updateTransform(opts, canvasSize) {
|
||||||
if (canvasSize) {
|
if (canvasSize) {
|
||||||
const elRect = this.parentLevel.getBoundingRect();
|
const elRect = this.parentLevel.getBoundingRect();
|
||||||
const zrRect = this.rect;
|
const zrRect = this.rect;
|
||||||
if (canvasSize.x - opts.offsetX > 0) {
|
if (canvasSize.x - opts.offsetX > 0) {
|
||||||
opts.offsetX = -elRect.x;
|
opts.offsetX = -elRect.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canvasSize.y - opts.offsetY > 0) {
|
if (canvasSize.y - opts.offsetY > 0) {
|
||||||
opts.offsetY = -elRect.y;
|
opts.offsetY = -elRect.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elRect.x + canvasSize.width < zrRect.width) {
|
if (elRect.x + canvasSize.width < zrRect.width) {
|
||||||
opts.offsetX -= zrRect.width - (elRect.x + canvasSize.width);
|
opts.offsetX -= zrRect.width - (elRect.x + canvasSize.width);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elRect.y + canvasSize.height < zrRect.height) {
|
if (elRect.y + canvasSize.height < zrRect.height) {
|
||||||
opts.offsetY -= zrRect.height - (elRect.y + canvasSize.height);
|
opts.offsetY -= zrRect.height - (elRect.y + canvasSize.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.transform = createTransform(opts);
|
this.transform = createTransform(opts);
|
||||||
this.transformAll();
|
this.transformAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新画布尺寸
|
// 更新画布尺寸
|
||||||
updateZrSize(opts) {
|
updateZrSize(opts) {
|
||||||
this.rect = { x: 0, y: 0, width: opts.width, height: opts.height };
|
this.rect = { x: 0, y: 0, width: opts.width, height: opts.height };
|
||||||
this.revisibleAll();
|
this.revisibleAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 遍历group执行回调
|
// 遍历group执行回调
|
||||||
traverse(cb, context) {
|
traverse(cb, context) {
|
||||||
this.parentLevel.eachChild(level => {
|
this.parentLevel.eachChild(level => {
|
||||||
level.eachChild((view) => {
|
level.eachChild((view) => {
|
||||||
cb.call(context, view);
|
cb.call(context, view);
|
||||||
}, context);
|
}, context);
|
||||||
}, context);
|
}, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TransformHandle;
|
export default TransformHandle;
|
||||||
|
@ -120,7 +120,7 @@ export function Jlmap3ddata(mapid,scope){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function init3d(mapid,netdata){
|
function init3d(mapid,netdata){
|
||||||
console.log(netdata)
|
// console.log(netdata)
|
||||||
getMapDetail(mapid).then(data => {
|
getMapDetail(mapid).then(data => {
|
||||||
jlmap3ddata.id = netdata.id;
|
jlmap3ddata.id = netdata.id;
|
||||||
jlmap3ddata.mapId = mapid;
|
jlmap3ddata.mapId = mapid;
|
||||||
@ -141,8 +141,8 @@ export function Jlmap3ddata(mapid,scope){
|
|||||||
let switchdata = JSON.parse(netdata.switchs);
|
let switchdata = JSON.parse(netdata.switchs);
|
||||||
let signaldata = JSON.parse(netdata.signals);
|
let signaldata = JSON.parse(netdata.signals);
|
||||||
let standsdata = JSON.parse(netdata.stands);
|
let standsdata = JSON.parse(netdata.stands);
|
||||||
console.log(mapdata);
|
// console.log(mapdata);
|
||||||
assetloader.setmodellist(netdata.assets);
|
assetloader.setmodellist(netdata.assets,5);
|
||||||
assetloader.assetpromise(scene)
|
assetloader.assetpromise(scene)
|
||||||
.then(function(data){
|
.then(function(data){
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
@ -162,7 +162,7 @@ export function Jlmap3ddata(mapid,scope){
|
|||||||
})
|
})
|
||||||
.then(function(data){
|
.then(function(data){
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,scene,assetloader);
|
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,scene,assetloader,"0");
|
||||||
})
|
})
|
||||||
// .then(function(data){
|
// .then(function(data){
|
||||||
// //console.log(data);
|
// //console.log(data);
|
||||||
|
@ -48,7 +48,7 @@ export function SectionList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildsuidao(linkdata,scope.sections,assetloader,scene);
|
buildsuidao(linkdata,scope.sections,assetloader,scene);
|
||||||
console.log(scope.sections.datalist);
|
// console.log(scope.sections.datalist);
|
||||||
//定义区分道岔组
|
//定义区分道岔组
|
||||||
let switchlist = [];
|
let switchlist = [];
|
||||||
//遍历道岔数据
|
//遍历道岔数据
|
||||||
@ -105,7 +105,7 @@ export function SectionList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
scope.switchs.datalist = switchlist;
|
scope.switchs.datalist = switchlist;
|
||||||
console.log(switchlist);
|
// console.log(switchlist);
|
||||||
//道岔贴图
|
//道岔贴图
|
||||||
let switchmesh1;
|
let switchmesh1;
|
||||||
let switchmesh2;
|
let switchmesh2;
|
||||||
@ -142,9 +142,9 @@ export function SectionList() {
|
|||||||
|
|
||||||
let switchposz = sectionA.position.z;
|
let switchposz = sectionA.position.z;
|
||||||
let switchposx;
|
let switchposx;
|
||||||
if(switchlist[i].code == "Switch_135_0.16369"){
|
// if(switchlist[i].code == "Switch_135_0.16369"){
|
||||||
console.log(switchlist[i]);
|
// console.log(switchlist[i]);
|
||||||
}
|
// }
|
||||||
if(switchlist[i].pa[0].x>switchlist[i].pb[0].x){
|
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].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){
|
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){
|
this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,switchdata,scene){
|
||||||
return new Promise(function(resolve, reject){
|
return new Promise(function(resolve, reject){
|
||||||
console.log(sectiondata);
|
// console.log(sectiondata);
|
||||||
scene.add(scope.sectiongroup);
|
scene.add(scope.sectiongroup);
|
||||||
scene.add(scope.switchgroup);
|
scene.add(scope.switchgroup);
|
||||||
let linkdata = jlmap3ddata.linklist;
|
let linkdata = jlmap3ddata.linklist;
|
||||||
|
@ -159,13 +159,13 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
|||||||
if (trainlisttest.list[code].runMode == '02') {
|
if (trainlisttest.list[code].runMode == '02') {
|
||||||
|
|
||||||
if (trainlisttest.list[code].isStandTrack == true) {
|
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 {
|
} 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 {
|
} 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) {
|
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 (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) {
|
||||||
|
|
||||||
if (rails.linkrail[data.body[i].linkCode]) {
|
if (rails.linkrail[data.body[i].linkCode]) {
|
||||||
console.log(trainlisttest.group);
|
// console.log(trainlisttest.group);
|
||||||
if(trainlisttest.group.children.length<1){
|
if(trainlisttest.group.children.length<1){
|
||||||
trainlisttest.group.add(trainlisttest.list[code]);
|
trainlisttest.group.add(trainlisttest.list[code]);
|
||||||
}
|
}
|
||||||
@ -363,7 +363,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
|||||||
// trainlisttest.list[code].startmark = 1;
|
// trainlisttest.list[code].startmark = 1;
|
||||||
}else{
|
}else{
|
||||||
trainlisttest.list[code].speeds = data.body[i].speed;
|
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 (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].curve = rails.linkrail[data.body[i].linkCode].lineleft;
|
||||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||||
trainlisttest.list[code].progress = data.body[i].linkOffsetPercent;
|
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'){
|
}else if(data.body[i].directionType == '03'){
|
||||||
if(rails.linkrail[data.body[i].linkCode].lineright){
|
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].curve = rails.linkrail[data.body[i].linkCode].lineright;
|
||||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||||
trainlisttest.list[code].progress = 1-data.body[i].linkOffsetPercent;
|
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;
|
trainlisttest.list[code].nextcode = nextcode;
|
||||||
|
@ -12,6 +12,7 @@ export function UpdateTrain(camera,traindata,control){
|
|||||||
|
|
||||||
if(trainmodel.speeds > 0 && trainmodel.speeds){
|
if(trainmodel.speeds > 0 && trainmodel.speeds){
|
||||||
let speed = null;
|
let speed = null;
|
||||||
|
// console.log(traindata.group.children[0].progress);
|
||||||
if(traindata.group.children[0].progress >=0&&traindata.group.children[0].progress<=1){
|
if(traindata.group.children[0].progress >=0&&traindata.group.children[0].progress<=1){
|
||||||
|
|
||||||
let movecurve = trainmodel.curve;
|
let movecurve = trainmodel.curve;
|
||||||
@ -19,8 +20,9 @@ export function UpdateTrain(camera,traindata,control){
|
|||||||
if(trainmodel.status == "03"){
|
if(trainmodel.status == "03"){
|
||||||
if(movecurve.points.length>1){
|
if(movecurve.points.length>1){
|
||||||
let point = movecurve.getPointAt(traindata.group.children[0].progress);
|
let point = movecurve.getPointAt(traindata.group.children[0].progress);
|
||||||
|
trainmodel.position.x = point.x;
|
||||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.001){
|
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);
|
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).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);
|
let offsetz = parseFloat(trainmodel.children[0].matrixWorld.elements[14]) - parseFloat(point.z);
|
||||||
trainmodel.children[0].position.z += offsetz;
|
trainmodel.children[0].position.z += offsetz;
|
||||||
//trainmodel.position.z = point.z;
|
|
||||||
|
// trainmodel.position.z = point.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
trainmodel.position.x = point.x;
|
trainmodel.position.x = point.x;
|
||||||
@ -52,7 +55,7 @@ export function UpdateTrain(camera,traindata,control){
|
|||||||
trainmodel.children[rs].position.z += offsetz;
|
trainmodel.children[rs].position.z += offsetz;
|
||||||
|
|
||||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
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){
|
if(rs != 5){
|
||||||
let asd = trainmodel.children[rs].rotalist[0];
|
let asd = trainmodel.children[rs].rotalist[0];
|
||||||
@ -78,8 +81,9 @@ export function UpdateTrain(camera,traindata,control){
|
|||||||
if(trainmodel.status == "02"){
|
if(trainmodel.status == "02"){
|
||||||
if(movecurve.points.length>1){
|
if(movecurve.points.length>1){
|
||||||
let point = movecurve.getPointAt(trainmodel.progress);
|
let point = movecurve.getPointAt(trainmodel.progress);
|
||||||
|
trainmodel.position.x = point.x;
|
||||||
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.001){
|
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);
|
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).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);
|
trainmodel.children[1].rotalist.push(rotas);
|
||||||
let offsetz = parseFloat(point.z) - parseFloat(trainmodel.children[0].matrixWorld.elements[14]);
|
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.x = point.x;
|
||||||
trainmodel.position.y = 0;
|
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){
|
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++){
|
for(let rs = 1;rs<6;rs++){
|
||||||
@ -110,7 +115,7 @@ export function UpdateTrain(camera,traindata,control){
|
|||||||
trainmodel.children[rs].position.z += offsetz;
|
trainmodel.children[rs].position.z += offsetz;
|
||||||
|
|
||||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
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){
|
if(rs != 5){
|
||||||
let asd = trainmodel.children[rs].rotalist[0];
|
let asd = trainmodel.children[rs].rotalist[0];
|
||||||
@ -146,7 +151,7 @@ export function UpdateTrain(camera,traindata,control){
|
|||||||
trainmodel.progress = 0;
|
trainmodel.progress = 0;
|
||||||
trainmodel.len = trainmodel.nextlen;
|
trainmodel.len = trainmodel.nextlen;
|
||||||
trainmodel.nowcode = trainmodel.nextcode;
|
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.curve = trainmodel.nextcurve;
|
||||||
|
|
||||||
trainmodel.nextcurve = null;
|
trainmodel.nextcurve = null;
|
||||||
@ -178,7 +183,7 @@ export function UpdateTrain(camera,traindata,control){
|
|||||||
if(trainmodel.status == "03" && trainmodel.progress>0){
|
if(trainmodel.status == "03" && trainmodel.progress>0){
|
||||||
if(movecurve.points.length>1){
|
if(movecurve.points.length>1){
|
||||||
let point = movecurve.getPointAt(traindata.group.children[0].progress);
|
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);
|
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).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;
|
trainmodel.children[rs].position.z += offsetz;
|
||||||
|
|
||||||
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
|
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){
|
if(rs != 5){
|
||||||
let asd = trainmodel.children[rs].rotalist[0];
|
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){
|
if(movecurve.points.length>1 && trainmodel.progress>0){
|
||||||
|
|
||||||
let point = movecurve.getPointAt(trainmodel.progress);
|
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);
|
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||||
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
let tangent = movecurve.getTangentAt(traindata.group.children[0].progress).normalize();
|
||||||
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).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;
|
trainlisttest.list[code].speed = data.body[tl].v;
|
||||||
if (trainlisttest.list[code].runMode == '02') {
|
if (trainlisttest.list[code].runMode == '02') {
|
||||||
if (trainlisttest.list[code].isStandTrack == true) {
|
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 {
|
} 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 {
|
} 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) {
|
if (code == drivingcode) {
|
||||||
@ -313,7 +313,7 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
|||||||
// trainlisttest.list[code].startmark = 1;
|
// trainlisttest.list[code].startmark = 1;
|
||||||
}else{
|
}else{
|
||||||
trainlisttest.list[code].speeds = data.body[i].speed;
|
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";
|
rails.switchrail[code].locateType = "01";
|
||||||
let testswitch = rails.switchrail[code];
|
let testswitch = rails.switchrail[code];
|
||||||
console.log(testswitch);
|
// console.log(testswitch);
|
||||||
console.log(rails.linkrail[testswitch.alink]);
|
// console.log(rails.linkrail[testswitch.alink]);
|
||||||
console.log(rails.linkrail[testswitch.clink]);
|
// console.log(rails.linkrail[testswitch.clink]);
|
||||||
if(rails.switchrail[code].directtype == "1"){
|
if(rails.switchrail[code].directtype == "1"){
|
||||||
rails.linkrail[testswitch.alink].lconnect = testswitch.blink;
|
rails.linkrail[testswitch.alink].lconnect = testswitch.blink;
|
||||||
rails.linkrail[testswitch.blink].rconnect = testswitch.alink;
|
rails.linkrail[testswitch.blink].rconnect = testswitch.alink;
|
||||||
|
@ -36,6 +36,7 @@ let defaultstation = {
|
|||||||
picUrl:"",
|
picUrl:"",
|
||||||
assetUrl:modelurl+"/models/station/fuzhou/fuzhou.FBX"
|
assetUrl:modelurl+"/models/station/fuzhou/fuzhou.FBX"
|
||||||
}
|
}
|
||||||
|
//modelurl+"/models/station/fuzhou/fuzhou.FBX"
|
||||||
//https://test.joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
//https://test.joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
||||||
//https://joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
//https://joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
||||||
//../../static/model/station/zhantai715(2).FBX
|
//../../static/model/station/zhantai715(2).FBX
|
||||||
@ -64,11 +65,12 @@ let defaultsuidao = {
|
|||||||
deviceType:"suidao",
|
deviceType:"suidao",
|
||||||
type:"suidao",
|
type:"suidao",
|
||||||
picUrl:"",
|
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://test.joylink.club/oss/models/suidao/suidao.FBX
|
||||||
//https://joylink.club/oss/models/suidao/suidao.FBX
|
//https://joylink.club/oss/models/suidao/suidao.FBX
|
||||||
//../../static/model/
|
//../../static/model/suidao/suidao.FBX
|
||||||
|
|
||||||
let defaultautorail = {
|
let defaultautorail = {
|
||||||
id:"100",
|
id:"100",
|
||||||
@ -112,11 +114,16 @@ export function AssetLoader(){
|
|||||||
|
|
||||||
this.name = null;
|
this.name = null;
|
||||||
|
|
||||||
|
this.trainoffset = 0;
|
||||||
|
|
||||||
this.modellist = [];
|
this.modellist = [];
|
||||||
|
|
||||||
this.materiallist = [];
|
this.materiallist = [];
|
||||||
//初始化资源加载器
|
//初始化资源加载器
|
||||||
this.setmodellist = function (data){
|
this.setmodellist = function (data,trainoffset){
|
||||||
|
if(trainoffset){
|
||||||
|
scope.trainoffset = trainoffset;
|
||||||
|
}
|
||||||
// console.log("setmodellist");
|
// console.log("setmodellist");
|
||||||
let defaultmodel1 = new AssetModel(defaultsignal);
|
let defaultmodel1 = new AssetModel(defaultsignal);
|
||||||
scope.modellist.push(defaultmodel1);
|
scope.modellist.push(defaultmodel1);
|
||||||
@ -464,7 +471,8 @@ export function AssetLoader(){
|
|||||||
let name = "c"+j;
|
let name = "c"+j;
|
||||||
for(let i=0;i<object.children.length;i++){
|
for(let i=0;i<object.children.length;i++){
|
||||||
if(object.children[i].name == name){
|
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;
|
//object.children[i].position.y = j*10;
|
||||||
realtrain.add(object.children[i]);
|
realtrain.add(object.children[i]);
|
||||||
i--;
|
i--;
|
||||||
|
@ -554,7 +554,7 @@ THREE.FBXLoader = ( function () {
|
|||||||
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
||||||
parameters.side = THREE.DoubleSide;
|
parameters.side = THREE.DoubleSide;
|
||||||
parameters.transparent = true;
|
parameters.transparent = true;
|
||||||
parameters.alphaTest = 0.7;
|
// parameters.alphaTest = 0.7;
|
||||||
parameters.opacity = 1;
|
parameters.opacity = 1;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@ -567,7 +567,7 @@ THREE.FBXLoader = ( function () {
|
|||||||
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
if(materialNode.Opacity.value<1 && materialNode.Opacity.value>0.9){
|
||||||
parameters.side = THREE.DoubleSide;
|
parameters.side = THREE.DoubleSide;
|
||||||
parameters.transparent = true;
|
parameters.transparent = true;
|
||||||
parameters.alphaTest = 0.7;
|
// parameters.alphaTest = 0.7;
|
||||||
parameters.opacity = 1;
|
parameters.opacity = 1;
|
||||||
}else{
|
}else{
|
||||||
parameters.opacity = parseFloat( materialNode.Opacity.value );
|
parameters.opacity = parseFloat( materialNode.Opacity.value );
|
||||||
@ -577,7 +577,7 @@ THREE.FBXLoader = ( function () {
|
|||||||
if ( parameters.opacity < 1.0 ) {
|
if ( parameters.opacity < 1.0 ) {
|
||||||
|
|
||||||
parameters.transparent = true;
|
parameters.transparent = true;
|
||||||
parameters.alphaTest = 0.1;
|
// parameters.alphaTest = 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( materialNode.ReflectionFactor ) {
|
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 signaldata = JSON.parse(netdata.signals);
|
||||||
let standsdata = JSON.parse(netdata.stands);
|
let standsdata = JSON.parse(netdata.stands);
|
||||||
// console.log(netdata.assets);
|
// console.log(netdata.assets);
|
||||||
assetloader.setmodellist(netdata.assets);
|
assetloader.setmodellist(netdata.assets,5);
|
||||||
|
|
||||||
assetloader.assetpromise(sceneload)
|
assetloader.assetpromise(sceneload)
|
||||||
.then(function(data){
|
.then(function(data){
|
||||||
@ -75,12 +75,12 @@ export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,store
|
|||||||
})
|
})
|
||||||
.then(function(data){
|
.then(function(data){
|
||||||
//console.log(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){
|
.then(function(data){
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
//console.log(assetloader);
|
//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){
|
.then(function(data){
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
|
@ -73,12 +73,12 @@ export function ModelLoad(data,scope,netdata,mapdata,camera,controls,scene,mixer
|
|||||||
})
|
})
|
||||||
.then(function(data){
|
.then(function(data){
|
||||||
//console.log(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){
|
.then(function(data){
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
//console.log(assetloader);
|
//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){
|
.then(function(data){
|
||||||
//console.log(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++){
|
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
|
||||||
if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "suidao"){
|
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.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);
|
// console.log(scope.assetloader.modellist[mn].mesh);
|
||||||
scene.add(scope.assetloader.modellist[mn].mesh);
|
scene.add(scope.assetloader.modellist[mn].mesh);
|
||||||
}
|
}
|
||||||
|
@ -23,24 +23,8 @@ export function RailList(){
|
|||||||
points:[],
|
points:[],
|
||||||
type:null
|
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++){
|
for(let i=0;i<switchdata.length;i++){
|
||||||
scope.switchrail[switchdata[i].code] = {
|
scope.switchrail[switchdata[i].code] = {
|
||||||
alink:switchdata[i].alink,
|
alink:switchdata[i].alink,
|
||||||
@ -52,64 +36,101 @@ export function RailList(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(scope.linkrail[switchdata[i].blink].lp.x < switchdata[i].position.x){
|
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].alink].lswitch = switchdata[i].code;
|
||||||
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].rswitch = switchdata[i].code;
|
||||||
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";
|
|
||||||
}else{
|
}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].alink].rswitch = switchdata[i].code;
|
||||||
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].lswitch = switchdata[i].code;
|
||||||
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";
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if(scope.linkrail[switchdata[i].clink].lp.x < switchdata[i].position.x){
|
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].alink].lswitch = switchdata[i].code;
|
||||||
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].rswitch = switchdata[i].code;
|
||||||
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";
|
|
||||||
}else{
|
}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].alink].rswitch = switchdata[i].code;
|
||||||
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].lswitch = switchdata[i].code;
|
||||||
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";
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
const ddd = storemod.getters['map/getDeviceByCode'](switchdata[i].code);
|
||||||
scope.switchrail[switchdata[i].code].locateType = ddd.locateType;
|
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].alink].rconnect = switchdata[i].blink;
|
||||||
scope.linkrail[switchdata[i].blink].lconnect = switchdata[i].alink;
|
scope.linkrail[switchdata[i].blink].lconnect = switchdata[i].alink;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(ddd.locateType == "02"){
|
}else if(ddd.locateType == "02"){
|
||||||
if(switchdata[i].directtype == "1"){
|
if(switchdata[i].directtype == "1"){
|
||||||
scope.linkrail[switchdata[i].alink].lconnect = switchdata[i].clink;
|
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;
|
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++){
|
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 = 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;
|
// scope.linkrail[linkdata[i].code].lineleft.tension = 0.2;
|
||||||
let rightpoints = [];
|
let rightpoints = [];
|
||||||
scope.linkrail[linkdata[i].code].points.forEach(item=>{
|
scope.linkrail[linkdata[i].code].points.forEach(item=>{
|
||||||
@ -145,10 +193,10 @@ export function RailList(){
|
|||||||
);
|
);
|
||||||
rightpoints.reverse();
|
rightpoints.reverse();
|
||||||
scope.linkrail[linkdata[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints);
|
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++){
|
// 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 material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
||||||
// var circle = new THREE.Mesh( geometry, material );
|
// var circle = new THREE.Mesh( geometry, material );
|
||||||
// console.log(n);
|
// console.log(n);
|
||||||
@ -177,7 +225,7 @@ export function RailList(){
|
|||||||
// // Create the final object to add to the scene
|
// // Create the final object to add to the scene
|
||||||
// var curveObject = new THREE.Line( geometry, material );
|
// var curveObject = new THREE.Line( geometry, material );
|
||||||
//
|
//
|
||||||
// curveObject.position.y = Math.random()/10;
|
// curveObject.position.y = Math.random();
|
||||||
// scene.add(curveObject);
|
// scene.add(curveObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ export function StationStandList() {
|
|||||||
|
|
||||||
this.textlist = [];
|
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){
|
return new Promise(function(resolve, reject){
|
||||||
|
|
||||||
let netstand = null;
|
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.x = netstand[map[k].index].scale.x;
|
||||||
map[k].mesh.scale.y = netstand[map[k].index].scale.y;
|
map[k].mesh.scale.y = netstand[map[k].index].scale.y;
|
||||||
map[k].mesh.scale.z = netstand[map[k].index].scale.z;
|
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]));
|
if(mode){
|
||||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
if(mode == "02"){
|
||||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
let textgeometry = new THREE.PlaneBufferGeometry( 271, 374, 1 );
|
||||||
textplane.name = stationdata[map[k].num].code;
|
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].type = "station";
|
||||||
map[k].rname = stationdata[map[k].num].runPlanName;
|
map[k].rname = stationdata[map[k].num].runPlanName;
|
||||||
map[k].kmmark = stationdata[map[k].num].kmPost;
|
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);
|
scope.group.add(map[k].mesh);
|
||||||
}
|
}
|
||||||
@ -354,9 +362,9 @@ function getTextCanvas(text){
|
|||||||
ctx.fillText("信息", 114,100);
|
ctx.fillText("信息", 114,100);
|
||||||
ctx.fillText("备忘", 190,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);
|
let data = ctx.getImageData(0, 0,256,512);
|
||||||
return data;
|
return data;
|
||||||
|
@ -12,7 +12,7 @@ export function TrainList() {
|
|||||||
|
|
||||||
this.textlist = [];
|
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){
|
return new Promise(function(resolve, reject){
|
||||||
//遍历列车数据
|
//遍历列车数据
|
||||||
for(let i=0;i<data.length;i++){
|
for(let i=0;i<data.length;i++){
|
||||||
@ -118,22 +118,28 @@ export function TrainList() {
|
|||||||
// newmesh.children[n-1].add(newmesh.children[n]);
|
// newmesh.children[n-1].add(newmesh.children[n]);
|
||||||
// }
|
// }
|
||||||
//创建列车字牌
|
//创建列车字牌
|
||||||
let textgeometry = new THREE.PlaneBufferGeometry( 150, 100, 1 );
|
if(mode){
|
||||||
let textt = new THREE.CanvasTexture(getTextCanvas(data[i]));
|
if(mode == "02"){
|
||||||
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
let textgeometry = new THREE.PlaneBufferGeometry( 150, 100, 1 );
|
||||||
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
let textt = new THREE.CanvasTexture(getTextCanvas(data[i]));
|
||||||
textplane.name = data[i].code;
|
let textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
|
||||||
textplane.position.x = 0;
|
let textplane = new THREE.Mesh( textgeometry, textmaterial );
|
||||||
textplane.position.y = 0;
|
textplane.name = data[i].code;
|
||||||
textplane.position.z = 60;
|
textplane.position.x = 0;
|
||||||
textplane.tcode = data[i].code;
|
textplane.position.y = 0;
|
||||||
//textplane.rotation.x = Math.PI;
|
textplane.position.z = 60;
|
||||||
scope.textlist.push(textplane);
|
textplane.tcode = data[i].code;
|
||||||
newmesh.children[0].add(textplane);
|
//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);
|
//group.add(textplane);
|
||||||
newmesh.first = false;
|
newmesh.first = false;
|
||||||
newmesh.name = data[i].code;
|
newmesh.name = data[i].code;
|
||||||
@ -187,24 +193,24 @@ function getTextCanvas(text){
|
|||||||
var canvas = document.getElementById('canvastexture');
|
var canvas = document.getElementById('canvastexture');
|
||||||
|
|
||||||
canvas.width = 128;
|
canvas.width = 128;
|
||||||
canvas.height = 96;
|
canvas.height = 64;
|
||||||
|
|
||||||
var ctx = canvas.getContext('2d');
|
var ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
//var bg = canvas.createPattern(img, "no-repeat");
|
//var bg = canvas.createPattern(img, "no-repeat");
|
||||||
//ctx.fillStyle = bg;
|
//ctx.fillStyle = bg;
|
||||||
ctx.fillRect(0, 0,128,96);
|
ctx.fillRect(0, 0,128,64);
|
||||||
ctx.font = "10px Verdana";
|
ctx.font = "8px Verdana";
|
||||||
ctx.fillStyle = '#000000';
|
ctx.fillStyle = '#000000';
|
||||||
ctx.textAlign = 'center';
|
ctx.textAlign = 'center';
|
||||||
ctx.textBaseline = 'middle';
|
ctx.textBaseline = 'middle';
|
||||||
ctx.clearRect(0,0,128,96);
|
ctx.clearRect(0,0,128,64);
|
||||||
//console.log(text.groupNumber);
|
//console.log(text.groupNumber);
|
||||||
ctx.drawImage(beauty,0,0,128, 96);
|
ctx.drawImage(beauty,0,0,128, 64);
|
||||||
ctx.fillText("车组号:"+text.groupNumber, 60,15);
|
ctx.fillText("车组号:"+text.groupNumber, 40,10);
|
||||||
ctx.fillText("车组人员:XXX", 60,31);
|
ctx.fillText("车组人员:XXX", 40,20);
|
||||||
ctx.fillText("速度:XXX.XXX", 60,43);
|
// ctx.fillText("速度:XXX.XXX", 40,30);
|
||||||
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
|
//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;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,8 @@ export function UpdateTrain(camera,traindata){
|
|||||||
if(trainmodel.status == "03"){
|
if(trainmodel.status == "03"){
|
||||||
if(movecurve.points.length>1){
|
if(movecurve.points.length>1){
|
||||||
let point = movecurve.getPointAt(traindata.group.children[j].progress);
|
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){
|
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){
|
||||||
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
|
||||||
let tangent = movecurve.getTangentAt(traindata.group.children[j].progress).normalize();
|
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.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){
|
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++){
|
for(let rs = 1;rs<6;rs++){
|
||||||
@ -84,6 +84,8 @@ export function UpdateTrain(camera,traindata){
|
|||||||
if(trainmodel.status == "02"){
|
if(trainmodel.status == "02"){
|
||||||
if(movecurve.points.length>1){
|
if(movecurve.points.length>1){
|
||||||
let point = movecurve.getPointAt(trainmodel.progress);
|
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){
|
if(Math.abs( point.z -trainmodel.children[0].matrixWorld.elements[14]) >0.02){
|
||||||
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
|
||||||
let tangent = movecurve.getTangentAt(traindata.group.children[j].progress).normalize();
|
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.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){
|
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++){
|
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渲染配置*/
|
/** link渲染配置*/
|
||||||
deviceRender[deviceType.Link] = {
|
deviceRender[deviceType.Link] = {
|
||||||
_type: deviceType.Link,
|
_type: deviceType.Link,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 1
|
// progressive: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Section渲染配置*/
|
/** Section渲染配置*/
|
||||||
deviceRender[deviceType.Section] = {
|
deviceRender[deviceType.Section] = {
|
||||||
_type: deviceType.Section,
|
_type: deviceType.Section,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 2
|
// progressive: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Signal渲染配置*/
|
/** Signal渲染配置*/
|
||||||
deviceRender[deviceType.Signal] = {
|
deviceRender[deviceType.Signal] = {
|
||||||
_type: deviceType.Signal,
|
_type: deviceType.Signal,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 3
|
// progressive: 3
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Switch渲染配置*/
|
/** Switch渲染配置*/
|
||||||
deviceRender[deviceType.Switch] = {
|
deviceRender[deviceType.Switch] = {
|
||||||
_type: deviceType.Switch,
|
_type: deviceType.Switch,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 5
|
// progressive: 5
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Station渲染配置*/
|
/** Station渲染配置*/
|
||||||
deviceRender[deviceType.Station] = {
|
deviceRender[deviceType.Station] = {
|
||||||
_type: deviceType.Station,
|
_type: deviceType.Station,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 4
|
// progressive: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** StationStand渲染配置*/
|
/** StationStand渲染配置*/
|
||||||
deviceRender[deviceType.StationStand] = {
|
deviceRender[deviceType.StationStand] = {
|
||||||
_type: deviceType.StationStand,
|
_type: deviceType.StationStand,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 5
|
// progressive: 5
|
||||||
};
|
};
|
||||||
|
|
||||||
/** StationControl渲染配置*/
|
/** StationControl渲染配置*/
|
||||||
deviceRender[deviceType.StationControl] = {
|
deviceRender[deviceType.StationControl] = {
|
||||||
_type: deviceType.StationControl,
|
_type: deviceType.StationControl,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 4
|
// progressive: 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ImageControl渲染配置*/
|
/** ImageControl渲染配置*/
|
||||||
deviceRender[deviceType.ImageControl] = {
|
deviceRender[deviceType.ImageControl] = {
|
||||||
_type: deviceType.ImageControl,
|
_type: deviceType.ImageControl,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 5
|
// progressive: 5
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ZcControl渲染配置*/
|
/** ZcControl渲染配置*/
|
||||||
deviceRender[deviceType.ZcControl] = {
|
deviceRender[deviceType.ZcControl] = {
|
||||||
_type: deviceType.ZcControl,
|
_type: deviceType.ZcControl,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 6
|
// progressive: 6
|
||||||
};
|
};
|
||||||
|
|
||||||
/** LcControl渲染配置*/
|
/** LcControl渲染配置*/
|
||||||
deviceRender[deviceType.LcControl] = {
|
deviceRender[deviceType.LcControl] = {
|
||||||
_type: deviceType.LcControl,
|
_type: deviceType.LcControl,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 6
|
// progressive: 6
|
||||||
};
|
};
|
||||||
|
|
||||||
/** LimitControl渲染配置*/
|
/** LimitControl渲染配置*/
|
||||||
deviceRender[deviceType.LimitControl] = {
|
deviceRender[deviceType.LimitControl] = {
|
||||||
_type: deviceType.LimitControl,
|
_type: deviceType.LimitControl,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 5
|
// progressive: 5
|
||||||
};
|
};
|
||||||
|
|
||||||
/** StationDelayUnlock渲染配置*/
|
/** StationDelayUnlock渲染配置*/
|
||||||
deviceRender[deviceType.StationDelayUnlock] = {
|
deviceRender[deviceType.StationDelayUnlock] = {
|
||||||
_type: deviceType.StationDelayUnlock,
|
_type: deviceType.StationDelayUnlock,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 6
|
// progressive: 6
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Train渲染配置*/
|
/** Train渲染配置*/
|
||||||
deviceRender[deviceType.Train] = {
|
deviceRender[deviceType.Train] = {
|
||||||
_type: deviceType.Train,
|
_type: deviceType.Train,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 9
|
// progressive: 9
|
||||||
};
|
};
|
||||||
|
|
||||||
/** TrainWindow渲染配置*/
|
/** TrainWindow渲染配置*/
|
||||||
deviceRender[deviceType.TrainWindow] = {
|
deviceRender[deviceType.TrainWindow] = {
|
||||||
_type: deviceType.TrainWindow,
|
_type: deviceType.TrainWindow,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 8
|
// progressive: 8
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Line渲染配置*/
|
/** Line渲染配置*/
|
||||||
deviceRender[deviceType.Line] = {
|
deviceRender[deviceType.Line] = {
|
||||||
_type: deviceType.Line,
|
_type: deviceType.Line,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 7
|
// progressive: 7
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Text渲染配置*/
|
/** Text渲染配置*/
|
||||||
deviceRender[deviceType.Text] = {
|
deviceRender[deviceType.Text] = {
|
||||||
_type: deviceType.Text,
|
_type: deviceType.Text,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 7
|
// progressive: 7
|
||||||
};
|
};
|
||||||
|
|
||||||
/** TrainWindow渲染配置*/
|
/** TrainWindow渲染配置*/
|
||||||
deviceRender[deviceType.TrainWindow] = {
|
deviceRender[deviceType.TrainWindow] = {
|
||||||
_type: deviceType.TrainWindow,
|
_type: deviceType.TrainWindow,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 4
|
// progressive: 4
|
||||||
};
|
};
|
||||||
/** Train渲染配置*/
|
/** Train渲染配置*/
|
||||||
deviceRender[deviceType.TRain] = {
|
deviceRender[deviceType.TRain] = {
|
||||||
_type: deviceType.TRain,
|
_type: deviceType.TRain,
|
||||||
zlevel: 1
|
zlevel: 1
|
||||||
// progressive: 4
|
// progressive: 4
|
||||||
|
};
|
||||||
|
/** CheckBox渲染配置*/
|
||||||
|
deviceRender[deviceType.CheckBox] = {
|
||||||
|
_type: deviceType.CheckBox,
|
||||||
|
zlevel: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
export default deviceRender;
|
export default deviceRender;
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
const deviceType = {
|
const deviceType = {
|
||||||
Link: 'Link',
|
Link: 'Link',
|
||||||
Section: 'Section',
|
Section: 'Section',
|
||||||
Switch: 'Switch',
|
Switch: 'Switch',
|
||||||
Signal: 'Signal',
|
Signal: 'Signal',
|
||||||
ZcControl: 'ZcControl',
|
ZcControl: 'ZcControl',
|
||||||
LcControl: 'LcControl',
|
LcControl: 'LcControl',
|
||||||
LimitControl: 'LimitControl',
|
LimitControl: 'LimitControl',
|
||||||
ImageControl: 'ImageControl',
|
ImageControl: 'ImageControl',
|
||||||
Station: 'Station',
|
Station: 'Station',
|
||||||
StationStand: 'StationStand',
|
StationStand: 'StationStand',
|
||||||
StationControl: 'StationControl',
|
StationControl: 'StationControl',
|
||||||
StationCounter: 'StationCounter',
|
StationCounter: 'StationCounter',
|
||||||
ButtonControl: 'ButtonControl',
|
ButtonControl: 'ButtonControl',
|
||||||
StationDelayUnlock: 'StationDelayUnlock',
|
StationDelayUnlock: 'StationDelayUnlock',
|
||||||
Train: 'Train',
|
Train: 'Train',
|
||||||
TrainWindow: 'TrainWindow',
|
TrainWindow: 'TrainWindow',
|
||||||
Line: 'Line',
|
Line: 'Line',
|
||||||
Text: 'Text'
|
Text: 'Text',
|
||||||
|
CheckBox: 'CheckBox'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default deviceType;
|
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 Painter from './painter';
|
||||||
import Options from './options';
|
import Options from './options';
|
||||||
import MouseController from './mouseController';
|
import MouseController from './mouseController';
|
||||||
|
import KeyboardController from './keyboardController';
|
||||||
import deviceState from './constant/deviceState';
|
import deviceState from './constant/deviceState';
|
||||||
import deviceType from './constant/deviceType';
|
import deviceType from './constant/deviceType';
|
||||||
import { selectSkinCode } from './config/deviceStyle';
|
import { selectSkinCode } from './config/deviceStyle';
|
||||||
@ -14,353 +15,382 @@ const renderer = 'canvas';
|
|||||||
const devicePixelRatio = 1;
|
const devicePixelRatio = 1;
|
||||||
|
|
||||||
class Jlmap {
|
class Jlmap {
|
||||||
constructor(opts) {
|
constructor(opts) {
|
||||||
// 回调事件
|
// 回调事件
|
||||||
this.methods = opts.methods;
|
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) {
|
initMapInstance(opts) {
|
||||||
const width = opts.dom.clientWidth;
|
const width = opts.dom.clientWidth;
|
||||||
const height = opts.dom.clientHeight;
|
const height = opts.dom.clientHeight;
|
||||||
this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel;
|
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.$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 = new Painter(this);
|
||||||
this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()});
|
this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()});
|
||||||
this.$painter.updateTransform(this.$options);
|
this.$painter.updateTransform(this.$options);
|
||||||
|
|
||||||
this.optionsHandler = this.setOptions.bind(this);
|
this.optionsHandler = this.setOptions.bind(this);
|
||||||
|
|
||||||
this.$mouseController = new MouseController(this);
|
this.$mouseController = new MouseController(this);
|
||||||
this.$mouseController.enable();
|
this.$mouseController.enable();
|
||||||
|
|
||||||
this.$mouseController.on(this.events.__Pan, this.optionsHandler);
|
this.$mouseController.on(this.events.__Pan, this.optionsHandler);
|
||||||
this.$mouseController.on(this.events.__Zoom, this.optionsHandler);
|
this.$mouseController.on(this.events.__Zoom, this.optionsHandler);
|
||||||
}
|
|
||||||
|
|
||||||
loadStyle(skinCode) {
|
this.$keyboardController = new KeyboardController(this);
|
||||||
return selectSkinCode(skinCode);
|
this.$keyboardController.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadDefaultState() {
|
loadStyle(skinCode) {
|
||||||
const defaultStateDict = {};
|
return selectSkinCode(skinCode);
|
||||||
|
}
|
||||||
|
|
||||||
zrUtil.each(Object.keys(deviceState), (type) => {
|
loadDefaultState() {
|
||||||
defaultStateDict[type] = {};
|
const defaultStateDict = {};
|
||||||
zrUtil.each(Object.keys(deviceState[type] || {}), (state) => {
|
|
||||||
defaultStateDict[type][state] = deviceState[type][state].Default;
|
|
||||||
}, this);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
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) {
|
return defaultStateDict;
|
||||||
// 保存皮肤类型
|
}
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新视图大小
|
setMap(map, mapDevice) {
|
||||||
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
// 保存皮肤类型
|
||||||
|
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 => {
|
setDefaultState() {
|
||||||
const code = elem.code;
|
const list = [];
|
||||||
const type = elem._type;
|
|
||||||
// 列车不需要设置默认状态
|
|
||||||
type != deviceType.Train && list.push(Object.assign({ code, _type: type }, this.defaultStateDict[type]));
|
|
||||||
});
|
|
||||||
|
|
||||||
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) {
|
if (this.methods.stateLoaded instanceof Function) { this.methods.stateLoaded(list); }
|
||||||
const options = this.pullBack(opts);
|
}
|
||||||
this.$options.update(options);
|
|
||||||
this.$painter.updateTransform(this.$options);
|
|
||||||
|
|
||||||
if (this.$options.disabled == true) {
|
setOptions(opts) {
|
||||||
this.$mouseController.disable();
|
const options = this.pullBack(opts);
|
||||||
} else {
|
this.$options.update(options);
|
||||||
opts['zoomOnMouseWheel'] = this.zoomOnMouseWheel;
|
this.$painter.updateTransform(this.$options);
|
||||||
this.$mouseController.enable(opts);
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); }
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setLayerVisible(layer) {
|
setCenter(deviceCode) {
|
||||||
this.$painter.setLayerVisible(layer);
|
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) {
|
setLayerVisible(layer) {
|
||||||
this.$painter.setLevelVisible(list);
|
this.$painter.setLayerVisible(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(list) {
|
setLevelVisible(list) {
|
||||||
(list || []).forEach(elem => {
|
this.$painter.setLevelVisible(list);
|
||||||
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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 中间处理
|
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
|
||||||
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';
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
localStore(code, val);
|
||||||
if (elem[prop] != oDevice[prop]) {
|
}
|
||||||
deepAssign(oDevice, elem);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
for (var prop in elem) {
|
||||||
}
|
if (elem[prop] != oDevice[prop]) {
|
||||||
|
deepAssign(oDevice, elem);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 后处理
|
return false;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
this.$painter.update(item);
|
||||||
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(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) {
|
this.$painter.update(swch);
|
||||||
(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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 状态后处理
|
update(list) {
|
||||||
this.postHandle(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 (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 payload || {};
|
||||||
return this.$zr;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
getEvents() {
|
getZr() {
|
||||||
return this.events;
|
return this.$zr;
|
||||||
}
|
}
|
||||||
|
|
||||||
getDeviceByCode(code) {
|
getEvents() {
|
||||||
return this.mapDevice[code];
|
return this.events;
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint(opts) {
|
getDeviceByCode(code) {
|
||||||
const device = this.mapDevice[opts.code];
|
return this.mapDevice[code];
|
||||||
if (device) {
|
}
|
||||||
return this.$painter.getShapeTipPoint(device.instance, opts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resize(opt) {
|
getShapeTipPoint(opts) {
|
||||||
this.$zr.resize(opt);
|
const device = this.mapDevice[opts.code];
|
||||||
this.$painter.updateZrSize(opt);
|
if (device) {
|
||||||
}
|
return this.$painter.getShapeTipPoint(device.instance, opts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
refresh() {
|
resize(opt) {
|
||||||
this.$painter.refresh();
|
this.$zr.resize(opt);
|
||||||
}
|
this.$painter.updateZrSize(opt);
|
||||||
|
}
|
||||||
|
|
||||||
clearTrainView() {
|
refresh() {
|
||||||
this.$painter.clearLevel(deviceType.Train);
|
this.$painter.refresh();
|
||||||
zrUtil.each(Object.values(this.mapDevice), device => {
|
}
|
||||||
if (device._type == deviceType.Train) {
|
|
||||||
device.instance = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
clear() {
|
clearTrainView() {
|
||||||
this.skinCode = '';
|
this.$painter.clearLevel(deviceType.Train);
|
||||||
this.style = {};
|
zrUtil.each(Object.values(this.mapDevice), device => {
|
||||||
this.mapDevice = {};
|
if (device._type == deviceType.Train) {
|
||||||
this.$painter.clear();
|
device.instance = null;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
dispose() {
|
clear() {
|
||||||
this.off(this.events.Pan, this.optionsHandler);
|
this.skinCode = '';
|
||||||
this.off(this.events.Zoom, this.optionsHandler);
|
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.clear();
|
||||||
this.$zr && zrender.dispose(this.$zr);
|
|
||||||
this.$painter.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
on(eventname, cb, context) {
|
this.$mouseController.dispose();
|
||||||
const idx = Object.values(this.events).indexOf(eventname);
|
this.$keyboardController.dispose();
|
||||||
if (idx >= 0) {
|
this.$zr && zrender.dispose(this.$zr);
|
||||||
switch (eventname) {
|
this.$painter.dispose();
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
off(eventname, cb) {
|
on(eventname, cb, context) {
|
||||||
const idx = Object.values(this.events).indexOf(eventname);
|
const idx = Object.values(this.events).indexOf(eventname);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
switch (eventname) {
|
switch (eventname) {
|
||||||
case this.events.Selected:
|
case this.events.Selected:
|
||||||
this.$mouseController.off(this.events.Selected, cb);
|
this.$mouseController.on(this.events.Selected, cb, context);
|
||||||
break;
|
break;
|
||||||
case this.events.Contextmenu:
|
case this.events.Contextmenu:
|
||||||
this.$mouseController.off(this.events.Contextmenu, cb);
|
this.$mouseController.on(this.events.Contextmenu, cb, context);
|
||||||
break;
|
break;
|
||||||
case this.events.DataZoom:
|
case this.events.DataZoom:
|
||||||
this.$mouseController.off(this.events.DataZoom, cb);
|
this.$mouseController.on(this.events.DataZoom, cb, context);
|
||||||
break;
|
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;
|
export default Jlmap;
|
||||||
|
@ -4,194 +4,301 @@ import * as eventTool from 'zrender/src/core/event';
|
|||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
|
||||||
class EventModel {
|
class EventModel {
|
||||||
constructor(e) {
|
constructor(e) {
|
||||||
this.clientX = e.event.clientX;
|
this.clientX = e.event.clientX;
|
||||||
this.clientY = e.event.clientY;
|
this.clientY = e.event.clientY;
|
||||||
|
|
||||||
let view = e.target;
|
let view = e.target;
|
||||||
while (view) {
|
while (view) {
|
||||||
if (Object.values(deviceType).includes(view._type)) {
|
if (Object.values(deviceType).includes(view._type)) {
|
||||||
this.deviceCode = view._code;
|
this.deviceCode = view._code;
|
||||||
this.deviceType = view._type;
|
this.deviceType = view._type;
|
||||||
break;
|
this.eventTarget = view;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (view._subType) {
|
if (view._subType) {
|
||||||
this.subType = view._subType;
|
this.subType = view._subType;
|
||||||
}
|
}
|
||||||
if (view._val) {
|
if (view._val) {
|
||||||
this.val = view._val;
|
this.val = view._val;
|
||||||
}
|
}
|
||||||
|
|
||||||
view = view.parent;
|
view = view.parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MouseController extends Eventful {
|
class MouseController extends Eventful {
|
||||||
constructor(jmap) {
|
constructor(jmap) {
|
||||||
super();
|
super();
|
||||||
this.$jmap = jmap;
|
this.$jmap = jmap;
|
||||||
this.$zr = jmap.getZr();
|
this.deviceList = [];
|
||||||
this.events = jmap.getEvents();
|
this.rightClickPoint = {
|
||||||
this.initHandler(this.$zr);
|
x: 0,
|
||||||
}
|
y: 0
|
||||||
|
}; // 右键点击坐标
|
||||||
|
this.$zr = jmap.getZr();
|
||||||
|
this.events = jmap.getEvents();
|
||||||
|
this.initHandler(this.$zr);
|
||||||
|
}
|
||||||
|
|
||||||
initHandler(zr) {
|
initHandler(zr) {
|
||||||
if (zr) {
|
if (zr) {
|
||||||
zr.on('click', this.click, this);
|
zr.on('click', this.click, this);
|
||||||
zr.on('contextmenu', this.contextmenu, this);
|
zr.on('contextmenu', this.contextmenu, this);
|
||||||
zr.on('mousemove', this.moveEvent, this);
|
zr.on('mousemove', this.moveEvent, this);
|
||||||
|
|
||||||
this.enable = function (opts) {
|
this.enable = function (opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
this._moveOnMouseMove = opts.moveOnMouseMove || true;
|
||||||
this._zoomOnMouseWheel = opts.zoomOnMouseWheel || false;
|
this._zoomOnMouseWheel = opts.zoomOnMouseWheel || false;
|
||||||
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
this._preventDefaultMouseMove = opts.preventDefaultMouseMove || true;
|
||||||
|
|
||||||
this.disable();
|
this.disable();
|
||||||
|
|
||||||
zr.on('mousedown', this.mousedown, this);
|
zr.on('mousedown', this.mousedown, this);
|
||||||
zr.on('mousemove', this.mousemove, this);
|
zr.on('mousemove', this.mousemove, this);
|
||||||
zr.on('mouseup', this.mouseup, this);
|
zr.on('mouseup', this.mouseup, this);
|
||||||
zr.on('mousewheel', this.mousewheel, this);
|
zr.on('mousewheel', this.mousewheel, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.disable = function () {
|
this.disable = function () {
|
||||||
zr.off('mousedown', this.mousedown);
|
zr.off('mousedown', this.mousedown);
|
||||||
zr.off('mousemove', this.mousemove);
|
zr.off('mousemove', this.mousemove);
|
||||||
zr.off('mouseup', this.mouseup);
|
zr.off('mouseup', this.mouseup);
|
||||||
zr.off('mousewheel', this.mousewheel);
|
zr.off('mousewheel', this.mousewheel);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.dispose = function () {
|
this.dispose = function () {
|
||||||
zr.off('click', this.click);
|
zr.off('click', this.click);
|
||||||
zr.off('contextmenu', this.contextmenu);
|
zr.off('contextmenu', this.contextmenu);
|
||||||
zr.off('mousemove', this.moveEvent);
|
zr.off('mousemove', this.moveEvent);
|
||||||
this.disable();
|
this.disable();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.isDragging = function () { return this._dragging; };
|
this.isDragging = function () { return this._dragging; };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mousedown(e) {
|
mousedown(e) {
|
||||||
if (eventTool.notLeftMouse(e)) {
|
// if (eventTool.notLeftMouse(e)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
if (e.which == 1 || e.which == 3) {
|
||||||
|
var x = e.offsetX;
|
||||||
|
var y = e.offsetY;
|
||||||
|
|
||||||
var x = e.offsetX;
|
this._x = x;
|
||||||
var y = e.offsetY;
|
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;
|
mousemove(e) {
|
||||||
this._y = y;
|
// if (eventTool.notLeftMouse(e) ||
|
||||||
this._dragging = true;
|
// !this._moveOnMouseMove ||
|
||||||
}
|
// !this._dragging
|
||||||
|
// ) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
mousemove(e) {
|
const oldX = this._x;
|
||||||
if (eventTool.notLeftMouse(e) ||
|
const oldY = this._y;
|
||||||
!this._moveOnMouseMove ||
|
|
||||||
!this._dragging
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const oldX = this._x;
|
const dx = e.offsetX - oldX;
|
||||||
const oldY = this._y;
|
const dy = e.offsetY - oldY;
|
||||||
|
|
||||||
const dx = e.offsetX - oldX;
|
this._x = e.offsetX;
|
||||||
const dy = e.offsetY - oldY;
|
this._y = e.offsetY;
|
||||||
|
|
||||||
this._x = e.offsetX;
|
if (e.which == 1) {
|
||||||
this._y = e.offsetY;
|
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) {
|
mousewheel(e) {
|
||||||
if (!eventTool.notLeftMouse(e)) {
|
const shouldZoom = this._zoomOnMouseWheel;
|
||||||
this._dragging = false;
|
const wheelDelta = e.wheelDelta;
|
||||||
}
|
const originX = e.offsetX;
|
||||||
}
|
const originY = e.offsetY;
|
||||||
|
|
||||||
mousewheel(e) {
|
if (wheelDelta === 0 || !shouldZoom) {
|
||||||
const shouldZoom = this._zoomOnMouseWheel;
|
return;
|
||||||
const wheelDelta = e.wheelDelta;
|
}
|
||||||
const originX = e.offsetX;
|
|
||||||
const originY = e.offsetY;
|
|
||||||
|
|
||||||
if (wheelDelta === 0 || !shouldZoom) {
|
if (shouldZoom) {
|
||||||
return;
|
eventTool.stop(e.event);
|
||||||
}
|
let scale = 1;
|
||||||
|
if (wheelDelta > 0) {
|
||||||
|
scale = 1;
|
||||||
|
} else if (wheelDelta < 0) {
|
||||||
|
scale = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (shouldZoom) {
|
this.trigger(this.events.__Zoom, {type: this.events.__Zoom, scale, originX, originY });
|
||||||
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 });
|
click(e) {
|
||||||
}
|
var em = this.checkEvent(e);
|
||||||
}
|
this.trigger(this.events.Selected, em);
|
||||||
|
}
|
||||||
|
|
||||||
click(e) {
|
contextmenu(e) {
|
||||||
var em = this.checkEvent(e);
|
var em = this.checkEvent(e);
|
||||||
this.trigger(this.events.Selected, em);
|
this.trigger(this.events.Contextmenu, em);
|
||||||
}
|
}
|
||||||
|
|
||||||
contextmenu(e) {
|
moveEvent(e) {
|
||||||
var em = this.checkEvent(e);
|
const newEm = new EventModel(e);
|
||||||
this.trigger(this.events.Contextmenu, em);
|
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) {
|
checkEvent(e) {
|
||||||
const newEm = new EventModel(e);
|
var oldEm = new EventModel(this.$zr.curEvent || { event: {} });
|
||||||
const trainDetails = store.state.map.trainDetails;
|
var newEm = new EventModel(e);
|
||||||
if (trainDetails) {
|
if ([1, 3].includes(e.which)) {
|
||||||
if (newEm.deviceType != deviceType.Train || trainDetails.code != newEm.deviceCode) {
|
// 查找之前和当前鼠标选中的实例
|
||||||
var instance = (this.$jmap.getDeviceByCode(trainDetails.code) || {} ).instance;
|
var oldDevice = this.$jmap.getDeviceByCode(oldEm.deviceCode) || {};
|
||||||
instance && instance.removeTrainDetail && instance.removeTrainDetail();
|
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: {} });
|
if (oldInstance != newInstance) {
|
||||||
var newEm = new EventModel(e);
|
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
||||||
if ([1, 3].includes(e.which)) {
|
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
||||||
// 查找之前和当前鼠标选中的实例
|
// 视图数据设置点击标志,同步执行
|
||||||
var oldDevice = this.$jmap.getDeviceByCode(oldEm.deviceCode) || {};
|
oldDevice['down'] = false;
|
||||||
var newDevice = this.$jmap.getDeviceByCode(newEm.deviceCode) || {};
|
oldInstance.mouseEvent['mouseout'](e);
|
||||||
var oldInstance = (this.$jmap.getDeviceByCode(oldEm.deviceCode) || {}).instance || {};
|
}
|
||||||
var newInstance = (this.$jmap.getDeviceByCode(newEm.deviceCode) || {}).instance || {};
|
|
||||||
|
|
||||||
// 如果之前和当前选中的实例不一致
|
// 如果实例有选中函数并且被点击,则执行选中函数
|
||||||
if (oldInstance != newInstance) {
|
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
||||||
// 如果实例有取消选择函数并且被点击,则执行取消选中函数
|
newDevice['down'] = true;
|
||||||
if (oldInstance.mouseEvent && oldInstance.mouseEvent.mouseout) {
|
newInstance.mouseEvent['mouseover'](e);
|
||||||
// 视图数据设置点击标志,同步执行
|
}
|
||||||
oldDevice['down'] = false;
|
}
|
||||||
oldInstance.mouseEvent['mouseout'](e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果实例有选中函数并且被点击,则执行选中函数
|
// 保存当前实例到全局
|
||||||
if (e.which == 3 && newInstance.mouseEvent && newInstance.mouseEvent.mouseover) {
|
this.$zr.curEvent = e;
|
||||||
newDevice['down'] = true;
|
}
|
||||||
newInstance.mouseEvent['mouseover'](e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存当前实例到全局
|
return newEm;
|
||||||
this.$zr.curEvent = e;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
export default MouseController;
|
||||||
|
@ -1,100 +1,100 @@
|
|||||||
class Options {
|
class Options {
|
||||||
constructor(opts, trigger) {
|
constructor(opts, trigger) {
|
||||||
this.scaleIndex = 0;
|
this.scaleIndex = 0;
|
||||||
this.scaleList = [
|
this.scaleList = [
|
||||||
0.5, 0.6, 0.7, 0.8, 0.9,
|
0.8, 0.9,
|
||||||
1, 1.2, 1.4, 1.6, 1.8,
|
1, 1.2, 1.4, 1.6, 1.8,
|
||||||
2, 2.2, 2.4, 2.6, 2.8,
|
2, 2.2, 2.4, 2.6, 2.8,
|
||||||
3, 3.2, 3.4, 3.6, 3.8,
|
3, 3.2, 3.4, 3.6, 3.8,
|
||||||
4, 4.2, 4.4, 4.6, 4.8,
|
4, 4.2, 4.4, 4.6, 4.8,
|
||||||
5, 5.2, 5.4, 5.6, 5.8,
|
5, 5.2, 5.4, 5.6, 5.8,
|
||||||
6, 6.2, 6.4, 6.6, 6.8,
|
6, 6.2, 6.4, 6.6, 6.8,
|
||||||
7, 7.2, 7.4, 7.6, 7.8,
|
7, 7.2, 7.4, 7.6, 7.8,
|
||||||
8, 8.2, 8.4, 8.6, 8.8
|
8
|
||||||
];
|
];
|
||||||
|
|
||||||
if (Number.isFinite(opts.scaleRate)) {
|
if (Number.isFinite(opts.scaleRate)) {
|
||||||
const idx = this.scaleList.indexOf(opts.scaleRate);
|
const idx = this.scaleList.indexOf(opts.scaleRate);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
this.scaleIndex = idx;
|
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) {
|
update(payload) {
|
||||||
if (Number.isFinite(payload.dx)) {
|
if (Number.isFinite(payload.dx)) {
|
||||||
this.offsetX -= payload.dx;
|
this.offsetX -= payload.dx;
|
||||||
}
|
}
|
||||||
if (Number.isFinite(payload.dy)) {
|
if (Number.isFinite(payload.dy)) {
|
||||||
this.offsetY -= payload.dy;
|
this.offsetY -= payload.dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isFinite(payload.offsetX)) {
|
if (Number.isFinite(payload.offsetX)) {
|
||||||
this.offsetX = payload.offsetX;
|
this.offsetX = payload.offsetX;
|
||||||
}
|
}
|
||||||
if (Number.isFinite(payload.offsetY)) {
|
if (Number.isFinite(payload.offsetY)) {
|
||||||
this.offsetY = payload.offsetY;
|
this.offsetY = payload.offsetY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isFinite(payload.scale)) {
|
if (Number.isFinite(payload.scale)) {
|
||||||
if (Number.isFinite(payload.scale)) {
|
if (Number.isFinite(payload.scale)) {
|
||||||
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
if ((this.scaleIndex + payload.scale) >= 0 && (this.scaleIndex + payload.scale) < this.scaleList.length) {
|
||||||
this.scaleIndex = this.scaleIndex + payload.scale;
|
this.scaleIndex = this.scaleIndex + payload.scale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.scaleRate = this.scaleList[this.scaleIndex];
|
this.scaleRate = this.scaleList[this.scaleIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isFinite(payload.scaleRate)) {
|
if (Number.isFinite(payload.scaleRate)) {
|
||||||
const idx = this.scaleList.indexOf(payload.scaleRate);
|
const idx = this.scaleList.indexOf(payload.scaleRate);
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.scaleIndex = idx;
|
this.scaleIndex = idx;
|
||||||
this.scaleRate = payload.scaleRate;
|
this.scaleRate = payload.scaleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload.disabled === true || payload.disabled === false) {
|
if (payload.disabled === true || payload.disabled === false) {
|
||||||
this.disabled = payload.disabled;
|
this.disabled = payload.disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
if (payload.moveOnMouseMove === true || payload.moveOnMouseMove === false) {
|
||||||
this.moveOnMouseMove = payload.moveOnMouseMove;
|
this.moveOnMouseMove = payload.moveOnMouseMove;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
|
||||||
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.trigger instanceof Function) { this.trigger(this); }
|
if (this.trigger instanceof Function) { this.trigger(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
getScaleRate(scale) {
|
getScaleRate(scale) {
|
||||||
if (Number.isFinite(scale)) {
|
if (Number.isFinite(scale)) {
|
||||||
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
if ((this.scaleIndex + scale) >= 0 && (this.scaleIndex + scale) < this.scaleList.length) {
|
||||||
return this.scaleList[this.scaleIndex + scale];
|
return this.scaleList[this.scaleIndex + scale];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.scaleList[this.scaleIndex];
|
return this.scaleList[this.scaleIndex];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Options;
|
export default Options;
|
||||||
|
@ -6,265 +6,265 @@ import shapefactory from './shape/factory';
|
|||||||
import TransformHandle from './transformHandle';
|
import TransformHandle from './transformHandle';
|
||||||
|
|
||||||
class Painter {
|
class Painter {
|
||||||
constructor(jmap) {
|
constructor(jmap) {
|
||||||
// 父级实例
|
// 父级实例
|
||||||
this.$jmap = jmap;
|
this.$jmap = jmap;
|
||||||
this.$zr = jmap.getZr();
|
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 {*} dom
|
||||||
* @param {*} config
|
* @param {*} config
|
||||||
*/
|
*/
|
||||||
initLevels() {
|
initLevels() {
|
||||||
// 图层分级策略
|
// 图层分级策略
|
||||||
this.layerBranch = {};
|
this.layerBranch = {};
|
||||||
this.layerBranch['01'] = (type) => { return type == deviceType.Link; }; // 逻辑图层级
|
this.layerBranch['01'] = (type) => { return type == deviceType.Link; }; // 逻辑图层级
|
||||||
this.layerBranch['02'] = (type) => { return type != deviceType.Link; }; // 物理图层级
|
this.layerBranch['02'] = (type) => { return type != deviceType.Link; }; // 物理图层级
|
||||||
this.layerBranch['03'] = (type) => { return true; }; // 混合图层级
|
this.layerBranch['03'] = (type) => { return true; }; // 混合图层级
|
||||||
|
|
||||||
// 添加父级图层
|
// 添加父级图层
|
||||||
this.parentLevel = new Group({ name: '__parent__' });
|
this.parentLevel = new Group({ name: '__parent__' });
|
||||||
this.$zr.add(this.parentLevel);
|
this.$zr.add(this.parentLevel);
|
||||||
|
|
||||||
// 添加子级图层
|
// 添加子级图层
|
||||||
zrUtil.each(Object.values(deviceType), (type) => {
|
zrUtil.each(Object.values(deviceType), (type) => {
|
||||||
const level = new Group({ name: `__${type}__` });
|
const level = new Group({ name: `__${type}__` });
|
||||||
this.mapInstanceLevel[type] = level;
|
this.mapInstanceLevel[type] = level;
|
||||||
this.parentLevel.add(level);
|
this.parentLevel.add(level);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 设置默认显示图级
|
// 设置默认显示图级
|
||||||
this.setLayerVisible('02');
|
this.setLayerVisible('02');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重绘视图
|
* 重绘视图
|
||||||
* @param {*} mapDevice
|
* @param {*} mapDevice
|
||||||
*/
|
*/
|
||||||
repaint(mapDevice) {
|
repaint(mapDevice) {
|
||||||
// 清空视图
|
// 清空视图
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
||||||
// 创建视图
|
// 创建视图
|
||||||
Object.values(mapDevice).forEach(device => {
|
Object.values(mapDevice).forEach(device => {
|
||||||
this.add(device);
|
this.add(device);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加视图
|
* 添加视图
|
||||||
* @param {*} device
|
* @param {*} device
|
||||||
*/
|
*/
|
||||||
add(device) {
|
add(device) {
|
||||||
try {
|
try {
|
||||||
const instance = shapefactory(device, this.$jmap);
|
const instance = shapefactory(device, this.$jmap);
|
||||||
if (instance) {
|
if (instance) {
|
||||||
device.instance = instance;
|
device.instance = instance;
|
||||||
this.$transformHandle.transformView(instance);
|
this.$transformHandle.transformView(instance);
|
||||||
this.mapInstanceLevel[device._type].add(instance);
|
this.mapInstanceLevel[device._type].add(instance);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除视图
|
* 删除视图
|
||||||
* @param {*} device
|
* @param {*} device
|
||||||
*/
|
*/
|
||||||
delete(device) {
|
delete(device) {
|
||||||
const instance = device.instance;
|
const instance = device.instance;
|
||||||
if (instance) {
|
if (instance) {
|
||||||
this.mapInstanceLevel[device._type].remove(instance);
|
this.mapInstanceLevel[device._type].remove(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIntersect(device) {
|
checkIntersect(device) {
|
||||||
var intersect = false;
|
var intersect = false;
|
||||||
var befor = device.instance;
|
var befor = device.instance;
|
||||||
var train = shapefactory(device, this.$jmap);
|
var train = shapefactory(device, this.$jmap);
|
||||||
|
|
||||||
this.mapInstanceLevel[deviceType.Train].eachChild(elem => {
|
this.mapInstanceLevel[deviceType.Train].eachChild(elem => {
|
||||||
if (elem !== befor && elem.getBoundingRect().intersect(train.getBoundingRect())) {
|
if (elem !== befor && elem.getBoundingRect().intersect(train.getBoundingRect())) {
|
||||||
intersect = true;
|
intersect = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return intersect;
|
return intersect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新列车
|
* 更新列车
|
||||||
* @param {*} device
|
* @param {*} device
|
||||||
*/
|
*/
|
||||||
updateTrain(device) {
|
updateTrain(device) {
|
||||||
var oldTrainWindowModel = null;
|
var oldTrainWindowModel = null;
|
||||||
var instance = device.instance;
|
var instance = device.instance;
|
||||||
var curModel = device;
|
var curModel = device;
|
||||||
|
|
||||||
if (instance) {
|
if (instance) {
|
||||||
oldTrainWindowModel = device.trainWindowModel;
|
oldTrainWindowModel = device.trainWindowModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curModel.sectionCode) {
|
if (curModel.sectionCode) {
|
||||||
curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode);
|
curModel.sectionModel = this.$jmap.getDeviceByCode(curModel.sectionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curModel.trainWindowCode) {
|
if (curModel.trainWindowCode) {
|
||||||
curModel.trainWindowModel = this.$jmap.getDeviceByCode(curModel.trainWindowCode);
|
curModel.trainWindowModel = this.$jmap.getDeviceByCode(curModel.trainWindowCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance && oldTrainWindowModel && this.checkIntersect(device)) {
|
if (instance && oldTrainWindowModel && this.checkIntersect(device)) {
|
||||||
device.trainWindowModel = oldTrainWindowModel;
|
device.trainWindowModel = oldTrainWindowModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
instance && this.mapInstanceLevel[deviceType.Train].remove(instance);
|
instance && this.mapInstanceLevel[deviceType.Train].remove(instance);
|
||||||
this.add(device);
|
this.add(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新视图
|
* 更新视图
|
||||||
* @param {*} device
|
* @param {*} device
|
||||||
*/
|
*/
|
||||||
update(device) {
|
update(device) {
|
||||||
if (device) {
|
if (device) {
|
||||||
try {
|
try {
|
||||||
if (device._dispose) {
|
if (device._dispose) {
|
||||||
this.delete(device);
|
this.delete(device);
|
||||||
} else if (deviceType.Train == device._type) {
|
} else if (deviceType.Train == device._type) {
|
||||||
this.updateTrain(device);
|
this.updateTrain(device);
|
||||||
} else {
|
} else {
|
||||||
const instance = device.instance;
|
const instance = device.instance;
|
||||||
if (instance) {
|
if (instance) {
|
||||||
instance.setState(device);
|
instance.setState(device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新transform变化
|
* 更新transform变化
|
||||||
* @param {*} opt
|
* @param {*} opt
|
||||||
*/
|
*/
|
||||||
updateTransform(opt) {
|
updateTransform(opt) {
|
||||||
this.$transformHandle.updateTransform(opt);
|
this.$transformHandle.updateTransform(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新zrender尺寸
|
* 更新zrender尺寸
|
||||||
* @param {*} opt
|
* @param {*} opt
|
||||||
*/
|
*/
|
||||||
updateZrSize(opt) {
|
updateZrSize(opt) {
|
||||||
this.$transformHandle.updateZrSize(opt);
|
this.$transformHandle.updateZrSize(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过去坐标提示位置
|
* 过去坐标提示位置
|
||||||
* @param {*} opts
|
* @param {*} opts
|
||||||
*/
|
*/
|
||||||
getShapeTipPoint(instance, opts) {
|
getShapeTipPoint(instance, opts) {
|
||||||
if (instance) {
|
if (instance) {
|
||||||
var point = instance.getShapeTipPoint(opts);
|
var point = instance.getShapeTipPoint(opts);
|
||||||
if (point) {
|
if (point) {
|
||||||
// 矩阵变换
|
// 矩阵变换
|
||||||
var transform = this.$transformHandle.transform;
|
var transform = this.$transformHandle.transform;
|
||||||
var transPoint = vector.applyTransform([], [point.x, point.y], transform);
|
var transPoint = vector.applyTransform([], [point.x, point.y], transform);
|
||||||
return {
|
return {
|
||||||
x: transPoint[0],
|
x: transPoint[0],
|
||||||
y: transPoint[1]
|
y: transPoint[1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置逻辑和物理图层
|
* 设置逻辑和物理图层
|
||||||
* @param {*} layer
|
* @param {*} layer
|
||||||
*/
|
*/
|
||||||
setLayerVisible(layer) {
|
setLayerVisible(layer) {
|
||||||
zrUtil.each(Object.values(deviceType), type => {
|
zrUtil.each(Object.values(deviceType), type => {
|
||||||
const level = this.mapInstanceLevel[type];
|
const level = this.mapInstanceLevel[type];
|
||||||
if (this.layerBranch[layer](type)) {
|
if (this.layerBranch[layer](type)) {
|
||||||
level.show();
|
level.show();
|
||||||
} else {
|
} else {
|
||||||
level.hide();
|
level.hide();
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置图层可见
|
* 设置图层可见
|
||||||
* @param {*} code
|
* @param {*} code
|
||||||
*/
|
*/
|
||||||
setLevelVisible(list) {
|
setLevelVisible(list) {
|
||||||
zrUtil.each(Object.values(deviceType), type => {
|
zrUtil.each(Object.values(deviceType), type => {
|
||||||
const level = this.mapInstanceLevel[type];
|
const level = this.mapInstanceLevel[type];
|
||||||
if (list.includes(type)) {
|
if (list.includes(type)) {
|
||||||
level.show();
|
level.show();
|
||||||
} else {
|
} else {
|
||||||
level.hide();
|
level.hide();
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新图层
|
* 刷新图层
|
||||||
*/
|
*/
|
||||||
refresh() {
|
refresh() {
|
||||||
this.$zr.refresh();
|
this.$zr.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除图层
|
* 清除图层
|
||||||
*/
|
*/
|
||||||
clearLevel(type) {
|
clearLevel(type) {
|
||||||
const level = this.mapInstanceLevel[type];
|
const level = this.mapInstanceLevel[type];
|
||||||
if (level) {
|
if (level) {
|
||||||
level.removeAll();
|
level.removeAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除canvas
|
* 清除canvas
|
||||||
*/
|
*/
|
||||||
clear() {
|
clear() {
|
||||||
zrUtil.each(Object.values(this.mapInstanceLevel), (level) => {
|
zrUtil.each(Object.values(this.mapInstanceLevel), (level) => {
|
||||||
level && level.removeAll();
|
level && level.removeAll();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 销毁图层
|
* 销毁图层
|
||||||
*/
|
*/
|
||||||
dispose() {
|
dispose() {
|
||||||
this.mapInstanceLevel = {};
|
this.mapInstanceLevel = {};
|
||||||
this.parentLevel = null;
|
this.parentLevel = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父级图层
|
* 父级图层
|
||||||
*/
|
*/
|
||||||
getParentLevel() {
|
getParentLevel() {
|
||||||
return this.parentLevel;
|
return this.parentLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,65 +5,65 @@ import Group from 'zrender/src/container/Group';
|
|||||||
import Image from 'zrender/src/graphic/Image';
|
import Image from 'zrender/src/graphic/Image';
|
||||||
|
|
||||||
export default class ImageControl extends Group {
|
export default class ImageControl extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
super();
|
super();
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = model.zIndex || 1;
|
this.z = model.zIndex || 1;
|
||||||
this.create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.image = new Image({
|
this.image = new Image({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
origin: {
|
origin: {
|
||||||
x: model.position.x,
|
x: model.position.x,
|
||||||
y: model.position.y
|
y: model.position.y
|
||||||
},
|
},
|
||||||
rotation: -Math.PI / 180 * model.rotate,
|
rotation: -Math.PI / 180 * model.rotate,
|
||||||
style: {
|
style: {
|
||||||
image: model.url,
|
image: model.url,
|
||||||
x: model.position.x,
|
x: model.position.x,
|
||||||
y: model.position.y,
|
y: model.position.y,
|
||||||
width: model.width,
|
width: model.width,
|
||||||
height: model.height
|
height: model.height
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.image);
|
this.add(this.image);
|
||||||
// 旋转
|
// 旋转
|
||||||
if (model.rotate) {
|
if (model.rotate) {
|
||||||
this.transformRotation(this.image);
|
this.transformRotation(this.image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 整体图片
|
// 整体图片
|
||||||
transformRotation(item) {
|
transformRotation(item) {
|
||||||
if (this.model.rotate) {
|
if (this.model.rotate) {
|
||||||
const origin = [this.model.position.x, this.model.position.y];
|
const origin = [this.model.position.x, this.model.position.y];
|
||||||
const rotation = -Math.PI / 180 * Number(this.model.rotate);
|
const rotation = -Math.PI / 180 * Number(this.model.rotate);
|
||||||
item.origin = origin;
|
item.origin = origin;
|
||||||
item.rotation = rotation;
|
item.rotation = rotation;
|
||||||
item.dirty();
|
item.dirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
if (this.image) {
|
if (this.image) {
|
||||||
var distance = 2;
|
var distance = 2;
|
||||||
var rect = this.image.getBoundingRect();
|
var rect = this.image.getBoundingRect();
|
||||||
return {
|
return {
|
||||||
x: rect.x + rect.width / 2,
|
x: rect.x + rect.width / 2,
|
||||||
y: rect.y - distance
|
y: rect.y - distance
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,36 +4,36 @@ import Rect from 'zrender/src/graphic/shape/Rect';
|
|||||||
// import store from '@/store';
|
// import store from '@/store';
|
||||||
|
|
||||||
class EMouse extends Group {
|
class EMouse extends Group {
|
||||||
constructor(device) {
|
constructor(device) {
|
||||||
super();
|
super();
|
||||||
this.device = device;
|
this.device = device;
|
||||||
this.create();
|
this.create();
|
||||||
}
|
}
|
||||||
create() {
|
create() {
|
||||||
if (this.device.link) {
|
if (this.device.link) {
|
||||||
const rect = this.device.link.getBoundingRect();
|
const rect = this.device.link.getBoundingRect();
|
||||||
this.lineBorder = new Rect({
|
this.lineBorder = new Rect({
|
||||||
zlevel: this.device.zlevel,
|
zlevel: this.device.zlevel,
|
||||||
z: this.device.z - 1,
|
z: this.device.z - 1,
|
||||||
shape: rect,
|
shape: rect,
|
||||||
style: {
|
style: {
|
||||||
lineDash: [3, 3],
|
lineDash: [3, 3],
|
||||||
stroke: '#fff',
|
stroke: '#fff',
|
||||||
fill: this.device.style.transparentColor
|
fill: this.device.style.transparentColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.add(this.lineBorder);
|
this.add(this.lineBorder);
|
||||||
this.lineBorder.hide();
|
this.lineBorder.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseover(e) {
|
mouseover(e) {
|
||||||
this.lineBorder && this.lineBorder.show();
|
this.lineBorder && this.lineBorder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseout(e) {
|
mouseout(e) {
|
||||||
this.lineBorder && this.lineBorder.hide();
|
this.lineBorder && this.lineBorder.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default EMouse;
|
export default EMouse;
|
||||||
|
@ -3,62 +3,62 @@ import Group from 'zrender/src/container/Group';
|
|||||||
import EMouse from './EMouse';
|
import EMouse from './EMouse';
|
||||||
|
|
||||||
class Link extends Group {
|
class Link extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
super();
|
super();
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
|
||||||
let textPosition = 'insideBottom';
|
let textPosition = 'insideBottom';
|
||||||
if (model.lp.x !== model.rp.x && model.lp.y !== model.rp.y) {
|
if (model.lp.x !== model.rp.x && model.lp.y !== model.rp.y) {
|
||||||
textPosition = model.lp.y > model.rp.y ? 'insideLeft' : 'insideRight';
|
textPosition = model.lp.y > model.rp.y ? 'insideLeft' : 'insideRight';
|
||||||
}
|
}
|
||||||
// 标准link
|
// 标准link
|
||||||
this.link = new Line({
|
this.link = new Line({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: 0,
|
z: 0,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.lp.x,
|
x1: model.lp.x,
|
||||||
y1: model.lp.y,
|
y1: model.lp.y,
|
||||||
x2: model.rp.x,
|
x2: model.rp.x,
|
||||||
y2: model.rp.y
|
y2: model.rp.y
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: style.Link.linkWidth,
|
lineWidth: style.Link.linkWidth,
|
||||||
stroke: style.Link.linkColor,
|
stroke: style.Link.linkColor,
|
||||||
text: model.name,
|
text: model.name,
|
||||||
textDistance: style.Link.linkWidth * 2,
|
textDistance: style.Link.linkWidth * 2,
|
||||||
textPosition: textPosition, // 'inside',
|
textPosition: textPosition, // 'inside',
|
||||||
textAlign: 'middle',
|
textAlign: 'middle',
|
||||||
fontSize: style.Link.textFontSize,
|
fontSize: style.Link.textFontSize,
|
||||||
textFill: style.Link.linkTextColor,
|
textFill: style.Link.linkTextColor,
|
||||||
textStroke: style.Link.backgroundColor
|
textStroke: style.Link.backgroundColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.add(this.link);
|
this.add(this.link);
|
||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
if (path.includes('/map/draw')) {
|
if (path.includes('/map/draw')) {
|
||||||
// 鼠标事件
|
// 鼠标事件
|
||||||
this.mouseEvent = new EMouse(this);
|
this.mouseEvent = new EMouse(this);
|
||||||
this.add(this.mouseEvent);
|
this.add(this.mouseEvent);
|
||||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tipBasePoint() {
|
tipBasePoint() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Link;
|
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';
|
import Text from 'zrender/src/graphic/Text';
|
||||||
|
|
||||||
export default class EMouse extends Group {
|
export default class EMouse extends Group {
|
||||||
constructor(device) {
|
constructor(device) {
|
||||||
super();
|
super();
|
||||||
this.device = device;
|
this.device = device;
|
||||||
this.create();
|
this.create();
|
||||||
}
|
}
|
||||||
create() {
|
create() {
|
||||||
this.text = new Text({
|
this.text = new Text({
|
||||||
_subType: 'Text',
|
_subType: 'Text',
|
||||||
zlevel: this.device.zlevel,
|
zlevel: this.device.zlevel,
|
||||||
z: this.device.z+1,
|
z: this.device.z + 1,
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
style: {
|
style: {
|
||||||
x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x,
|
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,
|
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,
|
fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight,
|
||||||
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
|
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
|
||||||
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
|
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
|
||||||
text: '填充',
|
text: '',
|
||||||
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
|
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
|
||||||
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
|
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
|
||||||
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
|
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.add(this.text);
|
this.add(this.text);
|
||||||
this.text.hide();
|
this.text.hide();
|
||||||
}
|
}
|
||||||
setTextContext(text) {
|
setTextContext(text) {
|
||||||
if (text) {
|
if (text) {
|
||||||
this.text.setStyle('text', text);
|
this.text.setStyle('text', text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mouseover(e) {
|
mouseover(e) {
|
||||||
if (e.target) {
|
if (e.target) {
|
||||||
let name = '';
|
let name = '';
|
||||||
switch (e.target.parent._subType) {
|
switch (e.target.parent._subType) {
|
||||||
case 'emergency':
|
case 'emergency':
|
||||||
name = '紧急站控';
|
name = '紧急站控';
|
||||||
break;
|
break;
|
||||||
case 'center':
|
case 'center':
|
||||||
name = '中控';
|
name = '中控';
|
||||||
break;
|
break;
|
||||||
case 'substation':
|
case 'substation':
|
||||||
name = '站控';
|
name = '站控';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// debugger;
|
// debugger;
|
||||||
this.setTextContext(name);
|
this.setTextContext(name);
|
||||||
this.text.show();
|
this.text.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseout(e) {
|
mouseout(e) {
|
||||||
if (!this.device.model.down) {
|
if (!this.device.model.down) {
|
||||||
this.text.hide();
|
this.text.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,95 +4,95 @@ import Text from 'zrender/src/graphic/Text';
|
|||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
|
|
||||||
class ESwName extends Group {
|
class ESwName extends Group {
|
||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
this.nameText = new Text({
|
this.nameText = new Text({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z + 6,
|
z: model.z + 6,
|
||||||
style: {
|
style: {
|
||||||
x: model.nameTextX,
|
x: model.nameTextX,
|
||||||
y: model.nameTextY,
|
y: model.nameTextY,
|
||||||
fontWeight: style.Switch.text.fontWeight,
|
fontWeight: style.Switch.text.fontWeight,
|
||||||
fontSize: style.Switch.text.fontSize,
|
fontSize: style.Switch.text.fontSize,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
text: model.name,
|
text: model.name,
|
||||||
textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
|
textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
|
||||||
textVerticalAlign: 'middle',
|
textVerticalAlign: 'middle',
|
||||||
textFill: style.Switch.text.fontColor
|
textFill: style.Switch.text.fontColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const rect = this.nameText.getBoundingRect();
|
const rect = this.nameText.getBoundingRect();
|
||||||
let textWidth = rect.width * 0.8;
|
let textWidth = rect.width * 0.8;
|
||||||
if (model.triangle.drictx !== 1) {
|
if (model.triangle.drictx !== 1) {
|
||||||
rect.x += rect.width;
|
rect.x += rect.width;
|
||||||
textWidth = -textWidth;
|
textWidth = -textWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.textRect = new Rect({
|
this.textRect = new Rect({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z + 10,
|
z: model.z + 10,
|
||||||
silent: true,
|
silent: true,
|
||||||
shape: {
|
shape: {
|
||||||
x: rect.x,
|
x: rect.x,
|
||||||
y: rect.y,
|
y: rect.y,
|
||||||
width: textWidth,
|
width: textWidth,
|
||||||
height: rect.height
|
height: rect.height
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 0,
|
lineWidth: 0,
|
||||||
// lineDash: [3, 3],
|
// lineDash: [3, 3],
|
||||||
stroke: style.Switch.text.borderColor,
|
stroke: style.Switch.text.borderColor,
|
||||||
fill: style.transparentColor
|
fill: style.transparentColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const data=LangStorage.getLang() == 'en'?'Turnout section':'道岔区段名称';
|
const data = LangStorage.getLang() == 'en' ? 'Turnout section' : '道岔区段名称';
|
||||||
|
|
||||||
this.arrowText = new Text({
|
this.arrowText = new Text({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z + 20,
|
z: model.z + 20,
|
||||||
style: {
|
style: {
|
||||||
x: model.arrowTextX,
|
x: model.arrowTextX,
|
||||||
y: model.arrowTextY,
|
y: model.arrowTextY,
|
||||||
fontSize: style.arrowFontSize,
|
fontSize: style.arrowFontSize,
|
||||||
fontWeight: style.Switch.text.fontWeight,
|
fontWeight: style.Switch.text.fontWeight,
|
||||||
fontFamily: style.fontFamily,
|
fontFamily: style.fontFamily,
|
||||||
text: `${data}: ${model.sectionName}`,
|
text: `${data}: ${model.sectionName}`,
|
||||||
textFill: '#000',
|
textFill: '#000',
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
textPadding: 3,
|
textPadding: 3,
|
||||||
textBackgroundColor: style.tipBackgroundColor
|
textBackgroundColor: style.tipBackgroundColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.add(this.textRect);
|
this.add(this.textRect);
|
||||||
this.add(this.nameText);
|
this.add(this.nameText);
|
||||||
this.add(this.arrowText);
|
this.add(this.arrowText);
|
||||||
|
|
||||||
this.arrowText.hide();
|
this.arrowText.hide();
|
||||||
model.nameShow ? this.nameText.show() : this.nameText.hide();
|
model.nameShow ? this.nameText.show() : this.nameText.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
getArrowText() {
|
getArrowText() {
|
||||||
return this.arrowText;
|
return this.arrowText;
|
||||||
}
|
}
|
||||||
|
|
||||||
getNameText() {
|
getNameText() {
|
||||||
return this.nameText;
|
return this.nameText;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTextRect() {
|
getTextRect() {
|
||||||
return this.textRect;
|
return this.textRect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ESwName;
|
export default ESwName;
|
||||||
|
@ -12,414 +12,414 @@ import ELockRect from './ELockRect';
|
|||||||
import EMouse from './EMouse';
|
import EMouse from './EMouse';
|
||||||
|
|
||||||
export default class Switch extends Group {
|
export default class Switch extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
super();
|
super();
|
||||||
this._code = model.code;
|
this._code = model.code;
|
||||||
this._type = model._type;
|
this._type = model._type;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = 6;
|
this.z = 6;
|
||||||
this.triangle = new JTriangle(model.intersection, model.skew);
|
this.triangle = new JTriangle(model.intersection, model.skew);
|
||||||
this.create();
|
this.create();
|
||||||
this.createLockRect(); // 创建单锁矩形框显示
|
this.createLockRect(); // 创建单锁矩形框显示
|
||||||
this.createMouseEvent();
|
this.createMouseEvent();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
createMouseEvent() {
|
createMouseEvent() {
|
||||||
// 鼠标事件
|
// 鼠标事件
|
||||||
if (this.style.Switch.mouseOverStyle) {
|
if (this.style.Switch.mouseOverStyle) {
|
||||||
this.mouseEvent = new EMouse(this);
|
this.mouseEvent = new EMouse(this);
|
||||||
this.add(this.mouseEvent);
|
this.add(this.mouseEvent);
|
||||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
|
||||||
let halfWidth = style.Section.line.width / 2;
|
let halfWidth = style.Section.line.width / 2;
|
||||||
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth*2 + 0.8;
|
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth * 2 + 0.8;
|
||||||
const swPadding = style.Switch.core.length;
|
const swPadding = style.Switch.core.length;
|
||||||
const directx = this.triangle.drictx;
|
const directx = this.triangle.drictx;
|
||||||
const directy = this.triangle.dricty;
|
const directy = this.triangle.dricty;
|
||||||
const direct = -this.triangle.drictx * this.triangle.dricty;
|
const direct = -this.triangle.drictx * this.triangle.dricty;
|
||||||
const coverLength = switchWidth * 1.5;
|
const coverLength = switchWidth * 1.5;
|
||||||
|
|
||||||
this.swCore = new ESwCore({
|
this.swCore = new ESwCore({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: style,
|
style: style,
|
||||||
intersectionX: model.intersection.x,
|
intersectionX: model.intersection.x,
|
||||||
intersectionY: model.intersection.y,
|
intersectionY: model.intersection.y,
|
||||||
coverLength: coverLength,
|
coverLength: coverLength,
|
||||||
lineWidth: switchWidth,
|
lineWidth: switchWidth,
|
||||||
triangle: this.triangle
|
triangle: this.triangle
|
||||||
});
|
});
|
||||||
|
|
||||||
halfWidth += 0.3;
|
halfWidth += 0.3;
|
||||||
const point1 = [model.intersection.x - directx * halfWidth, model.intersection.y + directy * halfWidth];
|
const point1 = [model.intersection.x - directx * halfWidth, model.intersection.y + directy * halfWidth];
|
||||||
const point2 = [point1[0] + directx * switchWidth / this.triangle.getSinRate(), point1[1]];
|
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 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)];
|
const point4 = [point3[0] + direct * this.triangle.getSin(switchWidth), point3[1] - direct * this.triangle.getCos(switchWidth)];
|
||||||
this.locShelter = new ESwLocal({ // 定位
|
this.locShelter = new ESwLocal({ // 定位
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: style,
|
style: style,
|
||||||
shelterPoints: [point1, point2, point3, point4],
|
shelterPoints: [point1, point2, point3, point4],
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
triangle: this.triangle,
|
triangle: this.triangle,
|
||||||
onmouseover: () => { this.name.getArrowText().show(); },
|
onmouseover: () => { this.name.getArrowText().show(); },
|
||||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||||
});
|
});
|
||||||
|
|
||||||
const slen = switchWidth / this.triangle.getSinRate();
|
const slen = switchWidth / this.triangle.getSinRate();
|
||||||
const rpoint1 = [model.intersection.x + directx * halfWidth, model.intersection.y - directy * halfWidth];
|
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 rpoint2 = [rpoint1[0] + directx * (swPadding + switchWidth * this.triangle.getCotRate()), rpoint1[1]];
|
||||||
const rpoint3 = [rpoint2[0], rpoint2[1] + directy * switchWidth];
|
const rpoint3 = [rpoint2[0], rpoint2[1] + directy * switchWidth];
|
||||||
const rpoint4 = [rpoint1[0] + this.triangle.getCos(slen), rpoint1[1] + this.triangle.getSin(slen)];
|
const rpoint4 = [rpoint1[0] + this.triangle.getCos(slen), rpoint1[1] + this.triangle.getSin(slen)];
|
||||||
|
|
||||||
const switchWidth1 = style.Section.line.width / 2 + 0.1;
|
const switchWidth1 = style.Section.line.width / 2 + 0.1;
|
||||||
const width1 = switchWidth1 * this.triangle.getSinRate();
|
const width1 = switchWidth1 * this.triangle.getSinRate();
|
||||||
const height1 = switchWidth1 * this.triangle.getCosRate();
|
const height1 = switchWidth1 * this.triangle.getCosRate();
|
||||||
const width2 = (height1 + switchWidth1) / this.triangle.getTanRate();
|
const width2 = (height1 + switchWidth1) / this.triangle.getTanRate();
|
||||||
const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1;
|
const width3 = (style.Section.line.width / this.triangle.getSinRate()) - width2 - width1;
|
||||||
const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1];
|
const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1];
|
||||||
const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]];
|
const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]];
|
||||||
const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1];
|
const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1];
|
||||||
const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]];
|
const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]];
|
||||||
|
|
||||||
this.relocShelter = new ESwLnversion({ // 反位
|
this.relocShelter = new ESwLnversion({ // 反位
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: style,
|
style: style,
|
||||||
shelterPoints: [rpoint1, rpoint2, rpoint3, rpoint4],
|
shelterPoints: [rpoint1, rpoint2, rpoint3, rpoint4],
|
||||||
sectionPoints: [spoint1, spoint2, spoint3, spoint4],
|
sectionPoints: [spoint1, spoint2, spoint3, spoint4],
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
halfWidth: halfWidth,
|
halfWidth: halfWidth,
|
||||||
triangle: this.triangle,
|
triangle: this.triangle,
|
||||||
onmouseover: () => { this.name.getArrowText().show(); },
|
onmouseover: () => { this.name.getArrowText().show(); },
|
||||||
onmouseout: () => { this.name.getArrowText().hide(); }
|
onmouseout: () => { this.name.getArrowText().hide(); }
|
||||||
});
|
});
|
||||||
|
|
||||||
this.releaseBackground = new Line({ // 区段上遮盖段
|
this.releaseBackground = new Line({ // 区段上遮盖段
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
shape: {
|
shape: {
|
||||||
x1: model.intersection.x - (coverLength * this.triangle.getCotRate()),
|
x1: model.intersection.x - (coverLength * this.triangle.getCotRate()),
|
||||||
y1: model.intersection.y,
|
y1: model.intersection.y,
|
||||||
x2: model.intersection.x + (coverLength * this.triangle.getCotRate()),
|
x2: model.intersection.x + (coverLength * this.triangle.getCotRate()),
|
||||||
y2: model.intersection.y
|
y2: model.intersection.y
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: style.Section.line.width + style.Section.line.beyondWidth + 1,
|
lineWidth: style.Section.line.width + style.Section.line.beyondWidth + 1,
|
||||||
stroke: style.backgroundColor
|
stroke: style.backgroundColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const arrowTextX = model.intersection.x + 10;
|
const arrowTextX = model.intersection.x + 10;
|
||||||
const arrowTextY = model.intersection.y + 15;
|
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 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 nameTextY = model.namePosition.y + model.intersection.y + style.Switch.text.offset.y * (style.Switch.text.position || directy);
|
||||||
|
|
||||||
this.name = new ESwName({
|
this.name = new ESwName({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
style: style,
|
style: style,
|
||||||
arrowTextX: arrowTextX,
|
arrowTextX: arrowTextX,
|
||||||
arrowTextY: arrowTextY,
|
arrowTextY: arrowTextY,
|
||||||
nameTextX: nameTextX,
|
nameTextX: nameTextX,
|
||||||
nameTextY: nameTextY,
|
nameTextY: nameTextY,
|
||||||
sectionName: model.sectionName,
|
sectionName: model.sectionName,
|
||||||
name: model.name,
|
name: model.name,
|
||||||
nameShow: style.Switch.text.show,
|
nameShow: style.Switch.text.show,
|
||||||
triangle: this.triangle
|
triangle: this.triangle
|
||||||
});
|
});
|
||||||
|
|
||||||
this.add(this.swCore); // 岔芯link
|
this.add(this.swCore); // 岔芯link
|
||||||
this.add(this.locShelter);
|
this.add(this.locShelter);
|
||||||
this.add(this.relocShelter);
|
this.add(this.relocShelter);
|
||||||
this.add(this.releaseBackground);
|
this.add(this.releaseBackground);
|
||||||
this.add(this.name);
|
this.add(this.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
createLockRect() {
|
createLockRect() {
|
||||||
const offsetX = this.model.locateType == '01' ? 3 : 0;
|
const offsetX = this.model.locateType == '01' ? 3 : 0;
|
||||||
this.lockRect = new ELockRect({ // 锁定矩形
|
this.lockRect = new ELockRect({ // 锁定矩形
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z + 6,
|
z: this.z + 6,
|
||||||
x: this.model.intersection.x - this.style.Switch.monolock.rectWidth / 2 + offsetX,
|
x: this.model.intersection.x - this.style.Switch.monolock.rectWidth / 2 + offsetX,
|
||||||
y: this.model.intersection.y - this.style.Switch.monolock.rectWidth / 2,
|
y: this.model.intersection.y - this.style.Switch.monolock.rectWidth / 2,
|
||||||
width: this.style.Switch.monolock.rectWidth,
|
width: this.style.Switch.monolock.rectWidth,
|
||||||
lineWidth: 1.8,
|
lineWidth: 1.8,
|
||||||
stroke: this.style.Switch.monolock.rectBorderColor,
|
stroke: this.style.Switch.monolock.rectBorderColor,
|
||||||
fill: this.style.transparentColor
|
fill: this.style.transparentColor
|
||||||
});
|
});
|
||||||
this.add(this.lockRect);
|
this.add(this.lockRect);
|
||||||
this.lockRect.hide();
|
this.lockRect.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 名称动画*/
|
/** 名称动画*/
|
||||||
nameTextAnimation() {
|
nameTextAnimation() {
|
||||||
this.name.getNameText().animateStyle(true)
|
this.name.getNameText().animateStyle(true)
|
||||||
.when(0, { textFill: this.style.backgroundColor })
|
.when(0, { textFill: this.style.backgroundColor })
|
||||||
.when(1000, { textFill: this.style.Switch.text.lossColor })
|
.when(1000, { textFill: this.style.Switch.text.lossColor })
|
||||||
.when(2000, { textFill: this.style.backgroundColor })
|
.when(2000, { textFill: this.style.backgroundColor })
|
||||||
.start();
|
.start();
|
||||||
|
|
||||||
this.name.getTextRect().animateStyle(true)
|
this.name.getTextRect().animateStyle(true)
|
||||||
.when(0, { textFill: this.style.backgroundColor })
|
.when(0, { textFill: this.style.backgroundColor })
|
||||||
.when(1000, { textFill: this.style.Switch.text.borderColor })
|
.when(1000, { textFill: this.style.Switch.text.borderColor })
|
||||||
.when(2000, { textFill: this.style.backgroundColor })
|
.when(2000, { textFill: this.style.backgroundColor })
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置岔芯是否隐藏*/
|
/** 设置岔芯是否隐藏*/
|
||||||
setSwitchCoreInvisible(invisible) {
|
setSwitchCoreInvisible(invisible) {
|
||||||
if (invisible) {
|
if (invisible) {
|
||||||
this.swCore.hide();
|
this.swCore.hide();
|
||||||
} else {
|
} else {
|
||||||
this.swCore.show();
|
this.swCore.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置岔芯颜色*/
|
/** 设置岔芯颜色*/
|
||||||
setSwitchCoreColor(color) {
|
setSwitchCoreColor(color) {
|
||||||
this.swCore && this.swCore.setColor(color);
|
this.swCore && this.swCore.setColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置道岔文字颜色*/
|
/** 设置道岔文字颜色*/
|
||||||
setTextColor(color) {
|
setTextColor(color) {
|
||||||
this.name.getNameText().setStyle({textFill: color});
|
this.name.getNameText().setStyle({textFill: color});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置道岔背景颜色*/
|
/** 设置道岔背景颜色*/
|
||||||
setTextStyle(style) {
|
setTextStyle(style) {
|
||||||
this.name.getNameText().setStyle(style);
|
this.name.getNameText().setStyle(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置道岔文字边框颜色 (道岔封锁) */
|
/** 设置道岔文字边框颜色 (道岔封锁) */
|
||||||
setHasTextBorder(width) {
|
setHasTextBorder(width) {
|
||||||
this.name.getTextRect().setStyle({lineWidth: width});
|
this.name.getTextRect().setStyle({lineWidth: width});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 恢复状态*/
|
/** 恢复状态*/
|
||||||
recover() {
|
recover() {
|
||||||
this.lockRect.hide();
|
this.lockRect.hide();
|
||||||
this.setSwitchCoreColor(this.style.backgroundColor);
|
this.setSwitchCoreColor(this.style.backgroundColor);
|
||||||
this.name.getNameText().stopAnimation(false);
|
this.name.getNameText().stopAnimation(false);
|
||||||
this.swCore.stopAnimation(false);
|
this.swCore.stopAnimation(false);
|
||||||
this.relocShelter.stopAnimation(false);
|
this.relocShelter.stopAnimation(false);
|
||||||
this.relocShelter.hide();
|
this.relocShelter.hide();
|
||||||
this.releaseBackground.hide();
|
this.releaseBackground.hide();
|
||||||
this.setHasTextBorder(0);
|
this.setHasTextBorder(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 定位*/
|
/** 定位*/
|
||||||
setLocationAction() {
|
setLocationAction() {
|
||||||
this.recover();
|
this.recover();
|
||||||
this.setSwitchCoreInvisible(true);
|
this.setSwitchCoreInvisible(true);
|
||||||
this.locShelter.show();
|
this.locShelter.show();
|
||||||
this.relocShelter.hide();
|
this.relocShelter.hide();
|
||||||
this.setTextColor(this.style.Switch.text.locateColor);
|
this.setTextColor(this.style.Switch.text.locateColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 反位*/
|
/** 反位*/
|
||||||
setInversionAction() {
|
setInversionAction() {
|
||||||
this.recover();
|
this.recover();
|
||||||
this.setSwitchCoreInvisible(true);
|
this.setSwitchCoreInvisible(true);
|
||||||
this.setTextColor(this.style.Switch.text.inversionColor);
|
this.setTextColor(this.style.Switch.text.inversionColor);
|
||||||
this.locShelter.hide();
|
this.locShelter.hide();
|
||||||
this.relocShelter.show();
|
this.relocShelter.show();
|
||||||
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
|
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 失去*/
|
/** 失去*/
|
||||||
setLossAction(nameFlicker) {
|
setLossAction(nameFlicker) {
|
||||||
this.recover();
|
this.recover();
|
||||||
this.locShelter.hide();
|
this.locShelter.hide();
|
||||||
this.relocShelter.hide();
|
this.relocShelter.hide();
|
||||||
this.setSwitchCoreInvisible(false);
|
this.setSwitchCoreInvisible(false);
|
||||||
this.setTextColor(this.style.Switch.text.lossColor);
|
this.setTextColor(this.style.Switch.text.lossColor);
|
||||||
nameFlicker && this.nameTextAnimation();
|
nameFlicker && this.nameTextAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 挤叉*/
|
/** 挤叉*/
|
||||||
setForkAction() {
|
setForkAction() {
|
||||||
this.setLossAction(true);
|
this.setLossAction(true);
|
||||||
this.swCore.animateStyle(item => {
|
this.swCore.animateStyle(item => {
|
||||||
item.animateStyle(true)
|
item.animateStyle(true)
|
||||||
.when(0, { stroke: this.style.backgroundColor })
|
.when(0, { stroke: this.style.backgroundColor })
|
||||||
.when(1000, { stroke: 'red' })
|
.when(1000, { stroke: 'red' })
|
||||||
.when(2000, { stroke: this.style.backgroundColor })
|
.when(2000, { stroke: this.style.backgroundColor })
|
||||||
.start();
|
.start();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 空闲*/
|
/** 空闲*/
|
||||||
spare() {
|
spare() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 单锁*/
|
/** 单锁*/
|
||||||
setMonolock() {
|
setMonolock() {
|
||||||
if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示
|
if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示
|
||||||
this.lockRect.show();
|
this.lockRect.show();
|
||||||
}
|
}
|
||||||
switch (this.model.locateType) {
|
switch (this.model.locateType) {
|
||||||
case '01': // 定位
|
case '01': // 定位
|
||||||
this.setTextColor(this.style.Switch.monolock.locationColor); // 设置道岔名称颜色
|
this.setTextColor(this.style.Switch.monolock.locationColor); // 设置道岔名称颜色
|
||||||
break;
|
break;
|
||||||
case '02': // 反位
|
case '02': // 反位
|
||||||
this.setTextColor(this.style.Switch.monolock.inversionColor); // 设置道岔名称颜色
|
this.setTextColor(this.style.Switch.monolock.inversionColor); // 设置道岔名称颜色
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 封锁 */
|
/** 封锁 */
|
||||||
block() {
|
block() {
|
||||||
if (this.style.Switch.block.nameBorderShow) {
|
if (this.style.Switch.block.nameBorderShow) {
|
||||||
this.setHasTextBorder(1);
|
this.setHasTextBorder(1);
|
||||||
} else if (this.style.Switch.block.contentRectShow) {
|
} else if (this.style.Switch.block.contentRectShow) {
|
||||||
this.lockRect.show();
|
this.lockRect.show();
|
||||||
this.lockRect.setStyle({stroke: this.style.Switch.block.contentRectColor});
|
this.lockRect.setStyle({stroke: this.style.Switch.block.contentRectColor});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 延时释放*/
|
/** 延时释放*/
|
||||||
timeRelease() {
|
timeRelease() {
|
||||||
this.setSwitchCoreInvisible(true);
|
this.setSwitchCoreInvisible(true);
|
||||||
this.releaseBackground.show();
|
this.releaseBackground.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置道岔切除*/
|
/** 设置道岔切除*/
|
||||||
setSwitchCutOff() {
|
setSwitchCutOff() {
|
||||||
this.setSwitchCoreInvisible(true);
|
this.setSwitchCoreInvisible(true);
|
||||||
switch (this.model.locateType) {
|
switch (this.model.locateType) {
|
||||||
case '01':
|
case '01':
|
||||||
this.releaseBackground.hide();
|
this.releaseBackground.hide();
|
||||||
break;
|
break;
|
||||||
case '02':
|
case '02':
|
||||||
this.relocShelter.getSection().animateStyle(true)
|
this.relocShelter.getSection().animateStyle(true)
|
||||||
.when(1000, { fill: this.style.backgroundColor })
|
.when(1000, { fill: this.style.backgroundColor })
|
||||||
.start();
|
.start();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sectionCutOff(section) {
|
sectionCutOff(section) {
|
||||||
const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0);
|
const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0);
|
||||||
if (section) {
|
if (section) {
|
||||||
section.animateStyle(true, [
|
section.animateStyle(true, [
|
||||||
{ time: 0, styles: { lineWidth: lineWidth } },
|
{ time: 0, styles: { lineWidth: lineWidth } },
|
||||||
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
|
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
|
||||||
{ time: 2000, styles: { lineWidth: lineWidth } }
|
{ time: 2000, styles: { lineWidth: lineWidth } }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setSectionState(section, style, state) {
|
setSectionState(section, style, state) {
|
||||||
if (section && !section.animators.length) {
|
if (section && !section.animators.length) {
|
||||||
switch (state.sectionAstatus) {
|
switch (state.sectionAstatus) {
|
||||||
case '00': break;
|
case '00': break;
|
||||||
case '01': /** 空闲*/
|
case '01': /** 空闲*/
|
||||||
section.setStyle(style, this.style.Section.line.spareColor);
|
section.setStyle(style, this.style.Section.line.spareColor);
|
||||||
break;
|
break;
|
||||||
case '02': /** 通信车占用*/
|
case '02': /** 通信车占用*/
|
||||||
section.setStyle(style, this.style.Section.line.communicationOccupiedColor);
|
section.setStyle(style, this.style.Section.line.communicationOccupiedColor);
|
||||||
break;
|
break;
|
||||||
case '03': /** 非通信车占用*/
|
case '03': /** 非通信车占用*/
|
||||||
section.setStyle(style, this.style.Section.line.unCommunicationOccupiedColor);
|
section.setStyle(style, this.style.Section.line.unCommunicationOccupiedColor);
|
||||||
break;
|
break;
|
||||||
case '04': /** 进路锁闭*/
|
case '04': /** 进路锁闭*/
|
||||||
section.setStyle(style, this.style.Section.line.routeLockColor);
|
section.setStyle(style, this.style.Section.line.routeLockColor);
|
||||||
break;
|
break;
|
||||||
case '05': /** 故障锁闭*/
|
case '05': /** 故障锁闭*/
|
||||||
section.setStyle(style, this.style.Section.line.faultLockColor);
|
section.setStyle(style, this.style.Section.line.faultLockColor);
|
||||||
break;
|
break;
|
||||||
case '06': /** 封锁*/
|
case '06': /** 封锁*/
|
||||||
section.setStyle(style, this.style.Section.line.blockColor);
|
section.setStyle(style, this.style.Section.line.blockColor);
|
||||||
break;
|
break;
|
||||||
case '07': /** ATC切除*/
|
case '07': /** ATC切除*/
|
||||||
section.setStyle(style, this.style.Section.line.atcExcisionColor);
|
section.setStyle(style, this.style.Section.line.atcExcisionColor);
|
||||||
break;
|
break;
|
||||||
case '08': /** ATS切除*/
|
case '08': /** ATS切除*/
|
||||||
section.setStyle(style, this.style.Section.line.atsExcisionColor);
|
section.setStyle(style, this.style.Section.line.atsExcisionColor);
|
||||||
section.animateStyle(true)
|
section.animateStyle(true)
|
||||||
.when(1000, { fill: this.style.backgroundColor })
|
.when(1000, { fill: this.style.backgroundColor })
|
||||||
.when(2000, { fill: this.style.Section.line.atsExcisionColor })
|
.when(2000, { fill: this.style.Section.line.atsExcisionColor })
|
||||||
.start();
|
.start();
|
||||||
break;
|
break;
|
||||||
case '09': /** 进路延续保护 */
|
case '09': /** 进路延续保护 */
|
||||||
section.setStyle(style, this.style.Section.line.protectiveLockColor);
|
section.setStyle(style, this.style.Section.line.protectiveLockColor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.cutOff) {
|
if (state.cutOff) {
|
||||||
this.sectionCutOff(section);
|
this.sectionCutOff(section);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setLocateType(model) {
|
setLocateType(model) {
|
||||||
switch (model.locateType) {
|
switch (model.locateType) {
|
||||||
case '01':
|
case '01':
|
||||||
this.setLocationAction(); /** 定位*/
|
this.setLocationAction(); /** 定位*/
|
||||||
break;
|
break;
|
||||||
case '02':
|
case '02':
|
||||||
this.setInversionAction(); /** 反位*/
|
this.setInversionAction(); /** 反位*/
|
||||||
break;
|
break;
|
||||||
case '03':
|
case '03':
|
||||||
this.setLossAction(true); /** 失去*/
|
this.setLossAction(true); /** 失去*/
|
||||||
break;
|
break;
|
||||||
case '04':
|
case '04':
|
||||||
this.setForkAction(); /** 挤岔*/
|
this.setForkAction(); /** 挤岔*/
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.setLocationAction();
|
this.setLocationAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
this.setLocateType(model);
|
this.setLocateType(model);
|
||||||
|
|
||||||
switch (model.status) {
|
switch (model.status) {
|
||||||
case '01':
|
case '01':
|
||||||
this.spare(); /** 空闲*/
|
this.spare(); /** 空闲*/
|
||||||
break;
|
break;
|
||||||
case '10':
|
case '10':
|
||||||
this.setMonolock(); /** 单锁*/
|
this.setMonolock(); /** 单锁*/
|
||||||
break;
|
break;
|
||||||
case '13':
|
case '13':
|
||||||
this.timeRelease(); /** 延时释放*/
|
this.timeRelease(); /** 延时释放*/
|
||||||
break;
|
break;
|
||||||
case '14':
|
case '14':
|
||||||
this.block(); /** 封锁*/
|
this.block(); /** 封锁*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 区段切除*/
|
/** 区段切除*/
|
||||||
if (model.cutOff) {
|
if (model.cutOff) {
|
||||||
this.setSwitchCutOff();
|
this.setSwitchCutOff();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getBoundingRect() {
|
getBoundingRect() {
|
||||||
return this.name.getBoundingRect();
|
return this.name.getBoundingRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
const text = this.name.getNameText();
|
const text = this.name.getNameText();
|
||||||
if (text) {
|
if (text) {
|
||||||
const rect = text.getBoundingRect();
|
const rect = text.getBoundingRect();
|
||||||
return {
|
return {
|
||||||
x: rect.x + rect.width / 2,
|
x: rect.x + rect.width / 2,
|
||||||
y: rect.y
|
y: rect.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return null;
|
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 Train from './Train/index.js';
|
||||||
import Line from './Line/index.js';
|
import Line from './Line/index.js';
|
||||||
import Text2 from './Text/index.js';
|
import Text2 from './Text/index.js';
|
||||||
|
import CheckBox from './checkBox/checkBox.js';
|
||||||
|
|
||||||
/** 图库*/
|
/** 图库*/
|
||||||
const mapShape = {};
|
const mapShape = {};
|
||||||
@ -38,14 +39,15 @@ mapShape[deviceType.TrainWindow] = TrainWindow;
|
|||||||
mapShape[deviceType.Train] = Train;
|
mapShape[deviceType.Train] = Train;
|
||||||
mapShape[deviceType.Line] = Line;
|
mapShape[deviceType.Line] = Line;
|
||||||
mapShape[deviceType.Text] = Text2;
|
mapShape[deviceType.Text] = Text2;
|
||||||
|
mapShape[deviceType.CheckBox] = CheckBox;
|
||||||
|
|
||||||
function shapefactory(device, jmap) {
|
function shapefactory(device, jmap) {
|
||||||
const type = device._type;
|
const type = device._type;
|
||||||
const shape = mapShape[type];
|
const shape = mapShape[type];
|
||||||
if (shape instanceof Function) {
|
if (shape instanceof Function) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
return new shape(device, jmap.style);
|
return new shape(device, jmap.style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default shapefactory;
|
export default shapefactory;
|
||||||
|
@ -19,94 +19,94 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChooseTemplatePlan',
|
name: 'ChooseTemplatePlan',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
skinCodeList: [],
|
skinCodeList: [],
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
reset: true,
|
reset: true,
|
||||||
labelWidth: '100px',
|
labelWidth: '100px',
|
||||||
queryObject: {
|
queryObject: {
|
||||||
name: {
|
name: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: '运行图名称'
|
label: '运行图名称'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
radioShow: true,
|
radioShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '运行图名称',
|
title: '运行图名称',
|
||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '皮肤类型',
|
title: '线路类型',
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||||
},
|
},
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return '选择模板运行图';
|
return '选择模板运行图';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.loadInitData();
|
this.loadInitData();
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$store.state.map && this.$store.state.map.map) {
|
if (this.$store.state.map && this.$store.state.map.map) {
|
||||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||||
}
|
}
|
||||||
return runPlanTemplateList(params);
|
return runPlanTemplateList(params);
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
if (this.$refs && this.$refs.pageRules) {
|
if (this.$refs && this.$refs.pageRules) {
|
||||||
const choose = this.$refs.pageRules.currentChoose();
|
const choose = this.$refs.pageRules.currentChoose();
|
||||||
if (choose) {
|
if (choose) {
|
||||||
this.$emit('chooseConfirm', choose);
|
this.$emit('chooseConfirm', choose);
|
||||||
} else {
|
} else {
|
||||||
this.$messageBox(`请选择模板运行图`);
|
this.$messageBox(`请选择模板运行图`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getStationList } from '@/api/runplan';
|
import { getStationList } from '@/api/runplan';
|
||||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ReloadTodayPlan',
|
name: 'ReloadTodayPlan',
|
||||||
@ -54,7 +54,7 @@ export default {
|
|||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '皮肤类型',
|
title: '线路类型',
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
@ -76,7 +76,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -16,126 +16,126 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||||
import { listPublishMap } from '@/api/jmap/map';
|
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ManagePlanList',
|
name: 'ManagePlanList',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
labelWidth: '140px',
|
labelWidth: '140px',
|
||||||
reset: true
|
reset: true
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
indexShow: true,
|
indexShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('publish.mapName'),
|
title: this.$t('publish.mapName'),
|
||||||
prop: 'mapId',
|
prop: 'mapId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||||
tagType: (row) => { return ''; }
|
tagType: (row) => { return ''; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('publish.runPlanName'),
|
title: this.$t('publish.runPlanName'),
|
||||||
prop: 'templatePlanId',
|
prop: 'templatePlanId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '加载日期',
|
title: '加载日期',
|
||||||
prop: 'loadTime'
|
prop: 'loadTime'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: '100',
|
width: '100',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: '删除',
|
name: '删除',
|
||||||
handleClick: this.handleDelete,
|
handleClick: this.handleDelete,
|
||||||
type: 'danger'
|
type: 'danger'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return '运行图计划表';
|
return '运行图计划表';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadPageData();
|
this.loadPageData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadPageData() {
|
loadPageData() {
|
||||||
this.mapList = [];
|
this.mapList = [];
|
||||||
listPublishMap().then(resp => {
|
getPublishMapListOnline().then(resp => {
|
||||||
this.mapList = resp.data;
|
this.mapList = resp.data;
|
||||||
});
|
});
|
||||||
this.templatePlanList = [];
|
this.templatePlanList = [];
|
||||||
listAllTempLateRunPlan().then(resp => {
|
listAllTempLateRunPlan().then(resp => {
|
||||||
this.templatePlanList = resp.data;
|
this.templatePlanList = resp.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$route.query.mapId) {
|
if (this.$route.query.mapId) {
|
||||||
params['mapId'] = this.$route.query.mapId;
|
params['mapId'] = this.$route.query.mapId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$store.state.user.id) {
|
if (this.$store.state.user.id) {
|
||||||
params['userId'] = this.$store.state.user.id;
|
params['userId'] = this.$store.state.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getRunPlanLoadList(params);
|
return getRunPlanLoadList(params);
|
||||||
},
|
},
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteRunPlanLoad(row.id).then(response => {
|
deleteRunPlanLoad(row.id).then(response => {
|
||||||
this.$message.success('删除成功');
|
this.$message.success('删除成功');
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
this.$messageBox('删除失败');
|
this.$messageBox('删除失败');
|
||||||
});
|
});
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
handleCreateRunPlan() {
|
handleCreateRunPlan() {
|
||||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.$nextTick(()=> { this.reloadTable(); });
|
this.$nextTick(()=> { this.reloadTable(); });
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -19,94 +19,94 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChooseTemplatePlan',
|
name: 'ChooseTemplatePlan',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
skinCodeList: [],
|
skinCodeList: [],
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
reset: true,
|
reset: true,
|
||||||
labelWidth: '100px',
|
labelWidth: '100px',
|
||||||
queryObject: {
|
queryObject: {
|
||||||
name: {
|
name: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: '运行图名称'
|
label: '运行图名称'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
radioShow: true,
|
radioShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '运行图名称',
|
title: '运行图名称',
|
||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '皮肤类型',
|
title: '线路类型',
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||||
},
|
},
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return '选择模板运行图';
|
return '选择模板运行图';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.loadInitData();
|
this.loadInitData();
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$store.state.map && this.$store.state.map.map) {
|
if (this.$store.state.map && this.$store.state.map.map) {
|
||||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||||
}
|
}
|
||||||
return runPlanTemplateList(params);
|
return runPlanTemplateList(params);
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
if (this.$refs && this.$refs.pageRules) {
|
if (this.$refs && this.$refs.pageRules) {
|
||||||
const choose = this.$refs.pageRules.currentChoose();
|
const choose = this.$refs.pageRules.currentChoose();
|
||||||
if (choose) {
|
if (choose) {
|
||||||
this.$emit('chooseConfirm', choose);
|
this.$emit('chooseConfirm', choose);
|
||||||
} else {
|
} else {
|
||||||
this.$messageBox(`请选择模板运行图`);
|
this.$messageBox(`请选择模板运行图`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getStationList } from '@/api/runplan';
|
import { getStationList } from '@/api/runplan';
|
||||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ReloadTodayPlan',
|
name: 'ReloadTodayPlan',
|
||||||
@ -54,7 +54,7 @@ export default {
|
|||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '皮肤类型',
|
title: '线路类型',
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
@ -76,7 +76,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -16,126 +16,126 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||||
import { listPublishMap } from '@/api/jmap/map';
|
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ManagePlanList',
|
name: 'ManagePlanList',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
labelWidth: '140px',
|
labelWidth: '140px',
|
||||||
reset: true
|
reset: true
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
indexShow: true,
|
indexShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('publish.mapName'),
|
title: this.$t('publish.mapName'),
|
||||||
prop: 'mapId',
|
prop: 'mapId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||||
tagType: (row) => { return ''; }
|
tagType: (row) => { return ''; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('publish.runPlanName'),
|
title: this.$t('publish.runPlanName'),
|
||||||
prop: 'templatePlanId',
|
prop: 'templatePlanId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '加载日期',
|
title: '加载日期',
|
||||||
prop: 'loadTime'
|
prop: 'loadTime'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: '100',
|
width: '100',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: '删除',
|
name: '删除',
|
||||||
handleClick: this.handleDelete,
|
handleClick: this.handleDelete,
|
||||||
type: 'danger'
|
type: 'danger'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return '运行图计划表';
|
return '运行图计划表';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadPageData();
|
this.loadPageData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadPageData() {
|
loadPageData() {
|
||||||
this.mapList = [];
|
this.mapList = [];
|
||||||
listPublishMap().then(resp => {
|
getPublishMapListOnline().then(resp => {
|
||||||
this.mapList = resp.data;
|
this.mapList = resp.data;
|
||||||
});
|
});
|
||||||
this.templatePlanList = [];
|
this.templatePlanList = [];
|
||||||
listAllTempLateRunPlan().then(resp => {
|
listAllTempLateRunPlan().then(resp => {
|
||||||
this.templatePlanList = resp.data;
|
this.templatePlanList = resp.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$route.query.mapId) {
|
if (this.$route.query.mapId) {
|
||||||
params['mapId'] = this.$route.query.mapId;
|
params['mapId'] = this.$route.query.mapId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$store.state.user.id) {
|
if (this.$store.state.user.id) {
|
||||||
params['userId'] = this.$store.state.user.id;
|
params['userId'] = this.$store.state.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getRunPlanLoadList(params);
|
return getRunPlanLoadList(params);
|
||||||
},
|
},
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteRunPlanLoad(row.id).then(response => {
|
deleteRunPlanLoad(row.id).then(response => {
|
||||||
this.$message.success('删除成功');
|
this.$message.success('删除成功');
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
this.$messageBox('删除失败');
|
this.$messageBox('删除失败');
|
||||||
});
|
});
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
handleCreateRunPlan() {
|
handleCreateRunPlan() {
|
||||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.$nextTick(()=> { this.reloadTable(); });
|
this.$nextTick(()=> { this.reloadTable(); });
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -19,94 +19,94 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChooseTemplatePlan',
|
name: 'ChooseTemplatePlan',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
skinCodeList: [],
|
skinCodeList: [],
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
reset: true,
|
reset: true,
|
||||||
labelWidth: '100px',
|
labelWidth: '100px',
|
||||||
queryObject: {
|
queryObject: {
|
||||||
name: {
|
name: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: '运行图名称'
|
label: '运行图名称'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
radioShow: true,
|
radioShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '运行图名称',
|
title: '运行图名称',
|
||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '皮肤类型',
|
title: '线路类型',
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||||
},
|
},
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return '选择模板运行图';
|
return '选择模板运行图';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.loadInitData();
|
this.loadInitData();
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$store.state.map && this.$store.state.map.map) {
|
if (this.$store.state.map && this.$store.state.map.map) {
|
||||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||||
}
|
}
|
||||||
return runPlanTemplateList(params);
|
return runPlanTemplateList(params);
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
if (this.$refs && this.$refs.pageRules) {
|
if (this.$refs && this.$refs.pageRules) {
|
||||||
const choose = this.$refs.pageRules.currentChoose();
|
const choose = this.$refs.pageRules.currentChoose();
|
||||||
if (choose) {
|
if (choose) {
|
||||||
this.$emit('chooseConfirm', choose);
|
this.$emit('chooseConfirm', choose);
|
||||||
} else {
|
} else {
|
||||||
this.$messageBox(`请选择模板运行图`);
|
this.$messageBox(`请选择模板运行图`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getStationList } from '@/api/runplan';
|
import { getStationList } from '@/api/runplan';
|
||||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ReloadTodayPlan',
|
name: 'ReloadTodayPlan',
|
||||||
@ -54,7 +54,7 @@ export default {
|
|||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '皮肤类型',
|
title: '线路类型',
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
@ -76,7 +76,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -16,126 +16,126 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||||
import { listPublishMap } from '@/api/jmap/map';
|
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ManagePlanList',
|
name: 'ManagePlanList',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
labelWidth: '140px',
|
labelWidth: '140px',
|
||||||
reset: true
|
reset: true
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
indexShow: true,
|
indexShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('publish.mapName'),
|
title: this.$t('publish.mapName'),
|
||||||
prop: 'mapId',
|
prop: 'mapId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||||
tagType: (row) => { return ''; }
|
tagType: (row) => { return ''; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('publish.runPlanName'),
|
title: this.$t('publish.runPlanName'),
|
||||||
prop: 'templatePlanId',
|
prop: 'templatePlanId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '加载日期',
|
title: '加载日期',
|
||||||
prop: 'loadTime'
|
prop: 'loadTime'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: '100',
|
width: '100',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: '删除',
|
name: '删除',
|
||||||
handleClick: this.handleDelete,
|
handleClick: this.handleDelete,
|
||||||
type: 'danger'
|
type: 'danger'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return '运行图计划表';
|
return '运行图计划表';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadPageData();
|
this.loadPageData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadPageData() {
|
loadPageData() {
|
||||||
this.mapList = [];
|
this.mapList = [];
|
||||||
listPublishMap().then(resp => {
|
getPublishMapListOnline().then(resp => {
|
||||||
this.mapList = resp.data;
|
this.mapList = resp.data;
|
||||||
});
|
});
|
||||||
this.templatePlanList = [];
|
this.templatePlanList = [];
|
||||||
listAllTempLateRunPlan().then(resp => {
|
listAllTempLateRunPlan().then(resp => {
|
||||||
this.templatePlanList = resp.data;
|
this.templatePlanList = resp.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$route.query.mapId) {
|
if (this.$route.query.mapId) {
|
||||||
params['mapId'] = this.$route.query.mapId;
|
params['mapId'] = this.$route.query.mapId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$store.state.user.id) {
|
if (this.$store.state.user.id) {
|
||||||
params['userId'] = this.$store.state.user.id;
|
params['userId'] = this.$store.state.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getRunPlanLoadList(params);
|
return getRunPlanLoadList(params);
|
||||||
},
|
},
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteRunPlanLoad(row.id).then(response => {
|
deleteRunPlanLoad(row.id).then(response => {
|
||||||
this.$message.success('删除成功');
|
this.$message.success('删除成功');
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
this.$messageBox('删除失败');
|
this.$messageBox('删除失败');
|
||||||
});
|
});
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
handleCreateRunPlan() {
|
handleCreateRunPlan() {
|
||||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.$nextTick(()=> { this.reloadTable(); });
|
this.$nextTick(()=> { this.reloadTable(); });
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<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';
|
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
components: {
|
components: {
|
||||||
PopMenu,
|
PopMenu,
|
||||||
SectionControl,
|
SectionControl,
|
||||||
SectionCmdControl,
|
SectionCmdControl,
|
||||||
SpeedCmdControl,
|
SpeedCmdControl,
|
||||||
TrainCreate,
|
TrainCreate,
|
||||||
NoticeInfo
|
NoticeInfo
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
local: [
|
local: [
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||||
handler: this.fault,
|
handler: this.fault,
|
||||||
disabledCallback: MenuDisabledState.Section.fault,
|
disabledCallback: MenuDisabledState.Section.fault,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionResection'),
|
label: this.$t('menu.menuSection.sectionResection'),
|
||||||
handler: this.split,
|
handler: this.split,
|
||||||
disabledCallback: MenuDisabledState.Section.split,
|
disabledCallback: MenuDisabledState.Section.split,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionActive'),
|
label: this.$t('menu.menuSection.sectionActive'),
|
||||||
handler: this.active,
|
handler: this.active,
|
||||||
disabledCallback: MenuDisabledState.Section.active,
|
disabledCallback: MenuDisabledState.Section.active,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionAxisPreReset'),
|
label: this.$t('menu.menuSection.sectionAxisPreReset'),
|
||||||
handler: this.axlePreReset,
|
handler: this.axlePreReset,
|
||||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||||
handler: this.lock,
|
handler: this.lock,
|
||||||
disabledCallback: MenuDisabledState.Section.lock,
|
disabledCallback: MenuDisabledState.Section.lock,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||||
handler: this.unlock,
|
handler: this.unlock,
|
||||||
disabledCallback: MenuDisabledState.Section.unlock,
|
disabledCallback: MenuDisabledState.Section.unlock,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||||
handler: this.setSpeed,
|
handler: this.setSpeed,
|
||||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||||
handler: this.cancelSpeed,
|
handler: this.cancelSpeed,
|
||||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
central: [
|
central: [
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||||
handler: this.fault,
|
handler: this.fault,
|
||||||
disabledCallback: MenuDisabledState.Section.fault,
|
disabledCallback: MenuDisabledState.Section.fault,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionResection'),
|
label: this.$t('menu.menuSection.sectionResection'),
|
||||||
handler: this.split,
|
handler: this.split,
|
||||||
disabledCallback: MenuDisabledState.Section.split,
|
disabledCallback: MenuDisabledState.Section.split,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionActive'),
|
label: this.$t('menu.menuSection.sectionActive'),
|
||||||
handler: this.active,
|
handler: this.active,
|
||||||
disabledCallback: MenuDisabledState.Section.active,
|
disabledCallback: MenuDisabledState.Section.active,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.axisPreReset'),
|
label: this.$t('menu.menuSection.axisPreReset'),
|
||||||
handler: this.axlePreReset,
|
handler: this.axlePreReset,
|
||||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||||
handler: this.lock,
|
handler: this.lock,
|
||||||
disabledCallback: MenuDisabledState.Section.lock,
|
disabledCallback: MenuDisabledState.Section.lock,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||||
handler: this.unlock,
|
handler: this.unlock,
|
||||||
disabledCallback: MenuDisabledState.Section.unlock,
|
disabledCallback: MenuDisabledState.Section.unlock,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||||
handler: this.setSpeed,
|
handler: this.setSpeed,
|
||||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||||
handler: this.cancelSpeed,
|
handler: this.cancelSpeed,
|
||||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuTrain: [
|
menuTrain: [
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.createTrain'),
|
label: this.$t('menu.menuSection.createTrain'),
|
||||||
handler: this.newTrain,
|
handler: this.newTrain,
|
||||||
disabledCallback: MenuDisabledState.Section.newTrain
|
disabledCallback: MenuDisabledState.Section.newTrain
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
menuForce: [
|
menuForce: [
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.setFault'),
|
label: this.$t('menu.menuSection.setFault'),
|
||||||
handler: this.setStoppage,
|
handler: this.setStoppage,
|
||||||
disabledCallback: MenuDisabledState.Section.setStoppage
|
disabledCallback: MenuDisabledState.Section.setStoppage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.cancelFault'),
|
label: this.$t('menu.menuSection.cancelFault'),
|
||||||
handler: this.cancelStoppage,
|
handler: this.cancelStoppage,
|
||||||
disabledCallback: MenuDisabledState.Section.cancelStoppage
|
disabledCallback: MenuDisabledState.Section.cancelStoppage
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('training', [
|
...mapGetters('training', [
|
||||||
'mode',
|
'mode',
|
||||||
'operatemode'
|
'operatemode'
|
||||||
]),
|
]),
|
||||||
...mapGetters('menuOperation', [
|
...mapGetters('menuOperation', [
|
||||||
'buttonOperation'
|
'buttonOperation'
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.menuOperation.menuCount': function (val) {
|
'$store.state.menuOperation.menuCount': function (val) {
|
||||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
|
||||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||||
} else {
|
} else {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
window.onclick = function (e) {
|
window.onclick = function (e) {
|
||||||
self.doClose();
|
self.doClose();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
this.menu = menuFiltration(this.menuNormal);
|
this.menu = menuFiltration(this.menuNormal);
|
||||||
if (this.operatemode === OperateMode.ADMIN) {
|
if (this.operatemode === OperateMode.ADMIN) {
|
||||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain];
|
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.menu = menuConvert(this.menu);
|
this.menu = menuConvert(this.menu);
|
||||||
},
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.clickEvent();
|
this.clickEvent();
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
this.$refs.popMenu.resetShowPosition(point);
|
this.$refs.popMenu.resetShowPosition(point);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
if (this.$refs && this.$refs.popMenu) {
|
if (this.$refs && this.$refs.popMenu) {
|
||||||
this.$refs.popMenu.close();
|
this.$refs.popMenu.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 设置故障
|
// 设置故障
|
||||||
setStoppage() {
|
setStoppage() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.stoppage.menu.operation
|
operation: OperationEvent.Section.stoppage.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消故障
|
// 取消故障
|
||||||
cancelStoppage() {
|
cancelStoppage() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.cancelStoppage.menu.operation
|
operation: OperationEvent.Section.cancelStoppage.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 故障解锁
|
// 故障解锁
|
||||||
fault() {
|
fault() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.fault.menu.operation
|
operation: OperationEvent.Section.fault.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 切除
|
// 切除
|
||||||
split() {
|
split() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.split.menu.operation
|
operation: OperationEvent.Section.split.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 激活
|
// 激活
|
||||||
active() {
|
active() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.active.menu.operation
|
operation: OperationEvent.Section.active.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 区段计轴预复位
|
// 区段计轴预复位
|
||||||
axlePreReset() {
|
axlePreReset() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.axlePreReset.menu.operation
|
operation: OperationEvent.Section.axlePreReset.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 区段解锁
|
// 区段解锁
|
||||||
lock() {
|
lock() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.lock.menu.operation
|
operation: OperationEvent.Section.lock.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 区段封锁
|
// 区段封锁
|
||||||
unlock() {
|
unlock() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.unlock.menu.operation
|
operation: OperationEvent.Section.unlock.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置速度
|
// 设置速度
|
||||||
setSpeed() {
|
setSpeed() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.setSpeed.menu.operation
|
operation: OperationEvent.Section.setSpeed.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消速度
|
// 取消速度
|
||||||
cancelSpeed() {
|
cancelSpeed() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.cancelSpeed.menu.operation
|
operation: OperationEvent.Section.cancelSpeed.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const tempData = response.data;
|
const tempData = response.data;
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 新建列车
|
// 新建列车
|
||||||
newTrain() {
|
newTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.Section.type,
|
type: MapDeviceType.Section.type,
|
||||||
label: MapDeviceType.Section.label,
|
label: MapDeviceType.Section.label,
|
||||||
operation: OperationEvent.Section.newtrain.menu.operation
|
operation: OperationEvent.Section.newtrain.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.trainCreate.doShow(operate, this.selected);
|
this.$refs.trainCreate.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -26,463 +26,463 @@ import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
|||||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StationStandMenu',
|
name: 'StationStandMenu',
|
||||||
components: {
|
components: {
|
||||||
PopMenu,
|
PopMenu,
|
||||||
StandControl,
|
StandControl,
|
||||||
StandDetail,
|
StandDetail,
|
||||||
StandRunLevel,
|
StandRunLevel,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
StandBackStrategy,
|
StandBackStrategy,
|
||||||
StandStopTime,
|
StandStopTime,
|
||||||
StandDetainTrainAll
|
StandDetainTrainAll
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
local: [
|
local: [
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.detainTrain'),
|
label: this.$t('menu.menuStationStand.detainTrain'),
|
||||||
handler: this.setDetainTrain,
|
handler: this.setDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||||
handler: this.cancelDetainTrain,
|
handler: this.cancelDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
||||||
handler: this.cancelDetainTrainForce,
|
handler: this.cancelDetainTrainForce,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||||
handler: this.setJumpStop,
|
handler: this.setJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||||
handler: this.cancelJumpStop,
|
handler: this.cancelJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||||
handler: this.setRunLevel,
|
handler: this.setRunLevel,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||||
handler: this.earlyDeparture,
|
handler: this.earlyDeparture,
|
||||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||||
handler: this.setBackStrategy,
|
handler: this.setBackStrategy,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||||
handler: this.detail,
|
handler: this.detail,
|
||||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
central: [
|
central: [
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.detainTrain'),
|
label: this.$t('menu.menuStationStand.detainTrain'),
|
||||||
handler: this.setDetainTrain,
|
handler: this.setDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||||
handler: this.cancelDetainTrain,
|
handler: this.cancelDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
||||||
handler: this.cancelDetainTrainForce,
|
handler: this.cancelDetainTrainForce,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelDetainTrainAll'),
|
label: this.$t('menu.menuStationStand.cancelDetainTrainAll'),
|
||||||
handler: this.cancelDetainTrainAll,
|
handler: this.cancelDetainTrainAll,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
|
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||||
handler: this.setJumpStop,
|
handler: this.setJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||||
handler: this.cancelJumpStop,
|
handler: this.cancelJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setStopTime'),
|
label: this.$t('menu.menuStationStand.setStopTime'),
|
||||||
handler: this.setStopTime,
|
handler: this.setStopTime,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||||
handler: this.setRunLevel,
|
handler: this.setRunLevel,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||||
handler: this.earlyDeparture,
|
handler: this.earlyDeparture,
|
||||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||||
handler: this.setBackStrategy,
|
handler: this.setBackStrategy,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||||
auth: { station: false, center: true }
|
auth: { station: false, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||||
handler: this.detail,
|
handler: this.detail,
|
||||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
menuForce: [
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.setFault'),
|
label: this.$t('menu.menuStationStand.setFault'),
|
||||||
handler: this.setStoppage,
|
handler: this.setStoppage,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuStationStand.cancelFault'),
|
label: this.$t('menu.menuStationStand.cancelFault'),
|
||||||
handler: this.cancelStoppage,
|
handler: this.cancelStoppage,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('training', [
|
...mapGetters('training', [
|
||||||
'mode',
|
'mode',
|
||||||
'operatemode'
|
'operatemode'
|
||||||
]),
|
]),
|
||||||
...mapGetters('menuOperation', [
|
...mapGetters('menuOperation', [
|
||||||
'buttonOperation'
|
'buttonOperation'
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.menuOperation.menuCount': function (val) {
|
'$store.state.menuOperation.menuCount': function (val) {
|
||||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||||
} else {
|
} else {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
window.onclick = function (e) {
|
window.onclick = function (e) {
|
||||||
self.doClose();
|
self.doClose();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
this.menu = menuFiltration(this.menuNormal);
|
this.menu = menuFiltration(this.menuNormal);
|
||||||
if (this.operatemode === OperateMode.ADMIN) {
|
if (this.operatemode === OperateMode.ADMIN) {
|
||||||
this.menu = [...this.menu, ...this.menuForce];
|
this.menu = [...this.menu, ...this.menuForce];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.menu = menuConvert(this.menu);
|
this.menu = menuConvert(this.menu);
|
||||||
},
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.clickEvent();
|
this.clickEvent();
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
this.$refs.popMenu.resetShowPosition(point);
|
this.$refs.popMenu.resetShowPosition(point);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
if (this.$refs && this.$refs.popMenu) {
|
if (this.$refs && this.$refs.popMenu) {
|
||||||
this.$refs.popMenu.close();
|
this.$refs.popMenu.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 设置故障
|
// 设置故障
|
||||||
setStoppage() {
|
setStoppage() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消故障
|
// 取消故障
|
||||||
cancelStoppage() {
|
cancelStoppage() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置扣车
|
// 设置扣车
|
||||||
setDetainTrain() {
|
setDetainTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消扣车
|
// 取消扣车
|
||||||
cancelDetainTrain() {
|
cancelDetainTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 强制取消扣车
|
// 强制取消扣车
|
||||||
cancelDetainTrainForce() {
|
cancelDetainTrainForce() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 全线取消扣车
|
// 全线取消扣车
|
||||||
cancelDetainTrainAll() {
|
cancelDetainTrainAll() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置跳停
|
// 设置跳停
|
||||||
setJumpStop() {
|
setJumpStop() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消跳停
|
// 取消跳停
|
||||||
cancelJumpStop() {
|
cancelJumpStop() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置停站时间
|
// 设置停站时间
|
||||||
setStopTime() {
|
setStopTime() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置运行等级
|
// 设置运行等级
|
||||||
setRunLevel() {
|
setRunLevel() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置提前发车
|
// 设置提前发车
|
||||||
earlyDeparture() {
|
earlyDeparture() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置折返策略
|
// 设置折返策略
|
||||||
setBackStrategy() {
|
setBackStrategy() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 查询站台状态
|
// 查询站台状态
|
||||||
detail() {
|
detail() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.detail.menu.operation
|
operation: OperationEvent.StationStand.detail.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -19,94 +19,94 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChooseTemplatePlan',
|
name: 'ChooseTemplatePlan',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
skinCodeList: [],
|
skinCodeList: [],
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
reset: true,
|
reset: true,
|
||||||
labelWidth: '120px',
|
labelWidth: '120px',
|
||||||
queryObject: {
|
queryObject: {
|
||||||
name: {
|
name: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: this.$t('menu.runGraphName')
|
label: this.$t('menu.runGraphName')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
radioShow: true,
|
radioShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('menu.runGraphName'),
|
title: this.$t('menu.runGraphName'),
|
||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('menu.skinType'),
|
title: this.$t('menu.lineCode'),
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||||
},
|
},
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return this.$t('menu.selectTemplateRunGraph');
|
return this.$t('menu.selectTemplateRunGraph');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.loadInitData();
|
this.loadInitData();
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$store.state.map && this.$store.state.map.map) {
|
if (this.$store.state.map && this.$store.state.map.map) {
|
||||||
params['skinCode'] = this.$store.getters['map/skinCode'];
|
params['skinCode'] = this.$store.getters['map/skinCode'];
|
||||||
}
|
}
|
||||||
return runPlanTemplateList(params);
|
return runPlanTemplateList(params);
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
if (this.$refs && this.$refs.pageRules) {
|
if (this.$refs && this.$refs.pageRules) {
|
||||||
const choose = this.$refs.pageRules.currentChoose();
|
const choose = this.$refs.pageRules.currentChoose();
|
||||||
if (choose) {
|
if (choose) {
|
||||||
this.$emit('chooseConfirm', choose);
|
this.$emit('chooseConfirm', choose);
|
||||||
this.doClose();
|
this.doClose();
|
||||||
} else {
|
} else {
|
||||||
this.$messageBox(this.$t('menu.pleaseSelectTemplateRunGraph'));
|
this.$messageBox(this.$t('menu.pleaseSelectTemplateRunGraph'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
import { runPlanTemplateList } from '@/api/runplan';
|
import { runPlanTemplateList } from '@/api/runplan';
|
||||||
import { getStationList } from '@/api/runplan';
|
import { getStationList } from '@/api/runplan';
|
||||||
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getLineCodeList } from '@/api/management/mapline';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ReloadTodayPlan',
|
name: 'ReloadTodayPlan',
|
||||||
@ -54,7 +54,7 @@ export default {
|
|||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('menu.skinType'),
|
title: this.$t('menu.lineCode'),
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => {
|
columnValue: (row) => {
|
||||||
@ -76,7 +76,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
loadInitData() {
|
loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getLineCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -16,126 +16,126 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
import { getRunPlanLoadList, deleteRunPlanLoad, listAllTempLateRunPlan } from '@/api/runplan';
|
||||||
import { listPublishMap } from '@/api/jmap/map';
|
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ManagePlanList',
|
name: 'ManagePlanList',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
labelWidth: '140px',
|
labelWidth: '140px',
|
||||||
reset: true
|
reset: true
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
indexShow: true,
|
indexShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('menu.mapName'),
|
title: this.$t('menu.mapName'),
|
||||||
prop: 'mapId',
|
prop: 'mapId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
|
||||||
tagType: (row) => { return ''; }
|
tagType: (row) => { return ''; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('menu.runGraphName'),
|
title: this.$t('menu.runGraphName'),
|
||||||
prop: 'templatePlanId',
|
prop: 'templatePlanId',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.templatePlanId, this.templatePlanList, ['id', 'name']); },
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('menu.loadDate'),
|
title: this.$t('menu.loadDate'),
|
||||||
prop: 'loadTime'
|
prop: 'loadTime'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '100',
|
width: '100',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('global.delete'),
|
name: this.$t('global.delete'),
|
||||||
handleClick: this.handleDelete,
|
handleClick: this.handleDelete,
|
||||||
type: 'danger'
|
type: 'danger'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return this.$t('menu.operationChartSchedule');
|
return this.$t('menu.operationChartSchedule');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadPageData();
|
this.loadPageData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadPageData() {
|
loadPageData() {
|
||||||
this.mapList = [];
|
this.mapList = [];
|
||||||
listPublishMap().then(resp => {
|
getPublishMapListOnline().then(resp => {
|
||||||
this.mapList = resp.data;
|
this.mapList = resp.data;
|
||||||
});
|
});
|
||||||
this.templatePlanList = [];
|
this.templatePlanList = [];
|
||||||
listAllTempLateRunPlan().then(resp => {
|
listAllTempLateRunPlan().then(resp => {
|
||||||
this.templatePlanList = resp.data;
|
this.templatePlanList = resp.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$route.query.mapId) {
|
if (this.$route.query.mapId) {
|
||||||
params['mapId'] = this.$route.query.mapId;
|
params['mapId'] = this.$route.query.mapId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$store.state.user.id) {
|
if (this.$store.state.user.id) {
|
||||||
params['userId'] = this.$store.state.user.id;
|
params['userId'] = this.$store.state.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getRunPlanLoadList(params);
|
return getRunPlanLoadList(params);
|
||||||
},
|
},
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm(this.$t('tip.deleteTheRunningGraphLoadedTheNextDay'), this.$t('tip.hint'), {
|
this.$confirm(this.$t('tip.deleteTheRunningGraphLoadedTheNextDay'), this.$t('tip.hint'), {
|
||||||
confirmButtonText: this.$t('global.confirm'),
|
confirmButtonText: this.$t('global.confirm'),
|
||||||
cancelButtonText: this.$t('global.cancel'),
|
cancelButtonText: this.$t('global.cancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteRunPlanLoad(row.id).then(response => {
|
deleteRunPlanLoad(row.id).then(response => {
|
||||||
this.$message.success(this.$t('global.successfullyDelete'));
|
this.$message.success(this.$t('global.successfullyDelete'));
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
this.$messageBox(this.$t('global.failDelete'));
|
this.$messageBox(this.$t('global.failDelete'));
|
||||||
});
|
});
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
handleCreateRunPlan() {
|
handleCreateRunPlan() {
|
||||||
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.$nextTick(()=> { this.reloadTable(); });
|
this.$nextTick(()=> { this.reloadTable(); });
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -1,364 +1,364 @@
|
|||||||
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
|
import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
/** 边缘高度*/
|
/** 边缘高度*/
|
||||||
EdgeHeight: 3,
|
EdgeHeight: 3,
|
||||||
|
|
||||||
/** 间隔高度*/
|
/** 间隔高度*/
|
||||||
CoordMultiple: 3,
|
CoordMultiple: 3,
|
||||||
|
|
||||||
/** 偏移时间*/
|
/** 偏移时间*/
|
||||||
TranslationTime: 60 * 60 * 2,
|
TranslationTime: 60 * 60 * 2,
|
||||||
|
|
||||||
/** excel解析配置*/
|
/** excel解析配置*/
|
||||||
ExcelConfig: {
|
ExcelConfig: {
|
||||||
beginRow: 1,
|
beginRow: 1,
|
||||||
beginCol: 0,
|
beginCol: 0,
|
||||||
// fieldNum: 10,
|
// fieldNum: 10,
|
||||||
columns: {
|
columns: {
|
||||||
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
||||||
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 解析exal数据转换为Json后台数据*/
|
/** 解析exal数据转换为Json后台数据*/
|
||||||
importData(Sheet, JsonData) {
|
importData(Sheet, JsonData) {
|
||||||
const dataList = convertSheetToList(Sheet, true);
|
const dataList = convertSheetToList(Sheet, true);
|
||||||
const needList = Object.keys(this.ExcelConfig.columns);
|
const needList = Object.keys(this.ExcelConfig.columns);
|
||||||
const tripObj = { upTrack: '', downTrack: '' };
|
const tripObj = { upTrack: '', downTrack: '' };
|
||||||
if (dataList && dataList.length) {
|
if (dataList && dataList.length && dataList[1] && dataList[0]) {
|
||||||
const tIndex = dataList.findIndex(it => { return it[0]; });
|
const tIndex = dataList.findIndex(it => { return it[0]; });
|
||||||
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
||||||
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
||||||
var isContinue = true;
|
var isContinue = true;
|
||||||
|
|
||||||
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
||||||
isContinue = false;
|
isContinue = false;
|
||||||
|
|
||||||
var title = dataList[colIndex][0];
|
var title = dataList[colIndex][0];
|
||||||
var value = dataList[colIndex][rowIndex];
|
var value = dataList[colIndex][rowIndex];
|
||||||
|
|
||||||
if (title && value) {
|
if (title && value) {
|
||||||
// 数据列解析
|
// 数据列解析
|
||||||
isContinue = true;
|
isContinue = true;
|
||||||
var titleStr = `${title}`.replace(/\s*/g, '');
|
var titleStr = `${title}`.replace(/\s*/g, '');
|
||||||
var valueStr = `${value}`.replace(/\s*/g, '');
|
var valueStr = `${value}`.replace(/\s*/g, '');
|
||||||
|
|
||||||
// 取需要的字段
|
// 取需要的字段
|
||||||
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
||||||
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/** 解析二维数组为json对象*/
|
/** 解析二维数组为json对象*/
|
||||||
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
||||||
const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
||||||
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨]+)/; // 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 reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
|
||||||
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
||||||
|
|
||||||
dataList.forEach((elem, i) => {
|
dataList.forEach((elem, i) => {
|
||||||
var begin = -1;
|
var begin = -1;
|
||||||
/** 跳过名称所在的行*/
|
/** 跳过名称所在的行*/
|
||||||
if (i != tIndex && elem && elem.length > 0) {
|
if (i != tIndex && elem && elem.length > 0) {
|
||||||
elem.forEach((item, j) => {
|
elem.forEach((item, j) => {
|
||||||
/** 过滤空值*/
|
/** 过滤空值*/
|
||||||
if (item) {
|
if (item) {
|
||||||
var value = `${item}`.trim();
|
var value = `${item}`.trim();
|
||||||
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
||||||
/** 匹配到开始位置或者结束位置*/
|
/** 匹配到开始位置或者结束位置*/
|
||||||
if (reg0.test(value)) {
|
if (reg0.test(value)) {
|
||||||
if (begin == -1) {
|
if (begin == -1) {
|
||||||
begin = value; // 设置初始索引
|
begin = value; // 设置初始索引
|
||||||
JsonData.push({
|
JsonData.push({
|
||||||
code: reg0.exec(value)[1],
|
code: reg0.exec(value)[1],
|
||||||
arrivalList: []
|
arrivalList: []
|
||||||
});
|
});
|
||||||
} else if (begin === value) {
|
} else if (begin === value) {
|
||||||
begin = -1; // 清空初始索引
|
begin = -1; // 清空初始索引
|
||||||
}
|
}
|
||||||
} else if (begin !== -1) {
|
} else if (begin !== -1) {
|
||||||
/** 匹配到中间位置*/
|
/** 匹配到中间位置*/
|
||||||
var begTime, endTime;
|
var begTime, endTime;
|
||||||
var runFlag = JsonData[JsonData.length - 1].code[2];
|
var runFlag = JsonData[JsonData.length - 1].code[2];
|
||||||
var stationName = title.replace(/\s/, '');
|
var stationName = title.replace(/\s/, '');
|
||||||
var need = false;
|
var need = false;
|
||||||
var flag = false;
|
var flag = false;
|
||||||
if (reg1.test(value)) {
|
if (reg1.test(value)) {
|
||||||
/** 含有特殊字符的时间格式*/
|
/** 含有特殊字符的时间格式*/
|
||||||
[, begTime, endTime] = reg1.exec(value);
|
[, begTime, endTime] = reg1.exec(value);
|
||||||
|
|
||||||
begTime = reg4.test(begTime) ? '' : begTime;
|
begTime = reg4.test(begTime) ? '' : begTime;
|
||||||
endTime = reg4.test(endTime) ? '' : endTime;
|
endTime = reg4.test(endTime) ? '' : endTime;
|
||||||
|
|
||||||
/** 下行方向时间互换*/
|
/** 下行方向时间互换*/
|
||||||
if (runFlag === '2') {
|
if (runFlag === '2') {
|
||||||
[begTime, endTime] = [endTime, begTime];
|
[begTime, endTime] = [endTime, begTime];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置标志*/
|
/** 设置标志*/
|
||||||
[need, flag] = [true, true];
|
[need, flag] = [true, true];
|
||||||
} else if (reg2.test(value)) {
|
} else if (reg2.test(value)) {
|
||||||
/** 含有特殊字符的时间格式*/
|
/** 含有特殊字符的时间格式*/
|
||||||
[, begTime, endTime] = reg2.exec(value);
|
[, begTime, endTime] = reg2.exec(value);
|
||||||
|
|
||||||
begTime = reg4.test(begTime) ? '' : begTime;
|
begTime = reg4.test(begTime) ? '' : begTime;
|
||||||
endTime = reg4.test(endTime) ? '' : endTime;
|
endTime = reg4.test(endTime) ? '' : endTime;
|
||||||
|
|
||||||
/** 下行方向时间互换*/
|
/** 下行方向时间互换*/
|
||||||
if (runFlag === '2') {
|
if (runFlag === '2') {
|
||||||
[begTime, endTime] = [endTime, begTime];
|
[begTime, endTime] = [endTime, begTime];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置标志*/
|
/** 设置标志*/
|
||||||
[need, flag] = [true, true];
|
[need, flag] = [true, true];
|
||||||
} else if (reg3.test(value)) {
|
} else if (reg3.test(value)) {
|
||||||
/** 正常时间格式*/
|
/** 正常时间格式*/
|
||||||
[, begTime, endTime] = reg3.exec(value);
|
[, begTime, endTime] = reg3.exec(value);
|
||||||
|
|
||||||
/** 如果只存在一个数据时,则开始和结束设置一样*/
|
/** 如果只存在一个数据时,则开始和结束设置一样*/
|
||||||
endTime = endTime || begTime;
|
endTime = endTime || begTime;
|
||||||
|
|
||||||
/** 下行方向时间互换*/
|
/** 下行方向时间互换*/
|
||||||
if (runFlag === '2') {
|
if (runFlag === '2') {
|
||||||
[begTime, endTime] = [endTime, begTime];
|
[begTime, endTime] = [endTime, begTime];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置标志*/
|
/** 设置标志*/
|
||||||
[need, flag] = [true, false];
|
[need, flag] = [true, false];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加json数据*/
|
/** 添加json数据*/
|
||||||
if (need) { // 储存非空 数据
|
if (need) { // 储存非空 数据
|
||||||
var stationObj = {
|
var stationObj = {
|
||||||
stationName: stationName
|
stationName: stationName
|
||||||
};
|
};
|
||||||
|
|
||||||
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
||||||
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
||||||
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
||||||
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JsonData.forEach(item => {
|
JsonData.forEach(item => {
|
||||||
item['upTrack'] = tripObj.upTrack;
|
item['upTrack'] = tripObj.upTrack;
|
||||||
item['downTrack'] = tripObj.downTrack;
|
item['downTrack'] = tripObj.downTrack;
|
||||||
});
|
});
|
||||||
|
|
||||||
return JsonData;
|
return JsonData;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 将后台数据解析成图表*/
|
/** 将后台数据解析成图表*/
|
||||||
convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) {
|
convertDataToModels(data, stations, kmRangeCoordMap, lineStyle) {
|
||||||
var models = [];
|
var models = [];
|
||||||
|
|
||||||
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
|
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
|
||||||
/** 按服务遍历数据*/
|
/** 按服务遍历数据*/
|
||||||
data.serviceNumberDataList.forEach((service) => {
|
data.serviceNumberDataList.forEach((service) => {
|
||||||
/** 按车次遍历数据*/
|
/** 按车次遍历数据*/
|
||||||
var isBackup = true;
|
var isBackup = true;
|
||||||
var opt = { name: '', markPointData: [], data: [] };
|
var opt = { name: '', markPointData: [], data: [] };
|
||||||
if (service.tripNumberDataList && service.tripNumberDataList.length) {
|
if (service.tripNumberDataList && service.tripNumberDataList.length) {
|
||||||
service.tripNumberDataList.forEach((train, j) => {
|
service.tripNumberDataList.forEach((train, j) => {
|
||||||
var pointdata = {};
|
var pointdata = {};
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
var lastPoint = null;
|
var lastPoint = null;
|
||||||
var nextPoint = null;
|
var nextPoint = null;
|
||||||
|
|
||||||
/** 创建标记点名称和坐标*/
|
/** 创建标记点名称和坐标*/
|
||||||
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
|
pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`;
|
||||||
pointdata.color = '#000' || lineStyle.color;
|
pointdata.color = '#000' || lineStyle.color;
|
||||||
pointdata.directionCode = train.directionCode;
|
pointdata.directionCode = train.directionCode;
|
||||||
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
|
pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)];
|
||||||
|
|
||||||
/** 给服务对象添加服务名称和标记点*/
|
/** 给服务对象添加服务名称和标记点*/
|
||||||
opt.name = '' + service.serviceNumber;
|
opt.name = '' + service.serviceNumber;
|
||||||
opt.markPointData.push(createMartPoint(pointdata));
|
opt.markPointData.push(createMartPoint(pointdata));
|
||||||
|
|
||||||
/** 计算非折返点车次点坐标集合*/
|
/** 计算非折返点车次点坐标集合*/
|
||||||
train.stationTimeList.forEach((elem, index) => {
|
train.stationTimeList.forEach((elem, index) => {
|
||||||
idx = index;
|
idx = index;
|
||||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
const aa = `${train.directionCode}${train.tripNumber}`;
|
||||||
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]);
|
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) {
|
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
|
||||||
lastPoint = train.stationTimeList[idx];
|
lastPoint = train.stationTimeList[idx];
|
||||||
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
|
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
|
||||||
const aa = `${train.directionCode}${train.tripNumber}`;
|
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([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, '折返轨']);
|
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 如果是备用车,按车次添加线*/
|
/** 如果是备用车,按车次添加线*/
|
||||||
if (train.backup) {
|
if (train.backup) {
|
||||||
/** 创建一条完成的服务数据*/
|
/** 创建一条完成的服务数据*/
|
||||||
opt.name += j;
|
opt.name += j;
|
||||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||||
if (model) {
|
if (model) {
|
||||||
models.push(model);
|
models.push(model);
|
||||||
opt = { name: '', markPointData: [], data: [] };
|
opt = { name: '', markPointData: [], data: [] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isBackup = train.backup;
|
isBackup = train.backup;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 不是备用车,按服务添加线
|
// 不是备用车,按服务添加线
|
||||||
if (!isBackup) {
|
if (!isBackup) {
|
||||||
/** 创建一条完成的服务数据*/
|
/** 创建一条完成的服务数据*/
|
||||||
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
// var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
|
||||||
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
var model = createSeriesModel(opt, Object.assign({ color: '#000' }, lineStyle));
|
||||||
if (model) {
|
if (model) {
|
||||||
models.push(model);
|
models.push(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return models;
|
return models;
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 更新数据并解析成图表*/
|
/** 更新数据并解析成图表*/
|
||||||
updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
updateDataToModels(data, stations, kmRangeCoordMap, runPlanData, series, lineStyle) {
|
||||||
if (data && data.length) {
|
if (data && data.length) {
|
||||||
data.forEach(elem => {
|
data.forEach(elem => {
|
||||||
/** 判断此条记录的服务号是否存在*/
|
/** 判断此条记录的服务号是否存在*/
|
||||||
if (!runPlanData[elem.serviceNumber]) {
|
if (!runPlanData[elem.serviceNumber]) {
|
||||||
/** 创建一个新服务号标记*/
|
/** 创建一个新服务号标记*/
|
||||||
runPlanData[elem.serviceNumber] = {};
|
runPlanData[elem.serviceNumber] = {};
|
||||||
|
|
||||||
/** 不存在此服务号,则需要创建一条新的line*/
|
/** 不存在此服务号,则需要创建一条新的line*/
|
||||||
series.push(createSeriesModel({
|
series.push(createSeriesModel({
|
||||||
zlevel: 1,
|
zlevel: 1,
|
||||||
name: `run${elem.serviceNumber}`,
|
name: `run${elem.serviceNumber}`,
|
||||||
data: [],
|
data: [],
|
||||||
markPointData: []
|
markPointData: []
|
||||||
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
|
}, Object.assign({ color: hexColor.toCreate() }, lineStyle)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加数据*/
|
/** 添加数据*/
|
||||||
series.forEach(serie => {
|
series.forEach(serie => {
|
||||||
/** 找到服务号所在图数据的位置*/
|
/** 找到服务号所在图数据的位置*/
|
||||||
if (serie.name == `run${elem.serviceNumber}`) {
|
if (serie.name == `run${elem.serviceNumber}`) {
|
||||||
/** 添加车组号记录标记*/
|
/** 添加车组号记录标记*/
|
||||||
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
|
if (!runPlanData[elem.serviceNumber][elem.tripNumber]) {
|
||||||
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
|
runPlanData[elem.serviceNumber][elem.tripNumber] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
|
runPlanData[elem.serviceNumber][elem.tripNumber].push(elem);
|
||||||
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
|
runPlanData[elem.serviceNumber][elem.tripNumber].sort((a, b) => {
|
||||||
return parseInt(a.secondTime) - parseInt(b.secondTime);
|
return parseInt(a.secondTime) - parseInt(b.secondTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 如果此记录车组号的数据为第一条时,则打上标签*/
|
/** 如果此记录车组号的数据为第一条时,则打上标签*/
|
||||||
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
|
if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) {
|
||||||
serie.markPoint.data.push(createMartPoint({
|
serie.markPoint.data.push(createMartPoint({
|
||||||
directionCode: elem.directionCode,
|
directionCode: elem.directionCode,
|
||||||
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
|
coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)],
|
||||||
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
|
name: `(${elem.groupNumber})${elem.serviceNumber}${elem.directionCode}${elem.tripNumber}`,
|
||||||
color: lineStyle.color || '#000'
|
color: lineStyle.color || '#000'
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 计算折返点*/
|
/** 计算折返点*/
|
||||||
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.directionCode];
|
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.directionCode];
|
||||||
if (serie.data.length > 0) {
|
if (serie.data.length > 0) {
|
||||||
var lastPoint = serie.data[serie.data.length - 1];
|
var lastPoint = serie.data[serie.data.length - 1];
|
||||||
if (lastPoint[2] !== nextPoint[2]) {
|
if (lastPoint[2] !== nextPoint[2]) {
|
||||||
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2]), lastPoint[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[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2]), lastPoint[2]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加车组号数据到对应的服务图数据中*/
|
/** 添加车组号数据到对应的服务图数据中*/
|
||||||
serie.data.push(nextPoint);
|
serie.data.push(nextPoint);
|
||||||
|
|
||||||
/** 保证原始数据排序*/
|
/** 保证原始数据排序*/
|
||||||
serie.data.sort((a, b) => {
|
serie.data.sort((a, b) => {
|
||||||
return parseInt(a[0]) - parseInt(b[0]);
|
return parseInt(a[0]) - parseInt(b[0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return series;
|
return series;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 将后台数据转换为试图序列模型*/
|
/** 将后台数据转换为试图序列模型*/
|
||||||
convertStationsToMap(stations) {
|
convertStationsToMap(stations) {
|
||||||
var map = {};
|
var map = {};
|
||||||
if (stations && stations.length) {
|
if (stations && stations.length) {
|
||||||
stations.forEach((elem, index) => {
|
stations.forEach((elem, index) => {
|
||||||
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple;
|
map[`${elem.kmRange}`] = this.EdgeHeight + index * this.CoordMultiple;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
},
|
},
|
||||||
/** 初始化Y轴*/
|
/** 初始化Y轴*/
|
||||||
initializeYaxis(stations) {
|
initializeYaxis(stations) {
|
||||||
return createMarkLineModels(stations, (elem, index) => {
|
return createMarkLineModels(stations, (elem, index) => {
|
||||||
return this.EdgeHeight + index * this.CoordMultiple;
|
return this.EdgeHeight + index * this.CoordMultiple;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 计算y轴最小值*/
|
/** 计算y轴最小值*/
|
||||||
computedYaxisMinValue() {
|
computedYaxisMinValue() {
|
||||||
return 0;
|
return 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 计算y轴最大值*/
|
/** 计算y轴最大值*/
|
||||||
computedYaxisMaxValue(stations) {
|
computedYaxisMaxValue(stations) {
|
||||||
return this.EdgeHeight * 2 + (stations.length - 1) * this.CoordMultiple;
|
return this.EdgeHeight * 2 + (stations.length - 1) * this.CoordMultiple;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 格式化y轴数据*/
|
/** 格式化y轴数据*/
|
||||||
computedFormatYAxis(stations, params) {
|
computedFormatYAxis(stations, params) {
|
||||||
var yText = '';
|
var yText = '';
|
||||||
var index = Math.floor((parseInt(params.value) - this.EdgeHeight) / this.CoordMultiple);
|
var index = Math.floor((parseInt(params.value) - this.EdgeHeight) / this.CoordMultiple);
|
||||||
if (index >= 0 && index < stations.length) {
|
if (index >= 0 && index < stations.length) {
|
||||||
yText = stations[index].kmRange + 'm';
|
yText = stations[index].kmRange + 'm';
|
||||||
}
|
}
|
||||||
return yText;
|
return yText;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 根据方向计算y折返偏移量*/
|
/** 根据方向计算y折返偏移量*/
|
||||||
getYvalueByDirectionCode(defaultVlue, directionCode) {
|
getYvalueByDirectionCode(defaultVlue, directionCode) {
|
||||||
if (directionCode === '1') {
|
if (directionCode === '1') {
|
||||||
defaultVlue -= this.EdgeHeight / 2;
|
defaultVlue -= this.EdgeHeight / 2;
|
||||||
} else if (directionCode === '2') {
|
} else if (directionCode === '2') {
|
||||||
defaultVlue += this.EdgeHeight / 2;
|
defaultVlue += this.EdgeHeight / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultVlue;
|
return defaultVlue;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 根据elem计算y值*/
|
/** 根据elem计算y值*/
|
||||||
getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) {
|
getCoordYByElem(stations, kmRangeCoordMap, elem, directionCode, isSpecial) {
|
||||||
var defaultVlue = 0;
|
var defaultVlue = 0;
|
||||||
var station = stations.find(it => { return it.code == elem.stationCode; });
|
var station = stations.find(it => { return it.code == elem.stationCode; });
|
||||||
if (station) {
|
if (station) {
|
||||||
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
defaultVlue = kmRangeCoordMap[`${station.kmRange}`];
|
||||||
if (isSpecial) {
|
if (isSpecial) {
|
||||||
defaultVlue = this.getYvalueByDirectionCode(defaultVlue, directionCode);
|
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