This commit is contained in:
fan 2021-01-08 17:27:36 +08:00
commit 682a47f730
5 changed files with 38 additions and 15 deletions

View File

@ -156,15 +156,20 @@ class Jlmap {
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); }
}
switchScreen(data, num, sum) {
const sumHalf = sum <= 2 ? sum : sum / 2;
const dx = data.width / sumHalf;
const dy = data.height / sumHalf;
const row = num <= sumHalf ? 0 : 1;
const opts = {
dx: dx * (row == 0 ? num - 1 : num - sumHalf - 1),
dy: dy * row
};
switchScreen(data, num, sum, obj) {
const opts = {};
if (obj.width == 1) {
const dy = data.height / sum;
opts['dx'] = 0;
opts['dy'] = dy * (num - 1);
} else {
const sumHalf = sum <= 2 ? sum : sum / 2;
const dx = data.width / sumHalf;
const dy = data.height / sumHalf;
const row = num <= sumHalf ? 0 : 1;
opts['dx'] = dx * (row == 0 ? num - 1 : num - sumHalf - 1);
opts['dy'] = dy * row;
}
this.$painter.updateScreenNum(opts);
}
@ -236,6 +241,7 @@ class Jlmap {
const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height};
rectList.push(rect);
}
console.log(screenList, rectList);
this.$painter.updateTransform1(screenList, rectList);
}

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://api.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.129:9000'; // 旭强
// BASE_API = 'http://192.168.8.119:9000'; // 张赛
BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -128,7 +128,11 @@ export default {
width: this.$store.state.app.width * width,
height: this.$store.state.app.height * height
};
this.$refs.jlmapVisual.setOffset(size, data, num);
const obj = {
width: width,
height: height
};
this.$refs.jlmapVisual.setOffset(size, data, num, obj);
},
handleUpdateScreen() {
this.maskOpen = false;
@ -142,6 +146,7 @@ export default {
const param = { value: index + 1, label: `${index + 1}` };
this.optionsList.push(param);
}
console.log(this.optionsList, '======');
const size = {
width: this.$store.state.app.width * width,
height: this.$store.state.app.height * height,

View File

@ -526,8 +526,8 @@ export default {
this.$jlmap.updateShowStation(list, stationCode);
!setCenter && this.setCenter(stationCode);
},
setOffset(data, num, sum) {
this.$jlmap.switchScreen(data, num, sum);
setOffset(data, num, sum, obj) {
this.$jlmap.switchScreen(data, num, sum, obj);
}
}
};

View File

@ -30,7 +30,16 @@ export default {
queryForm: {
labelWidth: '140px',
// reset: true,
offsetSpan: 20
// offsetSpan: 20,
queryObject: {
templatePlanId: {
type: 'select',
label: this.$t('publish.runPlanName'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
@ -82,6 +91,9 @@ export default {
this.templatePlanList = [];
queryRunPlanList(this.$route.query.mapId).then(resp => {
this.templatePlanList = resp.data;
this.templatePlanList.forEach(element => {
this.queryForm.queryObject.templatePlanId.config.data.push({label:element.name, value:element.id});
});
});
},
queryFunction(params) {