zc 代码调整
This commit is contained in:
parent
151eb83981
commit
6b7827bd91
@ -97,23 +97,23 @@ class MouseController extends Eventful {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mousemove(e) {
|
mousemove(e) {
|
||||||
if (this._dragging) {
|
if (this._dragging) {
|
||||||
const oldX = this._x;
|
const oldX = this._x;
|
||||||
const oldY = this._y;
|
const oldY = this._y;
|
||||||
|
|
||||||
const dx = e.offsetX - oldX;
|
const dx = e.offsetX - oldX;
|
||||||
const dy = e.offsetY - oldY;
|
const dy = e.offsetY - oldY;
|
||||||
|
|
||||||
this._x = e.offsetX;
|
this._x = e.offsetX;
|
||||||
this._y = e.offsetY;
|
this._y = e.offsetY;
|
||||||
|
|
||||||
if (e.which == 1) {
|
if (e.which == 1) {
|
||||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||||
} else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) {
|
} else if (e.which === 3 && this._zoomOnMouseWheel && this._previewOrMapDraw) {
|
||||||
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
|
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseup(e) {
|
mouseup(e) {
|
||||||
|
@ -109,7 +109,7 @@ export default {
|
|||||||
lineCode: elem.lineCode
|
lineCode: elem.lineCode
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '1',
|
id: '2',
|
||||||
name: '系统配置绘图',
|
name: '系统配置绘图',
|
||||||
type: 'mapSystem',
|
type: 'mapSystem',
|
||||||
mapId: elem.id,
|
mapId: elem.id,
|
||||||
|
@ -294,6 +294,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="checkFieldType(item,'checkBoxDevice')">
|
||||||
|
<div :key="item.prop" class="coordinate">
|
||||||
|
<span class="title">{{ item.label }}</span>
|
||||||
|
<div class="list-box">
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
:type="item.buttonShowType ? 'danger' : 'primary'"
|
||||||
|
@click="item.hover(item.buttonType)"
|
||||||
|
>激活选择</el-button>
|
||||||
|
</div>
|
||||||
|
<div v-for="(nor,indexIn) in formModel[item.prop]" :key="nor" class="list-content" @mouseenter="item.mouseenter(nor)" @mouseleave="item.mouseleave(nor)">
|
||||||
|
<div class="name">{{ item.getName(nor) }}</div>
|
||||||
|
<div class="close" @click="formModel[item.prop].splice(indexIn, 1);"><i class="el-icon-close" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</template>
|
</template>
|
||||||
|
@ -196,11 +196,19 @@ export default {
|
|||||||
} else if (controlLampTypeList.includes(type)) {
|
} else if (controlLampTypeList.includes(type)) {
|
||||||
this.enabledTab = 'ControlLamp';
|
this.enabledTab = 'ControlLamp';
|
||||||
} else {
|
} else {
|
||||||
this.enabledTab = type;
|
if (this.$refs['ZcControl'] && this.$refs['ZcControl'][0].field == 'checkZcSection') {
|
||||||
|
this.enabledTab = 'ZcControl';
|
||||||
|
} else {
|
||||||
|
this.enabledTab = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deviceSelect(type) {
|
deviceSelect(type) {
|
||||||
|
// if (this.$refs['ZcControl'].field != 'checkZcSection') {
|
||||||
this.selectDevice = type;
|
this.selectDevice = type;
|
||||||
|
// } else {
|
||||||
|
// this.selectDevice = 'ZcControl';
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
saveMapEvent() {
|
saveMapEvent() {
|
||||||
this.$emit('saveMapEvent');
|
this.$emit('saveMapEvent');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-tabs v-model="activeName" class="card" @tab-click="handleClick">
|
<el-tabs v-model="activeName" class="card">
|
||||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||||
<div class="view-control-content">
|
<div class="view-control-content">
|
||||||
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
|
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
|
||||||
@ -54,7 +54,7 @@ export default {
|
|||||||
code: '',
|
code: '',
|
||||||
name: '',
|
name: '',
|
||||||
// visible: '',
|
// visible: '',
|
||||||
concentrateStationList:[],
|
// concentrateStationList:[],
|
||||||
position: {
|
position: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0
|
y: 0
|
||||||
@ -64,12 +64,13 @@ export default {
|
|||||||
code: '',
|
code: '',
|
||||||
name: '',
|
name: '',
|
||||||
// visible: '',
|
// visible: '',
|
||||||
concentrateStationList:[],
|
// concentrateStationList:[],
|
||||||
position: {
|
position: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0
|
y: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
field:'',
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
|
||||||
@ -80,9 +81,9 @@ export default {
|
|||||||
// visible: [
|
// visible: [
|
||||||
// { required: true, message: this.$t('rules.visible'), trigger: 'change' }
|
// { required: true, message: this.$t('rules.visible'), trigger: 'change' }
|
||||||
// ],
|
// ],
|
||||||
concentrateStationList:[
|
// concentrateStationList:[
|
||||||
{ required: true, message: this.$t('rules.selectConcentrateStation'), trigger: 'change' }
|
// { required: true, message: this.$t('rules.selectConcentrateStation'), trigger: 'change' }
|
||||||
],
|
// ],
|
||||||
'position.x': [
|
'position.x': [
|
||||||
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -94,9 +95,11 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('map', [
|
...mapGetters('map', [
|
||||||
'zcList',
|
'zcList'
|
||||||
'stationList'
|
|
||||||
]),
|
]),
|
||||||
|
isButtonType() {
|
||||||
|
return this.field == 'checkZcSection';
|
||||||
|
},
|
||||||
form() {
|
form() {
|
||||||
const form = {
|
const form = {
|
||||||
labelWidth: '150px',
|
labelWidth: '150px',
|
||||||
@ -114,8 +117,8 @@ export default {
|
|||||||
{ prop: 'position', label: this.$t('map.stateSignalsPlotCoordinates'), type: 'coordinate', width: '140px', children: [
|
{ prop: 'position', label: this.$t('map.stateSignalsPlotCoordinates'), type: 'coordinate', width: '140px', children: [
|
||||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
{ 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: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||||
] },
|
] }
|
||||||
{ prop:'concentrateStationList', label:this.$t('map.concentrateStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.concertrateStation, deviceChange: this.changeConcentrateStation }
|
// { prop:'concentrateStationList', label:this.$t('map.concentrateStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.concertrateStation, deviceChange: this.changeConcentrateStation }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,7 +137,10 @@ export default {
|
|||||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
|
{ 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: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
|
||||||
] },
|
] },
|
||||||
{ prop:'concentrateStationList', label:this.$t('map.concentrateStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.concertrateStation, deviceChange: this.changeConcentrateStation }
|
|
||||||
|
{ prop:'sectionList', label:'关联区段: ', type: 'checkBoxDevice', getName:this.getName, mouseenter:this.mouseenter, mouseleave:this.mouseleave, buttonShowType:this.isButtonType, hover:this.hover, buttonType:'checkZcSection'}
|
||||||
|
//
|
||||||
|
// { prop:'concentrateStationList', label:this.$t('map.concentrateStationList'), type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.concertrateStation, deviceChange: this.changeConcentrateStation }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,51 +149,28 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
stationList() {
|
|
||||||
this.getConcertrateStation();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getConcertrateStation();
|
|
||||||
},
|
},
|
||||||
|
// mounted() {
|
||||||
|
// this.getConcertrateStation();
|
||||||
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
deviceChange(code) {
|
deviceChange(code) {
|
||||||
this.$emit('setCenter', code);
|
this.$emit('setCenter', code);
|
||||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||||
},
|
},
|
||||||
changeConcentrateStation() {},
|
|
||||||
handleClick() {
|
|
||||||
this.getConcertrateStation();
|
|
||||||
},
|
|
||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
|
// debugger;
|
||||||
|
// 待调整
|
||||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||||
this.$refs.make && this.$refs.make.resetFields();
|
this.$refs.make && this.$refs.make.resetFields();
|
||||||
if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) {
|
||||||
this.activeName = 'first';
|
this.activeName = 'first';
|
||||||
this.editModel = deepAssign(this.editModel, selected);
|
this.editModel = deepAssign(this.editModel, selected);
|
||||||
this.getConcertrateStation();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getConcertrateStation() {
|
|
||||||
// 被选中的集中站站数据
|
|
||||||
const beConcentrateStation = {};
|
|
||||||
this.zcList.forEach(data=>{
|
|
||||||
data.concentrateStationList.forEach(concentrate=>{
|
|
||||||
beConcentrateStation[concentrate] = data.code;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.concertrateStation = this.stationList.filter(station=>{
|
|
||||||
// if (this.activeName == 'first') {
|
|
||||||
// return station.centralized && !( beConcentrateStation[station.code] && (beConcentrateStation[station.code] != this.editModel.code));
|
|
||||||
return station.centralized;
|
|
||||||
// } else {
|
|
||||||
// return station.centralized && !( beConcentrateStation[station.code]);
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
},
|
|
||||||
create() {
|
create() {
|
||||||
const uid = getUID('ZcControl', this.zcList);
|
const uid = getUID('ZcControl', this.zcList);
|
||||||
let models = [];
|
const models = [];
|
||||||
const model = {
|
const model = {
|
||||||
_type: 'ZcControl',
|
_type: 'ZcControl',
|
||||||
code: uid,
|
code: uid,
|
||||||
@ -195,16 +178,11 @@ export default {
|
|||||||
position: {
|
position: {
|
||||||
x: this.addModel.position.x,
|
x: this.addModel.position.x,
|
||||||
y: this.addModel.position.y
|
y: this.addModel.position.y
|
||||||
},
|
}
|
||||||
concentrateStationList:this.addModel.concentrateStationList
|
|
||||||
};
|
};
|
||||||
models.push(model);
|
models.push(model);
|
||||||
model.concentrateStationList.forEach(stationCode=>{
|
|
||||||
const arr = this.setStationStand(stationCode, model.code);
|
|
||||||
models = [...models, ...arr];
|
|
||||||
});
|
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
this.getConcertrateStation();
|
|
||||||
this.$refs.createForm.resetForm();
|
this.$refs.createForm.resetForm();
|
||||||
},
|
},
|
||||||
// 修改对象
|
// 修改对象
|
||||||
@ -212,11 +190,7 @@ export default {
|
|||||||
this.$refs['dataform'].validate((valid) => {
|
this.$refs['dataform'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const data = Object.assign({_type: 'ZcControl'}, this.editModel);
|
const data = Object.assign({_type: 'ZcControl'}, this.editModel);
|
||||||
let models = [data];
|
const models = [data];
|
||||||
data.concentrateStationList.forEach(stationCode=>{
|
|
||||||
const arr = this.setStationStand(stationCode, data.code);
|
|
||||||
models = [...models, ...arr];
|
|
||||||
});
|
|
||||||
this.$emit('updateMapModel', models);
|
this.$emit('updateMapModel', models);
|
||||||
this.$emit('deviceSelect', '');
|
this.$emit('deviceSelect', '');
|
||||||
}
|
}
|
||||||
@ -231,16 +205,6 @@ export default {
|
|||||||
cancelButtonText: this.$t('tip.cancel'),
|
cancelButtonText: this.$t('tip.cancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.concertrateStation.forEach(station=>{
|
|
||||||
selected.concentrateStationList.forEach(stationCode=>{
|
|
||||||
switch (stationCode) {
|
|
||||||
case station.code: {
|
|
||||||
this.setStationStand(station.code, '');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.$emit('updateMapModel', {...selected, _dispose: true});
|
this.$emit('updateMapModel', {...selected, _dispose: true});
|
||||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -248,19 +212,18 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 设置车站所属ZC区域
|
getName(code) {
|
||||||
setStationStand(stationCode, code) {
|
const section = this.$store.getters['map/getDeviceByCode'](code);
|
||||||
const arr = [];
|
return section.name || '';
|
||||||
this.stationList.forEach(elem=>{
|
},
|
||||||
if (elem.code == stationCode) {
|
mouseenter(code) {
|
||||||
const station = deepAssign({}, elem);
|
|
||||||
// const station = Object.assign({}, elem);
|
},
|
||||||
station.zcCode = code;
|
mouseleave(code) {
|
||||||
arr.push(station);
|
|
||||||
// this.$emit('updateMapModel', station);
|
},
|
||||||
}
|
hover(field) {
|
||||||
});
|
this.field = field === this.field ? '' : field;
|
||||||
return arr; // 返回设置的车站list
|
|
||||||
}
|
}
|
||||||
// changeConcertrateStation(data) {
|
// changeConcertrateStation(data) {
|
||||||
// if (data.length > 0) {
|
// if (data.length > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user