feat: update eslint error

This commit is contained in:
xinhui.zxh 2020-02-10 10:20:13 +08:00
parent dd5ba55e16
commit 4a4ced4518
5 changed files with 6 additions and 12 deletions

View File

@ -20,7 +20,7 @@ export default {
let trigger;
// 检测输入是否合法
if (ALLOW_EVENTS.includes(this.trigger)) {
trigger = this.trigger; // eslint-disable-line
({ trigger } = this.trigger);
} else {
trigger = DEFAULT_TRIGGER;
console.warn('Behavior collapse-expand-group 的 trigger 参数不合法,请输入 \'click\' 或 \'dblclick \'');
@ -40,6 +40,5 @@ export default {
const customGroupControll = graph.get('customGroupControll');
customGroupControll.collapseExpandGroup(groupId);
return true;
}
};

View File

@ -16,7 +16,7 @@ export default {
let trigger;
// 检测输入是否合法
if (ALLOW_EVENTS.includes(this.trigger)) {
trigger = this.trigger; // eslint-disable-line
({ trigger } = this.trigger);
} else {
trigger = DEFAULT_TRIGGER;
console.warn('Behavior collapse-expand 的 trigger 参数不合法,请输入 \'click\' 或 \'dblclick\'');

View File

@ -25,7 +25,7 @@ export default {
const clientX = +e.clientX;
const clientY = +e.clientY;
if (isNaN(clientX) || isNaN(Number(clientY))) {
if (isNaN(clientX) || isNaN(clientY)) {
return;
}
let dx = clientX - origin.x;

View File

@ -62,14 +62,12 @@ export default {
const parentGroup = customGroup[parentGroupId].nodeGroup;
customGroupControll.setGroupStyle(parentGroup.get('keyShape'), 'hover');
}
return true;
},
onDrag(evt: IG6GraphEvent) {
if (!this.mouseOrigin) {
return false;
}
this.updateDelegate(evt);
return true;
},
onDragEnd(evt: IG6GraphEvent) {
@ -101,7 +99,6 @@ export default {
this.shapeOrigin = null;
customGroupControll.resetNodePoint();
this.delegateShapeBBox = null;
return true;
},
updateDelegate(evt: IG6GraphEvent) {
const { graph } = this;

View File

@ -247,13 +247,11 @@ export default {
customGroupControll.dynamicChangeGroupSize(evt, nodeInGroup, keyShape);
} else if (!this.inGroupId && groupId) {
// 拖出到群组之外了则删除数据中的groupId
const keys = Object.keys(groupNodes)
for (let i = 0; i < keys.length; i++) {
const gnode = groupNodes[keys[i]]
Object.keys(groupNodes).forEach((gnode) => {
const currentGroupNodes = groupNodes[gnode];
groupNodes[gnode] = currentGroupNodes.filter(node => node !== id);
}
})
const currentGroup = customGroup[groupId].nodeGroup;
if(!currentGroup) {
return