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);
}
onmousedown(e) {
if (this.model.allowDrag) {
var x = e.offsetX;
var y = e.offsetY;
this._x = x;
this._y = y;
this._dragginger = true;
}
return true;
mousedown(e) {
this.event.disable();
}
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;
mousemove(e) {
}
onmouseup(e) {
if (this.model.allowDrag) {
this._dragginger = false;
// this.model.point.y
// this.model.point.x
}
return true;
mouseup(e) {
this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX;
this.model.point.y = this.model.point.y + e.offsetY;
}
}

View File

@ -1,7 +1,7 @@
import Polygon from 'zrender/src/graphic/shape/Polygon';
import Group from 'zrender/src/container/Group';
import {arrow} from '../../jmap/shape/utils/ShapePoints';
import { updateIbpData } from '@/ibp/utils/parser';
import {arrow} from '@/jmap/shape/utils/ShapePoints';
// import { updateIbpData } from '@/ibp/utils/parser';
class Arrow extends Group {
constructor(device) {
@ -13,13 +13,12 @@ class Arrow extends Group {
create() {
const model = this.model;
const point = arrow(this.model.point.x, this.model.point.y, this.model.length, 10);
this.arrow = new Polygon({
zlevel: model.zlevel,
z: model.z,
draggable: model.draggable || false,
shape: {
points: point
points: arrow(this.model.point.x, this.model.point.y, this.model.length, 10)
},
style: {
stroke: model.stroke,
@ -28,6 +27,27 @@ class Arrow extends Group {
}
});
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() {
if (!this.model.allowDrag) {
if (!this.model.draggable) {
switch (this.model.status) {
case 'off': {
this.open();
@ -96,37 +96,15 @@ export default class button extends Group {
}
}
onmousedown(e) {
if (this.model.allowDrag) {
var x = e.offsetX;
var y = e.offsetY;
this._x = x;
this._y = y;
this._dragginger = true;
mousedown(e) {
this.event.disable();
}
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;
}
onmouseup(e) {
if (this.model.allowDrag) {
this._dragginger = false;
// this.model.point.y
// this.model.point.x
}
return true;
mouseup(e) {
this.event.enable();
this.model.point.x = this.model.point.x + e.offsetX;
this.model.point.y = this.model.point.y + e.offsetY;
}
// 关闭
close() {

View File

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

View File

@ -7,7 +7,7 @@
</div>
<div class="display-draft">
<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>
<template v-if="questId">
<el-button type="danger" @click="handleQuitQuest">退出剧本</el-button>