车辆段显示位置初始化调整

This commit is contained in:
fan 2021-10-11 16:41:56 +08:00
parent edc9fee0a7
commit 48efa2cfb8
5 changed files with 71 additions and 13 deletions

View File

@ -217,6 +217,12 @@ class Jlmap {
this.screenFlag = false;
this.$painter.updateTransform({ scaleRate: opts.scaleRate, offsetX: opts.offsetX, offsetY: opts.offsetY });
}
setDepot(opts) {
this.$options.scaleRate = opts.scaleRate;
this.$options.offsetX = opts.offsetX;
this.$options.offsetY = opts.offsetY;
this.$painter.updateTransform({ scaleRate: opts.scaleRate, offsetX: opts.offsetX, offsetY: opts.offsetY });
}
setUpdateScreen(opts) {
this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 });
this.screenFlag = true;

View File

@ -2,10 +2,10 @@ 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.8.152:9000'; // 袁琪
// BASE_API = 'http://192.168.8.172:9200'; // 旭强
BASE_API = 'http://192.168.8.109:9000'; // 张赛
// BASE_API = 'http://192.168.8.109:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -82,7 +82,14 @@ export default {
});
},
setCenter(code) {
this.$jlmap.setCenter(code);
if (this.$store.state.training.prdType === '09' && this.$store.state.map.map.displayList && this.$store.state.map.map.displayList.length) {
const tempData = this.$store.state.map.map.displayList.find(item => { return item.stationCodeList.includes(code); });
const dataZoom = { offsetX: tempData.offsetX, offsetY: tempData.offsetY, scaleRate: tempData.scaleRate };
this.$store.commit('map/setDataZoom', dataZoom);
this.$jlmap.setDepot(dataZoom);
} else {
this.$jlmap.setCenter(code);
}
},
initStationListMode() {
this.stationListMode = [];

View File

@ -395,7 +395,20 @@ export default {
this.$refs.menuSchema.chiShowStation = deviceCode;
this.showStation = deviceCode;
this.$jlmap.amendDevice([...this.sectionList, ...this.signalList]);
this.mapViewLoadedOver && this.setShowStation(deviceCode);
// this.mapViewLoadedOver && this.setShowStation(deviceCode);
if (this.mapViewLoadedOver) {
const showStation = this.centralizedStationMap[deviceCode];
const list = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowStation(list, showStation);
}
const tempData = this.$store.state.map.map.displayList.find(item => { return item.stationCodeList.includes(deviceCode); });
const dataZoom = { offsetX: tempData.offsetX, offsetY: tempData.offsetY, scaleRate: tempData.scaleRate };
this.$store.commit('map/setDataZoom', dataZoom);
this.$jlmap.setDepot(dataZoom);
this.jl3dmaintainershow = false;
this.drivingShow = false;
break;
@ -566,10 +579,6 @@ export default {
// },
setShowStation(stationCode) {
const showStation = this.centralizedStationMap[stationCode];
// const lineCode = this.$store.getters['map/lineCode'];
// if (lineCode === '02' || lineCode === '05') {
// this.$jlmap.setCenter(showStation);
// } else {
const list = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const key in mapDevice) {
@ -630,7 +639,7 @@ export default {
this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
this.deviceCode = item.deviceCode;
this.$nextTick(() => {
if (item.deviceCode) { this.setCenter(item.deviceCode); }
if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); }
});
}
});

View File

@ -116,6 +116,34 @@
</template>
</div>
</div>
<div style="padding: 10px;font-size: 14px;">
<div class="content-box-list" style="margin-top: 10px">
<div style="height: 30px;line-height: 30px;margin-bottom: 10px;">
<span class="title-box">偏移缩放</span>
<el-button size="mini" style="float:right;" @click="generateOffsetScale">定位</el-button>
</div>
</div>
<div>
<el-row style="margin-top: 10px;height: 28px;line-height: 28px">
<el-col :span="5">
<span>坐标点</span>
</el-col>
<el-col :span="19">
<el-input-number v-model="addModel.offsetX" style="width: 120px" size="mini" controls-position="right" />
<span style="line-height: 28px;">, </span>
<el-input-number v-model="addModel.offsetY" style="width: 120px" size="mini" controls-position="right" />
</el-col>
</el-row>
<el-row style="margin-top: 10px;height: 28px;line-height: 28px">
<el-col :span="5">
<span>缩放</span>
</el-col>
<el-col :span="19">
<el-input-number v-model="addModel.scaleRate" style="width: 100px" size="mini" :min="-360" :max="360" controls-position="right" />
</el-col>
</el-row>
</div>
</div>
</el-card>
<div style="display: table; margin-left: 150px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" size="small" @click="generateData">生成</el-button>
@ -148,7 +176,10 @@ export default {
addModel: {
type: 'LOCAL',
stationCodeList: [],
elementList: []
elementList: [],
offsetX: 0,
offsetY: 0,
scaleRate: 1
},
amendPointsList: [],
list: [],
@ -212,6 +243,11 @@ export default {
}
});
},
generateOffsetScale() {
this.addModel.offsetX = this.$store.state.map.dataZoom.offsetX || 0;
this.addModel.offsetY = this.$store.state.map.dataZoom.offsetY || 0;
this.addModel.scaleRate = this.$store.state.map.dataZoom.scaleRate || 1;
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
this.seclectDeviceList.forEach(item => {
@ -319,11 +355,11 @@ export default {
this.clearData();
},
clear() {
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [] };
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [], offsetX: 0, offsetY: 0, scaleRate: 1 };
this.amendPointsList = [];
},
clearData() {
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [] };
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [], offsetX: 0, offsetY: 0, scaleRate: 1 };
this.amendPointsList = [];
this.index = '';
this.cardMode = 'generate';
@ -345,7 +381,7 @@ export default {
this.tableData = [];
this.stationList.forEach(item => {
if (item.depot) {
this.tableData.push({type: 'DEPOT_IL', stationCodeList: [item.code], elementList: [item.code]});
this.tableData.push({type: 'DEPOT_IL', stationCodeList: [item.code], elementList: [item.code], offsetX: 0, offsetY: 0, scaleRate: 1 });
}
});