|
@@ -52,7 +52,9 @@
|
|
|
ignoreStroke: true,
|
|
ignoreStroke: true,
|
|
|
background: '#00ff00',
|
|
background: '#00ff00',
|
|
|
});
|
|
});
|
|
|
- window.stage = stage;
|
|
|
|
|
|
|
+ // if (import.meta.env.MODE === 'development') {
|
|
|
|
|
+ // window.stage = stage;
|
|
|
|
|
+ // }
|
|
|
setStageCursor('pointer');
|
|
setStageCursor('pointer');
|
|
|
|
|
|
|
|
//2实例化layer层
|
|
//2实例化layer层
|
|
@@ -536,7 +538,7 @@
|
|
|
pParent?.on('mousedown', (e) => {
|
|
pParent?.on('mousedown', (e) => {
|
|
|
if (!isEdit) return;
|
|
if (!isEdit) return;
|
|
|
|
|
|
|
|
- console.log('group mouse down');
|
|
|
|
|
|
|
+ console.log('group mouse down', e);
|
|
|
if (e.evt.button == 0) {
|
|
if (e.evt.button == 0) {
|
|
|
//绘画结束
|
|
//绘画结束
|
|
|
if (!drawing) {
|
|
if (!drawing) {
|
|
@@ -549,6 +551,7 @@
|
|
|
stage?.find('Circle').forEach((element) => {
|
|
stage?.find('Circle').forEach((element) => {
|
|
|
element.moveToTop();
|
|
element.moveToTop();
|
|
|
});
|
|
});
|
|
|
|
|
+ pParent.moveToTop();
|
|
|
//添加删除撤销对象
|
|
//添加删除撤销对象
|
|
|
currentDel = currentDrawingShape;
|
|
currentDel = currentDrawingShape;
|
|
|
setCurrentGroup(poly.getParent() as Konva.Group);
|
|
setCurrentGroup(poly.getParent() as Konva.Group);
|
|
@@ -622,12 +625,13 @@
|
|
|
currentDel.destroy();
|
|
currentDel.destroy();
|
|
|
currentDel = null;
|
|
currentDel = null;
|
|
|
currentDrawingShape = null;
|
|
currentDrawingShape = null;
|
|
|
- ElMessage({
|
|
|
|
|
- message: '删除成功!',
|
|
|
|
|
- type: 'success',
|
|
|
|
|
- center: true,
|
|
|
|
|
- duration: 1000,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // ElMessage.success({
|
|
|
|
|
+ // message: '删除成功!',
|
|
|
|
|
+ // center: true,
|
|
|
|
|
+ // duration: 1000,
|
|
|
|
|
+ // });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.warning({ message: '请选择要删除的电子围栏' });
|
|
|
}
|
|
}
|
|
|
layer?.draw();
|
|
layer?.draw();
|
|
|
};
|
|
};
|