Skip to content

Commit

Permalink
修复树右键菜单位置与无法执行选中sql的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwenmo committed Dec 1, 2021
1 parent a3d18b2 commit 744c07a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dlink-web/src/components/Studio/StudioMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const StudioMenu = (props: any) => {
}
let useSession = !!currentSession.session;
let param = {
...current.task,
useSession: useSession,
session: currentSession.session,
statement: selectsql,
configJson: JSON.stringify(current.task.config),
...current.task,
statement: selectsql,
};
const key = current.key;
const taskKey = (Math.random() * 1000) + '';
Expand Down
13 changes: 3 additions & 10 deletions dlink-web/src/components/Studio/StudioTree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
const {pageX, pageY} = {...rightClickNodeTreeItem};
const tmpStyle = {
position: 'absolute',
// left: `${pageX - 50}px`,
// top: `${pageY - 202}px`,
left: `${pageX}px`,
top: `${pageY - 120}px`,
left: `${pageX - 40}px`,
top: `${pageY - 150}px`,
};
let menuItems;
if(rightClickNode&&rightClickNode.isLeaf){
Expand Down Expand Up @@ -307,15 +305,10 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
};

const handleContextMenu = (e: React.MouseEvent, node: TreeDataNode) => {
console.log('top:',sref.current.getScrollTop());
console.log('node:',node);
console.log('e:',e.pageY);
let position = e.currentTarget.getBoundingClientRect();
console.log('p:',position);
setRightClickNode(node);
setRightClickNodeTreeItem({
pageX: e.pageX,
pageY: position.top+sref.current.getScrollTop(),
pageY: e.pageY+sref.current.getScrollTop(),
id: node.id,
categoryName: node.name
});
Expand Down

0 comments on commit 744c07a

Please sign in to comment.