Merge remote-tracking branch 'origin/test'

This commit is contained in:
program-walker 2020-06-11 17:56:00 +08:00
commit 3d3bca02a8
2 changed files with 45 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<template>
<div style="height:100%">
<div style="height: calc(100% - 46px);">
<div style="height: 100%;">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="showDelimiter" label-width="180px" size="mini">
<el-form-item label="逻辑区段数量">
@ -9,17 +9,18 @@
<el-form-item label="是否显示分隔符">
<el-checkbox v-model="isDelimiter" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="editSectionNum">{{ $t('map.updateObj') }}</el-button>
</el-form-item>
<el-form-item label="区段名称偏移Y坐标">
<el-input-number v-model="distanceY" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="editSectionDistance">{{ $t('map.updateObj') }}</el-button>
</el-form-item>
</el-form>
</el-scrollbar>
</div>
<div class="button_box">
<el-button-group class="map-draft-group">
<el-button type="primary" size="small" @click="editSectionNum">{{ $t('map.updateObj') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
@ -74,6 +75,9 @@ export default {
this.editModel.logicSectionCodeList.forEach(logicCode => {
const section = this.$store.getters['map/getDeviceByCode'](logicCode);
models.push(deepAssign(section, {_dispose: true}));
const trainWindowModel = this.$store.getters['map/getDeviceByCode'](section.trainWindowCode);
models.push(deepAssign(trainWindowModel, {_dispose: true}));
});
if (this.logicNum === 0) {
logicSectionCodeList = [];
@ -209,6 +213,16 @@ export default {
//
computedLogicSectionNumList(logicSectionCodeList) {
this.logicNum = logicSectionCodeList ? logicSectionCodeList.length : 0;
},
//
editSectionDistance() {
const models = [];
this.editModel.logicSectionCodeList.forEach(logicCode => {
const logicSection = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicCode));
logicSection.namePosition = { x: 0, y: this.distanceY };
models.push(logicSection);
});
this.$emit('updateMapModel', models, 'four');
}
}
};

View File

@ -88,6 +88,18 @@
<el-button type="primary" style="margin-right: 10px;" size="small" @click="setCtcShow">设置</el-button>
</div>
</el-collapse-item>
<el-collapse-item title="设置灯位类型">
<el-form ref="ctcForm" label-width="160px" :model="lampPositionModel" size="mini">
<el-form-item label="灯位类型:" prop="lampPositionType">
<el-select v-model="lampPositionModel.lampPositionType">
<el-option v-for="item in SignalLampPositionTypeList" :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="setLampPosition">设置</el-button>
</div>
</el-collapse-item>
</el-collapse>
<div style="height: calc(100% - 90px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
@ -195,6 +207,9 @@ export default {
guideModel: {
scope: 'All',
callOn: true
},
lampPositionModel: {
lampPositionType: ''
}
};
},
@ -491,6 +506,16 @@ export default {
this.$emit('updateMapModel', models);
this.$message.success('数据构建成功!');
},
setLampPosition() {
const models = [];
this.signalList.forEach(item => {
const signalModel = deepAssign({}, item); //
signalModel.lampPositionType = this.lampPositionModel.lampPositionType;
models.push(signalModel);
});
this.$emit('updateMapModel', models);
this.$message.success('数据构建成功!');
},
//
findSection(signal) {
// 01 02