This commit is contained in:
joylink_cuiweidong 2022-08-25 15:19:09 +08:00
commit e671165355
9 changed files with 46 additions and 28 deletions

View File

@ -116,6 +116,7 @@ class Jlmap {
this.$options.scaleRate = scaling;
this.$options.offsetX = origin ? origin.x : 0;
this.$options.offsetY = origin ? origin.y : 0;
this.$options.scaleIndex = parseInt((scaling / 0.05).toFixed());
this.$painter.updateTransform({ scaleRate: scaling, offsetX: origin ? origin.x : 0, offsetY: origin ? origin.y : 0 });
}
setMap(map, mapDevice, logicData) {
@ -123,6 +124,7 @@ class Jlmap {
if (map.skinVO) {
this.lineCode = map.skinVO.code;
this.$options.scaleRate = map.scaling || 1;
this.$options.scaleIndex = parseInt(((map.scaling || 1) / 0.05).toFixed());
this.$options.offsetX = map.origin ? map.origin.x : 0;
this.$options.offsetY = map.origin ? map.origin.y : 0;
}
@ -203,7 +205,6 @@ class Jlmap {
}
setCenterWithOffset(deviceCode, dx, offsetY) {
console.log('setCenterWithOffset');
const arr = Object.keys(this.mapDevice);
if (arr.length != 0) {
const device = this.mapDevice[deviceCode];
@ -286,7 +287,7 @@ class Jlmap {
const scaleX = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
const scaleY = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
this.screenScale = Math.min(scaleX, scaleY);
this.$painter.setScreenScale(this.screenScale);
this.optsWidth = opts.width;
this.optsHeight = opts.height;
this.optsOffsetList = opts.offsetList;

View File

@ -43,6 +43,7 @@ class Options {
}
update(payload) {
console.log(payload, '*****---------');
if (Number.isFinite(payload.dx)) {
this.offsetX -= payload.dx;
}

View File

@ -197,7 +197,6 @@ class Painter {
}
} catch (err) {
console.error(err);
console.log(device, 'device');
}
}
}
@ -233,6 +232,9 @@ class Painter {
this.screenFlag = true;
this.$transformHandleScreen.updateTransform(list, opts);
}
setScreenScale(screenScale) {
this.$transformHandleScreen.setScreenScale(screenScale);
}
updateScreenZoom(bili) {
return this.$jmap.calculateScreenPosition(bili);

View File

@ -42,7 +42,7 @@ export default class SignalButton extends Group {
this.model = model;
this.style = style;
this.pressed = false;
this.typeList = this.style.SignalButton.typeList || typeList;
this.typeList = this.style.SignalButton && this.style.SignalButton.typeList ? this.style.SignalButton.typeList : typeList;
// Line
this.create();
this.setState(model);

View File

@ -6,19 +6,18 @@ class TransformHandle {
this.$painter = painter;
this.scale = '';
this.scaleIndex = 0;
this.scaleList = [
0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
1, 1.2, 1.4, 1.6, 1.8,
2, 2.2, 2.4, 2.6, 2.8,
3, 3.2, 3.4, 3.6, 3.8,
4, 4.2, 4.4, 4.6, 4.8,
5, 5.2, 5.4, 5.6, 5.8,
6, 6.2, 6.4, 6.6, 6.8,
7, 7.2, 7.4, 7.6, 7.8,
8
];
this.scaleIndex = 20;
// this.scaleList = [
// 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
// 1, 1.2, 1.4, 1.6, 1.8,
// 2, 2.2, 2.4, 2.6, 2.8,
// 3, 3.2, 3.4, 3.6, 3.8,
// 4, 4.2, 4.4, 4.6, 4.8,
// 5, 5.2, 5.4, 5.6, 5.8,
// 6, 6.2, 6.4, 6.6, 6.8,
// 7, 7.2, 7.4, 7.6, 7.8,
// 8
// ];
this.parentLevel = painter.getParentLevel();
this.rect = { x: 0, y: 0, width: 0, height: 0 };
@ -31,7 +30,9 @@ class TransformHandle {
view.show();
view.dirty();
}
setScreenScale(screenScale) {
this.scaleIndex = parseInt((screenScale / 0.05).toFixed());
}
checkVisible(view, rect) {
// return createBoundingRect(view).intersect(this.rect); // 判断是否相交
// return createBoundingRect(view).intersect(rect); // 判断是否相交
@ -105,11 +106,11 @@ class TransformHandle {
updataOffset(opt) {
if (opt.scale) {
if (opt.scale <= 0) {
this.scaleIndex = this.scaleIndex <= 0 ? 0 : this.scaleIndex - 1;
this.scaleIndex = this.scaleIndex <= 2 ? 2 : this.scaleIndex - 1;
} else {
this.scaleIndex = this.scaleIndex >= 40 ? 40 : this.scaleIndex + 1;
this.scaleIndex = this.scaleIndex >= 200 ? 200 : this.scaleIndex + 1;
}
const {screenList, rectList} = this.$painter.updateScreenZoom(this.scaleList[this.scaleIndex]);
const {screenList, rectList} = this.$painter.updateScreenZoom((this.scaleIndex * 0.05).toFixed(2));
this.rectList = rectList;
this.transform = [];
screenList.forEach(item => {

View File

@ -24,14 +24,14 @@ export function handlerUrl(data) {
if (process.env.NODE_ENV === 'development') {
// const data = null;
// 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.3.233/rtss-server';
// BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -119,7 +119,20 @@ export default {
},
handleUpdateScreen() {
this.maskOpen = false;
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
let picture;
if (this.$store.state.map.map && this.$store.state.map.map.pictureList) {
picture = this.$store.state.map.map.pictureList.find(picture => picture.type === 'bigScreen');
}
if (picture) {
this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap);
const deviceList = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const deviceCode in mapDevice) {
deviceList.push(deviceCode);
}
this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(picture.scaling, picture.origin);
} else if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;

View File

@ -23,9 +23,8 @@ export default {
.trainingTipMessage{
position: absolute;
width: 400px;
padding: 15px 15px 20px 15px;
background: rgba(255,255,255,0.97);
top: 100px;
padding: 15px;
background: rgb(255, 221, 0);
left: 50%;
border-radius: 8px;
-webkit-transform: translateX(-50%);

View File

@ -13,9 +13,10 @@
<el-select v-model="ruleForm.type" placeholder="请选择画面类型">
<el-option label="站间透明" value="lucency" />
<el-option label="连锁车站" value="chainStation" />
<el-option label="大屏显示" value="bigScreen" />
</el-select>
</el-form-item>
<el-form-item label="所属车站:" prop="stationCode">
<el-form-item v-if="ruleForm.type !== 'bigScreen'" label="所属车站:" prop="stationCode">
<el-select v-model="ruleForm.stationCode" placeholder="请选择">
<el-option
v-for="item in stationList"