no message

This commit is contained in:
zyy 2019-07-16 13:34:03 +08:00
parent d50dc24121
commit 301e0f7245
14 changed files with 551 additions and 598 deletions

View File

@ -0,0 +1,398 @@
export default class DefaultSkin {
constructor() {
// 道岔字体颜色
this.switchTextColor = 'lightgreen';
/** 默认背景 颜色*/
this.backgroundColor = '#000000';
/** 默认提示背景 颜色*/
this.tipBackgroundColor = 'yellow';
/** 默认边线 颜色*/
this.sidelineColor = '#FFFFFF';
/** 透明填充 颜色*/
this.transparentColor = 'rgba(0,0,0,0)';
/** 默认字体 大小*/
this.textFontSize = 8.2;
/** 默认字体 族类*/
this.textFontFormat = 'consolas';
/** 默认字体颜色*/
this.textFontColor = '#C0C0C0';
/** 默认字体阴影颜色*/
this.textShadowColor = '#FFFF00';
/** 默认border文字背景色*/
this.borderContextBackgroundColor = '#00FFFF';
/** 默认border颜色*/
this.borderColor = '#fff';
/** 默认border线宽*/
this.borderWidth = 1;
/** 默认名称和设备的距离*/
this.nameDistance = 2;
/** 目的码字体颜色*/
this.destinationTextFontColor = 'yellow';
/** line 颜色*/
this.lineWidthColor = '#FFFFFF';
/** link 宽度*/
this.linkWidth = 4.4;
/** link 线条颜色*/
this.linkColor = '#3F3F3F';
/** link 字体颜色*/
this.linkTextColor = '#FFFFFF';
/** StopPoint 颜色*/
this.stopPointColor = '#FE0000';
/** StopPoint 字体颜色*/
this.stopPointTextColor = '#FFFFFF';
this.zcControlGrayColor = '#00FF00';
this.limitControlColor = '#ECE9D8';
this.lcControlColor = '#FFFF00';
this.zcControlmodeR = 4;
/** 区段 宽度*/
this.sectionWidth = 4.4;
/** 区段宽超出宽度*/
this.sectionBeyondWidth = 0;
/** 计轴 半径*/
this.sectionAxleR = 3;
/** 计轴和区段之间的距离*/
this.sectionAxleDistance = 5;
/** 限速线的宽度*/
this.sectionSpeedLimitLinewidth = 1;
/** 限速线距离区段距离*/
this.sectionSpeedLimitDistance = 5;
/** 分隔符宽度*/
this.sectionSeparatorWidth = 1.2;
/** 区段侵入颜色*/
this.sectionInvadeColor = '#EF0C08';
/** 限速线颜色*/
this.sectionSpeedLimitColor = '#FFFF00';
/** 逻辑区段颜色*/
this.sectionLogicalBackgroundColor = '#FFFF00';
/** 区段计轴颜色*/
this.sectionAxleColor = '#C0C0C0';
/** 区段边界符颜色*/
this.sectionSeparatorColor = '#7F7F7F';
/** 区段空闲颜色*/
this.sectionSpareColor = '#606060';
/** 逻辑区段名称颜色*/
this.sectionLogicalTextColor = '#C0C0C0';
/** 区段通信车占用颜色**/
this.sectionCommunicationOccupiedColor = '#FF0000';
/** 区段非通讯车占用颜色*/
this.sectionUnCommunicationOccupiedColor = '#800080';
/** 区段路由锁定颜色*/
this.sectionRouteLockColor = '#FFFFFF';
/** 区段故障锁定颜色*/
this.sectionFaultLockColor = '#006400';
/** 区段未定义颜色*/
this.sectionUndefinedColor = '#0071C1';
/** 保护区段锁闭*/
this.sectionProtectionSectionLockedColor = '#FEFF00';
/** 区段计轴预复位*/
this.sectionAxleResetColor = '#00FFFF';
/** 区段封锁颜色*/
this.sectionBlockColor = '#800080';
/** 区段atc切除颜色*/
this.sectionAtcExcisionColor = '#A0522D';
/** 区段ats切除颜色*/
this.sectionAtsExcisionColor = '#A0522D';
/** 区段延时释放颜色*/
this.sectionTimeReleaseColor = '#3F3F3F';
/** 区段保护锁闭*/
this.sectionProtectiveLockColor = '#FFFF00';
/** 区段保护延时解锁*/
this.sectionProtectiveTimeReleaseColor = '#0071C1';
/** 计轴失效*/
this.sectionAxleFailure = '#E6A23C'; // #FFFF00
/** 道岔单边长度 */
this.switchLen = 6;
/** 道岔边框颜色*/
this.switchTextBorderColor = '#FE0000';
/** 道岔失去颜色*/
this.switchTextLossColor = '#FFFFFF';
/** 道岔定位颜色*/
this.switchLocateTextColor = '#00FF00';
/** 道岔反位颜色*/
this.switchInversionColor = '#9C9D09';
/** 道岔单锁颜色*/
this.switchMonolockColor = '#870E10';
/** 信号机宽度 */
this.signalR = 4;
/** 灯柱宽度*/
this.signalLampStandardWidth = 1.2;
/** 设备距离区段的距离*/
this.signalDistance = 8;
/** 信号灯按钮边线*/
this.signalButtonDashColor = '#FFFFFF'; // '#C0C0C0'
/** 信号灯按钮颜色*/
this.signalButtonColor = 'darkgreen';
/** 信号灯按钮闪烁颜色*/
this.signalButtonLightenColor = '#E4EF50';
/** 信号灯字体颜色*/
this.signalTextColor = '#007600';
/** 信号灯灯柱颜色*/
this.signalLampStandardColor = '#5578B6';
/** 信号灯锁闭*/
this.signalBlockColor = '#EF0C08';
/** 信号灯灰色*/
this.signalLampGrayColor = '#7F7F7F';
/** 信号灯红色*/
this.signalLampRedColor = '#FF0000';
/** 信号灯绿色*/
this.signalLampGreenColor = '#00FF00';
/** 信号灯黄色*/
this.signalLampYellowColor = '#FFFF00';
/** 信号灯白色*/
this.signalLampWhiteColor = '#FFFFFF';
/** 信号灯蓝色*/
this.signalLampBlueColor = '#0070C0';
/** 公里表距离车站距离*/
this.stationKmRangeDistance = 22;
/** 控制模式字体大小*/
this.stationControlTextSize = 10;
/** 控制模式灯的半径 */
this.stationControlmodeR = 4;
/** 控制模式之间灯之间的距离*/
this.stationControlDistance = 36;
/** 控制模式灰色*/
this.stationControlGrayColor = '#7F7F7F';
/** 控制模式绿色*/
this.stationControlGreenColor = '#00FF00';
/** 控制模式红色*/
this.stationControlRedColor = '#FF0000';
/** 控制模式黄色*/
this.stationControlYellowColor = '#FFFF00';
/** 站台和屏蔽门之间的距离*/
this.stationStandDistance = 9;
/** 站台屏蔽门高度*/
this.statonStandSafeHeight = 1.6;
/** 站台首端字体大小*/
this.stationStandHeadFontSize = 9;
/** 站台无人折返*/
this.stationStandNoHumanReentryColor = '#0F16DA';
/** 站台自动换端*/
this.stationStandAutoChangeEndsColor = '#0BF400';
/** 站台空闲颜色*/
this.stationStandSpareColor = '#606060';
/** 站台列车停站颜色*/
this.stationStandStopColor = '#FEFE00';
/** 站台跳停颜色*/
this.stationStandJumpStopColor = '#9A99FF';
/** 站台指定列车跳停颜色*/
this.stationStandDesignatedJumpStopColor = 'lightSkyBlue';
/** 站台紧急关闭颜色*/
this.stationStandEmergentCloseColor = '#F61107';
/** 停站时间字体颜色*/
this.stationStandTimeTextColor = '#FFFFFF';
/** 车站扣车颜色*/
this.stationStandStandDetainTrainColor = '#E4EF50';
/** 中心扣车颜色*/
this.stationStandCenterDetainTrainColor = '#FFFFFF';
/** 车站+中心扣车颜色*/
this.stationStandStandAndCenterDetainTrainColor = '#F61107';
/** 屏蔽门默认颜色*/
this.stationStandDoorDefaultColor = '#00FF00';
/** 屏蔽门切除颜色*/
this.stationStandSplitDoorColor = '#F61107';
/** 车站扣除文字颜色*/
this.stationStandDetainTrainTextColor = '#E4EF50';
/** 计数器字体颜色*/
this.stationCounterTextColor = '#FFFFFF';
/** 计数器边框颜色*/
this.stationCounterBorderColor = '#E4EF50';
/** 延迟解锁倒计时和设备文字之间的距离*/
this.stationDelayUnlockDistance = 3;
/** 延时解锁字体颜色*/
this.stationDelayUnlockTextColor = '#FFFFFF';
/** 延迟解锁边框颜色*/
this.stationDelayUnlockBorderColor = '#FFFFFF';
// 停车点折返点目的码名字颜色
this.stopPointTexDestCodetColor = '#FFF07B';
/** 停车点目的码文字大小*/
this.textPointFontSize = 10;
/** 列车长度*/
this.trainWidth = 40;
/** 列车高度*/
this.trainHeight = 20;
/** 列车字号*/
this.trainTextFontSize = 12;
/** 列车HDSA字号*/
this.trainHSDATextFontSize = 9;
/** 列车信号的半径*/
this.trainConflictR = 3;
/** 列车信号距离车的距离*/
this.trainConflictDistance = 5;
/** 列车车头比车身高出的长度;上下相比车体伸出去的边框*/
this.trainMoreLength = 0;
/** 列车和车头之间的间距*/
this.trainHeadDistance = 4;
/** 列车竖杠的宽度*/
this.trainConntWidth = 3;
/** 列车竖杠和方向之间的间隔*/
this.trainPadding = 4;
/** 列车方向的宽度*/
this.trainArrowWidth = 6;
/** 列车和区段之间的距离*/
this.trainDistance = 30;
/** 列车边线颜色*/
this.trainSidelineColor = '#C0C0C0';
/** 列车背景*/
this.trainBackground = '#000000';
/** 列车 灰色*/
this.trainGrayColor = '#C0C0C0';
/** 列车 白色*/
this.trainWitheColor = '#FFFFFF';
/** 列车 棕色*/
this.trainBrownColor = '#A0522D';
/** 列车 黄色*/
this.trainYellowColor = '#FFFF00';
/** 列车 棕灰色 */
this.trainBrown1Color = '#725A64';
/** 列车 绿色*/
this.trainGreenColor = '#00FF00';
/** 列车 蓝色*/
this.trainBlueColor = '#3265FF';
/** 列车 红色*/
this.trainRedColor = '#FF0000';
/** 列车 橘色*/
this.trainOrangeColor = 'orange';
/** 列车 紫色*/
this.trainPurpleColor = 'purple';
/** 列车 粉色*/
this.trainPinkColor = 'pink';
/** 车次窗高度*/
this.trainWindowWidth = 40;
/** 车次窗高度*/
this.trainWindowHeight = 15;
/** 车次窗颜色*/
this.trainWindowColor = '#fff';
}
}

View File

@ -1,480 +1,10 @@
import deviceType from './deviceType'; import beijingSkin from '../theme/bejing';
const fuzhouSkin = {
};
fuzhouSkin[deviceType.Link] = {
linkColor: '#c0c0c0',
linkWidth: 6,
linkTextColor: '#FFFFFF',
textFontSize: 9,
backgroundColor: '#000000'
};
fuzhouSkin[deviceType.Section] = {
nameDistance: 2,
backgroundColor: '#000000',
/** 默认边线 颜色*/
sidelineColor: '#FFFFFF',
/** 透明填充 颜色*/
transparentColor: 'rgba(0,0,0,0)',
/** 默认字体 大小*/
textFontSize: 9,
/** 默认字体 族类*/
textFontFormat: 'consolas',
/** 默认字体颜色*/
textFontColor: '#C0C0C0',
/** 默认字体阴影颜色*/
textShadowColor: '#FFFF00',
/** 区段 宽度*/
sectionWidth: 4.4,
/** 区段宽超出宽度*/
sectionBeyondWidth: 0,
/** 计轴 半径*/
sectionAxleR: 3,
/** 计轴和区段之间的距离*/
sectionAxleDistance: 5,
/** 限速线的宽度*/
sectionSpeedLimitLinewidth: 1,
/** 限速线距离区段距离*/
sectionSpeedLimitDistance: 5,
/** 分隔符宽度*/
sectionSeparatorWidth: 1.2,
/** 区段侵入颜色*/
sectionInvadeColor: '#EF0C08',
/** 限速线颜色*/
sectionSpeedLimitColor: '#FFFF00',
/** 逻辑区段颜色*/
sectionLogicalBackgroundColor: '#FFFF00',
/** 区段计轴颜色*/
sectionAxleColor: '#C0C0C0',
/** 区段边界符颜色*/
sectionSeparatorColor: '#7F7F7F',
/** 区段空闲颜色*/
sectionSpareColor: '#606060',
/** 逻辑区段名称颜色*/
sectionLogicalTextColor: '#C0C0C0',
/** 区段通信车占用颜色**/
sectionCommunicationOccupiedColor: '#FF0000',
/** 区段非通讯车占用颜色*/
sectionUnCommunicationOccupiedColor: '#800080',
/** 区段路由锁定颜色*/
sectionRouteLockColor: '#FFFFFF',
/** 区段故障锁定颜色*/
sectionFaultLockColor: '#006400',
/** 区段未定义颜色*/
sectionUndefinedColor: '#0071C1',
/** 保护区段锁闭*/
sectionProtectionSectionLockedColor: '#FEFF00',
/** 区段计轴预复位*/
sectionAxleResetColor: '#00FFFF',
/** 区段封锁颜色*/
sectionBlockColor: '#800080',
/** 区段atc切除颜色*/
sectionAtcExcisionColor: '#A0522D',
/** 区段ats切除颜色*/
sectionAtsExcisionColor: '#A0522D',
/** 区段延时释放颜色*/
sectionTimeReleaseColor: '#3F3F3F',
/** 区段保护锁闭*/
sectionProtectiveLockColor: '#FFFF00',
/** 区段保护延时解锁*/
sectionProtectiveTimeReleaseColor: '#0071C1',
/** 计轴失效*/
sectionAxleFailure: '#E6A23C' // #FFFF00
};
fuzhouSkin[deviceType.Signal] = {
/** 信号机宽度 */
signalR: 7,
/** 灯柱宽度*/
signalLampStandardWidth: 1,
/** 设备距离区段的距离*/
signalDistance: 13,
/** 信号灯按钮边线*/
signalButtonDashColor: '#C0C0C0', // '#C0C0C0'
/** 信号灯按钮颜色*/
signalButtonColor: 'darkgreen',
/** 信号灯按钮闪烁颜色*/
signalButtonLightenColor: '#E4EF50',
/** 信号灯字体红色*/
signalTextRed: '#C00808',
/** 信号灯字体绿色*/
signalTextGreen: '#00FF00',
/** 信号灯灯柱颜色*/
signalLampStandardColor: '#606060',
/** 信号灯灰色*/
signalLampGrayColor: '#7F7F7F',
/** 信号灯绿色*/
signalLampGreenColor: '#00FF00',
/** 信号灯黄色*/
signalLampYellowColor: '#FFFF00',
/** 信号灯白色*/
signalLampWhiteColor: '#FFFFFF',
/** 信号灯蓝色*/
signalLampBlueColor: '#0000FF',
/** 信号灯锁闭*/
signalBlockColor: '#EF0C08'
};
fuzhouSkin[deviceType.Switch] = {
/** 默认背景 颜色*/
backgroundColor: '#000000',
/** 默认提示背景 颜色*/
tipBackgroundColor: 'yellow',
/** 透明填充 颜色*/
transparentColor: 'rgba(0,0,0,0)',
/** 默认字体 大小*/
textFontSize: 9,
/** 默认字体 族类*/
textFontFormat: 'consolas',
/** 默认border文字背景色*/
borderContextBackgroundColor: '#00FFFF',
/** 默认border颜色*/
borderColor: '#C0C0C0',
/** 默认名称和设备的距离*/
nameDistance: 2,
/** 区段宽超出宽度*/
sectionBeyondWidth: 0,
/** 区段 宽度*/
sectionWidth: 4.4,
/** 道岔单边长度*/
switchLen: 7,
/** 道岔字体颜色*/
switchTextColor: 'lightgreen',
/** 道岔边框颜色*/
switchTextBorderColor: '#FE0000',
/** 道岔失去颜色*/
switchTextLossColor: '#C00808',
/** 道岔定位颜色*/
switchLocateTextColor: '#08C008',
/** 道岔反位颜色*/
switchInversionColor: '#C0C000',
/** 道岔单锁颜色*/
switchMonolockColor: '#FFFFFF',
/** 道岔封锁*/
switchBlockLockColor: '#E20F0A'
};
fuzhouSkin[deviceType.Station] = {
/** 默认字体 族类*/
textFontFormat: '宋体' // consolas
};
fuzhouSkin[deviceType.StationControl] = {
nameDistance: 2,
/** 默认字体颜色*/
textFontColor: '#C0C0C0',
/** 默认字体阴影颜色*/
textShadowColor: '#FFFF00',
/** 默认字体 族类*/
textFontFormat: 'consolas',
/** 控制模式灯的半径 */
stationControlmodeR: 5,
/** 控制模式之间灯之间的距离*/
stationControlDistance: 44,
/** 控制模式字体大小*/
stationControlTextSize: 12,
/** 控制模式灰色*/
stationControlGrayColor: '#74747C',
/** 控制模式绿色*/
stationControlGreenColor: '#4DD43F',
/** 控制模式红色*/
stationControlRedColor: '#EF0C08',
/** 控制模式黄色*/
stationControlYellowColor: '#E4EF50'
};
fuzhouSkin[deviceType.LcControl] = {
nameDistance: 2,
zcControlmodeR: 4,
lcControlColor: '#FFFF00',
stationControlTextSize: 10,
textFontFormat: 'consolas',
textShadowColor: '#FFFF00',
borderColor: '#fff',
transparentColor: 'rgba(0,0,0,0)',
borderContextBackgroundColor: '#00FFFF'
};
fuzhouSkin[deviceType.LimitControl] = {
nameDistance: 2,
zcControlmodeR: 4,
lcControlColor: '#FFFF00',
stationControlTextSize: 10,
textFontFormat: 'consolas',
textShadowColor: '#FFFF00',
borderColor: '#fff',
transparentColor: 'rgba(0,0,0,0)',
borderContextBackgroundColor: '#00FFFF',
limitControlColor: 4
};
fuzhouSkin[deviceType.ZcControl] = {
nameDistance: 2,
zcControlmodeR: 4,
stationControlTextSize: 10,
textFontFormat: 'consolas',
textShadowColor: '#FFFF00',
borderColor: '#fff',
transparentColor: 'rgba(0,0,0,0)',
borderContextBackgroundColor: '#00FFFF',
zcControlGrayColor: '#00FF00'
};
fuzhouSkin[deviceType.StationCounter] = {
/** 默认字体 大小*/
textFontSize: 9,
/** 默认字体 族类*/
textFontFormat: 'consolas',
/** 计数器字体颜色*/
stationCounterTextColor: '#FFFFFF',
/** 计数器边框颜色*/
stationCounterBorderColor: '#E4EF50'
};
fuzhouSkin[deviceType.StationStand] = {
/** 站台空闲颜色*/
stationStandSpareColor: '#74747C',
/** 列车边线颜色*/
trainSidelineColor: '#C0C0C0',
/** 站台和屏蔽门之间的距离*/
stationStandDistance: 8,
/** 站台无人折返*/
stationStandNoHumanReentryColor: '#0F16DA',
/** 站台首端字体大小*/
stationStandHeadFontSize: 10,
/** 中心扣车颜色*/
stationStandCenterDetainTrainColor: '#FFFFFF',
/** 默认字体 族类*/
textFontFormat: '宋体', //consolas
/** 默认背景 颜色*/
backgroundColor: '#000000',
/** 默认字体 大小*/
textFontSize: 8.2,
/** 停站时间字体颜色*/
stationStandTimeTextColor: '#FFFFFF',
/** 站台紧急关闭颜色*/
stationStandEmergentCloseColor: '#F61107',
/** 站台屏蔽门高度*/
statonStandSafeHeight: 1.6,
/** 屏蔽门默认颜色*/
stationStandDoorDefaultColor: '#4DD43F',
/** 站台列车停站颜色*/
stationStandStopColor: '#FEFE00',
/** 站台指定列车跳停颜色*/
stationStandDesignatedJumpStopColor: 'lightSkyBlue',
/** 站台跳停颜色*/
stationStandJumpStopColor: '#9A99FF',
/** 车站扣除文字颜色*/
stationstandDetainTrainTextColor: '#E4EF50',
/** 屏蔽门切除颜色*/
stationStandSplitDoorColor: '#F61107',
/** 站台自动换端*/
stationStandAutoChangeEndsColor: '#0BF400',
/** 默认border文字背景色*/
borderContextBackgroundColor: '#00FFFF',
/** 默认边线 颜色*/
sidelineColor: '#FFFFFF',
};
fuzhouSkin[deviceType.TrainWindow] = {
/** 车次窗高度*/
trainWindowWidth: 40,
/** 车次窗高度*/
trainWindowHeight: 15,
/** 车次窗颜色*/
trainWindowColor: '#4DD43F',
/** 透明填充 颜色*/
transparentColor: 'rgba(0,0,0,0)',
};
fuzhouSkin[deviceType.Train] = {
/** 列车长度*/
trainWidth: 76,
/** 列车高度*/
trainHeight: 17,
/** 列车字号*/
trainTextFontSize: 15,
// 列车文字间距
trainTextSpaceBetween: 27,
/** 列车HDSA字号*/
trainHSDATextFontSize: 8,
/** 列车信号的半径*/
trainConflictR: 3,
/** 列车信号距离车的距离*/
trainConflictDistance: 5,
/** 列车车头比车身高出的长度,上下相比车体伸出去的边框*/
trainMoreLength: 1,
/** 列车和车头之间的间距*/
trainHeadDistance: 2,
/** 列车竖杠的宽度*/
trainConntWidth: 4,
/** 列车竖杠和方向之间的间隔*/
trainPadding: 1,
/** 列车方向的宽度*/
trainArrowWidth: 6,
/** 列车和区段之间的距离*/
trainDistance: 18,
/** 列车背景*/
trainBackground: 'rgba(0,0,0,0)',
/** 列车边线颜色*/
trainSidelineColor: '#C0C0C0',
/** 列车文字颜色*/
trainTextColor: '#ffffff',
/** 列车 灰色*/
trainGrayColor: '#C0C0C0',
/** 列车 白色*/
trainWitheColor: '#FFFFFF',
/** 列车 棕色*/
trainBrownColor: '#9B4A09',
/** 列车 黄色*/
trainYellowColor: '#FFFF00',
/** 列车 绿色*/
trainGreenColor: '#00AF50',
/** 列车 蓝色*/
trainBlueColor: '#3265FF',
/** 列车 红色*/
trainRedColor: '#EF0C08',
/** 列车 橘色*/
trainOrangeColor: '#EA700D',
/** 列车 紫色*/
trainPurpleColor: 'purple',
/** 列车 粉色*/
trainPinkColor: 'pink',
};
/** 皮肤配置*/ /** 皮肤配置*/
const deviceSkin = { const deviceSkin = {
'03': fuzhouSkin, '03': beijingSkin,
'04': fuzhouSkin, '04': beijingSkin,
'05': fuzhouSkin '05': beijingSkin
}; };
export function selectSkinStyle(code) { export function selectSkinStyle(code) {

View File

@ -100,12 +100,13 @@ deviceRender[deviceType.Text] = {
/** TrainWindow渲染配置*/ /** TrainWindow渲染配置*/
deviceRender[deviceType.TrainWindow] = { deviceRender[deviceType.TrainWindow] = {
zlevel: 5, zlevel: 5,
progressive: 4, progressive: 4
}; };
/** Train渲染配置*/ /** Train渲染配置*/
deviceRender[deviceType.TRain] = { deviceRender[deviceType.TRain] = {
zlevel: 6, zlevel: 6,
progressive: 4, progressive: 4
}; };
export default deviceRender; export default deviceRender;

View File

@ -18,4 +18,5 @@ const deviceType = {
Text: 'Text' Text: 'Text'
}; };
console.log(deviceType, 4444);
export default deviceType; export default deviceType;

View File

@ -4,9 +4,9 @@ import Painter from './painter';
import Options from './options'; import Options from './options';
import ProxyHandle from './proxyHandle'; import ProxyHandle from './proxyHandle';
import MouseController from './mouseController'; import MouseController from './mouseController';
import deviceState from './config/deviceState'; import deviceState from './constant/deviceState';
import { selectSkinStyle } from './config/deviceStyle'; import { selectSkinStyle } from './config/deviceStyle';
import deviceType from './config/deviceType'; import deviceType from './constant/deviceType';
import { parser, deviceFactory } from './utils/parser'; import { parser, deviceFactory } from './utils/parser';
const renderer = 'canvas'; const renderer = 'canvas';

View File

@ -1,4 +1,4 @@
import deviceType from './config/deviceType'; import deviceType from './constant/deviceType';
import Eventful from 'zrender/src/mixin/Eventful'; import Eventful from 'zrender/src/mixin/Eventful';
import * as eventTool from 'zrender/src/core/event'; import * as eventTool from 'zrender/src/core/event';

View File

@ -1,6 +1,6 @@
import * as zrUtil from 'zrender/src/core/util'; import * as zrUtil from 'zrender/src/core/util';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import deviceType from './config/deviceType'; import deviceType from './constant/deviceType';
import shapefactory from './shape/factory'; import shapefactory from './shape/factory';
import ZoomHandle from './zoomHandle'; import ZoomHandle from './zoomHandle';
@ -62,6 +62,7 @@ class Painter {
* @param {*} device * @param {*} device
*/ */
add(device) { add(device) {
// console.log(device, device._type, 111);
const type = device._type; const type = device._type;
const code = device._code; const code = device._code;
const view = shapefactory(type, device, this.$jmap); const view = shapefactory(type, device, this.$jmap);

View File

@ -1,129 +1,129 @@
/*车次窗*/ /* 车次窗*/
import Polygon from 'zrender/src/graphic/shape/Polygon'; import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
//import ModelType from '@/jlmap/model/ModelType'; // import ModelType from '@/jlmap/model/ModelType';
import store from '@/store'; import store from '@/store';
class TrainWindow extends Group { class TrainWindow extends Group {
constructor({ _code, _type, zlevel, model, state }, style){ constructor({ _code, _type, zlevel, model, state }, style) {
super(); super();
this._code = _code; this._code = _code;
this._type = _type; this._type = _type;
this.zlevel = zlevel; this.zlevel = zlevel;
this.model = model; this.model = model;
this.state = state; this.state = state;
this.style = style; this.style = style;
this.z = 1; this.z = 1;
this.selected = false; this.selected = false;
this._create(model); this._create(model);
this.on('mousedown', this.mouseclick); this.on('mousedown', this.mouseclick);
this.on('mouseout', this.mouseleave); this.on('mouseout', this.mouseleave);
this.on('mouseover', this.mouseenter); this.on('mouseover', this.mouseenter);
} }
_create(model) { _create(model) {
let prdType = '02'//store.state.map.prdType; const prdType = '02';// store.state.map.prdType;
if (prdType !== '01') { if (prdType !== '01') {
this.createTrainWindow(); this.createTrainWindow();
this.setTrainWindowEventShow(model.trainWindowShow); this.setTrainWindowEventShow(model.trainWindowShow);
this.setState(model); this.setState(model);
this.mouseStatusRecover(); this.mouseStatusRecover();
} }
} }
/** 创建车次窗*/ /** 创建车次窗*/
createTrainWindow() { createTrainWindow() {
let model = this.model; const model = this.model;
let point = model.point||model.position; const point = model.point||model.position;
this.trainRect = new Polygon({ this.trainRect = new Polygon({
_subType: 'TrainWindow', _subType: 'TrainWindow',
zlevel: this.zlevel - 1, zlevel: this.zlevel - 1,
z: this.z, z: this.z,
shape: { shape: {
smooth: 0.01, smooth: 0.01,
points: [ points: [
[point.x - model.width / 2, point.y], [point.x - model.width / 2, point.y],
[point.x + model.width / 2, point.y], [point.x + model.width / 2, point.y],
[point.x + model.width / 2, point.y + model.height], [point.x + model.width / 2, point.y + model.height],
[point.x - model.width / 2, point.y + model.height], [point.x - model.width / 2, point.y + model.height]
] ]
}, },
style: { style: {
lineDash: [3, 3], lineDash: [3, 3],
lineWidth: 1, lineWidth: 1,
stroke: this.style.trainWindowColor, stroke: this.style.trainWindowColor,
fill: this.style.transparentColor fill: this.style.transparentColor
} }
}); });
this.add(this.trainRect); this.add(this.trainRect);
} }
setTrainWindowEventShow(show) { setTrainWindowEventShow(show) {
let lineWidth = show ? 1 : 0; const lineWidth = show ? 1 : 0;
this.trainRect && this.trainRect.setStyle('lineWidth', lineWidth); this.trainRect && this.trainRect.setStyle('lineWidth', lineWidth);
} }
isPop(e) { isPop(e) {
for (var i = 0; i < this.childCount(); i++) { for (var i = 0; i < this.childCount(); i++) {
var rect = this.childAt(i).getBoundingRect(); var rect = this.childAt(i).getBoundingRect();
if (rect.contain(e.offsetX, e.offsetY) && this.childAt(i).pop) { if (rect.contain(e.offsetX, e.offsetY) && this.childAt(i).pop) {
return true; return true;
} }
} }
} }
//设置状态 // 设置状态
setState(model) { setState(model) {
} }
getShapeTipPoint() { getShapeTipPoint() {
if (this.stationControl) { if (this.stationControl) {
var distance = 2; var distance = 2;
var rect = this.stationControl.getBoundingRect(); var rect = this.stationControl.getBoundingRect();
return { return {
x: rect.x + rect.width / 2, x: rect.x + rect.width / 2,
y: rect.y - distance, y: rect.y - distance
}; };
} }
return null; return null;
} }
setSectionEventShow(e, show) { setSectionEventShow(e, show) {
/*let section = store.getters['map/getViewInstanceByDevice']({ _type: ModelType.Section, _code: this.model.sectionCode }); /* let section = store.getters['map/getViewInstanceByDevice']({ _type: ModelType.Section, _code: this.model.sectionCode });
show && section && section.mouseStatusVisible(e); show && section && section.mouseStatusVisible(e);
show || section && section.mouseStatusRecover(e);*/ show || section && section.mouseStatusRecover(e);*/
} }
mouseStatusRecover(e) { mouseStatusRecover(e) {
this.setTrainWindowEventShow(false); this.setTrainWindowEventShow(false);
this.setSectionEventShow(e, false); this.setSectionEventShow(e, false);
} }
mouseStatusVisible(e) { mouseStatusVisible(e) {
this.setTrainWindowEventShow(true); this.setTrainWindowEventShow(true);
this.setSectionEventShow(e, true); this.setSectionEventShow(e, true);
} }
mouseclick(e) { mouseclick(e) {
if ([3].includes(e.which)) { if ([3].includes(e.which)) {
this.selected = !this.selected; this.selected = !this.selected;
if (this.selected) { if (this.selected) {
this.mouseStatusVisible(e); this.mouseStatusVisible(e);
} }
} }
} }
mouseenter(e) { mouseenter(e) {
if (!this.selected) { if (!this.selected) {
this.mouseStatusVisible(e); this.mouseStatusVisible(e);
} }
} }
mouseleave(e) { mouseleave(e) {
if (!this.selected) { if (!this.selected) {
this.mouseStatusRecover(e); this.mouseStatusRecover(e);
} }
} }
} }
export default TrainWindow; export default TrainWindow;

View File

@ -0,0 +1,2 @@
// import Text from 'zrender/src/graphic/Text';

View File

@ -1,4 +1,4 @@
import deviceType from '../config/deviceType'; import deviceType from '../constant/deviceType';
import Link from './Link'; import Link from './Link';
import Section from './Section'; import Section from './Section';
import Signal from './Signal'; import Signal from './Signal';
@ -11,8 +11,8 @@ import Switch from './Switch';
import ZcControl from './ZcControl'; import ZcControl from './ZcControl';
import StationCounter from './StationCounter'; import StationCounter from './StationCounter';
import StationDelayUnlock from './StationDelayUnlock'; import StationDelayUnlock from './StationDelayUnlock';
import TrainWindow from "./TrainWindow"; import TrainWindow from './TrainWindow';
import Train from "./Train"; import Train from './Train';
/** 图库*/ /** 图库*/
const mapShape = {}; const mapShape = {};
@ -35,7 +35,9 @@ function shapefactory(type, device, jmap) {
const style = jmap.getStyleDict(); const style = jmap.getStyleDict();
const shape = mapShape[type]; const shape = mapShape[type];
if (shape instanceof Function) { if (shape instanceof Function) {
return new shape(device, style[type], jmap); console.log(style, type);
// eslint-disable-next-line
return new shape(device, style, jmap);
} }
} }

19
src/jmap/theme/bejing.js Normal file
View File

@ -0,0 +1,19 @@
import defaultSkin from '../config/defaultSkin';
// import deviceType from '../constant/deviceType';
class Beijing extends defaultSkin {
constructor() {
super();
this.Link = {
textFontColor: ''
};
this.Section = {
};
}
}
const beijingSkin = new Beijing();
export default beijingSkin;

View File

@ -1,6 +1,6 @@
import * as zrUtil from 'zrender/src/core/util'; import * as zrUtil from 'zrender/src/core/util';
import deviceType from '../config/deviceType'; import deviceType from '../constant/deviceType';
import deviceRender from '../config/deviceRender'; import deviceRender from '../constant/deviceRender';
export function deviceFactory(type, defaultStateDict, elem) { export function deviceFactory(type, defaultStateDict, elem) {
return Object.assign({ return Object.assign({
@ -15,7 +15,6 @@ export function deviceFactory(type, defaultStateDict, elem) {
export function parser(data, jmap) { export function parser(data, jmap) {
const mapDevice = {}; const mapDevice = {};
const defaultStateDict = jmap.getDefaultStateDict(); const defaultStateDict = jmap.getDefaultStateDict();
if (data) { if (data) {
zrUtil.each(data.linkList || [], elem => { zrUtil.each(data.linkList || [], elem => {
mapDevice[elem.code] = deviceFactory(deviceType.Link, defaultStateDict, elem); mapDevice[elem.code] = deviceFactory(deviceType.Link, defaultStateDict, elem);

View File

@ -4,7 +4,7 @@
<script> <script>
import Jmaps from '@/jmap/maps'; import Jmaps from '@/jmap/maps';
import deviceType from '@/jmap/config/deviceType'; import deviceType from '@/jmap/constant/deviceType';
import { getPublishMapDetail } from '@/api/test.js'; import { getPublishMapDetail } from '@/api/test.js';
export default { export default {