调整绘图相关调整_(控制模式多个创建)
This commit is contained in:
parent
7d262fc7c9
commit
f00a560327
@ -18,7 +18,7 @@
|
|||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<el-form ref="make" :model="addModel" label-width="120px" size="mini" :rules="makeRules">
|
<el-form ref="make" :model="addModel" label-width="120px" size="mini" :rules="makeRules">
|
||||||
<el-form-item :label="$t('map.stationstandName')" prop="stationCode">
|
<el-form-item :label="$t('map.stationstandName')" prop="stationCode">
|
||||||
<el-select v-model="addModel.stationCode" filterable>
|
<el-select v-model="addModel.stationCode" filterable multiple style="width: 350px;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in stationList"
|
v-for="item in stationList"
|
||||||
:key="item.code"
|
:key="item.code"
|
||||||
@ -77,7 +77,7 @@ export default {
|
|||||||
// lskContent: ''
|
// lskContent: ''
|
||||||
},
|
},
|
||||||
addModel: {
|
addModel: {
|
||||||
stationCode: ''
|
stationCode: []
|
||||||
},
|
},
|
||||||
makeRules: {
|
makeRules: {
|
||||||
stationCode: [
|
stationCode: [
|
||||||
@ -190,27 +190,31 @@ export default {
|
|||||||
create() {
|
create() {
|
||||||
this.$refs['make'].validate((valid) => {
|
this.$refs['make'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.addModel.stationCode) {
|
if (this.addModel.stationCode.length) {
|
||||||
const uid = getUID('StationControl');
|
const models = [];
|
||||||
const model = {
|
this.addModel.stationCode.forEach(item => {
|
||||||
_type: 'StationControl',
|
const uid = getUID('StationControl');
|
||||||
code: uid
|
const model = {
|
||||||
// zokContent: '中控',
|
_type: 'StationControl',
|
||||||
// zbjkContent: '总报警',
|
code: uid
|
||||||
// zakContent: '站控',
|
// zokContent: '中控',
|
||||||
// jjzkContent: '紧急站控',
|
// zbjkContent: '总报警',
|
||||||
// zzkContent: '站中控按钮',
|
// zakContent: '站控',
|
||||||
// lskContent: '连锁控'
|
// jjzkContent: '紧急站控',
|
||||||
};
|
// zzkContent: '站中控按钮',
|
||||||
this.stationList.forEach(elem => {
|
// lskContent: '连锁控'
|
||||||
if (elem.code === this.addModel.stationCode) {
|
};
|
||||||
model.name = 'StationControl_' + elem.name.replace('Station_', '');
|
this.stationList.forEach(elem => {
|
||||||
model.position = { x: elem.position.x, y: elem.position.y };
|
if (elem.code === item) {
|
||||||
model.stationCode = elem.code;
|
model.name = 'StationControl_' + elem.name.replace('Station_', '');
|
||||||
}
|
model.position = { x: elem.position.x, y: elem.position.y + 30 };
|
||||||
|
model.stationCode = elem.code;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(model);
|
||||||
|
models.push(model);
|
||||||
});
|
});
|
||||||
|
this.$emit('updateMapModel', models);
|
||||||
this.$emit('updateMapModel', model);
|
|
||||||
} else {
|
} else {
|
||||||
this.$messageBox(this.$t('tip.selectedStationEmpty'));
|
this.$messageBox(this.$t('tip.selectedStationEmpty'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user