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:', stationstandPosition: 'Station stand position:',
signalLinkCode: 'Signal link', signalLinkCode: 'Signal link',
signalNamePosition: 'Signal name position:', signalNamePosition: 'Signal name position:',
signalNameRotated: 'Signal name rotated:',
signalGuidePosition: 'Signal guide:', signalGuidePosition: 'Signal guide:',
signalPosition: 'Signal position:', signalPosition: 'Signal position:',
signalButtonPosition: 'button:', signalButtonPosition: 'button:',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -90,6 +90,7 @@ export default {
stationCode: '', stationCode: '',
sectionOffset: 0, sectionOffset: 0,
rotate: 0, rotate: 0,
nameRotated: false,
sectionCode: '', sectionCode: '',
guideShow: false, guideShow: false,
buttonShow: 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: '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: '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: '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', 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.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', 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, productionSourceMap: false,
devServer: { devServer: {
port: port, port: port,
open: true, // open: true,
overlay: { overlay: {
warnings: false, warnings: false,
errors: true errors: true