This commit is contained in:
zyy 2019-12-26 18:07:29 +08:00
commit 72ecdae535
13 changed files with 217 additions and 216 deletions

View File

@ -32,6 +32,7 @@ export default {
stationstandPosition: 'Station stand position:',
signalLinkCode: 'Signal link',
signalNamePosition: 'Signal name position:',
signalNameRotated: 'Signal name rotated:',
signalGuidePosition: 'Signal guide:',
signalPosition: 'Signal position:',
signalButtonPosition: 'button:',

View File

@ -317,7 +317,6 @@ export default {
enterTheNewsTitle: 'Please enter news title',
enterTheNewsContent: 'Please enter news content',
chooseNewsCanBeClosed: 'Please select the news can be closed',
theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent: 'The left end of the selected associated section is not adjacent!',
theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent: 'The right end of the selected associated section is not adjacent!',
theSelectedAssociatedSectionIsNotAdjacent: 'The selected associated section is not adjacent!',
selectConcentrateStation:'Please select Concentrate Station'
};

View File

@ -297,6 +297,7 @@ export default {
signalNamePositionX: '信号机名字偏移量 x:',
signalNamePositionY: '信号机名字偏移量 y:',
signalNamePosition: '信号机名字偏移量:',
signalNameRotated: '信号机名字是否旋转:',
signalButtonShow: '是否显示按钮:',
signalButtonPositionX: '按钮x:',
signalButtonPositionY: '按钮y:',

View File

@ -319,7 +319,6 @@ export default {
enterTheNewsTitle: '请输入消息标题',
enterTheNewsContent: '请输入消息内容',
chooseNewsCanBeClosed: '请选择消息是否可关闭',
theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent: '所选择关联区段与该区段左侧不相邻!',
theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent: '所选择关联区段与该区段右侧不相邻!',
theSelectedAssociatedSectionIsNotAdjacent: '所选择关联区段与该区段不相邻!',
selectConcentrateStation:'请选择设备集中站'
};

View File

@ -11,7 +11,7 @@ class ESigName extends Group {
create() {
const model = this.model;
this.name = new Text({
_subType: 'SignalLamp',
_subType: 'SignalName',
_val: '3',
zlevel: model.zlevel,
z: model.z,

View File

@ -13,7 +13,6 @@ import EMouse from './EMouse';
import Group from 'zrender/src/container/Group';
import BoundingRect from 'zrender/src/core/BoundingRect';
import EHighlight from '../element/EHighlight';
import {drawSectionStyle} from '../../config/defaultStyle';
class Signal extends Group {
constructor(model, style) {
@ -175,10 +174,12 @@ class Signal extends Group {
if (item instanceof Group) {
this.transformRotation(item);
} else if (item) {
if (item._subType !== 'SignalName' || this.model.nameRotated) {
item.origin = [this.model.position.x, this.model.position.y];
item.rotation = -Math.PI / 180 * Number(this.model.rotate);
item.dirty();
}
}
});
}
}

View File

@ -97,6 +97,11 @@ export default {
prop: 'name',
width: 180
},
{
title: '编码',
prop: 'code',
width: 150
},
{
title: this.$t('map.routeStationName'),
prop: 'stationCode'

View File

@ -446,22 +446,14 @@ export default {
return form;
},
rules() {
// var validateLeftSection = (rule, value, callback) => {
// const leftSection = value ? this.$store.getters['map/getDeviceByCode'](value) : null;
// if (leftSection && !(this.checkPointsCoincide(leftSection.points[leftSection.points.length - 1], this.editModel.points[0].x) || this.checkPointsCoincide(leftSection.points[leftSection.points.length - 1], this.oldPoint[0]) )) {
// callback(new Error(this.$t('rules.theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent')));
// } else {
// callback();
// }
// };
// var validateRightSection = (rule, value, callback) => {
// const rightSection = value ? this.$store.getters['map/getDeviceByCode'](value) : null;
// if (rightSection && !(this.checkPointsCoincide(rightSection.points[0], this.editModel.points[this.editModel.points.length - 1]) || this.checkPointsCoincide(rightSection.points[0], this.oldPoint[this.oldPoint.length - 1]))) {
// callback(new Error(this.$t('rules.theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent')));
// } else {
// callback();
// }
// };
var validateAssociatedSection = (rule, value, callback) => {
const rightSection = value ? this.$store.getters['map/getDeviceByCode'](value) : null;
if (rightSection && !(this.checkSectionPointsHasCoincide(rightSection.points, this.editModel.points) || this.checkSectionPointsHasCoincide(rightSection.points, this.oldPoint))) {
callback(new Error(this.$t('rules.theSelectedAssociatedSectionIsNotAdjacent')));
} else {
callback();
}
};
const rules = {
code: [
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
@ -504,13 +496,13 @@ export default {
],
relSwitchCode: [
{ required: true, message: this.$t('rules.sectionRelSwitchCode'), trigger: 'change' }
],
leftSectionCode: [
{ validator: validateAssociatedSection, trigger: 'change' }
],
rightSectionCode: [
{ validator: validateAssociatedSection, trigger: 'change'}
]
// leftSectionCode: [
// { validator: validateLeftSection, trigger: 'change' }
// ],
// rightSectionCode: [
// { validator: validateRightSection, trigger: 'change'}
// ]
};
return rules;
},

View File

@ -177,6 +177,7 @@ export default {
positionType: this.addModel.positionType,
right: this.addModel.right,
// leftOrRight: this.addModel.leftOrRight,
nameRotated: false,
nameShow: true,
namePosition: { x: 0, y: 0 },
buttonShow: true,

View File

@ -90,6 +90,7 @@ export default {
stationCode: '',
sectionOffset: 0,
rotate: 0,
nameRotated: false,
sectionCode: '',
guideShow: false,
buttonShow: false,
@ -155,6 +156,7 @@ export default {
{ prop: 'right', label: this.$t('map.signalDirectionTypeX'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalDirectionList },
{ prop: 'positionType', label: this.$t('map.signalPositionType'), type: 'radio', optionLabel: 'name', optionValue: 'code', border: true, radioList: this.SignalPositionTypeList },
{ prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: -180, max: 180, placeholder: this.$t('tip.angle') },
{ prop: 'nameRotated', label: this.$t('map.signalNameRotated'), type: 'checkbox' },
{ prop: 'namePosition', label: this.$t('map.signalNamePosition'), type: 'coordinate', width: '140px', children: [
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }

View File

@ -33,7 +33,7 @@ module.exports = {
productionSourceMap: false,
devServer: {
port: port,
open: true,
// open: true,
overlay: {
warnings: false,
errors: true