补充优化键盘事件处理bug

This commit is contained in:
lVAL 2020-09-30 17:18:01 +08:00
parent 24326c4808
commit 15a08feef8
4 changed files with 39 additions and 4 deletions

View File

@ -86,7 +86,8 @@ class MouseController extends Eventful {
mousedown(e) { mousedown(e) {
e.event.preventDefault(); e.event.preventDefault();
e.event.stopPropagation(); e.event.stopPropagation();
const em = new EventModel(e); const em = new EventModel(e);
this.$zr.dom.focus();
this.eventTarget = em.eventTarget; this.eventTarget = em.eventTarget;
this._offsetX = e.offsetX; this._offsetX = e.offsetX;
this._offsetY = e.offsetY; this._offsetY = e.offsetY;

View File

@ -84,7 +84,9 @@ class MouseController extends Eventful {
mousedown(e) { mousedown(e) {
// if (eventTool.notLeftMouse(e)) { // if (eventTool.notLeftMouse(e)) {
// return; // return;
// } // }
this.$zr.dom.focus();
if (e.which == 1 || e.which == 3) { if (e.which == 1 || e.which == 3) {
var x = e.offsetX; var x = e.offsetX;
var y = e.offsetY; var y = e.offsetY;

View File

@ -85,7 +85,8 @@ class MouseController extends Eventful {
mousedown(e) { mousedown(e) {
// if (eventTool.notLeftMouse(e)) { // if (eventTool.notLeftMouse(e)) {
// return; // return;
// } // }
this.$zr.dom.focus();
if (e.which == 1 || e.which == 3) { if (e.which == 1 || e.which == 3) {
var x = e.offsetX; var x = e.offsetX;
var y = e.offsetY; var y = e.offsetY;

View File

@ -41,6 +41,30 @@
@createDataModel="createDataModel" @createDataModel="createDataModel"
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-tab-pane>
<el-tab-pane label="圆形" name="IscsCircle">
<iscs-circle
ref="iscsCircle"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="三角形" name="IscsTriangle">
<iscs-triangle
ref="iscsTriangle"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="表格" name="StateTable">
<state-table
ref="stateTable"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
@ -53,6 +77,10 @@ import IscsLine from '../icscComponents/line';
import IscsText from '../icscComponents/text'; import IscsText from '../icscComponents/text';
import IscsRect from '../icscComponents/rect'; import IscsRect from '../icscComponents/rect';
import IscsButton from '../icscComponents/button'; import IscsButton from '../icscComponents/button';
import IscsCircle from '../icscComponents/circle';
import IscsTriangle from '../icscComponents/triangle';
import StateTable from '../icscComponents/stateTable';
export default { export default {
name: 'IscsOperate', name: 'IscsOperate',
@ -60,7 +88,10 @@ export default {
IscsRect, IscsRect,
IscsLine, IscsLine,
IscsText, IscsText,
IscsButton IscsButton,
IscsCircle,
IscsTriangle,
StateTable
}, },
mixins: [ mixins: [
], ],