Merge branch 'dev' of git.cloud.tencent.com:joylink/jl-nclient into dev

This commit is contained in:
sunzhenyu 2019-08-27 18:15:29 +08:00
commit 3e570560c6
5 changed files with 47 additions and 69 deletions

View File

@ -37,36 +37,16 @@ export default class alarm extends Group {
this.on('mouseup', this.mouseup, this); this.on('mouseup', this.mouseup, this);
} }
onmousedown(e) { mousedown(e) {
if (this.model.allowDrag) { this.event.disable();
var x = e.offsetX;
var y = e.offsetY;
this._x = x;
this._y = y;
this._dragginger = true;
}
return true;
} }
onmousemove(e) { mousemove(e) {
if (this._dragginger&&this.model.allowDrag) {
const oldX = this._x;
const oldY = this._y;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
this.model.point.x=this.model.point.x+dx;
this.model.point.y=this.model.point.y+dy;
this.imageBg.setStyle(this.model.point);
}
return true;
} }
onmouseup(e) { mouseup(e) {
if (this.model.allowDrag) { this.event.enable();
this._dragginger = false; this.model.point.x = this.model.point.x + e.offsetX;
// this.model.point.y this.model.point.y = this.model.point.y + e.offsetY;
// this.model.point.x
}
return true;
} }
} }

View File

@ -1,7 +1,7 @@
import Polygon from 'zrender/src/graphic/shape/Polygon'; import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import {arrow} from '../../jmap/shape/utils/ShapePoints'; import {arrow} from '@/jmap/shape/utils/ShapePoints';
import { updateIbpData } from '@/ibp/utils/parser'; // import { updateIbpData } from '@/ibp/utils/parser';
class Arrow extends Group { class Arrow extends Group {
constructor(device) { constructor(device) {
@ -13,13 +13,12 @@ class Arrow extends Group {
create() { create() {
const model = this.model; const model = this.model;
const point = arrow(this.model.point.x, this.model.point.y, this.model.length, 10);
this.arrow = new Polygon({ this.arrow = new Polygon({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
draggable: model.draggable || false, draggable: model.draggable || false,
shape: { shape: {
points: point points: arrow(this.model.point.x, this.model.point.y, this.model.length, 10)
}, },
style: { style: {
stroke: model.stroke, stroke: model.stroke,
@ -28,6 +27,27 @@ class Arrow extends Group {
} }
}); });
this.add(this.arrow); this.add(this.arrow);
this.getOrientate();
}
getOrientate() {
switch (this.model.orientation) {
case 'left': {
this.transformRotation(0);
break;
}
case 'right': {
this.transformRotation(180);
break;
}
}
}
// 整体旋转箭头
transformRotation(rotate) {
this.arrow.origin = [this.model.point.x, this.model.point.y];
this.arrow.rotation = Math.PI / 180 * Number(rotate);
this.arrow.dirty();
} }
// 箭头颜色 // 箭头颜色

View File

@ -80,7 +80,7 @@ export default class button extends Group {
} }
onclick() { onclick() {
if (!this.model.allowDrag) { if (!this.model.draggable) {
switch (this.model.status) { switch (this.model.status) {
case 'off': { case 'off': {
this.open(); this.open();
@ -96,37 +96,15 @@ export default class button extends Group {
} }
} }
onmousedown(e) { mousedown(e) {
if (this.model.allowDrag) { this.event.disable();
var x = e.offsetX;
var y = e.offsetY;
this._x = x;
this._y = y;
this._dragginger = true;
}
return true;
} }
mousemove(e) {
onmousemove(e) {
if (this._dragginger&&this.model.allowDrag) {
const oldX = this._x;
const oldY = this._y;
const dx = e.offsetX - oldX;
const dy = e.offsetY - oldY;
this.model.point.x=this.model.point.x+dx;
this.model.point.y=this.model.point.y+dy;
this.imageBg.setStyle(this.model.point);
}
return true;
} }
mouseup(e) {
onmouseup(e) { this.event.enable();
if (this.model.allowDrag) { this.model.point.x = this.model.point.x + e.offsetX;
this._dragginger = false; this.model.point.y = this.model.point.y + e.offsetY;
// this.model.point.y
// this.model.point.x
}
return true;
} }
// 关闭 // 关闭
close() { close() {

View File

@ -382,13 +382,13 @@ export const asyncRouter = [
} }
] ]
}, },
{ // {
path: 'ibp/edit', // path: 'ibp/edit',
component: IbpEdit, // component: IbpEdit,
meta: { // meta: {
i18n: 'router.ibpDraw' // i18n: 'router.ibpDraw'
} // }
}, // },
{ {
path: 'runPlan', path: 'runPlan',
redirect: '/map/runPlan/view/draft', redirect: '/map/runPlan/view/draft',

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="display-draft"> <div class="display-draft">
<el-button-group> <el-button-group>
<el-button @click="jumpIbp">IBP盘</el-button> <!--<el-button @click="jumpIbp">IBP盘</el-button>-->
<el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button> <el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<template v-if="questId"> <template v-if="questId">
<el-button type="danger" @click="handleQuitQuest">退出剧本</el-button> <el-button type="danger" @click="handleQuitQuest">退出剧本</el-button>