Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaowei
dlink
Commits
3cfcdbc1
Commit
3cfcdbc1
authored
Feb 16, 2022
by
coderTomato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
紧急修复前端文件不能点击点开的问题
parent
5432ea80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+10
-10
No files found.
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
3cfcdbc1
...
@@ -179,6 +179,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -179,6 +179,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
setAvailable
(
true
);
setAvailable
(
true
);
},
200
);
},
200
);
if
(
node
?.
isLeaf
&&
node
.
taskId
)
{
if
(
node
?.
isLeaf
&&
node
.
taskId
)
{
for
(
let
item
of
tabs
.
panes
){
for
(
let
item
of
tabs
.
panes
){
if
(
item
.
key
==
node
.
taskId
){
if
(
item
.
key
==
node
.
taskId
){
...
@@ -370,15 +371,15 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -370,15 +371,15 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
return (treeData&&treeData.length==0)?empty:'';
return (treeData&&treeData.length==0)?empty:'';
};
};
const handleContextMenu = (e:
React.MouseEvent, node: TreeDataNode
) => {
const handleContextMenu = (e:
any
) => {
let position = e.currentTarget.getBoundingClientRect();
let position = e.
event.
currentTarget.getBoundingClientRect();
let scrollTop = document.documentElement.scrollTop;
let scrollTop = document.documentElement.scrollTop;
setRightClickNode(node);
setRightClickNode(
e.
node);
setRightClickNodeTreeItem({
setRightClickNodeTreeItem({
pageX: e.pageX-20,
pageX: e.
event.
pageX-20,
pageY: position.y+sref.current.getScrollTop()+scrollTop-125-position.height,
pageY: position.y+sref.current.getScrollTop()+scrollTop-125-position.height,
id: node.id,
id:
e.
node.id,
categoryName: node.name
categoryName:
e.
node.name
});
});
dispatch&&dispatch({
dispatch&&dispatch({
type: "Studio/showRightClickMenu",
type: "Studio/showRightClickMenu",
...
@@ -424,9 +425,10 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -424,9 +425,10 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
<span>{item.title}</span>
<span>{item.title}</span>
);
);
if (item.children) {
if (item.children) {
return {name:item.name,id:item.id,taskId:item.taskId,parentId:item.parentId,path:item.path,icon:item.isLeaf?item.icon:'', title, key: item.key, children: loop(item.children) };
return {
isLeaf:item.isLeaf,
name:item.name,id:item.id,taskId:item.taskId,parentId:item.parentId,path:item.path,icon:item.isLeaf?item.icon:'', title, key: item.key, children: loop(item.children) };
}
}
return {
return {
isLeaf:item.isLeaf,
name:item.name,
name:item.name,
id:item.id,
id:item.id,
taskId:item.taskId,
taskId:item.taskId,
...
@@ -462,9 +464,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -462,9 +464,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
<Search style={{marginBottom: 8}} placeholder="Search" onChange={onChange} allowClear={true}/>
<Search style={{marginBottom: 8}} placeholder="Search" onChange={onChange} allowClear={true}/>
<DirectoryTree
<DirectoryTree
multiple
multiple
onRightClick={({event, node}: any) => {
onRightClick={handleContextMenu}
handleContextMenu(event, node)
}}
onSelect={onSelect}
onSelect={onSelect}
switcherIcon={<DownOutlined/>}
switcherIcon={<DownOutlined/>}
treeData={loop(treeData)}
treeData={loop(treeData)}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment