This commit is contained in:
joylink_cuiweidong 2019-12-04 13:01:22 +08:00
commit f97bd74c39
19 changed files with 325 additions and 345 deletions

View File

@ -558,4 +558,5 @@ export default {
chargeStationList:'Managed station list',
createModel: 'Create model:',
startingPoint: 'Starting point:',
endingPoint: 'Ending point:'
};

View File

@ -551,5 +551,6 @@ export default {
rightAssociatedSection: '右关联区段:',
chargeStationList:'管理车站列表',
createModel: '创建方式:',
startingPoint: '起点:'
startingPoint: '起点:',
endingPoint: '终点:'
};

View File

@ -150,10 +150,6 @@ class Jlmap {
}
}
setLayerVisible(layer) {
this.$painter.setLayerVisible(layer);
}
setLevelVisible(list) {
this.$painter.setLevelVisible(list);
}

View File

@ -241,7 +241,7 @@ class MouseController extends Eventful {
deviceList.forEach( item =>{
if (item.instance && item.instance._type == deviceType.Section) {
let deviceBoundingRect = {};
if (item.type == '03') {
if (item.type == '04') {
deviceBoundingRect = {
x1: item.namePosition.x,
y1: item.namePosition.y,

View File

@ -27,11 +27,6 @@ class Painter {
* @param {*} config
*/
initLevels() {
// 图层分级策略
this.layerBranch = {};
this.layerBranch['01'] = (type) => { return type == deviceType.Link; }; // 逻辑图层级
this.layerBranch['02'] = (type) => { return type != deviceType.Link; }; // 物理图层级
this.layerBranch['03'] = (type) => { return true; }; // 混合图层级
// 添加父级图层
this.parentLevel = new Group({ name: '__parent__' });
@ -43,9 +38,6 @@ class Painter {
this.mapInstanceLevel[type] = level;
this.parentLevel.add(level);
});
// 设置默认显示图级
this.setLayerVisible('02');
}
/**
@ -193,21 +185,6 @@ class Painter {
}
}
/**
* 设置逻辑和物理图层
* @param {*} layer
*/
setLayerVisible(layer) {
zrUtil.each(Object.values(deviceType), type => {
const level = this.mapInstanceLevel[type];
if (this.layerBranch[layer](type)) {
level.show();
} else {
level.hide();
}
}, this);
}
/**
* 设置图层可见
* @param {*} code

View File

@ -9,8 +9,8 @@ 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';
import router from '@/router';
import EHighlight from '../element/EHighlight';
/** 区段*/
export default class Section extends Group {
@ -24,8 +24,8 @@ export default class Section extends Group {
this.style = style;
this.create();
this.createMouseEvent();
this.createMouse(); // 框选鼠标移入移事件
this.setState(model);
this.checkIsDrawMap();
}
create() {
@ -823,31 +823,6 @@ 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();
@ -874,4 +849,18 @@ export default class Section extends Group {
return super.getBoundingRect();
}
}
drawSelected(selected) {
this.highlight && this.highlight.drawSelected(selected);
}
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this.section);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
}

View File

@ -12,6 +12,7 @@ import ESigName from './ESigName';
import EMouse from './EMouse';
import Group from 'zrender/src/container/Group';
import BoundingRect from 'zrender/src/core/BoundingRect';
import EHighlight from '../element/EHighlight';
class Signal extends Group {
constructor(model, style) {
@ -28,6 +29,7 @@ class Signal extends Group {
this.createMouseEvent();
this.transformRotation(this);
this.setState(model);
this.checkIsDrawMap();
}
create() {
@ -510,6 +512,19 @@ class Signal extends Group {
y: rect.y - offsetY
};
}
drawSelected(selected) {
this.highlight && this.highlight.drawSelected(selected);
}
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
}
export default Signal;

View File

@ -2,73 +2,88 @@
* 车站
*/
import Group from 'zrender/src/container/Group';
import ETextName from '../element/ETextName'; // 名称文字 (共有)
import ETextName from '../element/ETextName';
import EHighlight from '../element/EHighlight'; // 名称文字 (共有)
export default class Station extends Group {
constructor(model, style) {
super();
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.z = 40;
this.model = model;
this.style = style;
this.create();
this.setState(model);
}
constructor(model, style) {
super();
this._code = model.code;
this._type = model._type;
this.zlevel = model.zlevel;
this.z = 40;
this.model = model;
this.style = style;
this.create();
this.setState(model);
this.checkIsDrawMap();
}
create() {
const model = this.model;
const style = this.style;
create() {
const model = this.model;
const style = this.style;
if (model.visible) {
// 公里标名称是否显示
this.stationText = new ETextName({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
x: model.position.x,
y: model.position.y,
fontWeight: model.fontWeight,
fontSize: model.nameFont || 18,
fontFamily: style.fontFamily,
text: model.name,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.nameFontColor
});
this.add(this.stationText);
const path = window.location.href;
if (style.Station.kmPostShow || path.includes('/map/draw')) {
// 公里标是否显示
let direction = 1;
if (this.style.Station.kilometerPosition == 'up') {
direction = -1;
}
this.mileageText = new ETextName({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
x: model.position.x,
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction),
fontWeight: model.fontWeight,
fontSize: model.kmPostFont || 18,
fontFamily: style.fontFamily,
text: model.kmPost,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.kmPostFontColor
});
this.add(this.mileageText);
}
}
}
if (model.visible) {
// 公里标名称是否显示
this.stationText = new ETextName({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
x: model.position.x,
y: model.position.y,
fontWeight: model.fontWeight,
fontSize: model.nameFont || 18,
fontFamily: style.fontFamily,
text: model.name,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.nameFontColor
});
this.add(this.stationText);
const path = window.location.href;
if (style.Station.kmPostShow || path.includes('/map/draw')) {
// 公里标是否显示
let direction = 1;
if (this.style.Station.kilometerPosition == 'up') {
direction = -1;
}
this.mileageText = new ETextName({
zlevel: this.zlevel,
z: this.z,
position: [0, 0],
x: model.position.x,
y: model.position.y + ((parseInt(model.nameFont) + 2) * direction),
fontWeight: model.fontWeight,
fontSize: model.kmPostFont || 18,
fontFamily: style.fontFamily,
text: model.kmPost,
textAlign: 'middle',
textVerticalAlign: 'top',
textFill: model.kmPostFontColor
});
this.add(this.mileageText);
}
}
}
// eslint-disable-next-line no-unused-vars
setState(model) {
}
// eslint-disable-next-line no-unused-vars
setState(model) {
}
getShapeTipPoint() {
return null;
}
getShapeTipPoint() {
return null;
}
drawSelected(selected) {
this.highlight && this.highlight.drawSelected(selected);
}
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
}

View File

@ -9,6 +9,7 @@ import ESafeStand from './ESafeStand';
import ESafeEmergent from './ESafeEmergent';
import EMouse from './EMouse';
import EJump from './EJump';
import EHighlight from '../element/EHighlight';
class StationStand extends Group {
constructor(model, style) {
@ -24,6 +25,7 @@ class StationStand extends Group {
this.createMouseEvent();
this.setVisible(model.visible);
this.setState(model);
this.checkIsDrawMap();
}
create() {
const model = this.model;
@ -413,5 +415,19 @@ class StationStand extends Group {
}
return null;
}
drawSelected(selected) {
this.highlight && this.highlight.drawSelected(selected);
}
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
}
export default StationStand;

View File

@ -10,6 +10,7 @@ import ESwLocal from './ESwLocal.js';
import ESwLnversion from './ESwLnversion';
import ELockRect from './ELockRect';
import EMouse from './EMouse';
import EHighlight from '../element/EHighlight';
export default class Switch extends Group {
constructor(model, style) {
@ -25,6 +26,7 @@ export default class Switch extends Group {
this.createLockRect(); // 创建单锁矩形框显示
this.createMouseEvent();
this.setState(model);
this.checkIsDrawMap();
}
createMouseEvent() {
@ -422,4 +424,18 @@ export default class Switch extends Group {
}
return null;
}
drawSelected(selected) {
this.highlight && this.highlight.drawSelected(selected);
}
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
}

View File

@ -0,0 +1,47 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
class EHighlight extends Group {
constructor(device) {
super();
this.device = device;
this.selected = false;
this.create();
}
create() {
if (this.device) {
const rect = this.device.getBoundingRect();
this.lineBorder = new Rect({
zlevel: this.device.zlevel,
z: this.device.z + 1,
shape: rect,
style: {
lineDash: [3, 3],
stroke: '#fff',
fill: 'rgba(204,255,255,0.5)'
}
});
this.add(this.lineBorder);
this.lineBorder.hide();
}
}
mouseover() {
this.lineBorder && this.lineBorder.show();
}
mouseout() {
!this.selected && this.lineBorder && this.lineBorder.hide();
}
drawSelected(selected) {
if (selected) {
this.lineBorder.show();
this.selected = true;
} else {
this.lineBorder.hide();
this.selected = false;
}
}
}
export default EHighlight;

View File

@ -84,110 +84,110 @@ function saveMapDeviceDefaultRelations(state) {
const map = state.map;
const deviceMap = Vue.prototype.$jlmap.mapDevice;
// 是否集中站
if (map.stationControlList && map.stationControlList.length) {
map.stationControlList.forEach(elem => {
const station = deviceMap[elem.stationCode];
if (station) {
station.centralized = true;
}
});
}
// if (map.stationControlList && map.stationControlList.length) {
// map.stationControlList.forEach(elem => {
// const station = deviceMap[elem.stationCode];
// if (station) {
// station.centralized = true;
// }
// });
// }
// 设置区段关联
if (map.sectionList && map.sectionList.length) {
map.sectionList.forEach(elem => {
if (elem.type !== '03') {
const station = deviceMap[elem.parentCode];
if (station) {
elem.stationCode = station.stationCode;
}
} else {
elem.parentCode = '';
}
// map.sectionList.forEach(elem => {
// if (elem.type !== '03') {
// const station = deviceMap[elem.parentCode];
// if (station) {
// elem.stationCode = station.stationCode;
// }
// } else {
// elem.parentCode = '';
// }
if (elem.type === '01') {
elem.nameShow == true;
}
});
// if (elem.type === '01') {
// elem.nameShow == true;
// }
// });
}
// 站台轨设置
if (map.stationStandList && map.stationStandList.length && map.sectionList && map.sectionList.length) {
map.stationStandList.forEach((stand) => {
const stopPoint = deviceMap[stand.stopPointCode];
if (stopPoint) {
map.sectionList.forEach(section => {
if (section.type === '01' &&
stopPoint.linkCode === section.linkCode &&
stopPoint.offset >= section.offsetLeft &&
stopPoint.offset <= section.offsetRight) {
section.isStandTrack = true;
if (!section.standTrackName) {
section.standTrackName = section.name.replace(section.name.slice(0, 2), 'ZT');
}
if (!section.standTrackNamePosition) {
section.standTrackNamePosition = { x: 0, y: 0 };
}
}
});
}
});
}
// if (map.stationStandList && map.stationStandList.length && map.sectionList && map.sectionList.length) {
// map.stationStandList.forEach((stand) => {
// const stopPoint = deviceMap[stand.stopPointCode];
// if (stopPoint) {
// map.sectionList.forEach(section => {
// if (section.type === '01' &&
// stopPoint.linkCode === section.linkCode &&
// stopPoint.offset >= section.offsetLeft &&
// stopPoint.offset <= section.offsetRight) {
// section.isStandTrack = true;
// if (!section.standTrackName) {
// section.standTrackName = section.name.replace(section.name.slice(0, 2), 'ZT');
// }
// if (!section.standTrackNamePosition) {
// section.standTrackNamePosition = { x: 0, y: 0 };
// }
// }
// });
// }
// });
// }
// 折返轨设置
if (map.stopPointList && map.stopPointList.length && map.sectionList && map.sectionList.length) {
map.stopPointList.forEach(stopPoint => {
if (stopPoint.isTurningPoint) {
map.sectionList.forEach(section => {
if (section.type === '01' &&
stopPoint.linkCode === section.linkCode &&
stopPoint.offset >= section.offsetLeft &&
stopPoint.offset <= section.offsetRight) {
section.isReentryTrack = true;
if (!section.reentryTrackName) {
section.reentryTrackName = section.name.replace(section.name.slice(0, 2), 'ZF');
}
if (!section.reentryTrackNamePosition) {
section.reentryTrackNamePosition = { x: 0, y: 0 };
}
}
});
}
});
}
// if (map.stopPointList && map.stopPointList.length && map.sectionList && map.sectionList.length) {
// map.stopPointList.forEach(stopPoint => {
// if (stopPoint.isTurningPoint) {
// map.sectionList.forEach(section => {
// if (section.type === '01' &&
// stopPoint.linkCode === section.linkCode &&
// stopPoint.offset >= section.offsetLeft &&
// stopPoint.offset <= section.offsetRight) {
// section.isReentryTrack = true;
// if (!section.reentryTrackName) {
// section.reentryTrackName = section.name.replace(section.name.slice(0, 2), 'ZF');
// }
// if (!section.reentryTrackNamePosition) {
// section.reentryTrackNamePosition = { x: 0, y: 0 };
// }
// }
// });
// }
// });
// }
// 设置道岔区段
if (map.switchList && map.switchList.length && map.sectionList && map.sectionList.length) {
map.switchList.forEach(elem => {
const sectiona = deviceMap[elem.sectionACode];
if (sectiona && sectiona.type !== '03') {
sectiona.nameShow = false;
sectiona.isSwitchSection = true;
sectiona.relSwitchCode = elem.code;
// sectiona.nameShow = false;
// sectiona.isSwitchSection = true;
// sectiona.relSwitchCode = elem.code;
}
const sectionb = deviceMap[elem.sectionBCode];
if (sectionb && sectionb.type !== '03') {
sectionb.nameShow = false;
sectionb.isSwitchSection = true;
sectionb.relSwitchCode = elem.code;
// sectionb.nameShow = false;
// sectionb.isSwitchSection = true;
// sectionb.relSwitchCode = elem.code;
}
const sectionc = deviceMap[elem.sectionCCode];
if (sectionc && sectionc.type !== '03') {
sectionc.nameShow = false;
sectionc.isSwitchSection = true;
sectionc.relSwitchCode = elem.code;
}
let sectionp = '';
if (sectiona && sectiona.parentCode) {
sectionp = deviceMap[sectiona.parentCode];
} else if (sectionb && sectionb.parentCode) {
sectionp = deviceMap[sectionb.parentCode];
} else if (sectionc && sectionc.parentCode) {
sectionp = deviceMap[sectionc.parentCode];
}
if (sectionp) {
sectionp.relSwitchCode = elem.code;
// sectionc.nameShow = false;
// sectionc.isSwitchSection = true;
// sectionc.relSwitchCode = elem.code;
}
// let sectionp = '';
// if (sectiona && sectiona.parentCode) {
// sectionp = deviceMap[sectiona.parentCode];
// } else if (sectionb && sectionb.parentCode) {
// sectionp = deviceMap[sectionb.parentCode];
// } else if (sectionc && sectionc.parentCode) {
// sectionp = deviceMap[sectionc.parentCode];
// }
// if (sectionp) {
// sectionp.relSwitchCode = elem.code;
// }
});
}

View File

@ -137,7 +137,7 @@ export default {
//
const path = window.location.href;
let mouseWheelFlag = false;
if (path.includes('design/userlist/map/draw')) {
if (path.includes('design/userlist/map/draw') || path.includes('design/usermap/map/draw')) {
mouseWheelFlag = true;
}
@ -183,10 +183,6 @@ export default {
}, 100);
});
},
//
setLayerVisible(layer) {
this.$jlmap && this.$jlmap.setLayerVisible(layer);
},
//
setLevelVisible(levels) {
this.$jlmap && this.$jlmap.setLevelVisible(levels);

View File

@ -2,31 +2,13 @@
<el-dialog v-dialogDrag :title="$t('map.layerDisplay')" :visible.sync="dialogTableVisible" class="view_box" width="460px" :before-close="doClose" :modal-append-to-body="false">
<el-row type="flex" justify="center" class="content_box">
<el-form label-width="80px" class="demo-ruleForm">
<el-form-item :label="$t('map.viewShows')">
<el-checkbox-group v-model="viewSelect" :min="1" @change="handleSelectView">
<el-checkbox :label="ViewMode.LOGIC">{{ $t('map.logicalView') }}</el-checkbox>
<el-checkbox :label="ViewMode.PHYSICAL">{{ $t('map.physicalView') }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item :label="$t('map.contentShows')">
<el-row v-if="ViewMode.LOGIC === viewSelect[0] && viewSelect.length == 1" class="logical-view" type="flex" justify="center" style="width: 100%;">
<el-checkbox-group v-model="logicalLevelsSelect" @change="handleSelectLogicalView">
<el-checkbox v-for="view in LogicalViewTypeList" :key="view.code" :label="view.code" size="mini">
{{ view.name }}</el-checkbox>
</el-checkbox-group>
</el-row>
<el-row v-if="ViewMode.PHYSICAL === viewSelect[0] && viewSelect.length == 1" class="physical-view" type="flex" justify="center" style="width: 100%;">
<el-row class="physical-view" type="flex" justify="center" style="width: 100%;">
<el-checkbox-group v-model="physicalLevelsSelect" @change="handleSelectPhysicalView">
<el-checkbox v-for="view in PhysicalViewTypeList" :key="view.code" :label="view.code">
{{ view.name }}</el-checkbox>
</el-checkbox-group>
</el-row>
<el-row v-if=" viewSelect.length == 2" class="physical-view" type="flex" justify="center" style="width: 100%;">
<el-checkbox-group v-model="hybridLevelsSelect" @change="handleSelectHybridView">
<el-checkbox v-for="view in HybridViewTypeList" :key="view.code" :label="view.code">
{{ view.name }}</el-checkbox>
</el-checkbox-group>
</el-row>
</el-form-item>
</el-form>
</el-row>
@ -51,22 +33,10 @@ export default {
{ code: 'Signal', name: this.$t('map.signal') },
{ code: 'Switch', name: this.$t('map.switch') }
],
HybridViewTypeList: [],
defaultLogicalSelect: [],
defaultPhysicalSelect: [],
defaultHybridSelect: [],
logicalLevelsSelect: [],
physicalLevelsSelect: [],
hybridLevelsSelect: [] //
// defaultPhysicalSelect: [], //
physicalLevelsSelect: [] // list
};
},
watch: {
'$store.state.map.mapDataLoadedCount': function (val) {
this.handleSelectView(this.viewSelect);
}
},
mounted() {
this.initPage();
},
@ -78,53 +48,17 @@ export default {
this.dialogTableVisible = false;
},
initPage() {
this.$Dictionary.logicalViewType().then(list => {
this.LogicalViewTypeList = list;
list.forEach(v => {
this.HybridViewTypeList.push(v);
this.hybridLevelsSelect.push(v.code);
this.defaultHybridSelect.push(v.code);
});
this.LogicalViewTypeList.forEach(elem => {
this.logicalLevelsSelect.push(elem.code);
this.defaultLogicalSelect.push(elem.code);
});
});
this.$Dictionary.physicalViewType().then(list => {
this.PhysicalViewTypeList = list;
list.forEach(v => {
this.HybridViewTypeList.push(v);
this.hybridLevelsSelect.push(v.code);
this.defaultHybridSelect.push(v.code);
});
this.PhysicalViewTypeList.forEach(elem => {
this.physicalLevelsSelect.push(elem.code);
this.defaultPhysicalSelect.push(elem.code);
// this.defaultPhysicalSelect.push(elem.code);
});
});
},
handleSelectView(value) {
if (value.length == 2) {
this.$emit('handleSelectView', '03');
this.hybridLevelsSelect = this.copyList(this.defaultHybridSelect);
} else {
this.$emit('handleSelectView', value);
if (this.viewSelect[0] == this.ViewMode.LOGIC) {
this.logicalLevelsSelect = this.copyList(this.defaultLogicalSelect);
} else {
this.physicalLevelsSelect = this.copyList(this.defaultPhysicalSelect);
}
}
},
handleSelectLogicalView(handle) {
this.$emit('handleSelectLogicalView', handle);
},
handleSelectPhysicalView(handle) {
this.$emit('handleSelectPhysicalView', handle);
},
handleSelectHybridView(handle) {
this.$emit('handleSelectHybridView', handle);
},
copyList(list) {
return JSON.parse(JSON.stringify(list));
}

View File

@ -76,6 +76,7 @@ export default {
viewDraft: 'draft',
autoSaveTask: null,
selected: null,
oldSelected: null,
mapInfo: { name: this.$t('map.pleaseSelectMap') },
timeDemon: null
};
@ -158,32 +159,17 @@ export default {
this.autoSaveTask = null;
}
},
handleSelectControlPage (model) {
handleSelectControlPage (model, oldModel) {
if (this.$refs.mapOperate) {
this.$refs.mapOperate.handleSelectControlPage(model);
this.$refs.mapOperate.handleSelectControlPage(model, oldModel);
this.$store.dispatch('menuOperation/setMapDrawSelectCount');
}
},
handleSelectView(handle) {
if (this.$refs.jlmapVisual) {
this.$refs.jlmapVisual.setLayerVisible(handle);
}
},
handleSelectLogicalView(handle) {
if (this.$refs.jlmapVisual) {
this.$refs.jlmapVisual.setLevelVisible(handle);
}
},
handleSelectPhysicalView(handle) {
if (this.$refs.jlmapVisual) {
this.$refs.jlmapVisual.setLevelVisible(handle);
}
},
handleSelectHybridView(handle) {
if (this.$refs.jlmapVisual) {
this.$refs.jlmapVisual.setLevelVisible(handle);
}
},
clickEvent(em) {
var device = this.getDeviceByEm(em);
this.onSelect(device);
@ -200,8 +186,11 @@ export default {
return device;
},
onSelect(device) {
if (this.selected) {
this.oldSelected = this.selected;
}
this.selected = device || null;
this.selected && this.handleSelectControlPage(device);
this.selected && this.handleSelectControlPage(device, this.oldSelected);
},
onContextmenu(em) {
this.point = {
@ -235,9 +224,8 @@ export default {
if (this.$refs.jlmapVisual && map && parseInt(this.$route.params.mapId)) {
if (this.verifySectionPoint(map)) {
this.mapSaveing = true;
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => {
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => { // 稿
saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(response => {
// saveNewMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(response => {
this.$message.success(this.$t('tip.saveSuccessfully'));
this.mapSaveing = false;
this.initAutoSaveTask();

View File

@ -66,7 +66,7 @@
@stationSectionCode="stationEnabledTab"
/>
</el-tab-pane>
<el-tab-pane :label="$t('map.zcZoneControl')" class="tab_pane_box" name="ZcControl">
<!-- <el-tab-pane :label="$t('map.zcZoneControl')" class="tab_pane_box" name="ZcControl">
<zc-control-draft
ref="ZcControl"
:selected="selected"
@ -105,7 +105,7 @@
@updateMapModel="updateMapModel"
@setCenter="setCenter"
/>
</el-tab-pane>
</el-tab-pane> -->
<el-tab-pane :label="$t('map.train')" class="tab_pane_box" name="Train">
<train-draft
ref="Train"
@ -146,14 +146,14 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane :label="$t('map.button')" class="tab_pane_box" name="ButtonControl">
<!-- <el-tab-pane :label="$t('map.button')" class="tab_pane_box" name="ButtonControl">
<button-draft
ref="ButtonControl"
:selected="selected"
@updateMapModel="updateMapModel"
@setCenter="setCenter"
/>
</el-tab-pane>
</el-tab-pane> -->
<el-tab-pane label="包围框" class="tab_pane_box" name="CheckBox">
<checkbox-draft
ref="CheckBox"
@ -175,17 +175,17 @@ import SignalDraft from './signal';
import StationDraft from './station';
import StationStandDraft from './stationstand';
import StationControlDraft from './stationcontrol';
import CounterDraft from './counter';
import DelayUnlockDraft from './delayunlock';
// import CounterDraft from './counter';
// import DelayUnlockDraft from './delayunlock';
import TrainDraft from './train/index';
import LineDraft from './line';
import TextDraft from './text';
import TrainWindowDraft from './trainwindow';
import ZcControlDraft from './zcControl';
import LimitControlDraft from './limitControl';
import LcControlDraft from './lcControl';
// import ZcControlDraft from './zcControl';
// import LimitControlDraft from './limitControl';
// import LcControlDraft from './lcControl';
import ImageControlDraft from './ImageControl';
import ButtonDraft from './buttonDraft';
// import ButtonDraft from './buttonDraft';
import CheckboxDraft from './checkboxDraft';
import { ViewMode } from '@/scripts/ConstDic';
@ -193,23 +193,23 @@ import { ViewMode } from '@/scripts/ConstDic';
export default {
name: 'MapOperate',
components: {
CounterDraft,
// CounterDraft,
SectionDraft,
SwitchDraft,
SignalDraft,
StationDraft,
StationStandDraft,
StationControlDraft,
DelayUnlockDraft,
// DelayUnlockDraft,
TrainWindowDraft,
TrainDraft,
LineDraft,
TextDraft,
ZcControlDraft,
LimitControlDraft,
LcControlDraft,
// ZcControlDraft,
// LimitControlDraft,
// LcControlDraft,
ImageControlDraft,
ButtonDraft,
// ButtonDraft,
CheckboxDraft
},
props: {
@ -280,7 +280,7 @@ export default {
});
});
},
handleSelectControlPage(device) {
handleSelectControlPage(device, oldDevice) {
const type = device._type;
if (this.stationType) {
this.enabledTab = 'Station';
@ -292,6 +292,12 @@ export default {
this.enabledTab = 'Section';
} else {
this.enabledTab = type;
if ( device && device.instance && typeof device.instance.drawSelected === 'function' ) {
device.instance.drawSelected(true);
}
if ( oldDevice && device.instance && typeof device.instance.drawSelected === 'function') {
oldDevice.instance.drawSelected(false);
}
}
},
stationEnabledTab(type) {

View File

@ -29,7 +29,7 @@
</el-radio-group>
</el-form-item>
<div v-if="createModel.type == '01'" class="coordinate">
<span class="title" style="width: 120px">起点:</span>
<span class="title" style="width: 120px">{{ this.$t('map.startingPoint') }}</span>
<div class="listWidth">
<el-form-item label="x" prop="startPoint.x" label-width="25px">
<el-input-number v-model="createModel.startPoint.x" />
@ -41,20 +41,10 @@
</el-form-item>
</div>
</div>
<div v-if="createModel.type == '01'" class="coordinate">
<span class="title" style="width: 120px">终点:</span>
<div class="listWidth">
<el-form-item label="x" prop="endPoint.x" label-width="25px">
<el-input-number v-model="createModel.endPoint.x" />
</el-form-item>
</div>
<div class="listWidth">
<el-form-item label="y" prop="endPoint.y" label-width="25px">
<el-input-number v-model="createModel.endPoint.y" />
</el-form-item>
</div>
</div>
<el-form-item v-if="createModel.type == '02'" label="左关联区段:" prop="leftSectionCode">
<el-form-item v-if="createModel.type == '01'" label="距离长度:" prop="length">
<el-input-number v-model="createModel.length" />
</el-form-item>
<el-form-item v-if="createModel.type == '02'" :label="$t('map.leftAssociatedSection')" prop="leftSectionCode">
<el-select v-model="createModel.leftSectionCode" filterable>
<el-option
v-for="item in PhysicalSectionList"
@ -69,7 +59,7 @@
@click="hover('getSectionStart')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item v-if="createModel.type == '02'" label="右关联区段:" prop="rightSectionCode">
<el-form-item v-if="createModel.type == '02'" :label="$t('map.rightAssociatedSection')" prop="rightSectionCode">
<el-select v-model="createModel.rightSectionCode" filterable>
<el-option
v-for="item in PhysicalSectionList"
@ -89,7 +79,7 @@
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="create">新建</el-button>
<el-button type="primary" size="small" @click="create">{{ this.$t('map.newConstruction') }}</el-button>
</el-button-group>
</div>
</el-tab-pane>
@ -330,7 +320,7 @@ export default {
createModel: {
type: '01',
startPoint: { x: 0, y: 0 },
endPoint: { x: 0, y: 0 },
length: 0,
leftSectionCode: '',
rightSectionCode: ''
},
@ -341,11 +331,8 @@ export default {
'startPoint.y': [
{ required: true, message: this.$t('rules.destinationCodePointY'), trigger: 'blur' }
],
'endPoint.x': [
{ required: true, message: this.$t('rules.destinationCodePointX'), trigger: 'blur' }
],
'endPoint.y': [
{ required: true, message: this.$t('rules.destinationCodePointY'), trigger: 'blur' }
'length': [
{ required: true, message: '请填写距离值', trigger: 'blur' }
]
},
typeOptions: [{
@ -518,9 +505,6 @@ export default {
relSwitchCode: [
{ required: true, message: this.$t('rules.sectionRelSwitchCode'), trigger: 'change' }
],
trainPosType: [
{ required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' }
],
leftSectionCode: [
{ validator: validateLeftSection, trigger: 'change' }
],
@ -825,7 +809,7 @@ export default {
this.editModel.points.splice(index, 1);
this.logicSectionNums.splice(index, 1);
},
//
//
create() {
const uid = getUID('Section');
const model = {
@ -871,7 +855,7 @@ export default {
if (this.createModel.type == '01') {
model.points = [
{ x: this.createModel.startPoint.x, y: this.createModel.startPoint.y },
{ x: this.createModel.endPoint.x, y: this.createModel.endPoint.y }
{ x: this.createModel.startPoint.x + this.createModel.length, y: this.createModel.startPoint.y }
];
} else if (this.createModel.type == '02') {
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);

View File

@ -527,6 +527,7 @@ export default {
});
}
});
console.log(sectiona);
sectiona.relSwitchCode = elem.code;
sectionb.relSwitchCode = elem.code;

View File

@ -27,7 +27,7 @@
<el-table-column :label="this.$t('global.operate')" width="180">
<template slot-scope="scope">
<el-button type="text" size="small" @click="deleteForm(scope.$index, scope.row)">{{ $t('global.delete') }}</el-button>
<el-button type="text" size="small" @click="editForm(scope.$index, scope.row)">编辑</el-button>
<el-button v-if="addModel.type == '01'" type="text" size="small" @click="editForm(scope.$index, scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
@ -228,7 +228,7 @@ export default {
this.permissionPackageId = res.data.permissionId;
this.permissionGoddsId = res.data.id;
this.addModel.name = res.data.name;
this.addModel.price = res.data.prdPrice || 0.01;
this.addModel.price = res.data.price || 0.01;
this.addModel.remarks = res.data.remarks;
this.addModel.tryUse = res.data.tryUse;
this.addModel.tryUseTime = res.data.tryUseTime;
@ -397,8 +397,6 @@ export default {
allPermissionNext(arr) { //
this.$refs.formData.validate((valid) => {
if (valid) { // 使
// this.addModel['relPermissions'] = arr; // ids
// this.addModel['id'] = this.permissionPackageId;
if (this.isGoods) { //
const param = {
id: this.permissionGoddsId,