This commit is contained in:
joylink_cuiweidong 2020-05-14 17:25:25 +08:00
commit 3968331bbe
9 changed files with 189 additions and 115 deletions

View File

@ -413,7 +413,6 @@ class SkinCode extends defaultStyle {
block: false // 封锁显示
}
};
this[deviceType.Line] = {
lineColor: '#FFFFFF' // 线条颜色
};

View File

@ -165,6 +165,7 @@ class SkinCode extends defaultStyle {
},
lamp: {
bgShow: false, // 是否被选中
logicColor: true, // cbtc通信是否影响灯颜色
guidName: 'singleRY', // 默认引导类型
borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度

View File

@ -314,39 +314,85 @@ class Signal extends Group {
}
// 关闭
close() {
if (this.count == 2) { // 双灯
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
} else if (this.count == 1) { // 单灯
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
close(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
// 逻辑点灯影响灯颜色仅西安二且暂无双灯
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor});
setTimeout(()=> {
this.insideTriangle.setStyle({fill: '#000'});
}, 500);
setTimeout(()=> {
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor});
}, 1000);
}
} else {
if (this.count == 2) { // 双灯
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
} else if (this.count == 1) { // 单灯
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
}
}
}
/* 正向开放*/
openPositive() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
openPositive(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
// 逻辑点灯影响灯颜色仅西安二且暂无双灯
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor});
setTimeout(()=> {
this.insideTriangle.setStyle({fill: '#000'});
}, 500);
setTimeout(()=> {
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor});
}, 1000);
}
} else {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
}
}
/* 侧向开放 */
openLateral() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
openLateral(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.yellowColor});
setTimeout(()=> {
this.insideTriangle.setStyle({fill: '#000'});
}, 1000);
setTimeout(()=> {
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.yellowColor});
}, 2000);
}
} else {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
}
}
@ -529,9 +575,9 @@ class Signal extends Group {
model.blockade && this.block();
/** 设置灯的颜色 */
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
/** 进路交人工控或自动控 */
!model.atsControl && this.setArtificialRouteClose();
// 联锁自动进路通过

View File

@ -220,8 +220,8 @@ export default {
}
},
typeChange(type) { //
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.addModel.automaticRouteCode = '';
this.addModel.cycleCode = '';
this.addModel.concentrateStationList = '';

View File

@ -263,8 +263,8 @@ export default {
},
methods: {
typeChange(type) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.addModel.type = type;
this.editModel.type = type;
},
@ -288,6 +288,7 @@ export default {
this.returnModeGroupList = [];
this.controlSwitchList = [];
this.AxleList = [];
this.SwitchFaultList = [];
indicatorLightList.forEach(item => {
switch (item._type) {
case 'AtsControl':
@ -341,6 +342,9 @@ export default {
case 'Axle':
this.AxleList.push(item);
break;
case 'SwitchFault':
this.SwitchFaultList.push(item);
break;
}
});
},
@ -397,6 +401,9 @@ export default {
case 'Axle':
this.selectLists = this.AxleList;
break;
case 'SwitchFault':
this.selectLists = this.SwitchFaultList;
break;
default :
this.selectLists = this.intersiteControlList;
break;
@ -414,8 +421,8 @@ export default {
this.addModel.switchCode = selected.code;
}
} else if (selected && this.controlLampTypeList.includes(selected._type)) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;

View File

@ -1005,26 +1005,15 @@ export default {
edit() {
this.$refs['dataform'].validate(valid => {
if (valid) {
if (
this.editModel.type === '03' &&
this.editModel.leftSectionCode &&
this.editModel.rightSectionCode
) {
if (this.editModel.type === '03' && this.editModel.leftSectionCode && this.editModel.rightSectionCode) {
this.$messageBox('道岔区段应仅有一侧关联区段!');
return;
}
let models = [];
const model = deepAssign(this.editModel, {
_type: 'Section'
}); // model
if (
model.lengthFact > 5 &&
(model.transferTrack ||
model.reentryTrack ||
model.standTrack)
) {
model.leftStopPointOffset = 5;
model.rightStopPointOffset = model.lengthFact - 5;
const model = deepAssign(this.editModel, { _type: 'Section' }); // model
if (model.lengthFact > 5 && (model.transferTrack || model.reentryTrack || model.standTrack)) {
model.leftStopPointOffset = model.leftStopPointOffset || 5;
model.rightStopPointOffset = model.rightStopPointOffset || model.lengthFact - 5;
}
const changeSectionList = this.handleOtherSectionChange(model);
models = [model, ...changeSectionList];
@ -1091,9 +1080,8 @@ export default {
lengthFact += model.lengthFact;
copySection.lengthFact = lengthFact.toFixed(3); //
if (copySection.lengthFact > 5) {
copySection.leftStopPointOffset = 5;
copySection.rightStopPointOffset =
copySection.lengthFact - 5;
copySection.leftStopPointOffset = copySection.leftStopPointOffset || 5;
copySection.rightStopPointOffset = copySection.rightStopPointOffset || copySection.lengthFact - 5;
}
updataFlag = true;
}
@ -1203,6 +1191,7 @@ export default {
);
models = [...models, ...deleteObjAssociatedSection];
_that.$emit('updateMapModel', models);
this.clear();
_that.deviceSelect();
})
.catch(error => {

View File

@ -201,7 +201,8 @@ export default {
guideShow: false,
stationCode: this.addModel.stationCode,
callOn: true,
turnBack: false
turnBack: false,
ctc: true
};
this.sectionList.forEach(elem => {

View File

@ -17,61 +17,78 @@
<create-signal ref="createSignal" :field="field" @signalSectionCode="signalSectionCode" @updateMapModel="updateMapModel" />
</el-tab-pane>
<el-tab-pane class="view-control" label="批量操作" name="three" :lazy="lazy">
<el-form ref="mark" label-width="130px" :model="addModel" size="mini">
<el-form-item label="左右偏移值" prop="number">
<el-input v-model="addModel.number" style="width: 178px;" />
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="editAll">构建信号机偏移量</el-button>
<el-button type="" style="margin: 0;" size="small" @click="questionList = []">{{ $t('map.clearHint') }}</el-button>
</div>
<hr style="width: 100%">
<el-form ref="signalType" label-width="130px" :model="typeModel" size="mini" style="margin-top: 40px">
<el-form-item label="信号机类型:" prop="type">
<el-select v-model="typeModel.type" placeholder="请选择">
<el-option
v-for="item in signalTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setAllSignalType">设置全部信号机类型</el-button>
</div>
<hr style="width: 100%">
<el-form ref="signalCiStation" label-width="130px" :model="ciModel" size="mini" style="margin-top: 40px;">
<el-form-item label="信号机范围:">
<el-select v-model="ciModel.stationList" multiple placeholder="请选择">
<el-option
v-for="item in centralizedStationList"
:key="item.code"
:label="item.name+'下信号机'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="归属连锁站:">
<el-select v-model="ciModel.ciStation" placeholder="请选择">
<el-option
v-for="item in ciStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setCiStationSignal">设置归属联锁站</el-button>
</div>
<hr style="width: 100%">
<div class="flex_box" style="margin-top: 20px">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setSignalCallOn">批量设置引导信号</el-button>
</div>
<el-collapse v-model="collapseActive" accordion style="margin-left: 20px">
<el-collapse-item title="构建信号机偏移量" name="1">
<el-form ref="mark" label-width="130px" :model="addModel" size="mini">
<el-form-item label="左右偏移值" prop="number">
<el-input v-model="addModel.number" style="width: 178px;" />
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="editAll">设置</el-button>
<el-button type="" style="margin: 0;" size="small" @click="questionList = []">{{ $t('map.clearHint') }}</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置信号机类型" name="2">
<el-form ref="signalType" label-width="130px" :model="typeModel" size="mini" style="margin-top: 40px">
<el-form-item label="信号机类型:" prop="type">
<el-select v-model="typeModel.type" placeholder="请选择">
<el-option
v-for="item in signalTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setAllSignalType">设置</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置信号机归属联锁站" name="3">
<el-form ref="signalCiStation" label-width="130px" :model="ciModel" size="mini" style="margin-top: 40px;">
<el-form-item label="信号机范围:">
<el-select v-model="ciModel.stationList" multiple placeholder="请选择">
<el-option
v-for="item in centralizedStationList"
:key="item.code"
:label="item.name+'下信号机'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="归属连锁站:">
<el-select v-model="ciModel.ciStation" placeholder="请选择">
<el-option
v-for="item in ciStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setCiStationSignal">设置</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置引导信号" name="4">
<div class="flex_box" style="margin-top: 20px">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setSignalCallOn">设置</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置灭灯显示(CTC级)" name="5">
<el-form ref="ctcForm" label-width="160px" :model="ctcModel" size="mini">
<el-form-item label="是否灭灯显示(CTC级):" prop="number">
<el-checkbox v-model="ctcModel.ctc" />
</el-form-item>
</el-form>
<div class="flex_box">
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setCtcShow">设置</el-button>
</div>
</el-collapse-item>
</el-collapse>
<div style="height: calc(100% - 90px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-card v-if="questionList.length" class="box-card">
@ -106,6 +123,7 @@ export default {
data() {
return {
activeName: 'first',
collapseActive: '',
lazy: true,
SignalDirectionList: [
{ code: false, name: '向左' },
@ -153,7 +171,8 @@ export default {
guidePosition: { x: 0, y: 0 },
interlockStationCode: '',
callOn: true,
turnBack: false
turnBack: false,
ctc: true //
},
addModel: {
number: 2
@ -164,6 +183,9 @@ export default {
ciModel: {
stationList: [],
ciStation: []
},
ctcModel: {
ctc: true
}
};
},
@ -245,7 +267,8 @@ export default {
{ prop: 'guidePosition.y', firstLevel: 'guidePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'callOn', label: '是否引导信号:', type: 'checkbox'},
{ prop: 'turnBack', label: '是否折返进路始端:', type: 'checkbox', isHidden: this.editModel.virtual}
{ prop: 'turnBack', label: '是否折返进路始端:', type: 'checkbox', isHidden: this.editModel.virtual},
{ prop: 'ctc', label: '是否灭灯显示(CTC级)', type: 'checkbox'}
]
},
map: {
@ -421,10 +444,8 @@ export default {
},
virtualChange(val) {
if (val) {
this.editModel.callOn = false;
this.editModel.turnBack = false;
} else {
this.editModel.callOn = true;
this.editModel.turnBack = false;
}
},
@ -462,6 +483,16 @@ export default {
this.$emit('updateMapModel', models);
this.$message.success('数据构建成功!');
},
setCtcShow() {
const models = [];
this.signalList.forEach(item => {
const signalModel = deepAssign({}, item); //
signalModel.ctc = this.ctcModel.ctc;
models.push(signalModel);
});
this.$emit('updateMapModel', models);
this.$message.success('数据构建成功!');
},
//
findSection(signal) {
// 01 02

View File

@ -139,9 +139,9 @@ export default {
this.$message.success(this.$t('publish.deleteSuccess'));
this.reloadTable();
localStore.remove('mapId');
}).catch(() => {
}).catch((error) => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
this.$messageBox(this.$t('error.deleteFailed') + ':' + error.message);
});
}).catch(() => { });
},