Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
This commit is contained in:
commit
b1d19febe6
16
src/App.vue
16
src/App.vue
@ -34,14 +34,14 @@ export default {
|
||||
this.subscribe();
|
||||
const project = window.sessionStorage.getItem('project');
|
||||
document.querySelector("link[rel*='icon']").href = ProjectIcon[project];
|
||||
window.addEventListener('beforeunload', async e => {
|
||||
const token = handleToken();
|
||||
Cookies.remove('UserDesignName');
|
||||
Cookies.remove('UserDesignToken');
|
||||
Cookies.remove('UserName');
|
||||
Cookies.remove('UserToken');
|
||||
await logout(token);
|
||||
});
|
||||
// window.addEventListener('beforeunload', async e => {
|
||||
// const token = handleToken();
|
||||
// Cookies.remove('UserDesignName');
|
||||
// Cookies.remove('UserDesignToken');
|
||||
// Cookies.remove('UserName');
|
||||
// Cookies.remove('UserToken');
|
||||
// await logout(token);
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
|
@ -1,172 +1,180 @@
|
||||
import request from '@/utils/request';
|
||||
/** 注册用户*/
|
||||
export function createUserInfo(data) {
|
||||
return request({
|
||||
url: '/api/userinfo/create',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/userinfo/create',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 根据用户Id获取用户信息*/
|
||||
export function getUserInfoByOpenId(params) {
|
||||
return request({
|
||||
url: '/api/userinfo/getByOpenId',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: '/api/userinfo/getByOpenId',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 根据姓名或者手机号查询用户*/
|
||||
export function getUserInfoByNameOrMobile(params) {
|
||||
return request({
|
||||
url: '/api/userinfo/nameOrMobile',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: '/api/userinfo/nameOrMobile',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询用户参数*/
|
||||
export function getUserConfigInfo() {
|
||||
return request({
|
||||
url: '/api/user/config',
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: '/api/user/config',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 设置用户参数*/
|
||||
export function setUserConfigInfo(data) {
|
||||
return request({
|
||||
url: '/api/user/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/user/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取销售列表*/
|
||||
export function getSellerList() {
|
||||
return request({
|
||||
url: `/api/user/seller`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/user/seller`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询用户列表*/
|
||||
export function getUserList(params) {
|
||||
return request({
|
||||
url: `/api/user`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/user`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 模糊查询用户 昵称、名称、手机号*/
|
||||
export function getDimUserList(params) {
|
||||
return request({
|
||||
url: `/api/user/fuzzy`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/user/fuzzy`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户订阅地图列表*/
|
||||
export function getUserSubscribe(userId) {
|
||||
return request({
|
||||
url: `/api/user/subscribe/${userId}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/user/subscribe/${userId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存用户订阅地图列表*/
|
||||
export function saveUserSubscribe(data) {
|
||||
return request({
|
||||
url: '/api/user/subscribe',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/user/subscribe',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改用户权限
|
||||
export function putRoles(data) {
|
||||
return request({
|
||||
url: `/api/user/${data.id}/role`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/user/${data.id}/role`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取缓存列表数据
|
||||
export function getCacheList(params) {
|
||||
return request({
|
||||
url: `/api/cache/keys`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/cache/keys`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
// 删除缓存列表
|
||||
export function delCacheList(key) {
|
||||
return request({
|
||||
url: `/api/cache/${key}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/cache/${key}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 更新用户真实姓名
|
||||
export function getUserinfoName(id, name) {
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/name?name=${name}`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/name?name=${name}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
// 更新用户昵称
|
||||
export function getUserinfoNickname(id, nickname) {
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/nickname?nickname=${nickname}`,
|
||||
method: 'put'
|
||||
});
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/nickname?nickname=${nickname}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
// 更新用户手机号
|
||||
export function getUserinfoMobile(id, data) {
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/mobile`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/mobile`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 发送手机验证码
|
||||
export function getUserinfoMobileCode(data) {
|
||||
return request({
|
||||
url: `/api/userinfo/mobile/code`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/userinfo/mobile/code`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 更新用户邮箱
|
||||
export function getUserinfoEmail(id, data) {
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/email`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/email`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 发送邮箱验证码
|
||||
export function getUserinfoEmailCode(email) {
|
||||
return request({
|
||||
url: `/api/userinfo/email/code?email=${email}`,
|
||||
method: 'post'
|
||||
});
|
||||
return request({
|
||||
url: `/api/userinfo/email/code?email=${email}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
// 更新用户登陆密码
|
||||
export function getUserinfoPassword(id, data) {
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/password`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/userinfo/${id}/password`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取当前用户数量
|
||||
export function getOnlineNmuber() {
|
||||
return request({
|
||||
url: `/api/cache/onlineUser`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -127,7 +127,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
resetShowPosition(point) {
|
||||
console.log(point);
|
||||
if (point) {
|
||||
this.show = true;
|
||||
const self = this;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,149 +4,149 @@ import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
// import Vue from 'vue';
|
||||
import store from '@/store';
|
||||
class EMouse extends Group {
|
||||
constructor(device, code) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.code = code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
if (this.device.name) {
|
||||
const rect = this.device.name.getBoundingRect();
|
||||
if (!this.device.isSwitchSection) {
|
||||
this.sectionTextBorder = new Rect({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 4,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: '#fff', // 白色
|
||||
fill: this.device.model.sectionType == '02' ? this.device.style.Section.line.logicalColor : '#00FFFF' // 蓝色
|
||||
}
|
||||
});
|
||||
this.add(this.sectionTextBorder);
|
||||
this.sectionTextBorder.hide();
|
||||
}
|
||||
constructor(device, code) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.code = code;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
if (this.device.name) {
|
||||
const rect = this.device.name.getBoundingRect();
|
||||
if (!this.device.isSwitchSection) {
|
||||
this.sectionTextBorder = new Rect({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 4,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: '#fff', // 白色
|
||||
fill: this.device.model.sectionType == '02' ? this.device.style.Section.line.logicalColor : '#00FFFF' // 蓝色
|
||||
}
|
||||
});
|
||||
this.add(this.sectionTextBorder);
|
||||
this.sectionTextBorder.hide();
|
||||
}
|
||||
|
||||
const fontSize = this.device.model.type == '02' ? this.device.style.Section.text.fontSize + 2: this.device.style.Section.text.fontSize;
|
||||
this.TextName = new Text({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 4,
|
||||
style: {
|
||||
x: rect.x + (rect.width / 2),
|
||||
y: rect.y + (rect.height / 2),
|
||||
fontWeight: 'normal',
|
||||
fontSize: fontSize,
|
||||
fontFamily: this.device.style.fontFamily,
|
||||
text: this.device.model.name,
|
||||
textFill: '#000',
|
||||
textAlign: this.device.style.Section.text.textAlign,
|
||||
textPosition: this.device.style.Section.text.textPosition || 'inside',
|
||||
textVerticalAlign: this.device.style.Section.text.textVerticalAlign || null
|
||||
}
|
||||
});
|
||||
this.add(this.TextName);
|
||||
this.TextName.hide();
|
||||
const fontSize = this.device.model.type == '02' ? this.device.style.Section.text.fontSize + 2 : this.device.style.Section.text.fontSize;
|
||||
this.TextName = new Text({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 4,
|
||||
style: {
|
||||
x: rect.x + (rect.width / 2),
|
||||
y: rect.y + (rect.height / 2),
|
||||
fontWeight: 'normal',
|
||||
fontSize: fontSize,
|
||||
fontFamily: this.device.style.fontFamily,
|
||||
text: this.device.model.name,
|
||||
textFill: '#000',
|
||||
textAlign: this.device.style.Section.text.textAlign,
|
||||
textPosition: this.device.style.Section.text.textPosition || 'inside',
|
||||
textVerticalAlign: this.device.style.Section.text.textVerticalAlign || null
|
||||
}
|
||||
});
|
||||
this.add(this.TextName);
|
||||
this.TextName.hide();
|
||||
|
||||
this.sectionTextShadow = new Text({
|
||||
zlevel: this.zlevel + 3,
|
||||
z: 5,
|
||||
position: [4, -2],
|
||||
silent: true,
|
||||
style: {
|
||||
x: rect.x + (rect.width / 2),
|
||||
y: rect.y + (rect.height / 2),
|
||||
text: this.device.model.name,
|
||||
textFill: this.device.style.Section.mouseOverStyle.textShadowColor, // 黄色
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFont: 'bold ' + (fontSize + 1) + 'px ' + this.device.style.fontFamily
|
||||
}
|
||||
});
|
||||
this.add(this.sectionTextShadow);
|
||||
this.sectionTextShadow.hide();
|
||||
}
|
||||
if (this.device.section) {
|
||||
const rect = this.device.section.getBoundingRect();
|
||||
this.lineBorder = new Rect({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z - 1,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: this.device.style.Section.mouseOverStyle.borderColor,
|
||||
fill: this.device.style.transparentColor
|
||||
}
|
||||
});
|
||||
this.sectionTextShadow = new Text({
|
||||
zlevel: this.zlevel + 3,
|
||||
z: 5,
|
||||
position: [4, -2],
|
||||
silent: true,
|
||||
style: {
|
||||
x: rect.x + (rect.width / 2),
|
||||
y: rect.y + (rect.height / 2),
|
||||
text: this.device.model.name,
|
||||
textFill: this.device.style.Section.mouseOverStyle.textShadowColor, // 黄色
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top',
|
||||
textFont: 'bold ' + (fontSize + 1) + 'px ' + this.device.style.fontFamily
|
||||
}
|
||||
});
|
||||
this.add(this.sectionTextShadow);
|
||||
this.sectionTextShadow.hide();
|
||||
}
|
||||
if (this.device.section) {
|
||||
const rect = this.device.section.getBoundingRect();
|
||||
this.lineBorder = new Rect({
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z - 1,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: this.device.style.Section.mouseOverStyle.borderColor,
|
||||
fill: this.device.style.transparentColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.lineBorder);
|
||||
this.lineBorder.hide();
|
||||
}
|
||||
}
|
||||
this.add(this.lineBorder);
|
||||
this.lineBorder.hide();
|
||||
}
|
||||
}
|
||||
|
||||
getInstanceByCode(code) {
|
||||
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
||||
}
|
||||
getInstanceByCode(code) {
|
||||
return (store.getters['map/getDeviceByCode'](code) || {}).instance;
|
||||
}
|
||||
|
||||
mouseover(e) {
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseover(e);
|
||||
}
|
||||
} else {
|
||||
this.TextName && this.TextName.show();
|
||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
mouseover(e) {
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
|
||||
instance.mouseEvent.mouseover(e);
|
||||
}
|
||||
} else {
|
||||
this.TextName && this.TextName.show();
|
||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.sectionTextShadow && this.sectionTextShadow.hide();
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseout(e);
|
||||
}
|
||||
} else {
|
||||
this.TextName && this.TextName.hide();
|
||||
this.sectionTextBorder && this.sectionTextBorder.hide();
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.sectionTextShadow && this.sectionTextShadow.hide();
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
instance.mouseEvent.mouseout(e);
|
||||
}
|
||||
} else {
|
||||
this.TextName && this.TextName.hide();
|
||||
this.sectionTextBorder && this.sectionTextBorder.hide();
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
const instance = this.getInstanceByCode(this.device.model.trainWindowCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseEnter(e) {
|
||||
this.TextName && this.TextName.show();
|
||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
mouseEnter(e) {
|
||||
this.TextName && this.TextName.show();
|
||||
this.sectionTextBorder && this.sectionTextBorder.show();
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) {
|
||||
instance.mouseEvent.mouseEnter(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mouseLeave(e) {
|
||||
this.TextName && this.TextName.hide();
|
||||
this.sectionTextBorder && this.sectionTextBorder.hide();
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
mouseLeave(e) {
|
||||
this.TextName && this.TextName.hide();
|
||||
this.sectionTextBorder && this.sectionTextBorder.hide();
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
if (this.device.model.isSwitchSection && this.device.model.relSwitchCode) {
|
||||
const instance = this.getInstanceByCode(this.device.model.relSwitchCode);
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseLeave) {
|
||||
instance.mouseEvent.mouseLeave(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export default EMouse;
|
||||
|
@ -9,6 +9,7 @@ import { EAxle } from './EAxle'; // 创建计轴 (私有)
|
||||
import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
|
||||
import ELimitName from './ELimitName'; // 成都三号线 限速名称
|
||||
import JTriangle from '../../utils/JTriangle';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
/** 区段*/
|
||||
export default class Section extends Group {
|
||||
@ -22,6 +23,7 @@ export default class Section extends Group {
|
||||
this.style = style;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.createMouse(); // 框选鼠标移入移事件
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
@ -803,6 +805,31 @@ export default class Section extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
createMouse() {
|
||||
const rect = this.getBoundingRect();
|
||||
this.lineBorder = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z - 1,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: '#fff',
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.lineBorder);
|
||||
this.lineBorder.hide();
|
||||
}
|
||||
|
||||
mouseout() {
|
||||
this.lineBorder && this.lineBorder.show();
|
||||
}
|
||||
|
||||
mouseover() {
|
||||
this.lineBorder && this.lineBorder.hide();
|
||||
}
|
||||
|
||||
/** 计算提示位置*/
|
||||
getShapeTipPoint() {
|
||||
let rect = this.getBoundingRect();
|
||||
|
@ -6,382 +6,404 @@ import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
/** 列车 */
|
||||
export default class Train extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 40;
|
||||
this.size = 0;
|
||||
this.section = null;
|
||||
this.fontSize = style.Train.common.useSelfText?style.Train.common.nameFontSize || style.Train.common.trainTextFontSize:model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize;
|
||||
this.newScale = this.fontSize / style.Train.common.trainTextFontSize;
|
||||
this.nameFormat = style.Train.common.useSelfFormat?style.Train.trainBody.trainNameFormat:model.nameFormat || style.Train.trainBody.trainNameFormat;
|
||||
if ( style.Train.trainBody.specialTrainType.length > 0) {
|
||||
style.Train.trainBody.specialTrainType.some((item) =>{
|
||||
if (model.type === item.type) {
|
||||
this.nameFormat = item.nameFormat;
|
||||
model.serviceNumber = item.serviceNumber?item.serviceNumber : model.serviceNumber;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 40;
|
||||
this.size = 0;
|
||||
this.section = null;
|
||||
this.fontSize = style.Train.common.useSelfText ? style.Train.common.nameFontSize || style.Train.common.trainTextFontSize : model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize;
|
||||
this.newScale = this.fontSize / style.Train.common.trainTextFontSize;
|
||||
this.nameFormat = style.Train.common.useSelfFormat ? style.Train.trainBody.trainNameFormat : model.nameFormat || style.Train.trainBody.trainNameFormat;
|
||||
if ( style.Train.trainBody.specialTrainType.length > 0) {
|
||||
style.Train.trainBody.specialTrainType.some((item) =>{
|
||||
if (model.type === item.type) {
|
||||
this.nameFormat = item.nameFormat;
|
||||
model.serviceNumber = item.serviceNumber ? item.serviceNumber : model.serviceNumber;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
_computed() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
if (model.trainWindowModel) {
|
||||
this.point = {
|
||||
x: model.trainWindowModel.point.x,
|
||||
y: model.trainWindowModel.point.y
|
||||
};
|
||||
switch (model.directionType) {
|
||||
case '01': // 未知方向
|
||||
this.point.x = this.point.x + model.trainWindowModel.width / 2 + Math.abs((style.Train.common.trainWidth - model.trainWindowModel.width) / 2);
|
||||
break;
|
||||
case '02': // 从左向右
|
||||
this.point.x = this.point.x + model.trainWindowModel.width / 2 - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth;
|
||||
break;
|
||||
case '03': // 从右向左
|
||||
this.point.x = this.point.x - model.trainWindowModel.width / 2 + style.Train.trainHead.trainConntWidth * this.newScale;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this.point = model.position;
|
||||
this.traingle = null;
|
||||
}
|
||||
}
|
||||
create() {
|
||||
this._computed();
|
||||
this.isChangeTrainWidth(this.model, this.style);
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
if (this.point) {
|
||||
this.trainB = new TrainBody({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
point: this.point,
|
||||
destinationStatus: model.destinationStatus,
|
||||
serviceNumber: model.serviceNumber,
|
||||
tripNumber: model.tripNumber,
|
||||
targetCode: model.targetCode,
|
||||
groupNumber: model.groupNumber,
|
||||
directionType: model.directionType,
|
||||
directionCode: model.directionCode,
|
||||
sectionModel: model.sectionModel,
|
||||
runControlStatus: model.runControlStatus,
|
||||
runStatus: model.runStatus,
|
||||
fontSize: this.fontSize,
|
||||
nameFormat: this.nameFormat,
|
||||
type: model.type,
|
||||
speed: model.speed,
|
||||
maLen: model.maLen,
|
||||
model: model
|
||||
});
|
||||
this.trainL = new TrainHead({
|
||||
style: style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: this.point.x - style.Train.common.trainHeadDistance,
|
||||
y: this.point.y
|
||||
},
|
||||
drect: -1,
|
||||
scale: this.newScale
|
||||
});
|
||||
_computed() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
if (model.trainWindowModel) {
|
||||
this.point = {
|
||||
x: model.trainWindowModel.point.x,
|
||||
y: model.trainWindowModel.point.y
|
||||
};
|
||||
switch (model.directionType) {
|
||||
case '01': // 未知方向
|
||||
this.point.x = this.point.x + model.trainWindowModel.width / 2 + Math.abs((style.Train.common.trainWidth - model.trainWindowModel.width) / 2);
|
||||
break;
|
||||
case '02': // 从左向右
|
||||
this.point.x = this.point.x + model.trainWindowModel.width / 2 - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth;
|
||||
break;
|
||||
case '03': // 从右向左
|
||||
this.point.x = this.point.x - model.trainWindowModel.width / 2 + style.Train.trainHead.trainConntWidth * this.newScale;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this.point = model.position;
|
||||
this.traingle = null;
|
||||
}
|
||||
}
|
||||
create() {
|
||||
this._computed();
|
||||
this.isChangeTrainWidth(this.model, this.style);
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
if (this.point) {
|
||||
this.trainB = new TrainBody({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: style,
|
||||
point: this.point,
|
||||
destinationStatus: model.destinationStatus,
|
||||
serviceNumber: model.serviceNumber,
|
||||
tripNumber: model.tripNumber,
|
||||
targetCode: model.targetCode,
|
||||
groupNumber: model.groupNumber,
|
||||
directionType: model.directionType,
|
||||
directionCode: model.directionCode,
|
||||
sectionModel: model.sectionModel,
|
||||
runControlStatus: model.runControlStatus,
|
||||
runStatus: model.runStatus,
|
||||
fontSize: this.fontSize,
|
||||
nameFormat: this.nameFormat,
|
||||
type: model.type,
|
||||
speed: model.speed,
|
||||
maLen: model.maLen,
|
||||
model: model
|
||||
});
|
||||
this.trainL = new TrainHead({
|
||||
style: style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: this.point.x - style.Train.common.trainHeadDistance,
|
||||
y: this.point.y
|
||||
},
|
||||
drect: -1,
|
||||
scale: this.newScale
|
||||
});
|
||||
|
||||
this.trainR = new TrainHead({
|
||||
style: style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: this.point.x + style.Train.common.trainWidth + style.Train.common.trainHeadDistance,
|
||||
y: this.point.y
|
||||
},
|
||||
drect: 1,
|
||||
scale: this.newScale
|
||||
});
|
||||
this.trainR = new TrainHead({
|
||||
style: style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: this.point.x + style.Train.common.trainWidth + style.Train.common.trainHeadDistance,
|
||||
y: this.point.y
|
||||
},
|
||||
drect: 1,
|
||||
scale: this.newScale
|
||||
});
|
||||
|
||||
this.add(this.trainB);
|
||||
this.add(this.trainL);
|
||||
this.add(this.trainR);
|
||||
}
|
||||
if (style.Train.common.haveTrainBorder) {
|
||||
this.createTrainBorder();
|
||||
}
|
||||
}
|
||||
this.add(this.trainB);
|
||||
this.add(this.trainL);
|
||||
this.add(this.trainR);
|
||||
}
|
||||
if (style.Train.common.haveTrainBorder) {
|
||||
this.createTrainBorder();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取设备提示坐标
|
||||
getShapeTipPoint() {
|
||||
}
|
||||
// 获取设备提示坐标
|
||||
getShapeTipPoint() {
|
||||
}
|
||||
|
||||
// 恢复颜色状态
|
||||
recover() {
|
||||
this.trainB && this.trainB.setHShow(false);
|
||||
this.trainB && this.trainB.setSShow(false);
|
||||
this.trainB && this.trainB.setDShow(false);
|
||||
this.trainB && this.trainB.setAShow(false);
|
||||
this.trainL && this.trainL.setLineShow(false);
|
||||
this.trainR && this.trainR.setLineShow(false);
|
||||
this.trainL && this.trainL.setArrowShow(false);
|
||||
this.trainR && this.trainR.setArrowShow(false);
|
||||
}
|
||||
// 恢复颜色状态
|
||||
recover() {
|
||||
this.trainB && this.trainB.setHShow(false);
|
||||
this.trainB && this.trainB.setSShow(false);
|
||||
this.trainB && this.trainB.setDShow(false);
|
||||
this.trainB && this.trainB.setAShow(false);
|
||||
|
||||
// 设置服务号状态类型
|
||||
setServerNoType(type) {
|
||||
if (this.style.Train.trainStatusStyle.serverNoType.length>0) {
|
||||
const flag = this.style.Train.trainStatusStyle.serverNoType.some((item) =>{
|
||||
if (type === item.type) {
|
||||
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (this.style.Train.trainStatusStyle.defaultServerNoColor && !flag) {
|
||||
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultServerNoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.trainL && this.trainL.setLineShow(false);
|
||||
this.trainR && this.trainR.setLineShow(false);
|
||||
this.trainL && this.trainL.setArrowShow(false);
|
||||
this.trainR && this.trainR.setArrowShow(false);
|
||||
}
|
||||
|
||||
// 设置目的地状态
|
||||
setDestinationStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.destinationStatus.length>0) {
|
||||
const flag = this.style.Train.trainStatusStyle.destinationStatus.some((item) =>{
|
||||
if (status === item.status) {
|
||||
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||
case 'trainTarget':
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
break;
|
||||
case 'trainServer':
|
||||
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
|
||||
break;
|
||||
case 'trainWindowBorder':
|
||||
this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) {
|
||||
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||
case 'trainTarget':
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
case 'trainServer':
|
||||
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
case 'trainWindowBorder':
|
||||
this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 设置服务号状态类型
|
||||
setServerNoType(type) {
|
||||
if (this.style.Train.trainStatusStyle.serverNoType.length > 0) {
|
||||
const flag = this.style.Train.trainStatusStyle.serverNoType.some((item) =>{
|
||||
if (type === item.type) {
|
||||
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (this.style.Train.trainStatusStyle.defaultServerNoColor && !flag) {
|
||||
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultServerNoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设置运行方向状态类型
|
||||
setDirectionType(type) {
|
||||
if (this.style.Train.trainStatusStyle.directionType.length > 0) {
|
||||
this.style.Train.trainStatusStyle.directionType.some((item) => {
|
||||
if (type === item.type) {
|
||||
this.trainL && this.trainL.setLineShow(item.lineLShow);
|
||||
this.trainL && this.trainL.setArrowShow(item.arrowLShow);
|
||||
this.trainR && this.trainR.setLineShow(item.lineRShow);
|
||||
this.trainR && this.trainR.setArrowShow(item.arrowRShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置列车停止方向类型
|
||||
setDirectionStopType(type) {
|
||||
if (this.style.Train.trainStatusStyle.directionStopType.length > 0) {
|
||||
this.style.Train.trainStatusStyle.directionStopType.some((item) => {
|
||||
if (type === item.type) {
|
||||
this.trainL && this.trainL.setLineShow(item.lineLShow);
|
||||
this.trainR && this.trainR.setLineShow(item.lineRShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置运行状态
|
||||
setRunStatus(status) {
|
||||
switch (status) {
|
||||
case '01': // 停止
|
||||
this.setDirectionStopType(this.model.directionType); // 设置运行方向状态类型
|
||||
break;
|
||||
case '02': // 运行
|
||||
this.setDirectionType(this.model.directionType); // 设置运行方向状态类型
|
||||
break;
|
||||
}
|
||||
// 设置目的地状态
|
||||
setDestinationStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.destinationStatus.length > 0) {
|
||||
const flag = this.style.Train.trainStatusStyle.destinationStatus.some((item) =>{
|
||||
if (status === item.status) {
|
||||
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||
case 'trainTarget':
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
break;
|
||||
case 'trainServer':
|
||||
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
|
||||
break;
|
||||
case 'trainWindowBorder':
|
||||
this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) {
|
||||
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||
case 'trainTarget':
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
case 'trainServer':
|
||||
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
case 'trainWindowBorder':
|
||||
this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 设置运行模式
|
||||
setRunMode(status) {
|
||||
if (this.style.Train.trainStatusStyle.runModeStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.runModeStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainL && this.trainL.setColor(item.trainLColor);
|
||||
this.trainR &&this.trainR.setColor(item.trainRColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置运行控制状态类型
|
||||
setRunControlStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.runControlStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.runControlStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setHShow(item.hShow);
|
||||
this.trainB && this.trainB.setSShow(item.sShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置车门状态类型
|
||||
setDoorStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.doorStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.doorStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setDShow(item.dShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置通信状态类型
|
||||
setCommunicationStatus() {
|
||||
if (this.style.Train.trainStatusStyle.communicationStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.communicationStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setTrainColor(item.trainColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置报警状态
|
||||
setAlarmStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.alarmStatus.length >0) {
|
||||
this.style.Train.trainStatusStyle.alarmStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setAShow(item.aShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
setTrainTypeStatus(type) {
|
||||
if (this.style.Train.trainStatusStyle.trainTypeStatus) {
|
||||
this.style.Train.trainStatusStyle.trainTypeStatus.some((item) => {
|
||||
if ( type === item.type) {
|
||||
item.serviceNumberColor && this.trainB && this.trainB.setTextTrainServerColor(item.serviceNumberColor);
|
||||
item.trainNumberColor && this.trainB && this.trainB.setTextTrainNumberColor(item.trainNumberColor);
|
||||
item.trainTargetColor && this.trainB && this.trainB.setTextTrainTargetColor(item.trainTargetColor);
|
||||
item.groupNumberColor && this.trainB && this.trainB.setTextTrainTargetNumberColor(item.groupNumberColor);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
this.model = model;
|
||||
if (model) {
|
||||
this.recover();
|
||||
this.setServerNoType(model.serverNoType); // 设置服务号状态类型
|
||||
this.setDestinationStatus(model.destinationStatus); // 设置目的地状态
|
||||
this.setRunStatus(model.runStatus); // 设置运行状态
|
||||
this.setRunMode(model.runMode); // 设置运行模式
|
||||
this.setRunControlStatus(model.runControlStatus); // 设置运行控制状态类型
|
||||
this.setDoorStatus(model.doorStatus); // 设置车门状态类型
|
||||
this.setCommunicationStatus(model.communicationStatus); // 设置通信状态类型
|
||||
this.setAlarmStatus(model.alarmStatus); // 设置报警状态
|
||||
this.setTrainTypeStatus(model.type); // 根据列车类型设置列车识别号样式
|
||||
}
|
||||
}
|
||||
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
isChangeTrainWidth(model, style) {
|
||||
if (!style.Train.trainBody.changeTrainWidth) { return; }
|
||||
if (this.nameFormat) {
|
||||
const arr = this.nameFormat.split(':');
|
||||
arr.forEach(ele => {
|
||||
switch (ele) {
|
||||
case 'targetCode': {
|
||||
this.size += (style.Train.trainNumber.targetCodePrefix || '').length;
|
||||
break;
|
||||
}
|
||||
case 'serviceNumber': {
|
||||
this.size += (style.Train.trainServer.serviceNumberPrefix || '').length;
|
||||
break;
|
||||
}
|
||||
case 'tripNumber': {
|
||||
this.size += (style.Train.trainTarget.tripNumberPrefix || '').length;
|
||||
break;
|
||||
}
|
||||
case 'groupNumber': {
|
||||
this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.size = 9;
|
||||
}
|
||||
this.style.Train.common.trainWidth = this.size * this.fontSize * this.style.Train.common.aspectRatio + this.style.Train.common.trainWidthMoreText;
|
||||
}
|
||||
removeTrainDetail() {
|
||||
this.trainB && this.trainB.removeTrainDetail();
|
||||
}
|
||||
// 设置运行方向状态类型
|
||||
setDirectionType(type, flag) {
|
||||
if (this.style.Train.trainStatusStyle.directionType.length > 0) {
|
||||
this.style.Train.trainStatusStyle.directionType.forEach((item) => {
|
||||
if (type === item.type) {
|
||||
let lineLShow = item.lineLShow;
|
||||
let arrowLShow = item.arrowLShow;
|
||||
let lineRShow = item.lineRShow;
|
||||
let arrowRShow = item.arrowRShow;
|
||||
if (flag) {
|
||||
lineLShow = !item.lineLShow;
|
||||
arrowLShow = !item.arrowLShow;
|
||||
lineRShow = !item.lineRShow;
|
||||
arrowRShow = !item.arrowRShow;
|
||||
}
|
||||
this.trainL && this.trainL.setLineShow(lineLShow);
|
||||
this.trainL && this.trainL.setArrowShow(arrowLShow);
|
||||
this.trainR && this.trainR.setLineShow(lineRShow);
|
||||
this.trainR && this.trainR.setArrowShow(arrowRShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置列车停止方向类型
|
||||
setDirectionStopType(type) {
|
||||
if (this.style.Train.trainStatusStyle.directionStopType.length > 0) {
|
||||
this.style.Train.trainStatusStyle.directionStopType.forEach((item) => {
|
||||
if (type === item.type) {
|
||||
this.trainL && this.trainL.setLineShow(item.lineLShow);
|
||||
this.trainR && this.trainR.setLineShow(item.lineRShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置运行状态
|
||||
setRunStatus(status, flag) {
|
||||
switch (status) {
|
||||
case '01': // 停止
|
||||
this.setDirectionStopType(this.model.directionType); // 设置运行方向状态类型
|
||||
break;
|
||||
case '02': // 运行
|
||||
this.setDirectionType(this.model.directionType, flag); // 设置运行方向状态类型
|
||||
break;
|
||||
}
|
||||
|
||||
getBoundingRect() {
|
||||
const list = [this.trainB, this.trainL, this.trainR];
|
||||
let rect = null;
|
||||
}
|
||||
// 设置运行模式
|
||||
setRunMode(status) {
|
||||
if (this.style.Train.trainStatusStyle.runModeStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.runModeStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainL && this.trainL.setColor(item.trainLColor);
|
||||
this.trainR && this.trainR.setColor(item.trainRColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置运行控制状态类型
|
||||
setRunControlStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.runControlStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.runControlStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setHShow(item.hShow);
|
||||
this.trainB && this.trainB.setSShow(item.sShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置车门状态类型
|
||||
setDoorStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.doorStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.doorStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setDShow(item.dShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置通信状态类型
|
||||
setCommunicationStatus() {
|
||||
if (this.style.Train.trainStatusStyle.communicationStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.communicationStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setTrainColor(item.trainColor);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置报警状态
|
||||
setAlarmStatus(status) {
|
||||
if (this.style.Train.trainStatusStyle.alarmStatus.length > 0) {
|
||||
this.style.Train.trainStatusStyle.alarmStatus.some((item) => {
|
||||
if (status === item.status) {
|
||||
this.trainB && this.trainB.setAShow(item.aShow);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
setTrainTypeStatus(type) {
|
||||
if (this.style.Train.trainStatusStyle.trainTypeStatus) {
|
||||
this.style.Train.trainStatusStyle.trainTypeStatus.some((item) => {
|
||||
if ( type === item.type) {
|
||||
item.serviceNumberColor && this.trainB && this.trainB.setTextTrainServerColor(item.serviceNumberColor);
|
||||
item.trainNumberColor && this.trainB && this.trainB.setTextTrainNumberColor(item.trainNumberColor);
|
||||
item.trainTargetColor && this.trainB && this.trainB.setTextTrainTargetColor(item.trainTargetColor);
|
||||
item.groupNumberColor && this.trainB && this.trainB.setTextTrainTargetNumberColor(item.groupNumberColor);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
this.model = model;
|
||||
// let points = [];
|
||||
const flag = false;
|
||||
// if (this.model.sectionModel && this.model.sectionModel.points) {
|
||||
// points = this.model.sectionModel.points;
|
||||
// if (points.length) {
|
||||
// const pointFlag = points[0].x - points[points.length - 1].x;
|
||||
// if (pointFlag > 0) {
|
||||
// flag = true; // 方向去反
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (model) {
|
||||
this.recover();
|
||||
this.setServerNoType(model.serverNoType); // 设置服务号状态类型
|
||||
this.setDestinationStatus(model.destinationStatus); // 设置目的地状态
|
||||
this.setRunStatus(model.runStatus, flag); // 设置运行状态
|
||||
this.setRunMode(model.runMode); // 设置运行模式
|
||||
this.setRunControlStatus(model.runControlStatus); // 设置运行控制状态类型
|
||||
this.setDoorStatus(model.doorStatus); // 设置车门状态类型
|
||||
this.setCommunicationStatus(model.communicationStatus); // 设置通信状态类型
|
||||
this.setAlarmStatus(model.alarmStatus); // 设置报警状态
|
||||
this.setTrainTypeStatus(model.type); // 根据列车类型设置列车识别号样式
|
||||
}
|
||||
}
|
||||
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
isChangeTrainWidth(model, style) {
|
||||
if (!style.Train.trainBody.changeTrainWidth) { return; }
|
||||
if (this.nameFormat) {
|
||||
const arr = this.nameFormat.split(':');
|
||||
arr.forEach(ele => {
|
||||
switch (ele) {
|
||||
case 'targetCode': {
|
||||
this.size += (style.Train.trainNumber.targetCodePrefix || '').length;
|
||||
break;
|
||||
}
|
||||
case 'serviceNumber': {
|
||||
this.size += (style.Train.trainServer.serviceNumberPrefix || '').length;
|
||||
break;
|
||||
}
|
||||
case 'tripNumber': {
|
||||
this.size += (style.Train.trainTarget.tripNumberPrefix || '').length;
|
||||
break;
|
||||
}
|
||||
case 'groupNumber': {
|
||||
this.size += (style.Train.trainTargetNumber.groupNumberPrefix || '').length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.size = 9;
|
||||
}
|
||||
this.style.Train.common.trainWidth = this.size * this.fontSize * this.style.Train.common.aspectRatio + this.style.Train.common.trainWidthMoreText;
|
||||
}
|
||||
removeTrainDetail() {
|
||||
this.trainB && this.trainB.removeTrainDetail();
|
||||
}
|
||||
|
||||
list.forEach(elem => {
|
||||
if (elem) {
|
||||
const tempRect = elem.getBoundingRect();
|
||||
if (tempRect.x && tempRect.y && tempRect.width && tempRect.height) {
|
||||
if (rect) {
|
||||
rect.union(tempRect);
|
||||
} else {
|
||||
rect = tempRect;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
getBoundingRect() {
|
||||
const list = [this.trainB, this.trainL, this.trainR];
|
||||
let rect = null;
|
||||
|
||||
return rect || new BoundingRect(0, 0, 0, 0);
|
||||
}
|
||||
createTrainBorder() {
|
||||
const rect = Object.assign({}, this.getBoundingRect());
|
||||
rect.x -= this.style.Train.common.trainWidth / 2;
|
||||
rect.y -= 5;
|
||||
rect.width += this.style.Train.common.trainWidth;
|
||||
rect.height += 10;
|
||||
list.forEach(elem => {
|
||||
if (elem) {
|
||||
const tempRect = elem.getBoundingRect();
|
||||
if (tempRect.x && tempRect.y && tempRect.width && tempRect.height) {
|
||||
if (rect) {
|
||||
rect.union(tempRect);
|
||||
} else {
|
||||
rect = tempRect;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.trainBorder = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
silent: true,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: this.style.borderColor,
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
return rect || new BoundingRect(0, 0, 0, 0);
|
||||
}
|
||||
createTrainBorder() {
|
||||
const rect = Object.assign({}, this.getBoundingRect());
|
||||
rect.x -= this.style.Train.common.trainWidth / 2;
|
||||
rect.y -= 5;
|
||||
rect.width += this.style.Train.common.trainWidth;
|
||||
rect.height += 10;
|
||||
|
||||
this.add(this.trainBorder);
|
||||
}
|
||||
this.trainBorder = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
silent: true,
|
||||
shape: rect,
|
||||
style: {
|
||||
lineDash: [3, 3],
|
||||
stroke: this.style.borderColor,
|
||||
fill: this.style.transparentColor
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.trainBorder);
|
||||
}
|
||||
}
|
||||
|
@ -1,196 +1,208 @@
|
||||
<template>
|
||||
<el-dialog class="batong-01__systerm confirm-control" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<el-row>
|
||||
<el-col :span="20" :offset="2">
|
||||
<div style="float: left; line-height: 33px; font-size: 15px;">车站:</div>
|
||||
<div style="float: left; width: 140px; margin-left: 10px;">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" :offset="2" style="margin-top: 10px;">
|
||||
<div style="float: left; line-height: 33px; font-size: 15px;">{{tipContent}}:</div>
|
||||
<div style="float: left; width: 140px; margin-left: 10px;">
|
||||
<el-input v-model="splitName" size="small" disabled></el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="batong-01__systerm confirm-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="20" :offset="2">
|
||||
<div style="float: left; line-height: 33px; font-size: 15px;">车站:</div>
|
||||
<div style="float: left; width: 140px; margin-left: 10px;">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" :offset="2" style="margin-top: 10px;">
|
||||
<div style="float: left; line-height: 33px; font-size: 15px;">{{ tipContent }}:</div>
|
||||
<div style="float: left; width: 140px; margin-left: 10px;">
|
||||
<el-input v-model="splitName" size="small" disabled />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'SplitModule',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null,
|
||||
tipContent: '轨道',
|
||||
stationName: '',
|
||||
splitName: '',
|
||||
selected: null,
|
||||
export default {
|
||||
name: 'SplitModule',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null,
|
||||
tipContent: '轨道',
|
||||
stationName: '',
|
||||
splitName: '',
|
||||
selected: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Section.split.mbar.operation) {
|
||||
this.tipContent = '轨道';
|
||||
return '轨道切除';
|
||||
} else if (this.operation === OperationEvent.Section.active.mbar.operation) {
|
||||
this.tipContent = '轨道';
|
||||
return '轨道恢复';
|
||||
} else if (this.operation === OperationEvent.Switch.split.mbar.operation) {
|
||||
this.tipContent = '道岔';
|
||||
return '道岔切除';
|
||||
} else if (this.operation === OperationEvent.Switch.active.mbar.operation) {
|
||||
this.tipContent = '道岔';
|
||||
return '道岔恢复';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.split.mbar.operation) {
|
||||
this.tipContent = '轨道';
|
||||
return '轨道切除';
|
||||
} else if (this.operation === OperationEvent.Section.active.mbar.operation) {
|
||||
this.tipContent = '轨道';
|
||||
return '轨道恢复';
|
||||
} else if (this.operation === OperationEvent.Switch.split.mbar.operation) {
|
||||
this.tipContent = '道岔';
|
||||
return '道岔切除';
|
||||
} else if (this.operation === OperationEvent.Switch.active.mbar.operation) {
|
||||
this.tipContent = '道岔';
|
||||
return '道岔恢复';
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.split.mbar.operation) {
|
||||
/** 轨道切除*/
|
||||
return OperationEvent.Section.split.mbar.domId
|
||||
} else if (this.operation === OperationEvent.Section.active.mbar.operation) {
|
||||
// 轨道恢复
|
||||
return OperationEvent.Section.active.mbar.domId
|
||||
} else if (this.operation === OperationEvent.Switch.split.mbar.operation) {
|
||||
// '道岔切除';
|
||||
return OperationEvent.Switch.split.mbar.domId
|
||||
} else if (this.operation === OperationEvent.Switch.active.mbar.operation) {
|
||||
// '道岔恢复';
|
||||
return OperationEvent.Switch.active.mbar.domId
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, select) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.messages = operate.messages;
|
||||
this.operation = operate.operation;
|
||||
console.log(select, '数据');
|
||||
this.stationName = '';
|
||||
this.dialogShow = true;
|
||||
if (this.operation == OperationEvent.Section.split.mbar.operation || this.operation == OperationEvent.Section.active.mbar.operation) {
|
||||
if (select && select._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
let station = this.$store.getters['map/getDeviceByCode'](select.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
} else {
|
||||
this.$message.error('选择数据错误,请重新操作!');
|
||||
this.dialogShow = false;
|
||||
}
|
||||
} else if (this.operation == OperationEvent.Switch.split.mbar.operation || this.operation == OperationEvent.Switch.active.mbar.operation) {
|
||||
if (select && select._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
let station = this.$store.getters['map/getDeviceByCode'](select.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
} else {
|
||||
this.$message.error('选择数据错误,请重新操作!');
|
||||
this.dialogShow = false;
|
||||
}
|
||||
}
|
||||
this.splitName = select.name;
|
||||
this.selected = select;
|
||||
}
|
||||
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Section.split.mbar.operation) {
|
||||
/** 轨道切除*/
|
||||
this.handleData(OperationEvent.Section.split.menu.operation);
|
||||
/** 轨道切除*/
|
||||
return OperationEvent.Section.split.mbar.domId;
|
||||
} else if (this.operation === OperationEvent.Section.active.mbar.operation) {
|
||||
// 轨道恢复
|
||||
this.handleData(OperationEvent.Section.active.menu.operation);
|
||||
return OperationEvent.Section.active.mbar.domId;
|
||||
} else if (this.operation === OperationEvent.Switch.split.mbar.operation) {
|
||||
// '道岔切除';
|
||||
this.handleData(OperationEvent.Switch.split.menu.operation);
|
||||
return OperationEvent.Switch.split.mbar.domId;
|
||||
} else if (this.operation === OperationEvent.Switch.active.mbar.operation) {
|
||||
// '道岔恢复';
|
||||
this.handleData(OperationEvent.Switch.active.menu.operation);
|
||||
return OperationEvent.Switch.active.mbar.domId;
|
||||
}
|
||||
},
|
||||
//轨道切除/轨道恢复
|
||||
handleData(operation) {
|
||||
let operate = {
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
label: MapDeviceType.Section.label,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, select) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.messages = operate.messages;
|
||||
this.operation = operate.operation;
|
||||
this.stationName = '';
|
||||
this.dialogShow = true;
|
||||
if (this.operation == OperationEvent.Section.split.mbar.operation || this.operation == OperationEvent.Section.active.mbar.operation) {
|
||||
if (select && select._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](select.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
} else {
|
||||
this.$message.error('选择数据错误,请重新操作!');
|
||||
this.dialogShow = false;
|
||||
}
|
||||
} else if (this.operation == OperationEvent.Switch.split.mbar.operation || this.operation == OperationEvent.Switch.active.mbar.operation) {
|
||||
if (select && select._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](select.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
} else {
|
||||
this.$message.error('选择数据错误,请重新操作!');
|
||||
this.dialogShow = false;
|
||||
}
|
||||
}
|
||||
this.splitName = select.name;
|
||||
this.selected = select;
|
||||
}
|
||||
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Section.split.mbar.operation) {
|
||||
/** 轨道切除*/
|
||||
this.handleData(OperationEvent.Section.split.menu.operation);
|
||||
} else if (this.operation === OperationEvent.Section.active.mbar.operation) {
|
||||
// 轨道恢复
|
||||
this.handleData(OperationEvent.Section.active.menu.operation);
|
||||
} else if (this.operation === OperationEvent.Switch.split.mbar.operation) {
|
||||
// '道岔切除';
|
||||
this.handleData(OperationEvent.Switch.split.menu.operation);
|
||||
} else if (this.operation === OperationEvent.Switch.active.mbar.operation) {
|
||||
// '道岔恢复';
|
||||
this.handleData(OperationEvent.Switch.active.menu.operation);
|
||||
}
|
||||
},
|
||||
// 轨道切除/轨道恢复
|
||||
handleData(operation) {
|
||||
const operate = {
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
label: MapDeviceType.Section.label,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
@ -198,4 +210,4 @@
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,209 +1,214 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou_01 alarm-detail" :title="level+'级告警详细信息'" :visible.sync="show" width="760px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线路名称">
|
||||
<el-input v-model="model.lineName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位名称">
|
||||
<el-input v-model="model.unitName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="模块名称">
|
||||
<el-input v-model="model.moduleName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="报警时间">
|
||||
<el-date-picker v-model="model.alarmDate" type="datetime" placeholder="选择日期时间" disabled>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<span slot="label">等 级</span>
|
||||
<el-input v-model="model.level" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="确认状态">
|
||||
<el-input v-model="model.confirm" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" class="alarm-type">
|
||||
<el-form-item>
|
||||
<span slot="label">类  型</span>
|
||||
<el-input v-model="model.type" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15" class="alarm-child-type">
|
||||
<el-form-item label="子类型">
|
||||
<el-input v-model="model.childType" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="时间摘要">
|
||||
<el-input v-model="model.timeSummary" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="推荐操作">
|
||||
<el-input v-model="model.recommendedOperation" disabled></el-input>
|
||||
</el-form-item>
|
||||
<div class="alarm-detail-description">
|
||||
<span> 报警详细描述</span><br>
|
||||
<el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="model.alarmDetail" disabled>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="3" :offset="9">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">确 定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<span style="line-height:26px">未确认{{level}}级报警数目:1</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou_01 alarm-detail"
|
||||
:title="level+'级告警详细信息'"
|
||||
:visible.sync="show"
|
||||
width="760px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线路名称">
|
||||
<el-input v-model="model.lineName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位名称">
|
||||
<el-input v-model="model.unitName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="模块名称">
|
||||
<el-input v-model="model.moduleName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="报警时间">
|
||||
<el-date-picker v-model="model.alarmDate" type="datetime" placeholder="选择日期时间" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<span slot="label">等 级</span>
|
||||
<el-input v-model="model.level" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="确认状态">
|
||||
<el-input v-model="model.confirm" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" class="alarm-type">
|
||||
<el-form-item>
|
||||
<span slot="label">类  型</span>
|
||||
<el-input v-model="model.type" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15" class="alarm-child-type">
|
||||
<el-form-item label="子类型">
|
||||
<el-input v-model="model.childType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="时间摘要">
|
||||
<el-input v-model="model.timeSummary" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="推荐操作">
|
||||
<el-input v-model="model.recommendedOperation" disabled />
|
||||
</el-form-item>
|
||||
<div class="alarm-detail-description">
|
||||
<span> 报警详细描述</span><br>
|
||||
<el-input v-model="model.alarmDetail" type="textarea" :rows="5" placeholder="请输入内容" disabled />
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="3" :offset="9">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">确 定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<span style="line-height:26px">未确认{{ level }}级报警数目:1</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'AlarmDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
level: 0,
|
||||
operate: null,
|
||||
controlProps: {
|
||||
'01': '中控',
|
||||
'02': '站控'
|
||||
},
|
||||
model: {
|
||||
lineName: '',
|
||||
unitName: '',
|
||||
moduleName: '',
|
||||
level: '',
|
||||
confirm: '',
|
||||
alarmDate: '',
|
||||
type: '',
|
||||
childType: '',
|
||||
timeSummary: '',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: ''
|
||||
}
|
||||
export default {
|
||||
name: 'AlarmDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
level: 0,
|
||||
operate: null,
|
||||
controlProps: {
|
||||
'01': '中控',
|
||||
'02': '站控'
|
||||
},
|
||||
model: {
|
||||
lineName: '',
|
||||
unitName: '',
|
||||
moduleName: '',
|
||||
level: '',
|
||||
confirm: '',
|
||||
alarmDate: '',
|
||||
type: '',
|
||||
childType: '',
|
||||
timeSummary: '',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'name'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'name',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
console.log('alram', elem);
|
||||
if (elem && elem.type == 'resp') {
|
||||
if (elem.agree) {
|
||||
let operate = this.$store.state.training.operate;
|
||||
let control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
let newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name,
|
||||
}
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp') {
|
||||
if (elem.agree) {
|
||||
const operate = this.$store.state.training.operate;
|
||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
const newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name
|
||||
};
|
||||
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.model = {
|
||||
lineName: this.name,
|
||||
unitName: this.operate.name,
|
||||
moduleName: 'CMM控制模式转换模式',
|
||||
level: '0级告警',
|
||||
confirm: '确认状态',
|
||||
alarmDate: new Date(),
|
||||
type: '系统事件',
|
||||
childType: '依据信号设备操作命令设置控制模式',
|
||||
timeSummary: '控制模式摘要',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: `控制模式转换:${this.operate.name}由中控转为站控模式!`
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.model = {
|
||||
lineName: this.name,
|
||||
unitName: this.operate.name,
|
||||
moduleName: 'CMM控制模式转换模式',
|
||||
level: '0级告警',
|
||||
confirm: '确认状态',
|
||||
alarmDate: new Date(),
|
||||
type: '系统事件',
|
||||
childType: '依据信号设备操作命令设置控制模式',
|
||||
timeSummary: '控制模式摘要',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: `控制模式转换:${this.operate.name}由中控转为站控模式!`
|
||||
};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
.alarm-type .el-input {
|
||||
width: 220px;
|
||||
}
|
||||
@ -212,4 +217,4 @@
|
||||
padding-left: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,107 +1,116 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou_01 cmd-notice" title="操作命令提示" :visible.sync="show" width="400px" :before-close="doClose"
|
||||
:zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<span>{{name}},{{msg}}!</span>
|
||||
<el-row class="button-group">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">确认</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou_01 cmd-notice"
|
||||
title="操作命令提示"
|
||||
:visible.sync="show"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<span>{{ name }},{{ msg }}!</span>
|
||||
<el-row class="button-group">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">确认</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
export default {
|
||||
name: 'CmdNotice',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
name: '',
|
||||
msg: ''
|
||||
}
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
export default {
|
||||
name: 'CmdNotice',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
name: '',
|
||||
msg: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
console.log('timeout', elem);
|
||||
if (elem && elem.type == 'resp') {
|
||||
let operate = this.$store.state.training.operate;
|
||||
let control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
let newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name,
|
||||
}
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp') {
|
||||
const operate = this.$store.state.training.operate;
|
||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
const newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name
|
||||
};
|
||||
|
||||
if (elem.timeout) {
|
||||
newOperate['msg'] = '请求超时';
|
||||
this.doShow(newOperate);
|
||||
} else if (!elem.agree) {
|
||||
newOperate['msg'] = '请求拒绝';
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
if (elem.timeout) {
|
||||
newOperate['msg'] = '请求超时';
|
||||
this.doShow(newOperate);
|
||||
} else if (!elem.agree) {
|
||||
newOperate['msg'] = '请求拒绝';
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.name = this.operate.name || '';
|
||||
this.msg = this.operate.msg || '';
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
operation: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.name = this.operate.name || '';
|
||||
this.msg = this.operate.msg || '';
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation
|
||||
};
|
||||
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
@ -1,273 +1,289 @@
|
||||
<template>
|
||||
<el-dialog class="beijing-01__systerm stand-detain-train" :title="title" :visible.sync="show" width="380px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div class="head_content content">
|
||||
<span class="base-label" style="left: 0px;">会话管理</span>
|
||||
<el-col :span="8">
|
||||
<el-button class="status">查询会话状态</el-button>
|
||||
</el-col>
|
||||
<el-col :span="15" :offset="1">
|
||||
<el-input :value="messageText" placeholder="" size="mini" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button class="status_btn" :id="openMessageId" @click="handleMessage('open')"
|
||||
:disabled="isOpenMessage">打开会话</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button class="status_btn" :id="closeMessageId" @click="handleMessage('close')"
|
||||
:disabled="!isOpenMessage">关闭会话
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">操作</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText1" placeholder="" size="mini" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button class="status_btn" :id="confirmId1" @click="confirm1" :disabled="disabledConfirm1">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">确认</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText2" placeholder="" size="mini" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button class="status_btn" :id="confirmId2" @click="confirm2" :disabled="disabledConfirm2">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<el-col :span="7">
|
||||
<div class="text">操作倒计时</div>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
|
||||
{{timeCountConfirm == -1 ? '' : timeCountConfirm}}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<div class="status_text">状态</div>
|
||||
<div class="textarea_content"></div>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="beijing-01__systerm stand-detain-train"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="380px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="head_content content">
|
||||
<span class="base-label" style="left: 0px;">会话管理</span>
|
||||
<el-col :span="8">
|
||||
<el-button class="status">查询会话状态</el-button>
|
||||
</el-col>
|
||||
<el-col :span="15" :offset="1">
|
||||
<el-input :value="messageText" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button
|
||||
:id="openMessageId"
|
||||
class="status_btn"
|
||||
:disabled="isOpenMessage"
|
||||
@click="handleMessage('open')"
|
||||
>打开会话</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button
|
||||
:id="closeMessageId"
|
||||
class="status_btn"
|
||||
:disabled="!isOpenMessage"
|
||||
@click="handleMessage('close')"
|
||||
>关闭会话
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">操作</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText1" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">确认</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText2" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<el-col :span="7">
|
||||
<div class="text">操作倒计时</div>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
|
||||
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<div class="status_text">状态</div>
|
||||
<div class="textarea_content" />
|
||||
</div>
|
||||
|
||||
<el-button class="close_btn" :id="domIdConfirm" type="primary" @click="commit">关闭</el-button>
|
||||
<confirm-tip ref='ConfirmTip' @close="closeMessage"></confirm-tip>
|
||||
</el-dialog>
|
||||
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
|
||||
<confirm-tip ref="ConfirmTip" @close="closeMessage" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmTip from './childDialog/confirmTip';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmTip from './childDialog/confirmTip';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
ConfirmTip
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
radio: '1',
|
||||
radio1: '1',
|
||||
earlyDepar: false,
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
ConfirmTip
|
||||
messageText: '',
|
||||
messageText1: '',
|
||||
messageText2: '',
|
||||
isOpenMessage: false,
|
||||
timeCountConfirm: -1,
|
||||
disabledConfirm1: false,
|
||||
disabledConfirm2: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
radio: '1',
|
||||
radio1: '1',
|
||||
earlyDepar: false,
|
||||
|
||||
messageText: '',
|
||||
messageText1: '',
|
||||
messageText2: '',
|
||||
isOpenMessage: false,
|
||||
timeCountConfirm: -1,
|
||||
disabledConfirm1: false,
|
||||
disabledConfirm2: false,
|
||||
openMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.openMessage.domId : '';
|
||||
},
|
||||
closeMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.closeMessage.domId : '';
|
||||
},
|
||||
confirmId1() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm1.domId : '';
|
||||
},
|
||||
confirmId2() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm2.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '取消全线临时限速';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) { // 关闭会话
|
||||
this.timeCountConfirm = -1;
|
||||
this.disabledConfirm2 = true;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
openMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.openMessage.domId : '';
|
||||
},
|
||||
closeMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.closeMessage.domId : '';
|
||||
},
|
||||
confirmId1() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm1.domId : '';
|
||||
},
|
||||
confirmId2() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm2.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '取消全线临时限速';
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) { // 关闭会话
|
||||
this.timeCountConfirm = -1;
|
||||
this.disabledConfirm2 = true;
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
}, 1000);
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
handleMessage(message) {
|
||||
if (message == 'open') {
|
||||
let operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.openMessage.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText1 = '取消全线临时限速';
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
} else {
|
||||
let operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.closeMessage.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
handleMessage(message) {
|
||||
if (message == 'open') {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm1.operation,
|
||||
}
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.openMessage.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText1 = '**************';
|
||||
this.messageText2 = '取消全线临时限速';
|
||||
this.disabledConfirm1 = true;
|
||||
this.timeCountConfirm = 60; // 倒计时
|
||||
this.messageText1 = '取消全线临时限速';
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
} else {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm2.operation,
|
||||
}
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.closeMessage.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText2 = '**************';
|
||||
this.disabledConfirm2 = true;
|
||||
this.timeCountConfirm = -1;
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (!this.isOpenMessage) {
|
||||
this.doClose();
|
||||
} else {
|
||||
let operate = {
|
||||
message: `是否关闭会话,并关闭窗口`,
|
||||
confirmId: OperationEvent.LimitControl.CancelAllLimit.close.domId,
|
||||
}
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
closeMessage() {
|
||||
let operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.close.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.ConfirmTip.doClose();
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm1.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText1 = '**************';
|
||||
this.messageText2 = '取消全线临时限速';
|
||||
this.disabledConfirm1 = true;
|
||||
this.timeCountConfirm = 60; // 倒计时
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm2.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText2 = '**************';
|
||||
this.disabledConfirm2 = true;
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (!this.isOpenMessage) {
|
||||
this.doClose();
|
||||
} else {
|
||||
const operate = {
|
||||
message: `是否关闭会话,并关闭窗口`,
|
||||
confirmId: OperationEvent.LimitControl.CancelAllLimit.close.domId
|
||||
};
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
closeMessage() {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.close.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.ConfirmTip.doClose();
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.stand-detain-train .context {
|
||||
@ -352,4 +368,4 @@
|
||||
box-shadow: 2px 2px #959595 inset;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -68,186 +68,186 @@ import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteSelection',
|
||||
components: {
|
||||
// ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tempData: [],
|
||||
beforeSectionList: [],
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
row: null,
|
||||
operation: '',
|
||||
display: true,
|
||||
stationName: '',
|
||||
signalName: '',
|
||||
tableStyle: {
|
||||
'border-bottom': 'none'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '进路选排';
|
||||
},
|
||||
commitDisabled() {
|
||||
let disabled = true;
|
||||
if (this.row) {
|
||||
disabled = !this.row.canSetting;
|
||||
}
|
||||
return disabled;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getProtectedSectionName(row) {
|
||||
let name = '';
|
||||
if (row &&
|
||||
name: 'RouteSelection',
|
||||
components: {
|
||||
// ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tempData: [],
|
||||
beforeSectionList: [],
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
row: null,
|
||||
operation: '',
|
||||
display: true,
|
||||
stationName: '',
|
||||
signalName: '',
|
||||
tableStyle: {
|
||||
'border-bottom': 'none'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '进路选排';
|
||||
},
|
||||
commitDisabled() {
|
||||
let disabled = true;
|
||||
if (this.row) {
|
||||
disabled = !this.row.canSetting;
|
||||
}
|
||||
return disabled;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getProtectedSectionName(row) {
|
||||
let name = '';
|
||||
if (row &&
|
||||
row.overlapSectionList &&
|
||||
row.overlapSectionList &&
|
||||
row.overlapSectionList.length > 0) {
|
||||
|
||||
const protect = row.overlapSectionList[0];
|
||||
name = `${protect.name}`;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
|
||||
if (station) {
|
||||
name = `${name}(${station.name})`;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
},
|
||||
expandPath() {
|
||||
console.log('展开进路预览');
|
||||
},
|
||||
doShow(operate, selected, tempData) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
const protect = row.overlapSectionList[0];
|
||||
name = `${protect.name}`;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode);
|
||||
if (station) {
|
||||
name = `${name}(${station.name})`;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
},
|
||||
expandPath() {
|
||||
console.log('展开进路预览');
|
||||
},
|
||||
doShow(operate, selected, tempData) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.tempData = tempData || [];
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.restoreBeforeDevices();
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
restoreBeforeDevices() {
|
||||
// 恢复之前选中设备
|
||||
if (this.beforeSectionList && this.beforeSectionList.length) {
|
||||
this.beforeSectionList.forEach(elem => {
|
||||
elem.cutOff = false;
|
||||
});
|
||||
}
|
||||
this.tempData = tempData || [];
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.restoreBeforeDevices();
|
||||
this.$refs.table.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
restoreBeforeDevices() {
|
||||
// 恢复之前选中设备
|
||||
if (this.beforeSectionList && this.beforeSectionList.length) {
|
||||
this.beforeSectionList.forEach(elem => {
|
||||
elem.cutOff = false;
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
|
||||
this.beforeSectionList = [];
|
||||
},
|
||||
clickEvent(row, event, column) {
|
||||
this.row = row;
|
||||
if (row) {
|
||||
// 恢复进路区段的切除状态
|
||||
this.restoreBeforeDevices();
|
||||
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
|
||||
this.beforeSectionList = [];
|
||||
},
|
||||
clickEvent(row, event, column) {
|
||||
this.row = row;
|
||||
if (row) {
|
||||
// 恢复进路区段的切除状态
|
||||
this.restoreBeforeDevices();
|
||||
|
||||
if (row.canSetting) {
|
||||
// 设置选中区段为切除状态
|
||||
if (row.containSectionList && row.containSectionList.length) {
|
||||
// 设置新选的进路区段为切除状态
|
||||
row.containSectionList.forEach(elem => {
|
||||
elem.cutOff = true;
|
||||
});
|
||||
}
|
||||
if (row.canSetting) {
|
||||
// 设置选中区段为切除状态
|
||||
if (row.containSectionList && row.containSectionList.length) {
|
||||
// 设置新选的进路区段为切除状态
|
||||
row.containSectionList.forEach(elem => {
|
||||
elem.cutOff = true;
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
|
||||
this.beforeSectionList = row.containSectionList || [];
|
||||
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
|
||||
this.beforeSectionList = row.containSectionList || [];
|
||||
|
||||
// 设置选中指令
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
|
||||
val: row.code
|
||||
};
|
||||
// 设置选中指令
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.choose.operation,
|
||||
val: row.code
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
commit() {
|
||||
if (this.row && this.row.canSetting) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
commit() {
|
||||
if (this.row && this.row.canSetting) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -115,205 +115,205 @@ import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
radio: '1',
|
||||
radio1: '1',
|
||||
radio2: '1',
|
||||
earlyDepar: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
upRadioId() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : '';
|
||||
},
|
||||
downRadioId() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.downSelect.domId : '';
|
||||
},
|
||||
title() {
|
||||
this.earlyDepar = false;
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
this.radio1 = '1';
|
||||
return '扣车';
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
this.radio1 = '2';
|
||||
return '取消扣车';
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
this.earlyDepar = true;
|
||||
if (this.selected.direction == '01') {
|
||||
this.radio2 = '2';
|
||||
} else {
|
||||
this.radio2 = '1';
|
||||
}
|
||||
return '提前发车';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
this.standName = selected.name;
|
||||
}
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
radio: '1',
|
||||
radio1: '1',
|
||||
radio2: '1',
|
||||
earlyDepar: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
upRadioId() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : '';
|
||||
},
|
||||
downRadioId() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.downSelect.domId : '';
|
||||
},
|
||||
title() {
|
||||
this.earlyDepar = false;
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
this.radio1 = '1';
|
||||
return '扣车';
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
this.radio1 = '2';
|
||||
return '取消扣车';
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
this.earlyDepar = true;
|
||||
if (this.selected.direction == '01') {
|
||||
this.radio2 = '2';
|
||||
} else {
|
||||
this.radio2 = '1';
|
||||
}
|
||||
return '提前发车';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
this.standName = selected.name;
|
||||
}
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
changeRadio(val) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: '',
|
||||
val: val
|
||||
};
|
||||
if (val == 1) {
|
||||
operate.operation = OperationEvent.StationStand.earlyDeparture.upSelect.operation;
|
||||
} else if (val == 2) {
|
||||
operate.operation = OperationEvent.StationStand.earlyDeparture.downSelect.operation;
|
||||
}
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
changeRadio(val) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: '',
|
||||
val: val
|
||||
};
|
||||
if (val == 1) {
|
||||
operate.operation = OperationEvent.StationStand.earlyDeparture.upSelect.operation;
|
||||
} else if (val == 2) {
|
||||
operate.operation = OperationEvent.StationStand.earlyDeparture.downSelect.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
/** 设置扣车*/
|
||||
this.setDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
/** 取消扣车*/
|
||||
this.cancelDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
/** 提前发车*/
|
||||
this.earlyDeparture();
|
||||
}
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
/** 设置扣车*/
|
||||
this.setDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
/** 取消扣车*/
|
||||
this.cancelDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
/** 提前发车*/
|
||||
this.earlyDeparture();
|
||||
}
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.loading = false;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
@ -91,7 +91,6 @@ export default {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selected = selected;
|
||||
console.log(this.map);
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
|
||||
|
@ -118,7 +118,6 @@ export default {
|
||||
loadInitData(map) {
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
console.log('operate', operate, selected);
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
|
@ -1,273 +1,289 @@
|
||||
<template>
|
||||
<el-dialog class="chengdou-03__systerm stand-detain-train" :title="title" :visible.sync="show" width="380px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div class="head_content content">
|
||||
<span class="base-label" style="left: 0px;">会话管理</span>
|
||||
<el-col :span="8">
|
||||
<el-button class="status">查询会话状态</el-button>
|
||||
</el-col>
|
||||
<el-col :span="15" :offset="1">
|
||||
<el-input :value="messageText" placeholder="" size="mini" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button class="status_btn" :id="openMessageId" @click="handleMessage('open')"
|
||||
:disabled="isOpenMessage">打开会话</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button class="status_btn" :id="closeMessageId" @click="handleMessage('close')"
|
||||
:disabled="!isOpenMessage">关闭会话
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">操作</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText1" placeholder="" size="mini" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button class="status_btn" :id="confirmId1" @click="confirm1" :disabled="disabledConfirm1">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">确认</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText2" placeholder="" size="mini" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button class="status_btn" :id="confirmId2" @click="confirm2" :disabled="disabledConfirm2">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<el-col :span="7">
|
||||
<div class="text">操作倒计时</div>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
|
||||
{{timeCountConfirm == -1 ? '' : timeCountConfirm}}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<div class="status_text">状态</div>
|
||||
<div class="textarea_content"></div>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="chengdou-03__systerm stand-detain-train"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="380px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="head_content content">
|
||||
<span class="base-label" style="left: 0px;">会话管理</span>
|
||||
<el-col :span="8">
|
||||
<el-button class="status">查询会话状态</el-button>
|
||||
</el-col>
|
||||
<el-col :span="15" :offset="1">
|
||||
<el-input :value="messageText" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button
|
||||
:id="openMessageId"
|
||||
class="status_btn"
|
||||
:disabled="isOpenMessage"
|
||||
@click="handleMessage('open')"
|
||||
>打开会话</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button
|
||||
:id="closeMessageId"
|
||||
class="status_btn"
|
||||
:disabled="!isOpenMessage"
|
||||
@click="handleMessage('close')"
|
||||
>关闭会话
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">操作</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText1" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 0px;">确认</span>
|
||||
<el-col :span="3">
|
||||
<div class="text">操作</div>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input :value="messageText2" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<el-col :span="7">
|
||||
<div class="text">操作倒计时</div>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
|
||||
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<div class="status_text">状态</div>
|
||||
<div class="textarea_content" />
|
||||
</div>
|
||||
|
||||
<el-button class="close_btn" :id="domIdConfirm" type="primary" @click="commit">关闭</el-button>
|
||||
<confirm-tip ref='ConfirmTip' @close="closeMessage"></confirm-tip>
|
||||
</el-dialog>
|
||||
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
|
||||
<confirm-tip ref="ConfirmTip" @close="closeMessage" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmTip from './childDialog/confirmTip';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import ConfirmTip from './childDialog/confirmTip';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
ConfirmTip
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
radio: '1',
|
||||
radio1: '1',
|
||||
earlyDepar: false,
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
ConfirmTip
|
||||
messageText: '',
|
||||
messageText1: '',
|
||||
messageText2: '',
|
||||
isOpenMessage: false,
|
||||
timeCountConfirm: -1,
|
||||
disabledConfirm1: false,
|
||||
disabledConfirm2: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
selected: null,
|
||||
operation: null,
|
||||
radio: '1',
|
||||
radio1: '1',
|
||||
earlyDepar: false,
|
||||
|
||||
messageText: '',
|
||||
messageText1: '',
|
||||
messageText2: '',
|
||||
isOpenMessage: false,
|
||||
timeCountConfirm: -1,
|
||||
disabledConfirm1: false,
|
||||
disabledConfirm2: false,
|
||||
openMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.openMessage.domId : '';
|
||||
},
|
||||
closeMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.closeMessage.domId : '';
|
||||
},
|
||||
confirmId1() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm1.domId : '';
|
||||
},
|
||||
confirmId2() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm2.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '取消全线临时限速';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) { // 关闭会话
|
||||
this.timeCountConfirm = -1;
|
||||
this.disabledConfirm2 = true;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
openMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.openMessage.domId : '';
|
||||
},
|
||||
closeMessageId() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.closeMessage.domId : '';
|
||||
},
|
||||
confirmId1() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm1.domId : '';
|
||||
},
|
||||
confirmId2() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm2.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return '取消全线临时限速';
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) { // 关闭会话
|
||||
this.timeCountConfirm = -1;
|
||||
this.disabledConfirm2 = true;
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
}, 1000);
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
handleMessage(message) {
|
||||
if (message == 'open') {
|
||||
let operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.openMessage.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText1 = '取消全线临时限速';
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
} else {
|
||||
let operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.closeMessage.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
handleMessage(message) {
|
||||
if (message == 'open') {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm1.operation,
|
||||
}
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.openMessage.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText1 = '**************';
|
||||
this.messageText2 = '取消全线临时限速';
|
||||
this.disabledConfirm1 = true;
|
||||
this.timeCountConfirm = 60; // 倒计时
|
||||
this.messageText1 = '取消全线临时限速';
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
} else {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm2.operation,
|
||||
}
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.closeMessage.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText2 = '**************';
|
||||
this.disabledConfirm2 = true;
|
||||
this.timeCountConfirm = -1;
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (!this.isOpenMessage) {
|
||||
this.doClose();
|
||||
} else {
|
||||
let operate = {
|
||||
message: `是否关闭会话,并关闭窗口`,
|
||||
confirmId: OperationEvent.LimitControl.CancelAllLimit.close.domId,
|
||||
}
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
},
|
||||
closeMessage() {
|
||||
let operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.close.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.ConfirmTip.doClose();
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm1.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText1 = '**************';
|
||||
this.messageText2 = '取消全线临时限速';
|
||||
this.disabledConfirm1 = true;
|
||||
this.timeCountConfirm = 60; // 倒计时
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm2.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.messageText2 = '**************';
|
||||
this.disabledConfirm2 = true;
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.confirm.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (!this.isOpenMessage) {
|
||||
this.doClose();
|
||||
} else {
|
||||
const operate = {
|
||||
message: `是否关闭会话,并关闭窗口`,
|
||||
confirmId: OperationEvent.LimitControl.CancelAllLimit.close.domId
|
||||
};
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
closeMessage() {
|
||||
const operate = {
|
||||
type: MapDeviceType.LimitControl.type,
|
||||
operation: OperationEvent.LimitControl.CancelAllLimit.close.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.ConfirmTip.doClose();
|
||||
this.isOpenMessage = false;
|
||||
this.messageText1 = '';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = false;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = -1; // 倒计时
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.stand-detain-train .context {
|
||||
@ -352,4 +368,4 @@
|
||||
box-shadow: 2px 2px #959595 inset;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -101,7 +101,6 @@ export default {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selected = selected;
|
||||
console.log(this.map, 111);
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
|
||||
|
@ -33,52 +33,52 @@ import PassiveContorl from './passiveDialog/control';
|
||||
import PassiveTimeout from './passiveDialog/timeout';
|
||||
|
||||
export default {
|
||||
name: 'Menus',
|
||||
components: {
|
||||
MenuBar,
|
||||
MenuCancel,
|
||||
MenuSignal,
|
||||
MenuSwitch,
|
||||
MenuSection,
|
||||
MenuStationControl,
|
||||
MenuStationStand,
|
||||
MenuStation,
|
||||
MenuTrain,
|
||||
PassiveAlarm,
|
||||
PassiveContorl,
|
||||
PassiveTimeout
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('config', [
|
||||
'width'
|
||||
]),
|
||||
isShowAll() {
|
||||
return this.$route.params.mode != 'dp' &&
|
||||
name: 'Menus',
|
||||
components: {
|
||||
MenuBar,
|
||||
MenuCancel,
|
||||
MenuSignal,
|
||||
MenuSwitch,
|
||||
MenuSection,
|
||||
MenuStationControl,
|
||||
MenuStationStand,
|
||||
MenuStation,
|
||||
MenuTrain,
|
||||
PassiveAlarm,
|
||||
PassiveContorl,
|
||||
PassiveTimeout
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('config', [
|
||||
'width'
|
||||
]),
|
||||
isShowAll() {
|
||||
return this.$route.params.mode != 'dp' &&
|
||||
this.$route.params.mode != 'plan' &&
|
||||
this.$store.state.training.roles != 'BigScreen';
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isShowBar(val) {
|
||||
val && this.$store.dispatch('config/updateMenuBar');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('config/updateMenuBar');
|
||||
});
|
||||
}
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isShowBar(val) {
|
||||
val && this.$store.dispatch('config/updateMenuBar');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('config/updateMenuBar');
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -179,8 +179,6 @@ export function updateForList(model, state, liststr) {
|
||||
list.push(deepClone(model)); // 新增
|
||||
} else if (i >= 0) {
|
||||
list[i] = deepClone(model); // item map 数据 model 页面表单数据
|
||||
// state.mapDevice[model.code] = deepClone(model);
|
||||
// console.log(list[i], '更新');
|
||||
}
|
||||
} else {
|
||||
state.map[liststr] = [model];
|
||||
@ -188,8 +186,6 @@ export function updateForList(model, state, liststr) {
|
||||
}
|
||||
|
||||
export function updateMapData(state, model) {
|
||||
// const map = state.map;
|
||||
// const mapDevice = state.mapDevice;
|
||||
if (state.map && model) {
|
||||
switch (model._type) {
|
||||
case deviceType.Link: updateForList(model, state, 'linkList'); break;
|
||||
|
@ -134,7 +134,7 @@ export const userSimulation = '013'; // 仿真系统
|
||||
export const userScreen = '014'; // 大屏系统
|
||||
export const userPlan = '015'; // 计划系统
|
||||
export const userDesign = '016'; // 设计系统
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
// const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
export const UrlConfig = {
|
||||
display: '/display',
|
||||
|
@ -212,7 +212,7 @@ function handleOperation(state, models) {
|
||||
list.push({ operation: 'add', data: deepAssign({}, item) });
|
||||
}
|
||||
});
|
||||
// console.log(list, '步骤数据');
|
||||
|
||||
if (list.length) {
|
||||
if (state.stepData.length >= 15) { // 步骤数据最多储存15步
|
||||
state.stepData.pop();
|
||||
|
@ -129,7 +129,7 @@ export default {
|
||||
if (type === PermissionType.LESSON) {
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`, query: {lessonId: this.$route.query.lessonId, mapId: this.$route.query.mapId, prdId: this.$route.query.prdId}});
|
||||
} else if (type === PermissionType.EXAM) {
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.$route.query.lessonId}});
|
||||
} else if (type === PermissionType.SCREEN) {
|
||||
this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` });
|
||||
} else if (type === PermissionType.SIMULATION) {
|
||||
|
@ -242,11 +242,18 @@ export default {
|
||||
});
|
||||
},
|
||||
buy() {
|
||||
this.buttonLoading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
query: { permissionType: PermissionType.SIMULATION, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
this.$confirm('支付系统正在改进,如需购买请联系客服<br/>客服电话:13289398171', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
center: true
|
||||
});
|
||||
// this.buttonLoading = true;
|
||||
// this.$router.push({
|
||||
// path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
// query: { permissionType: PermissionType.SIMULATION, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
// });
|
||||
},
|
||||
transfer() {
|
||||
this.buttonLoading = false;
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="display-draft">
|
||||
<el-button-group>
|
||||
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">{{$t('display.plan.drivingByPlan')}}</el-button>
|
||||
<el-button type="danger" :disabled="!isDisable" @click="end">{{$t('display.plan.exitPlan')}}</el-button>
|
||||
<el-button type="primary" @click="back">{{$t('display.plan.back')}}</el-button>
|
||||
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">{{ $t('display.plan.drivingByPlan') }}</el-button>
|
||||
<el-button type="danger" :disabled="!isDisable" @click="end">{{ $t('display.plan.exitPlan') }}</el-button>
|
||||
<el-button type="primary" @click="back">{{ $t('display.plan.back') }}</el-button>
|
||||
</el-button-group>
|
||||
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
|
||||
</div>
|
||||
@ -13,92 +13,91 @@
|
||||
import SetTime from './demon/setTime';
|
||||
import { Notification } from 'element-ui';
|
||||
import { runDiagramIsStart, runDiagramGetTime, runDiagramOver, runDiagramStart } from '@/api/simulation';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'MenuPlan',
|
||||
components: {
|
||||
SetTime
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisable: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.simulationGroupCount': function () {
|
||||
this.initLoadPage();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
const rest = await runDiagramIsStart(this.group);
|
||||
if (rest && rest.data) {
|
||||
this.isDisable = true;
|
||||
this.$store.dispatch('training/simulationStart');
|
||||
} else {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/over');
|
||||
}
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async loadSystemTime() {
|
||||
const rest = await runDiagramGetTime(this.group);
|
||||
if (rest && rest.code == 200) {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
|
||||
}
|
||||
},
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
start(model) {
|
||||
this.isDisable = true;
|
||||
runDiagramStart(model, this.group).then(res => {
|
||||
this.$store.dispatch('training/simulationStart').then(() => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
|
||||
});
|
||||
}).catch(() => {
|
||||
this.isDisable = false;
|
||||
this.$messageBox(this.$t('display.plan.startPlanFail'));
|
||||
});
|
||||
},
|
||||
end() {
|
||||
this.isDisable = false;
|
||||
runDiagramOver(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.isDisable = true;
|
||||
this.$messageBox(this.$t('display.plan.endPlanFail'));
|
||||
});
|
||||
},
|
||||
async back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
// exitFullscreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
name: 'MenuPlan',
|
||||
components: {
|
||||
SetTime
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisable: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.simulationGroupCount': function () {
|
||||
this.initLoadPage();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
const rest = await runDiagramIsStart(this.group);
|
||||
if (rest && rest.data) {
|
||||
this.isDisable = true;
|
||||
this.$store.dispatch('training/simulationStart');
|
||||
} else {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/over');
|
||||
}
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async loadSystemTime() {
|
||||
const rest = await runDiagramGetTime(this.group);
|
||||
if (rest && rest.code == 200) {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
|
||||
}
|
||||
},
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
start(model) {
|
||||
this.isDisable = true;
|
||||
runDiagramStart(model, this.group).then(res => {
|
||||
this.$store.dispatch('training/simulationStart').then(() => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${model.initTime}`));
|
||||
});
|
||||
}).catch(() => {
|
||||
this.isDisable = false;
|
||||
this.$messageBox(this.$t('display.plan.startPlanFail'));
|
||||
});
|
||||
},
|
||||
end() {
|
||||
this.isDisable = false;
|
||||
runDiagramOver(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.isDisable = true;
|
||||
this.$messageBox(this.$t('display.plan.endPlanFail'));
|
||||
});
|
||||
},
|
||||
async back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
// exitFullscreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="display-card" :style="{top: offset+'px'}">
|
||||
<el-row>
|
||||
<span v-if="countTime" class="display-score">{{$t('display.screen.trialTime')}} {{ countTime }}</span>
|
||||
<span v-if="countTime" class="display-score">{{ $t('display.screen.trialTime') }} {{ countTime }}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
@ -10,107 +10,106 @@
|
||||
<script>
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { getCountTime } from '@/utils/index';
|
||||
import { runDiagramIsStart, runDiagramGetTime, runDiagramStart } from '@/api/simulation';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'MenuScreen',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tryTime: 0, // 进入页面多少秒
|
||||
timeNow: 0, // 进入页面 相对时间
|
||||
time: null, // 定时器
|
||||
countTime: 0, // 显示 倒计时
|
||||
remainingTime: 0,
|
||||
goodsId: this.$route.query.goodsId,
|
||||
try: this.$route.query.try, // 是否是试用权限
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.subscribeCount': function () {
|
||||
this.group && this.initLoadPage();
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.time) {
|
||||
this.setTryTime();
|
||||
clearTimeout(this.time);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
if (this.try != '0') {
|
||||
const data = {
|
||||
permissionType: PermissionType.SCREEN
|
||||
};
|
||||
name: 'MenuScreen',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tryTime: 0, // 进入页面多少秒
|
||||
timeNow: 0, // 进入页面 相对时间
|
||||
time: null, // 定时器
|
||||
countTime: 0, // 显示 倒计时
|
||||
remainingTime: 0,
|
||||
goodsId: this.$route.query.goodsId,
|
||||
try: this.$route.query.try, // 是否是试用权限
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.subscribeCount': function () {
|
||||
this.group && this.initLoadPage();
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.time) {
|
||||
this.setTryTime();
|
||||
clearTimeout(this.time);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
if (this.try != '0') {
|
||||
const data = {
|
||||
permissionType: PermissionType.SCREEN
|
||||
};
|
||||
|
||||
const resr = await getGoodsTryUse(data);
|
||||
if (resr && resr.code == 200) {
|
||||
this.remainingTime = resr.data.tryTime;
|
||||
this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime;
|
||||
if (this.try) {
|
||||
this.time = setInterval(() => {
|
||||
this.tryTime += 1;
|
||||
this.countTime = getCountTime(this.timeNow);
|
||||
if (this.countTime == -1) {
|
||||
this.back();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(this.$t('display.screen.getTimeFail'));
|
||||
}
|
||||
}
|
||||
const resr = await getGoodsTryUse(data);
|
||||
if (resr && resr.code == 200) {
|
||||
this.remainingTime = resr.data.tryTime;
|
||||
this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime;
|
||||
if (this.try) {
|
||||
this.time = setInterval(() => {
|
||||
this.tryTime += 1;
|
||||
this.countTime = getCountTime(this.timeNow);
|
||||
if (this.countTime == -1) {
|
||||
this.back();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(this.$t('display.screen.getTimeFail'));
|
||||
}
|
||||
}
|
||||
|
||||
const initTime = this.$route.query.initTime;
|
||||
const retp = await runDiagramIsStart(this.group);
|
||||
if (retp && !retp.data) {
|
||||
await runDiagramStart({ initTime: initTime }, this.group);
|
||||
}
|
||||
const initTime = this.$route.query.initTime;
|
||||
const retp = await runDiagramIsStart(this.group);
|
||||
if (retp && !retp.data) {
|
||||
await runDiagramStart({ initTime: initTime }, this.group);
|
||||
}
|
||||
|
||||
await this.$store.dispatch('training/simulationStart');
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async loadSystemTime() {
|
||||
const rest = await runDiagramGetTime(this.group);
|
||||
if (rest && rest.code == 200) {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
|
||||
}
|
||||
},
|
||||
setTryTime() {
|
||||
if (this.try) {
|
||||
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
Notification.closeAll();
|
||||
history.go(-1);
|
||||
// exitFullscreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
await this.$store.dispatch('training/simulationStart');
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async loadSystemTime() {
|
||||
const rest = await runDiagramGetTime(this.group);
|
||||
if (rest && rest.code == 200) {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
|
||||
}
|
||||
},
|
||||
setTryTime() {
|
||||
if (this.try) {
|
||||
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
Notification.closeAll();
|
||||
history.go(-1);
|
||||
// exitFullscreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -137,11 +137,18 @@ export default {
|
||||
});
|
||||
},
|
||||
buy() {
|
||||
this.loading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
this.$confirm('支付系统正在改进,如需购买请联系客服<br/>客服电话:13289398171', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
center: true
|
||||
});
|
||||
// this.loading = true;
|
||||
// this.$router.push({
|
||||
// path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
// query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
// });
|
||||
},
|
||||
checkCourse() {
|
||||
this.loading = true;
|
||||
|
@ -251,14 +251,7 @@ export default {
|
||||
},
|
||||
// 右键点击事件
|
||||
onContextMenu(em) {
|
||||
const path = window.location.href;
|
||||
let mouseWheelFlag = false;
|
||||
if (path.includes('design/userlist/map/draw')) {
|
||||
mouseWheelFlag = true;
|
||||
}
|
||||
if (!mouseWheelFlag) { // 地图绘制无右键操作
|
||||
this.$emit('onMenu', em);
|
||||
}
|
||||
this.$emit('onMenu', em);
|
||||
},
|
||||
// 设置地图加载状态
|
||||
mapViewLoaded(loading) {
|
||||
|
@ -8,7 +8,7 @@
|
||||
<el-button size="small" :disabled="!recoverStepData.length" @click="recover">恢复</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" />
|
||||
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="onContextmenu" />
|
||||
</div>
|
||||
<div class="map-draft">
|
||||
<div v-show="viewDraft === 'draft'" class="box">
|
||||
@ -49,7 +49,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { saveMap, getMapDetail, verifyMap, postBuildMapImport } from '@/api/jmap/mapdraft';
|
||||
import { ViewMode, TrainingMode } from '@/scripts/ConstDic';
|
||||
import { ViewMode, TrainingMode, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import JlmapVisual from '@/views/jlmap/index';
|
||||
import MapOperate from './mapoperate/index';
|
||||
@ -59,7 +59,6 @@ import { mapGetters } from 'vuex';
|
||||
import ConfigMap from './configMap';
|
||||
|
||||
import DataRelation from './dataRelation/index';
|
||||
// import { deepAssign } from '@/utils/index';
|
||||
|
||||
export default {
|
||||
name: 'MapView',
|
||||
@ -204,16 +203,16 @@ export default {
|
||||
this.selected = device || null;
|
||||
this.selected && this.handleSelectControlPage(device);
|
||||
},
|
||||
// onContextmenu(em) {
|
||||
// this.point = {
|
||||
// x: em.clientX,
|
||||
// y: em.clientY
|
||||
// };
|
||||
// if (!em.deviceType) {
|
||||
// var menu = getDeviceMenuByDeviceType('Cancel');
|
||||
// this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
// }
|
||||
// },
|
||||
onContextmenu(em) {
|
||||
this.point = {
|
||||
x: em.clientX,
|
||||
y: em.clientY
|
||||
};
|
||||
if (!em.deviceType) {
|
||||
var menu = getDeviceMenuByDeviceType('Cancel');
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
saveMapEvent() {
|
||||
if (this.$refs.jlmapVisual) {
|
||||
const map = this.$store.state.map.map;
|
||||
|
@ -231,7 +231,6 @@ export default {
|
||||
cancelButtonText: this.$t('map.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -241,7 +241,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -4,9 +4,9 @@
|
||||
<div v-for="item in modelList" :key="item.type" class="content-box-list">
|
||||
<div class="title-box">{{ item.name }}</div>
|
||||
<div class="list-box">
|
||||
<div v-for="nor in item.list" :key="nor.code" class="list-content">
|
||||
<div v-for="nor in item.list" :key="nor.code" class="list-content" @mouseenter="mouseenter(nor)" @mouseleave="mouseleave(nor)">
|
||||
<div class="name">{{ nor.name }}</div>
|
||||
<div class="close"><i class="el-icon-close" /></div>
|
||||
<div class="close" @click="delList(nor, item.list)"><i class="el-icon-close" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -83,9 +83,9 @@ export default {
|
||||
this.clearModelList();
|
||||
this.seclectDeviceList.forEach(item => {
|
||||
if (item._type == 'Section') {
|
||||
this.modelList[0].list.push(deepAssign({}, item));
|
||||
this.modelList[0].list.push(item);
|
||||
} else if (item._type == 'Switch') {
|
||||
this.modelList[1].list.push(deepAssign({}, item));
|
||||
this.modelList[1].list.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -95,6 +95,19 @@ export default {
|
||||
item.list = [];
|
||||
});
|
||||
},
|
||||
// 删除当前选中
|
||||
delList(model, list) {
|
||||
list.forEach((nor, index) => {
|
||||
if (nor.code == model.code) {
|
||||
list.splice(index, 1);
|
||||
}
|
||||
});
|
||||
this.seclectDeviceList.forEach((item, index) => {
|
||||
if (item.code == model.code) {
|
||||
this.seclectDeviceList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 多选区段设置集中站
|
||||
handleScetionStationCode() {
|
||||
if (this.stationCode && this.seclectDeviceList) {
|
||||
@ -108,6 +121,16 @@ export default {
|
||||
this.$message.success('设置设备集中站成功');
|
||||
this.stationCode = '';
|
||||
}
|
||||
},
|
||||
mouseenter(model) {
|
||||
if (model._type == 'Section') {
|
||||
model.instance.mouseout();
|
||||
}
|
||||
},
|
||||
mouseleave(model) {
|
||||
if (model._type == 'Section') {
|
||||
model.instance.mouseover();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -148,6 +171,11 @@ export default {
|
||||
line-height: 30px;
|
||||
padding-left: 10px;
|
||||
padding-right: 3px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover{
|
||||
background: #ccc;
|
||||
}
|
||||
.name{
|
||||
float: left;
|
||||
margin-right: 20px;
|
||||
|
@ -233,7 +233,6 @@ export default {
|
||||
cancelButtonText: this.$t('map.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -215,7 +215,6 @@ export default {
|
||||
cancelButtonText: this.$t('map.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -322,9 +322,6 @@ export default {
|
||||
updateMapModel(obj) {
|
||||
this.$emit('updateMapModel', obj);
|
||||
},
|
||||
// delMapModel(obj) {
|
||||
// this.$emit('delMapModel', obj);
|
||||
// },
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
}
|
||||
|
@ -211,7 +211,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -202,7 +202,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -244,7 +244,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -423,7 +423,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -232,7 +232,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', _that.selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -286,7 +286,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -327,7 +327,6 @@ export default {
|
||||
// 删除道岔/ 关联的道岔区段以及 道岔绑定关系
|
||||
handleDelete(selected) {
|
||||
const models = [];
|
||||
// const remove = [];
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.type == '03' && elem.relSwitchCode == selected.code) {
|
||||
models.push(deepAssign({ _type: 'Section', code: elem.code }, { _dispose: true }));
|
||||
@ -339,8 +338,6 @@ export default {
|
||||
}
|
||||
});
|
||||
models.push(deepAssign(selected, { _dispose: true }));
|
||||
// this.$emit('delMapModel', selected);
|
||||
// this.$emit('delMapModel', remove);
|
||||
this.$emit('updateMapModel', models);
|
||||
},
|
||||
findLinkData(code) {
|
||||
@ -389,7 +386,6 @@ export default {
|
||||
},
|
||||
// 一键删除道岔区段
|
||||
removeSwitchSection() {
|
||||
// const remove = [];
|
||||
const models = [];
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
this.sectionList.forEach(elem => {
|
||||
@ -403,7 +399,6 @@ export default {
|
||||
models.push(elem);
|
||||
}
|
||||
});
|
||||
// this.$emit('delMapModel', remove);
|
||||
this.$emit('updateMapModel', models);
|
||||
}
|
||||
},
|
||||
|
@ -222,7 +222,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -161,7 +161,7 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('delMapModel', train);
|
||||
this.$emit('updateMapModel', {...train, _dispose: true});
|
||||
this.deviceSelect();
|
||||
}).catch(() => {
|
||||
this.$message.info(this.$t('tip.cancelledDelete'));
|
||||
@ -177,7 +177,10 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('delMapModel', this.trainList);
|
||||
this.trainList.forEach(item => {
|
||||
item['_dispose'] = true;
|
||||
});
|
||||
this.$emit('updateMapModel', this.trainList);
|
||||
this.deviceSelect();
|
||||
}).catch(() => {
|
||||
this.$message.info(this.$t('tip.cancelledDelete'));
|
||||
|
@ -16,7 +16,6 @@
|
||||
<el-tab-pane class="view-control" :label="$t('map.batchOperation')" name="three">
|
||||
<div style="height: 100%">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<!-- style="display: flex;justify-content: center;" -->
|
||||
<div style="text-align:center;">
|
||||
<el-button type="danger" size="big" @click="removeTrainWindow">{{ $t('map.deleteTrainWindow') }}</el-button>
|
||||
<el-button type="primary" size="big" style="margin-top:10px" @click="createTrainWindow">{{ $t('map.createTrainWindow') }}</el-button>
|
||||
@ -59,7 +58,8 @@ export default {
|
||||
},
|
||||
width: 0,
|
||||
height: 0,
|
||||
sectionCode: ''
|
||||
sectionCode: '',
|
||||
isReversal: false
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
@ -119,7 +119,8 @@ export default {
|
||||
map: {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ prop: 'sectionCode', label: this.$t('map.trainWindowSectionCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.filterSectionList }
|
||||
{ prop: 'sectionCode', label: this.$t('map.trainWindowSectionCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.filterSectionList },
|
||||
{ prop: 'isReversal', label: '车头翻转', type: 'checkbox' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -155,7 +156,8 @@ export default {
|
||||
_type: 'TrainWindow',
|
||||
code: getUID('TrainWindow'),
|
||||
trainWindowShow: true,
|
||||
point: {}
|
||||
point: {},
|
||||
isReversal: false
|
||||
};
|
||||
|
||||
if (opts) {
|
||||
@ -221,10 +223,11 @@ export default {
|
||||
this.trainWindowList.forEach(elem => {
|
||||
remove.push({
|
||||
_type: 'TrainWindow',
|
||||
code: elem.code
|
||||
code: elem.code,
|
||||
_dispose: true
|
||||
});
|
||||
});
|
||||
this.$emit('delMapModel', remove);
|
||||
this.$emit('updateMapModel', remove);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.info(this.$t('tip.cancelledDelete'));
|
||||
@ -240,10 +243,11 @@ export default {
|
||||
this.trainWindowList.forEach(elem => {
|
||||
remove.push({
|
||||
_type: 'TrainWindow',
|
||||
code: elem.code
|
||||
code: elem.code,
|
||||
_dispose: true
|
||||
});
|
||||
});
|
||||
this.$emit('delMapModel', remove);
|
||||
this.$emit('updateMapModel', remove);
|
||||
}
|
||||
|
||||
if (collection && collection.length) {
|
||||
@ -284,7 +288,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -209,7 +209,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// _that.$emit('delMapModel', selected);
|
||||
_that.$emit('updateMapModel', {...selected, _dispose: true});
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
|
@ -5,7 +5,8 @@
|
||||
<el-step title="" icon="el-icon-upload" />
|
||||
</el-steps>
|
||||
<div class="joylink-card forms">
|
||||
<div style="height: 100%; padding-top: 40px; overflow-y: auto;">
|
||||
<div style="height: 100%; padding-top: 40px; overflow-y: auto; position: relative;">
|
||||
<div class="online_box">在线人数 {{ onlineNum }}</div>
|
||||
<el-form ref="form" :model="messageModel" :rules="rules" label-width="200px">
|
||||
<el-form-item :label="this.$t('system.newsHeadlines')" prop="title">
|
||||
<el-input v-model="messageModel.title" style="width: 450px" /></el-form-item>
|
||||
@ -29,11 +30,13 @@
|
||||
|
||||
<script>
|
||||
import {pushMessage} from '@/api/pushMessage';
|
||||
import { getOnlineNmuber } from '@/api/management/user.js';
|
||||
export default {
|
||||
name: 'News',
|
||||
data() {
|
||||
return {
|
||||
display: 1,
|
||||
onlineNum: 0,
|
||||
messageModel: {
|
||||
title: '',
|
||||
message: '',
|
||||
@ -56,7 +59,18 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOnlineNmuber();
|
||||
},
|
||||
methods: {
|
||||
async getOnlineNmuber() {
|
||||
try {
|
||||
const res = await getOnlineNmuber();
|
||||
this.onlineNum = res.data.total;
|
||||
} catch (error) {
|
||||
this.$msgbox(error.message);
|
||||
}
|
||||
},
|
||||
pushNotification() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
@ -93,6 +107,12 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.online_box {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
top: 18px;
|
||||
}
|
||||
|
||||
.forms {
|
||||
width: 800px;
|
||||
margin: 0 auto;
|
||||
|
@ -30,14 +30,6 @@ export default {
|
||||
type: 'text',
|
||||
label: this.$t('global.name')
|
||||
},
|
||||
cityCode: {
|
||||
type: 'select',
|
||||
label: this.$t('publish.city'),
|
||||
selectChange: this.handleCitySelect,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('publish.belongsToMap'),
|
||||
@ -186,21 +178,6 @@ export default {
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
handleCitySelect(form) {
|
||||
this.queryForm.queryObject.mapId.config.data = [];
|
||||
form.mapId = '';
|
||||
if (!form.cityCode) {
|
||||
this.mapList.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({value: elem.id, label: elem.name});
|
||||
});
|
||||
} else {
|
||||
this.mapList.forEach(elem => {
|
||||
if (elem.cityCode === form.cityCode) {
|
||||
this.queryForm.queryObject.mapId.config.data.push({value: elem.id, label: elem.name});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,214 +1,209 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="文字编号" prop="code">
|
||||
<el-input :disabled="true" v-model="form.code" >
|
||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文字内容" prop="context">
|
||||
<el-input type="textarea" v-model="form.context"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文字颜色" prop="textFill">
|
||||
<el-input v-model="form.textFill"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文字大小" prop="fontSize">
|
||||
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="100"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="文字粗细" prop="fontWeight">
|
||||
<el-input-number v-model="form.fontWeight" controls-position="right" :min="1" ></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="X轴坐标">
|
||||
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="Y轴坐标">
|
||||
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="文字背景">-->
|
||||
<!--<el-switch v-model="form.hasRect" @change="handleChange"></el-switch>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景X轴坐标">-->
|
||||
<!--<el-input-number v-model="form.xBg" controls-position="right" :min="0"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景Y轴坐标">-->
|
||||
<!--<el-input-number v-model="form.yBg" controls-position="right" :min="0"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景宽度">-->
|
||||
<!--<el-input-number v-model="form.bgWidth" controls-position="right" :min="1"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景高度">-->
|
||||
<!--<el-input-number v-model="form.bgHeight" controls-position="right" :min="1"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景颜色" prop="elevatorColor">-->
|
||||
<!--<el-color-picker v-model="form.textBackgroundColor"></el-color-picker>-->
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button>
|
||||
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="文字编号" prop="code">
|
||||
<el-input v-model="form.code" :disabled="true">
|
||||
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文字内容" prop="context">
|
||||
<el-input v-model="form.context" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文字颜色" prop="textFill">
|
||||
<el-input v-model="form.textFill" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文字大小" prop="fontSize">
|
||||
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="100" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文字粗细" prop="fontWeight">
|
||||
<el-input-number v-model="form.fontWeight" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="X轴坐标">
|
||||
<el-input-number v-model="form.x" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Y轴坐标">
|
||||
<el-input-number v-model="form.y" controls-position="right" :min="1" />
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="文字背景">-->
|
||||
<!--<el-switch v-model="form.hasRect" @change="handleChange"></el-switch>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景X轴坐标">-->
|
||||
<!--<el-input-number v-model="form.xBg" controls-position="right" :min="0"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景Y轴坐标">-->
|
||||
<!--<el-input-number v-model="form.yBg" controls-position="right" :min="0"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景宽度">-->
|
||||
<!--<el-input-number v-model="form.bgWidth" controls-position="right" :min="1"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景高度">-->
|
||||
<!--<el-input-number v-model="form.bgHeight" controls-position="right" :min="1"></el-input-number>-->
|
||||
<!--</el-form-item>-->
|
||||
<!--<el-form-item v-show="form.hasRect" label="背景颜色" prop="elevatorColor">-->
|
||||
<!--<el-color-picker v-model="form.textBackgroundColor"></el-color-picker>-->
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
|
||||
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
|
||||
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TextDraft',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isUpdate: false,
|
||||
buttonText: '立即创建',
|
||||
showDeleteButton: false,
|
||||
form: {
|
||||
code: '',
|
||||
context: '',
|
||||
textFill: '',
|
||||
fontSize: '',
|
||||
fontWeight: '',
|
||||
x: 10,
|
||||
y: 10,
|
||||
// hasRect: false,
|
||||
// xBg: 10,
|
||||
// yBg: 10,
|
||||
// bgWidth: 0,
|
||||
// bgHeight: 0,
|
||||
// textBackgroundColor: ''
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入文字编号', trigger: 'blur' },
|
||||
],
|
||||
context: [
|
||||
{ required: true, message: '请输入文字内容', trigger: 'blur' },
|
||||
],
|
||||
textFill: [
|
||||
{ required: true, message: '请输入文字颜色', trigger: 'blur' },
|
||||
],
|
||||
fontSize: [
|
||||
{ required: true, message: '请输入文字大小', trigger: 'blur' },
|
||||
],
|
||||
fontWeight: [
|
||||
{ required: true, message: '请输入文字粗细', trigger: 'blur' },
|
||||
],
|
||||
export default {
|
||||
name: 'TextDraft',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isUpdate: false,
|
||||
buttonText: '立即创建',
|
||||
showDeleteButton: false,
|
||||
form: {
|
||||
code: '',
|
||||
context: '',
|
||||
textFill: '',
|
||||
fontSize: '',
|
||||
fontWeight: '',
|
||||
x: 10,
|
||||
y: 10
|
||||
// hasRect: false,
|
||||
// xBg: 10,
|
||||
// yBg: 10,
|
||||
// bgWidth: 0,
|
||||
// bgHeight: 0,
|
||||
// textBackgroundColor: ''
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入文字编号', trigger: 'blur' }
|
||||
],
|
||||
context: [
|
||||
{ required: true, message: '请输入文字内容', trigger: 'blur' }
|
||||
],
|
||||
textFill: [
|
||||
{ required: true, message: '请输入文字颜色', trigger: 'blur' }
|
||||
],
|
||||
fontSize: [
|
||||
{ required: true, message: '请输入文字大小', trigger: 'blur' }
|
||||
],
|
||||
fontWeight: [
|
||||
{ required: true, message: '请输入文字粗细', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
'$store.state.ibp.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||
if (model._type === 'IbpText' ) {
|
||||
this.buttonText = '修改';
|
||||
this.showDeleteButton = true;
|
||||
this.isUpdate = true;
|
||||
this.form.code = model.code;
|
||||
this.form.context = model.context;
|
||||
this.form.textFill = model.textFill;
|
||||
this.form.fontSize = model.fontSize;
|
||||
this.form.fontWeight = model.fontWeight;
|
||||
this.form.x = model.point.x;
|
||||
this.form.y = model.point.y;
|
||||
// this.form.hasRect = model.hasRect;
|
||||
// this.form.xBg = model.textRect ? model.textRect.x : 10;
|
||||
// this.form.yBg = model.textRect ? model.textRect.y : 10;
|
||||
// this.form.bgWidth = model.textRect ? model.textRect.width : 0;
|
||||
// this.form.bgHeight = model.textRect ? model.textRect.height : 0;
|
||||
// this.form.textBackgroundColor = model.textRect ? model.textRect.textBackgroundColor : '';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
onSubmit(form) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const textModel = {
|
||||
point: {
|
||||
x: this.form.x,
|
||||
y: this.form.y
|
||||
},
|
||||
code: this.form.code,
|
||||
_type: 'IbpText',
|
||||
context: this.form.context,
|
||||
textFill: this.form.textFill,
|
||||
fontSize: this.form.fontSize,
|
||||
fontWeight: this.form.fontWeight,
|
||||
fontFamily: 'consolas'
|
||||
// hasRect: this.form.hasRect,
|
||||
// textRect: this.form.hasRect ?
|
||||
// {
|
||||
// x: this.form.xBg,
|
||||
// y: this.form.yBg,
|
||||
// width: this.form.bgWidth,
|
||||
// height: this.form.bgHeight
|
||||
// }:'',
|
||||
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
|
||||
};
|
||||
this.$emit('createText', textModel);
|
||||
this.initPage();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDevice() {
|
||||
const textModel = {
|
||||
zlevel: 2,
|
||||
z: 1,
|
||||
point: {
|
||||
x: this.form.x,
|
||||
y: this.form.y
|
||||
},
|
||||
code: this.form.code,
|
||||
_type: 'IbpText',
|
||||
context: this.form.context,
|
||||
textFill: this.form.textFill,
|
||||
fontSize: this.form.fontSize,
|
||||
fontWeight: this.form.fontWeight,
|
||||
fontFamily: 'consolas'
|
||||
// hasRect: this.form.hasRect,
|
||||
// textRect: this.form.hasRect ?
|
||||
// {
|
||||
// x: this.form.xBg,
|
||||
// y: this.form.yBg,
|
||||
// width: this.form.bgWidth,
|
||||
// height: this.form.bgHeight
|
||||
// }:'',
|
||||
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
|
||||
};
|
||||
this.$emit('deleteDataModel', textModel);
|
||||
this.initPage();
|
||||
},
|
||||
initPage() {
|
||||
this.isUpdate = false;
|
||||
this.buttonText = '立即创建';
|
||||
this.showDeleteButton = false;
|
||||
this.form = {
|
||||
code: '',
|
||||
context: '',
|
||||
textFill: '',
|
||||
fontSize: '',
|
||||
fontWeight: '',
|
||||
x: 10,
|
||||
y: 10
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
'$store.state.ibp.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||
if (model._type === 'IbpText' ){
|
||||
this.buttonText = '修改';
|
||||
this.showDeleteButton = true;
|
||||
this.isUpdate = true;
|
||||
this.form.code = model.code;
|
||||
this.form.context = model.context;
|
||||
this.form.textFill = model.textFill;
|
||||
this.form.fontSize = model.fontSize;
|
||||
this.form.fontWeight = model.fontWeight;
|
||||
this.form.x = model.point.x;
|
||||
this.form.y = model.point.y;
|
||||
// this.form.hasRect = model.hasRect;
|
||||
// this.form.xBg = model.textRect ? model.textRect.x : 10;
|
||||
// this.form.yBg = model.textRect ? model.textRect.y : 10;
|
||||
// this.form.bgWidth = model.textRect ? model.textRect.width : 0;
|
||||
// this.form.bgHeight = model.textRect ? model.textRect.height : 0;
|
||||
// this.form.textBackgroundColor = model.textRect ? model.textRect.textBackgroundColor : '';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
onSubmit(form) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const textModel = {
|
||||
point: {
|
||||
x: this.form.x,
|
||||
y: this.form.y
|
||||
},
|
||||
code: this.form.code,
|
||||
_type: 'IbpText',
|
||||
context: this.form.context,
|
||||
textFill: this.form.textFill,
|
||||
fontSize: this.form.fontSize ,
|
||||
fontWeight: this.form.fontWeight,
|
||||
fontFamily: 'consolas',
|
||||
// hasRect: this.form.hasRect,
|
||||
// textRect: this.form.hasRect ?
|
||||
// {
|
||||
// x: this.form.xBg,
|
||||
// y: this.form.yBg,
|
||||
// width: this.form.bgWidth,
|
||||
// height: this.form.bgHeight
|
||||
// }:'',
|
||||
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
|
||||
};
|
||||
this.$emit('createText', textModel);
|
||||
this.initPage();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDevice() {
|
||||
const textModel = {
|
||||
zlevel: 2,
|
||||
z: 1,
|
||||
point: {
|
||||
x: this.form.x,
|
||||
y: this.form.y
|
||||
},
|
||||
code: this.form.code,
|
||||
_type: 'IbpText',
|
||||
context: this.form.context,
|
||||
textFill: this.form.textFill,
|
||||
fontSize: this.form.fontSize ,
|
||||
fontWeight: this.form.fontWeight,
|
||||
fontFamily: 'consolas',
|
||||
// hasRect: this.form.hasRect,
|
||||
// textRect: this.form.hasRect ?
|
||||
// {
|
||||
// x: this.form.xBg,
|
||||
// y: this.form.yBg,
|
||||
// width: this.form.bgWidth,
|
||||
// height: this.form.bgHeight
|
||||
// }:'',
|
||||
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
|
||||
};
|
||||
this.$emit('deleteDataModel',textModel);
|
||||
this.initPage();
|
||||
},
|
||||
initPage() {
|
||||
this.isUpdate = false;
|
||||
this.buttonText = '立即创建';
|
||||
this.showDeleteButton = false;
|
||||
this.form = {
|
||||
code: '',
|
||||
context: '',
|
||||
textFill: '',
|
||||
fontSize: '',
|
||||
fontWeight: '',
|
||||
x: 10,
|
||||
y: 10
|
||||
};
|
||||
},
|
||||
generateCode() {
|
||||
const mydate = new Date();
|
||||
this.form.code = "text_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
|
||||
},
|
||||
// handleChange(e) {
|
||||
// this.form.hasRect = e;
|
||||
// // this.form.hasRect = !this.form.hasRect;
|
||||
// console.log('-------',e,this.form.hasRect);
|
||||
// }
|
||||
generateCode() {
|
||||
const mydate = new Date();
|
||||
this.form.code = 'text_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,227 +1,253 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="map-control">
|
||||
<el-card type="border-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{$t('ibp.stationName')}}</span>
|
||||
<el-select v-model="stationCode" @change="changeStationCode" :placeholder="this.$t('rules.selectStation')">
|
||||
<el-option
|
||||
v-for="item in stationOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="handleSave"
|
||||
>{{$t('ibp.save')}}</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="enabledTab" class="mapEdit" type="card" @tab-click="handleTabClick">
|
||||
<el-tab-pane :label="this.$t('ibp.background')" name="Background">
|
||||
<ibp-bg ref="background"
|
||||
@updateBg="createDataModel" style="width:90%"
|
||||
></ibp-bg>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.line')" name="IbpLine">
|
||||
<ibp-line ref="ibpline"
|
||||
@createLine="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-line>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.text')" name="IbpText">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
||||
<ibp-text ref="ibptext"
|
||||
@createText="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-text>
|
||||
</el-scrollbar>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.rect')" name="TipBox">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
||||
<ibp-tip-box ref="tipbox"
|
||||
@createTipBox="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
></ibp-tip-box>
|
||||
</el-scrollbar>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.button')" name="SquareButton">
|
||||
<ibp-button ref="squarebutton"
|
||||
@createButton="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-button>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.circularLamp')" name="CircularLamp">
|
||||
<ibp-lamp ref="circularlamp"
|
||||
@createLamp="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-lamp>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.arrow')" name="Arrow">
|
||||
<ibp-arrow ref="arrow"
|
||||
@createArrow="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-arrow>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.escalatorFrame')" name="AppendageBox">
|
||||
<ibp-appendage-box ref="appendagebox"
|
||||
@createAppendageBox="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-appendage-box>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.alarm')" name="Alarm">
|
||||
<ibp-alarm ref="alarm"
|
||||
@createAlarm="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-alarm>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.telephoneTerminal')" name="TeleTerminal">
|
||||
<ibp-telephone-terminal ref="teleTerminal"
|
||||
@createTeleTerminal="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-telephone-terminal>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.escalator')" name="Elevator">
|
||||
<ibp-elevator ref="elevator"
|
||||
@createElevator="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-elevator>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.key')" name="Key">
|
||||
<ibp-key ref="key"
|
||||
@createKey="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-key>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.digitalClock')" name="Clock">
|
||||
<ibp-clock ref="clock"
|
||||
@createClock="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-clock>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.rotateTip')" name="RotateTip">
|
||||
<ibp-rotate-tip ref="rotateTip"
|
||||
@createRotateTip="createDataModel" @deleteDataModel="deleteDataModel" style="width:90%"
|
||||
>
|
||||
</ibp-rotate-tip>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="map-control">
|
||||
<el-card type="border-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t('ibp.stationName') }}</span>
|
||||
<el-select v-model="stationCode" :placeholder="this.$t('rules.selectStation')" @change="changeStationCode">
|
||||
<el-option
|
||||
v-for="item in stationOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="handleSave"
|
||||
>{{ $t('ibp.save') }}</el-button>
|
||||
</div>
|
||||
</transition>
|
||||
<el-tabs v-model="enabledTab" class="mapEdit" type="card" @tab-click="handleTabClick">
|
||||
<el-tab-pane :label="this.$t('ibp.background')" name="Background">
|
||||
<ibp-bg
|
||||
ref="background"
|
||||
style="width:90%"
|
||||
@updateBg="createDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.line')" name="IbpLine">
|
||||
<ibp-line
|
||||
ref="ibpline"
|
||||
style="width:90%"
|
||||
@createLine="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.text')" name="IbpText">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
||||
<ibp-text
|
||||
ref="ibptext"
|
||||
style="width:90%"
|
||||
@createText="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.rect')" name="TipBox">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
|
||||
<ibp-tip-box
|
||||
ref="tipbox"
|
||||
style="width:90%"
|
||||
@createTipBox="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.button')" name="SquareButton">
|
||||
<ibp-button
|
||||
ref="squarebutton"
|
||||
style="width:90%"
|
||||
@createButton="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.circularLamp')" name="CircularLamp">
|
||||
<ibp-lamp
|
||||
ref="circularlamp"
|
||||
style="width:90%"
|
||||
@createLamp="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.arrow')" name="Arrow">
|
||||
<ibp-arrow
|
||||
ref="arrow"
|
||||
style="width:90%"
|
||||
@createArrow="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.escalatorFrame')" name="AppendageBox">
|
||||
<ibp-appendage-box
|
||||
ref="appendagebox"
|
||||
style="width:90%"
|
||||
@createAppendageBox="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.alarm')" name="Alarm">
|
||||
<ibp-alarm
|
||||
ref="alarm"
|
||||
style="width:90%"
|
||||
@createAlarm="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.telephoneTerminal')" name="TeleTerminal">
|
||||
<ibp-telephone-terminal
|
||||
ref="teleTerminal"
|
||||
style="width:90%"
|
||||
@createTeleTerminal="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.escalator')" name="Elevator">
|
||||
<ibp-elevator
|
||||
ref="elevator"
|
||||
style="width:90%"
|
||||
@createElevator="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.key')" name="Key">
|
||||
<ibp-key
|
||||
ref="key"
|
||||
style="width:90%"
|
||||
@createKey="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.digitalClock')" name="Clock">
|
||||
<ibp-clock
|
||||
ref="clock"
|
||||
style="width:90%"
|
||||
@createClock="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="this.$t('ibp.rotateTip')" name="RotateTip">
|
||||
<ibp-rotate-tip
|
||||
ref="rotateTip"
|
||||
style="width:90%"
|
||||
@createRotateTip="createDataModel"
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
<script>
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import {deviceFactory} from '@/ibp/utils/parser';
|
||||
import deviceType from '@/ibp/constant/deviceType';
|
||||
import IbpText from './ibpText';
|
||||
import IbpTipBox from './ibpTipBox';
|
||||
import IbpButton from './ibpButton';
|
||||
import IbpBg from './ibpBg';
|
||||
import IbpAlarm from './ibpAlarm';
|
||||
import IbpAppendageBox from './ibpAppendageBox';
|
||||
import IbpArrow from './ibpArrow';
|
||||
import IbpLamp from './ibpLamp';
|
||||
import IbpLine from './ibpLine';
|
||||
import IbpTelephoneTerminal from './ibpTelephoneTerminal';
|
||||
import IbpElevator from './ibpElevator';
|
||||
import IbpKey from './ibpKey';
|
||||
import IbpClock from './ibpClock';
|
||||
import IbpRotateTip from './ibpRotateTip';
|
||||
import {deviceFactory} from '@/ibp/utils/parser';
|
||||
import IbpText from './ibpText';
|
||||
import IbpTipBox from './ibpTipBox';
|
||||
import IbpButton from './ibpButton';
|
||||
import IbpBg from './ibpBg';
|
||||
import IbpAlarm from './ibpAlarm';
|
||||
import IbpAppendageBox from './ibpAppendageBox';
|
||||
import IbpArrow from './ibpArrow';
|
||||
import IbpLamp from './ibpLamp';
|
||||
import IbpLine from './ibpLine';
|
||||
import IbpTelephoneTerminal from './ibpTelephoneTerminal';
|
||||
import IbpElevator from './ibpElevator';
|
||||
import IbpKey from './ibpKey';
|
||||
import IbpClock from './ibpClock';
|
||||
import IbpRotateTip from './ibpRotateTip';
|
||||
|
||||
export default {
|
||||
name: 'IbpOperate',
|
||||
components: {
|
||||
IbpText,
|
||||
IbpBg,
|
||||
IbpButton,
|
||||
IbpTipBox,
|
||||
IbpAlarm,
|
||||
IbpAppendageBox,
|
||||
IbpArrow,
|
||||
IbpLamp,
|
||||
IbpLine,
|
||||
IbpTelephoneTerminal,
|
||||
IbpElevator,
|
||||
IbpKey,
|
||||
IbpClock,
|
||||
IbpRotateTip
|
||||
},
|
||||
mixins: [
|
||||
export default {
|
||||
name: 'IbpOperate',
|
||||
components: {
|
||||
IbpText,
|
||||
IbpBg,
|
||||
IbpButton,
|
||||
IbpTipBox,
|
||||
IbpAlarm,
|
||||
IbpAppendageBox,
|
||||
IbpArrow,
|
||||
IbpLamp,
|
||||
IbpLine,
|
||||
IbpTelephoneTerminal,
|
||||
IbpElevator,
|
||||
IbpKey,
|
||||
IbpClock,
|
||||
IbpRotateTip
|
||||
},
|
||||
mixins: [
|
||||
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
enabledTab: 'Background',
|
||||
data: '',
|
||||
stationOptions:[
|
||||
{
|
||||
value: 'Station_203_0.07533',
|
||||
// label: '通化门站'
|
||||
label: '车站一'
|
||||
},
|
||||
{
|
||||
value: 'Station_207_0.62282',
|
||||
// label: '枣园站'
|
||||
label: '车站二'
|
||||
},
|
||||
{
|
||||
value: 'Station_209_0.95175',
|
||||
label: '车站三'
|
||||
// label: '后卫寨站'
|
||||
}
|
||||
],
|
||||
stationCode: '',
|
||||
height: this.$store.state.app.height - 190
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.ibp.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||
this.enabledTab = model._type;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
createDataModel(model) {
|
||||
const newModel = deviceFactory(model._type, model);
|
||||
this.$store.dispatch('ibp/updateIbpDevices', newModel.model);
|
||||
},
|
||||
deleteDataModel(model) {
|
||||
this.$store.dispatch('ibp/deleteIbpDevices', model);
|
||||
},
|
||||
handleSave() {
|
||||
const data = JSON.stringify(this.$store.state.ibp.ibp);
|
||||
console.log(data);
|
||||
},
|
||||
changeStationCode(e) {
|
||||
this.$emit('ibpChange',e);
|
||||
this.handleTabClick();
|
||||
},
|
||||
handleTabClick() {
|
||||
this.$refs.ibpline.initPage();
|
||||
this.$refs.ibptext.initPage();
|
||||
this.$refs.tipbox.initPage();
|
||||
this.$refs.squarebutton.initPage();
|
||||
this.$refs.circularlamp.initPage();
|
||||
this.$refs.arrow.initPage();
|
||||
this.$refs.appendagebox.initPage();
|
||||
this.$refs.alarm.initPage();
|
||||
this.$refs.elevator.initPage();
|
||||
this.$refs.key.initPage();
|
||||
this.$refs.teleTerminal.initPage();
|
||||
this.$refs.clock.initPage();
|
||||
this.$refs.rotateTip.initPage();
|
||||
this.$refs.background.initPage();
|
||||
}
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
enabledTab: 'Background',
|
||||
data: '',
|
||||
stationOptions:[
|
||||
{
|
||||
value: 'Station_203_0.07533',
|
||||
// label: '通化门站'
|
||||
label: '车站一'
|
||||
},
|
||||
{
|
||||
value: 'Station_207_0.62282',
|
||||
// label: '枣园站'
|
||||
label: '车站二'
|
||||
},
|
||||
{
|
||||
value: 'Station_209_0.95175',
|
||||
label: '车站三'
|
||||
// label: '后卫寨站'
|
||||
}
|
||||
],
|
||||
stationCode: '',
|
||||
height: this.$store.state.app.height - 190
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.ibp.rightClickCount': function (val) {
|
||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||
this.enabledTab = model._type;
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
createDataModel(model) {
|
||||
const newModel = deviceFactory(model._type, model);
|
||||
this.$store.dispatch('ibp/updateIbpDevices', newModel.model);
|
||||
},
|
||||
deleteDataModel(model) {
|
||||
this.$store.dispatch('ibp/deleteIbpDevices', model);
|
||||
},
|
||||
handleSave() {
|
||||
const data = JSON.stringify(this.$store.state.ibp.ibp);
|
||||
console.log(data);
|
||||
},
|
||||
changeStationCode(e) {
|
||||
this.$emit('ibpChange', e);
|
||||
this.handleTabClick();
|
||||
},
|
||||
handleTabClick() {
|
||||
this.$refs.ibpline.initPage();
|
||||
this.$refs.ibptext.initPage();
|
||||
this.$refs.tipbox.initPage();
|
||||
this.$refs.squarebutton.initPage();
|
||||
this.$refs.circularlamp.initPage();
|
||||
this.$refs.arrow.initPage();
|
||||
this.$refs.appendagebox.initPage();
|
||||
this.$refs.alarm.initPage();
|
||||
this.$refs.elevator.initPage();
|
||||
this.$refs.key.initPage();
|
||||
this.$refs.teleTerminal.initPage();
|
||||
this.$refs.clock.initPage();
|
||||
this.$refs.rotateTip.initPage();
|
||||
this.$refs.background.initPage();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -79,7 +79,6 @@ export default {
|
||||
}
|
||||
},
|
||||
clickEvent(obj, node, data) {
|
||||
console.log(obj, node);
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
this.$emit('loadData', node);
|
||||
},
|
||||
|
@ -157,10 +157,17 @@ export default {
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
buy() {
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
|
||||
{ permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdId: this.$route.query.prdId, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
|
||||
this.$confirm('支付系统正在改进,如需购买请联系客服<br/>客服电话:13289398171', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
center: true
|
||||
});
|
||||
// this.$router.push({
|
||||
// path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
|
||||
// { permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdId: this.$route.query.prdId, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
|
||||
// });
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
const key = obj.id;
|
||||
|
Loading…
Reference in New Issue
Block a user