交路区段区别显示&故障状态组调整

This commit is contained in:
fan 2020-04-20 17:10:50 +08:00
parent 8fee613083
commit 7c55c19933
8 changed files with 177 additions and 82 deletions

View File

@ -134,5 +134,6 @@ export const drawSectionStyle = {
continueProtectSection: 'rgba(255,0,255,0.5)',
signalNearSectionCBTC: 'rgba(255, 0, 0, 0.5)',
signalNearSectionReserve: 'rgba(160, 32, 240, 0.5)',
signalNearSection: 'rgba(124, 252, 0, 0.5)'
signalNearSection: 'rgba(124, 252, 0, 0.5)',
routingSection: 'rgba(255, 20, 147, 0.9)'
};

View File

@ -560,20 +560,12 @@ class SkinCode extends defaultStyle {
text: 'PSD',
defaultColor: '#FFF'
},
mfa: {
text: 'MFA',
mf: {
text: 'MF',
defaultColor: '#FFF'
},
mfb: {
text: 'MFB',
defaultColor: '#FFF'
},
pfa: {
text: 'PFA',
defaultColor: '#FFF'
},
pfb: {
text: 'PFB',
pf: {
text: 'PF',
defaultColor: '#FFF'
}
};

View File

@ -26,66 +26,110 @@ export default class EDeviceStatus extends Group {
textVerticalAlign: model.style.textStyle.textVerticalAlign
}
});
this.mfa = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x + model.style.FaultStatusGroup.distance,
y: model.y,
fontWeight: model.style.textStyle.fontWeight,
fontSize: model.style.FaultStatusGroup.fontSize,
fontFamily: model.style.fontFamily,
text: model.style.FaultStatusGroup.mfa.text,
textFill: model.style.FaultStatusGroup.mfa.defaultColor,
textAlign: model.style.textStyle.textAlign,
textVerticalAlign: model.style.textStyle.textVerticalAlign
}
this.mfList = [];
for (let i = 0; i < model.mfNum; i++) {
const mf = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x + model.style.FaultStatusGroup.distance * (i + 1),
y: model.y,
fontWeight: model.style.textStyle.fontWeight,
fontSize: model.style.FaultStatusGroup.fontSize,
fontFamily: model.style.fontFamily,
text: model.style.FaultStatusGroup.mf.text + String.fromCharCode((65 + i)),
textFill: model.style.FaultStatusGroup.mf.defaultColor,
textAlign: model.style.textStyle.textAlign,
textVerticalAlign: model.style.textStyle.textVerticalAlign
}
});
this.mfList.push(mf);
}
this.pfList = [];
for (let i = 0; i < model.pfNum; i++) {
const pf = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x + model.style.FaultStatusGroup.distance * (this.mfList.length + i + 1),
y: model.y,
fontWeight: model.style.textStyle.fontWeight,
fontSize: model.style.FaultStatusGroup.fontSize,
fontFamily: model.style.fontFamily,
text: model.style.FaultStatusGroup.pf.text + String.fromCharCode((65 + i)),
textFill: model.style.FaultStatusGroup.pf.defaultColor,
textAlign: model.style.textStyle.textAlign,
textVerticalAlign: model.style.textStyle.textVerticalAlign
}
});
this.pfList.push(pf);
}
this.mfList.forEach(item => {
this.add(item);
});
this.mfb = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x + model.style.FaultStatusGroup.distance * 2,
y: model.y,
fontWeight: model.style.textStyle.fontWeight,
fontSize: model.style.FaultStatusGroup.fontSize,
fontFamily: model.style.fontFamily,
text: model.style.FaultStatusGroup.mfb.text,
textFill: model.style.FaultStatusGroup.mfb.defaultColor,
textAlign: model.style.textStyle.textAlign,
textVerticalAlign: model.style.textStyle.textVerticalAlign
}
});
this.pfa = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x + model.style.FaultStatusGroup.distance * 3,
y: model.y,
fontWeight: model.style.textStyle.fontWeight,
fontSize: model.style.FaultStatusGroup.fontSize,
fontFamily: model.style.fontFamily,
text: model.style.FaultStatusGroup.pfa.text,
textFill: model.style.FaultStatusGroup.pfa.defaultColor,
textAlign: model.style.textStyle.textAlign,
textVerticalAlign: model.style.textStyle.textVerticalAlign
}
});
this.pfb = new Text({
zlevel: this.zlevel,
z: this.z,
style: {
x: model.x + model.style.FaultStatusGroup.distance * 4,
y: model.y,
fontWeight: model.style.textStyle.fontWeight,
fontSize: model.style.FaultStatusGroup.fontSize,
fontFamily: model.style.fontFamily,
text: model.style.FaultStatusGroup.pfb.text,
textFill: model.style.FaultStatusGroup.pfb.defaultColor,
textAlign: model.style.textStyle.textAlign,
textVerticalAlign: model.style.textStyle.textVerticalAlign
}
this.pfList.forEach(item => {
this.add(item);
});
// this.mfa = new Text({
// zlevel: this.zlevel,
// z: this.z,
// style: {
// x: model.x + model.style.FaultStatusGroup.distance,
// y: model.y,
// fontWeight: model.style.textStyle.fontWeight,
// fontSize: model.style.FaultStatusGroup.fontSize,
// fontFamily: model.style.fontFamily,
// text: model.style.FaultStatusGroup.mfa.text,
// textFill: model.style.FaultStatusGroup.mfa.defaultColor,
// textAlign: model.style.textStyle.textAlign,
// textVerticalAlign: model.style.textStyle.textVerticalAlign
// }
// });
// this.mfb = new Text({
// zlevel: this.zlevel,
// z: this.z,
// style: {
// x: model.x + model.style.FaultStatusGroup.distance * 2,
// y: model.y,
// fontWeight: model.style.textStyle.fontWeight,
// fontSize: model.style.FaultStatusGroup.fontSize,
// fontFamily: model.style.fontFamily,
// text: model.style.FaultStatusGroup.mfb.text,
// textFill: model.style.FaultStatusGroup.mfb.defaultColor,
// textAlign: model.style.textStyle.textAlign,
// textVerticalAlign: model.style.textStyle.textVerticalAlign
// }
// });
// this.pfa = new Text({
// zlevel: this.zlevel,
// z: this.z,
// style: {
// x: model.x + model.style.FaultStatusGroup.distance * 3,
// y: model.y,
// fontWeight: model.style.textStyle.fontWeight,
// fontSize: model.style.FaultStatusGroup.fontSize,
// fontFamily: model.style.fontFamily,
// text: model.style.FaultStatusGroup.pfa.text,
// textFill: model.style.FaultStatusGroup.pfa.defaultColor,
// textAlign: model.style.textStyle.textAlign,
// textVerticalAlign: model.style.textStyle.textVerticalAlign
// }
// });
// this.pfb = new Text({
// zlevel: this.zlevel,
// z: this.z,
// style: {
// x: model.x + model.style.FaultStatusGroup.distance * 4,
// y: model.y,
// fontWeight: model.style.textStyle.fontWeight,
// fontSize: model.style.FaultStatusGroup.fontSize,
// fontFamily: model.style.fontFamily,
// text: model.style.FaultStatusGroup.pfb.text,
// textFill: model.style.FaultStatusGroup.pfb.defaultColor,
// textAlign: model.style.textStyle.textAlign,
// textVerticalAlign: model.style.textStyle.textVerticalAlign
// }
// });
this.add(this.psd);
this.add(this.mfa);
this.add(this.mfb);

View File

@ -93,6 +93,8 @@ export default class SaidLamp extends Group {
z: this.z,
x: model.position.x,
y: model.position.y,
mfNum: model.mfNum,
pfNum: model.pfNum,
style: this.style
});
this.add(this.control);

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛

View File

@ -22,7 +22,7 @@
<span style="text-align:right;vertical-align:middle;font-size:14px;color:#606266;font-weight: 700;">停站区段:</span>
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in sectionList"
v-for="item in filterSectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
@ -141,10 +141,12 @@ export default {
'sectionList',
'stationList'
]),
filtersectionList() {
return this.sectionList.filter(section=>{
return section.type == '01' || section.type == '03';
});
filterSectionList() {
if (this.sectionList) {
return this.sectionList.filter(elem => { return elem.standTrack || elem.reentryTrack || elem.transferTrack; });
} else {
return [];
}
}
},
watch: {
@ -181,7 +183,11 @@ export default {
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'parkStationCode'.toUpperCase()) {
this.addModel.stationCode = selected.code;
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'parkSection'.toUpperCase()) {
this.sectionCode = selected.code;
if (selected.standTrack || selected.reentryTrack || selected.transferTrack) {
this.sectionCode = selected.code;
} else {
this.$message.error('请选择可以停车的区段!');
}
}
}
},

View File

@ -254,6 +254,9 @@ export default {
} else {
return [];
}
},
newParkSectionCodeList() {
return JSON.stringify(this.addModel.parkSectionCodeList);
}
},
watch: {
@ -267,6 +270,18 @@ export default {
this.addModel = val;
this.editShow = true;
}
},
newParkSectionCodeList: {
handler: function(val, old) {
const obj = JSON.parse(val);
const objOld = JSON.parse(old);
if (objOld && objOld.length) {
this.changeSectionSelected(objOld);
}
if (obj && obj.length) {
this.changeSectionSelected(obj);
}
}
}
},
mounted() {
@ -377,6 +392,31 @@ export default {
this.sectionCode = '';
this.isSave = true;
}
},
changeSectionSelected(list) {
let type = '';
let flag = true;
list && list.forEach((item) => {
const section = this.$store.getters['map/getDeviceByCode'](item);
if (this.addModel.parkSectionCodeList.includes(item)) {
type = 'routingSection';
flag = true;
} else {
type = '';
flag = false;
}
this.setSectionSelectedType(section, flag, type);
});
},
setSectionSelectedType(section, flag, type) {
if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach( (logicSectionCode) => {
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : '');
});
} else {
section && section.instance.drawBatchSelected(flag, flag ? type : '');
}
}
}
};

View File

@ -114,7 +114,9 @@ export default {
position: {
x: 0,
y: 0
}
},
mfNum: 0,
pfNum: 0
},
addModel: {
code: '',
@ -124,7 +126,9 @@ export default {
position: {
x: 0,
y: 0
}
},
mfNum: 0,
pfNum: 0
},
rules: {
code: [
@ -168,6 +172,8 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] },
{ prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup' },
{ prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.editModel.type !== 'FaultStatusGroup'},
{ prop:'stationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList}
]
}
@ -185,7 +191,9 @@ export default {
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
] },
{ prop: 'mfNum', label: '报警指示故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup' },
{ prop: 'pfNum', label: '电源故障数量:', type: 'number', min: 0, isHidden: this.addModel.type !== 'FaultStatusGroup'}
]
};
return form;
@ -468,6 +476,8 @@ export default {
x: this.addModel.position.x,
y: this.addModel.position.y
},
mfNum: this.addModel.mfNum,
pfNum: this.addModel.pfNum,
stationCode: this.addModel.stationCode //
};
models.push(model);