mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 19:58:46 +08:00
feat: update eslint error
This commit is contained in:
parent
dd5ba55e16
commit
4a4ced4518
@ -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;
|
||||
}
|
||||
};
|
||||
|
@ -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\'');
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user