This commit is contained in:
ival 2021-03-02 18:22:06 +08:00
commit d84f4ba836
7 changed files with 151 additions and 194 deletions

View File

@ -108,6 +108,10 @@ class SkinCode extends defaultStyle {
width: 2,
defaultColor: '#03FFF8'
},
runLineShow:{
lineWidth: 6,
lineStroke:'#F37117'
},
routeArrow: {
radius: 5,
lineWidth: 3,

View File

@ -268,6 +268,28 @@ export default class ELines extends Group {
this.bottomWithSection.hide();
}
if (style.Section.runLineShow && !isCurve) {
// 运行线
const points = [];
for (let i = 0; i < modelPoints.length; i++) {
points.push([modelPoints[i].x, modelPoints[i].y]);
}
this.runLine = new Polyline({
zlevel: this.zlevel,
progressive: model.progressive,
z: Z + 2,
shape: {
points: points
},
style: {
lineWidth: style.Section.runLineShow.lineWidth,
stroke: style.Section.runLineShow.lineStroke
}
});
this.add(this.runLine);
this.runLine.hide();
}
if (style.Section.routeArrow && !isCurve) {
const cPointLeft = {x: 0, y:0};
const cPointRight = {x: 0, y:0};
@ -402,6 +424,14 @@ export default class ELines extends Group {
this.section && this.section.attr('z', lev);
}
setRunLineDefault() {
this.runLine && this.runLine.hide();
}
runLineShow() {
this.runLine && this.runLine.show();
}
hide() {
this.eachChild((child) => {
child.hide();

View File

@ -23,8 +23,8 @@ export default class Section extends Group {
this.zlevel = model.zlevel;
this.z = 5 + parseInt(model.layer || 0);
this.model = model;
this.style = style;
this.mapDevice = mapDevice;
this.style = style;
this.mapDevice = mapDevice;
this.selected = false; // 绘图选中状态
this.selectedType = ''; // 绘图批量选中状态
this.isShowShape = true;
@ -100,6 +100,7 @@ export default class Section extends Group {
}
this.line.setCrossSpeedUpperLimit('');
this.line.setCrossDefault();
// this.line.setRunLineDefault();
}
this.name && this.name.recover();
this.speedLimit && this.speedLimit.hide();
@ -154,9 +155,9 @@ export default class Section extends Group {
/** 非通信车占用状态 03*/
unCommunicationOccupied() {
if (this.style.Section.preAxleIgnoreFault && this.model.preReset) {
return ;
}
if (this.style.Section.preAxleIgnoreFault && this.model.preReset) {
return;
}
if (this.line) {
this.line.setStyle({
@ -174,9 +175,9 @@ export default class Section extends Group {
}
/** ARB故障 */
invalid() {
if (this.style.Section.preAxleIgnoreFault && this.model.preReset) {
return ;
}
if (this.style.Section.preAxleIgnoreFault && this.model.preReset) {
return;
}
this.line && this.line.setStyle({
stroke: this.style.Section.line.invalidColor,
@ -253,6 +254,13 @@ export default class Section extends Group {
}
}
showRunLine() {
this.line && this.line.runLineShow();
}
setRunLineDefault() {
this.line && this.line.setRunLineDefault();
}
/** 保护区段锁闭 09*/
protectiveLock(lockRight) {
if (this.line) {
@ -300,7 +308,7 @@ export default class Section extends Group {
if (this.style.Section.sectionMiddle && this.style.Section.sectionMiddle.preResetColor && !blockade) { // 南京二号线
this.sectionMiddle.setStyle({stroke: this.style.Section.sectionMiddle.preResetColor});
this.sectionMiddle.show();
}
}
}
// 延时解锁
delayUnlock() {
@ -363,51 +371,53 @@ export default class Section extends Group {
/** 设置状态*/
setState(model, flag = false) {
if (!this.isShowShape) return;
this.recover();
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
// 先初始化为灰色
this.setAshShow()
model.preGreen && this.line.setStyle({stroke: '#00FF00'});
model.preBlue && this.line.setStyle({stroke: '#4A76B7'});
} else {
this.handleSwitchSection(model, flag);
// 顺序代表优先级
/** 道岔保护区段锁闭 */
model.overlapLock && this.protectiveLock(model.lockRight);
/** 空闲锁闭或者叫进路锁闭 */
model.routeLock && this.routeLock(model.lockRight);
/** 计轴故障 */
model.invalid && this.invalid();
/** 轨道封锁 */
model.blockade && this.block(model.routeLock);
/** 非通信车占用状态 */
model.nctOccupied && this.unCommunicationOccupied();
/** 通信车占用状态 */
model.ctOccupied && this.communicationOccupied();
// 计轴预复位
model.preReset && this.preReset(model.blockade);
/** 区段切除*/
model.cutOff && this.sectionCutOff();
/** 是否限速*/
model.speedUpLimit > 0 && this.setSpeedUpperLimit(model.speedUpLimit);
// 区段计轴预复位状态 (未处理)
// 区段延时解锁
model.delayUnlock && this.delayUnlock();
// 区段故障锁闭 之前是fault 暂时设置为faultLock
model.faultLock && this.faultLock();
// 设置灰显
model.noStatus && this.setAshShow();
/** 道岔区段更新岔心颜色 */
if (model.type === '03' && model.switch) {
const sectionSwitch = this.mapDevice[model.switch.code];
if (sectionSwitch && sectionSwitch.sectionACode === model.code) {
sectionSwitch.instance && sectionSwitch.instance.setState(sectionSwitch);
sectionSwitch.instance && sectionSwitch.instance.setLimitState(model.speedUpLimit > 0, model.speedUpLimit);
}
}
}
// 只响应前端自定义类型的状态变化
if (model._free) {
// 先初始化为灰色
this.setAshShow();
model.preGreen && this.line.setStyle({stroke: '#00FF00'});
model.preBlue && this.line.setStyle({stroke: '#4A76B7'});
} else {
this.handleSwitchSection(model, flag);
// 顺序代表优先级
/** 宁波三号线 运行线显示状态 (前端自定义状态)*/
// model.isRunLineShow && this.showRunLine();
/** 道岔保护区段锁闭 */
model.overlapLock && this.protectiveLock(model.lockRight);
/** 空闲锁闭或者叫进路锁闭 */
model.routeLock && this.routeLock(model.lockRight);
/** 计轴故障 */
model.invalid && this.invalid();
/** 轨道封锁 */
model.blockade && this.block(model.routeLock);
/** 非通信车占用状态 */
model.nctOccupied && this.unCommunicationOccupied();
/** 通信车占用状态 */
model.ctOccupied && this.communicationOccupied();
// 计轴预复位
model.preReset && this.preReset(model.blockade);
/** 区段切除*/
model.cutOff && this.sectionCutOff();
/** 是否限速*/
model.speedUpLimit > 0 && this.setSpeedUpperLimit(model.speedUpLimit);
// 区段计轴预复位状态 (未处理)
// 区段延时解锁
model.delayUnlock && this.delayUnlock();
// 区段故障锁闭 之前是fault 暂时设置为faultLock
model.faultLock && this.faultLock();
// 设置灰显
model.noStatus && this.setAshShow();
/** 道岔区段更新岔心颜色 */
if (model.type === '03' && model.switch) {
const sectionSwitch = this.mapDevice[model.switch.code];
if (sectionSwitch && sectionSwitch.sectionACode === model.code) {
sectionSwitch.instance && sectionSwitch.instance.setState(sectionSwitch);
sectionSwitch.instance && sectionSwitch.instance.setLimitState(model.speedUpLimit > 0, model.speedUpLimit);
}
}
}
}
/** 计算提示位置*/
@ -529,7 +539,7 @@ export default class Section extends Group {
}
}
getAnchorPoint() {
getAnchorPoint() {
const rect = this.getBoundingRect();
return {
x:rect.x,

View File

@ -245,7 +245,7 @@ export default {
display: flex;
flex-direction: column;
padding:0;
max-height: 200px;
// max-height: 200px;
overflow: auto;
position: fixed;
border-left: 1px #CACACA solid;

View File

@ -2572,65 +2572,6 @@ export default {
line-height: $height;
}
.nav {
display: block;
cursor: pointer;
color: #0000;
background: -webkit-linear-gradient(#FDFDFE, #DEE3F3);
background: -o-linear-gradient(#FDFDFE, #DEE3F3);
background: -moz-linear-gradient(#FDFDFE, #DEE3F3);
background: linear-gradient(#FDFDFE, #DEE3F3);
border: 1px solid #B6BCCC !important;
border-bottom: 2px solid #B6BCCC !important;
list-style: none;
}
.nav-li {
position: relative;
display: inline-block;
padding-left: $menuPadding;
padding-right: $menuPadding;
}
.nav-li:active {
background: #C9D0E1;
border-radius: 4px;
}
.nav-li-text {
font-size: 13px;
color: #000;
text-align: center;
text-decoration: none;
}
.nav-ul {
display: none;
position: absolute;
list-style: none;
border: 1px solid gray !important;
line-height: $menuItemHeight;
width: $menuItemWidth;
padding: 0px;
margin: 0px;
max-height: 550px;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #c3c3c3;
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: #f0f0f0;
}
}
.menu-ul {
display: none;
position: relative;
@ -2642,77 +2583,4 @@ export default {
line-height: $menuItemHeight;
width: $menuItemWidth + 20;
}
.active {
position: absolute;
display: block !important;
}
.menu-ul-text {
font-size: 14px;
color: #000;
letter-spacing: 0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li {
text-align: left;
background: #F0F0F0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li-block {
display: flex;
letter-spacing: 0;
height: $menuItemHeight;
line-height: $menuItemHeight;
}
.menu-li-text {
font-size: 14px;
color: #000;
width: $menuItemWidth;
}
.menu-li-text .status {
display: inline-block;
border-right: 1px inset #CACACA;
width: $width;
}
.menu-li-text .label {
display: inline-block;
}
.menu-separator {
text-align: left;
background: #F0F0F0;
height: 2px;
line-height: 2px;
}
.menu-separator .status {
display: inline-block;
border-right: 1px inset #CACACA;
width: $width;
height: 100%;
background: #EFECDE;
}
.menu-separator .separator {
display: inline-block;
background: #CACACA;
margin-left: 5px;
height: 2px;
width: $menuItemWidth - $width - 30px;
}
.menu-li-block:hover {
background: #C9DEF7;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
</style>

View File

@ -14,8 +14,8 @@
<el-col :span="13" :offset="1">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane label="运行线" name="first">
<el-table :data="stationStandList" height="380px">
<el-table-column prop="name" label="站台" />
<el-table ref="runLineTable" :data="runLineList" height="380px" :highlight-current-row="true" @current-change="handleChange">
<el-table-column prop="name" label="运行线" />
</el-table>
</el-tab-pane>
<el-tab-pane label="往返" name="second">
@ -78,6 +78,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
// import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
import { getSimulationDestinationList } from '@/api/jmap/mapdraft';
import { mapGetters } from 'vuex';
export default {
@ -88,6 +89,7 @@ export default {
data() {
return {
tableData: [],
runLineList:[],
activeName: 'first',
dialogShow: false,
loading: false,
@ -103,9 +105,9 @@ export default {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
selected() {
return this.$store.state.menuOperation.selected;
},
// selected() {
// return this.$store.state.menuOperation.selected;
// },
domIdClose() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
@ -126,12 +128,20 @@ export default {
}
}
},
mounted() {
getSimulationDestinationList(this.$route.query.group).then(res=>{
res.data.forEach(element => {
this.runLineList.push({name:element.code + '(' + element.description + ')', runPath:element.runPath});
});
}).catch(()=>{
});
},
methods: {
expandPath() {
console.log('展开进路预览');
},
doShow(operate, activeName) {
this.$store.dispatch('menuOperation/setSelected', {device: selected});
// this.$store.dispatch('menuOperation/setSelected', {device: selected});
this.activeName = activeName;
//
this.dialogShow = true;
@ -143,12 +153,38 @@ export default {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$refs.runLineTable.setCurrentRow();
// mouseCancelState(this.selected);
this.$store.dispatch('training/setRunPathSelected', []);
},
commit() {
},
handleClick() {
},
handleChange(row) {
if (row) {
const runPath = row.runPath;
if (runPath && runPath.length > 0) {
const oldRunPath = this.$store.state.training.runPathList;
this.setRunPath(oldRunPath, false);
this.setRunPath(runPath, true);
this.$store.dispatch('training/setRunPathSelected', runPath);
}
} else {
const runPath = this.$store.state.training.runPathList;
this.setRunPath(runPath, false);
}
},
setRunPath(runPath, isShow) {
runPath.forEach(sectionCode=>{
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
if (section && section.instance) {
if (isShow) { section.instance.showRunLine(); } else { section.instance.setRunLineDefault(); }
}
});
},
cancel() {
const operate = {

View File

@ -45,7 +45,8 @@ const training = {
triggerFaultCount: 0, // 触发故障计数器
triggerFaultDevice: '', // 触发故障目标设备
trainingStart: false, // 实训开始状态
notifySelected: null // 场景弹窗内容
notifySelected: null, // 场景弹窗内容
runPathList:[] // 运行线 (宁波三号线)
},
getters: {
@ -295,6 +296,10 @@ const training = {
},
setNotifySelected: (state, data) => {
state.notifySelected = data;
},
/** 运行线 (宁波三号线) */
setRunPathSelected: (state, runPathList) => {
state.runPathList = runPathList;
}
},
@ -650,6 +655,10 @@ const training = {
/** 触发故障计数器 */
setTriggerFaultCount: ({ commit }, device) => {
commit('setTriggerFaultCount', device);
},
/** 运行线 (宁波三号线) */
setRunPathSelected: ({ commit }, runPathList) => {
commit('setRunPathSelected', runPathList);
}
}
};