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
a3d18b27
Commit
a3d18b27
authored
Dec 01, 2021
by
coderTomato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化右键菜单的显示高度
parent
692d55f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
27 deletions
+21
-27
index.tsx
dlink-web/src/components/Studio/StudioEdit/index.tsx
+2
-13
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+19
-14
No files found.
dlink-web/src/components/Studio/StudioEdit/index.tsx
View file @
a3d18b27
...
@@ -3,7 +3,6 @@ import * as _monaco from "monaco-editor";
...
@@ -3,7 +3,6 @@ import * as _monaco from "monaco-editor";
import
MonacoEditor
from
"react-monaco-editor"
;
import
MonacoEditor
from
"react-monaco-editor"
;
import
{
BaseDataSourceField
,
BaseDataSourceHeader
,
CompletionItem
}
from
"./data"
;
import
{
BaseDataSourceField
,
BaseDataSourceHeader
,
CompletionItem
}
from
"./data"
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
"umi"
;
import
{
DocumentStateType
}
from
"@/pages/Document/model"
;
import
{
DocumentStateType
}
from
"@/pages/Document/model"
;
...
@@ -15,13 +14,6 @@ let provider = {
...
@@ -15,13 +14,6 @@ let provider = {
dispose
:
()
=>
{},
dispose
:
()
=>
{},
};
};
interface
IRightContent
{
key
:
string
;
value
:
any
;
handleCheck
:
()
=>
Promise
<
boolean
>
;
secondRightData
:
(
BaseDataSourceField
|
BaseDataSourceHeader
)[];
}
interface
ISuggestions
{
interface
ISuggestions
{
label
:
string
;
label
:
string
;
kind
:
string
;
kind
:
string
;
...
@@ -31,6 +23,7 @@ interface ISuggestions {
...
@@ -31,6 +23,7 @@ interface ISuggestions {
const
FlinkSqlEditor
=
(
props
:
any
)
=>
{
const
FlinkSqlEditor
=
(
props
:
any
)
=>
{
const
{
const
{
tabsKey
,
height
=
'100%'
,
height
=
'100%'
,
width
=
'100%'
,
width
=
'100%'
,
language
=
'sql'
,
language
=
'sql'
,
...
@@ -42,13 +35,9 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -42,13 +35,9 @@ const FlinkSqlEditor = (props:any) => {
tabs
,
tabs
,
fillDocuments
,
fillDocuments
,
dispatch
,
dispatch
,
}
=
props
}
=
props
;
;
const
{
tabsKey
,
value
,
handleCheck
,
secondRightData
=
[]
}:
IRightContent
=
props
;
const
editorInstance
:
any
=
useRef
<
any
>
();
const
editorInstance
:
any
=
useRef
<
any
>
();
const
monacoInstance
:
any
=
useRef
();
const
monacoInstance
:
any
=
useRef
();
const
getTabIndex
=
():
number
=>
{
const
getTabIndex
=
():
number
=>
{
...
...
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
a3d18b27
...
@@ -14,16 +14,17 @@ import UpdateCatalogueForm from './components/UpdateCatalogueForm';
...
@@ -14,16 +14,17 @@ import UpdateCatalogueForm from './components/UpdateCatalogueForm';
import
{
ActionType
}
from
"@ant-design/pro-table"
;
import
{
ActionType
}
from
"@ant-design/pro-table"
;
import
UpdateTaskForm
from
"@/components/Studio/StudioTree/components/UpdateTaskForm"
;
import
UpdateTaskForm
from
"@/components/Studio/StudioTree/components/UpdateTaskForm"
;
import
{
Scrollbars
}
from
'react-custom-scrollbars'
;
import
{
Scrollbars
}
from
'react-custom-scrollbars'
;
const
{
DirectoryTree
}
=
Tree
;
const
{
DirectoryTree
}
=
Tree
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
type
StudioTreeProps
=
{
type
StudioTreeProps
=
{
rightClickMenu
:
StateType
[
'rightClickMenu'
];
rightClickMenu
:
StateType
[
'rightClickMenu'
];
dispatch
:
any
;
dispatch
:
any
;
tabs
:
StateType
[
'tabs'
];
tabs
:
StateType
[
'tabs'
];
current
:
StateType
[
'current'
];
current
:
StateType
[
'current'
];
toolHeight
:
number
;
refs
:
any
;
};
};
type
RightClickMenu
=
{
type
RightClickMenu
=
{
...
@@ -50,7 +51,6 @@ const getParentKey = (key, tree) => {
...
@@ -50,7 +51,6 @@ const getParentKey = (key, tree) => {
const
StudioTree
:
React
.
FC
<
StudioTreeProps
>
=
(
props
)
=>
{
const
StudioTree
:
React
.
FC
<
StudioTreeProps
>
=
(
props
)
=>
{
const
{
rightClickMenu
,
dispatch
,
tabs
,
refs
,
toolHeight
}
=
props
;
const
{
rightClickMenu
,
dispatch
,
tabs
,
refs
,
toolHeight
}
=
props
;
const
[
treeData
,
setTreeData
]
=
useState
<
TreeDataNode
[]
>
();
const
[
treeData
,
setTreeData
]
=
useState
<
TreeDataNode
[]
>
();
const
[
dataList
,
setDataList
]
=
useState
<
[]
>
();
const
[
dataList
,
setDataList
]
=
useState
<
[]
>
();
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
[]
>
();
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
[]
>
();
...
@@ -62,6 +62,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -62,6 +62,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
const
[
taskFormValues
,
setTaskFormValues
]
=
useState
({});
const
[
taskFormValues
,
setTaskFormValues
]
=
useState
({});
const
[
rightClickNode
,
setRightClickNode
]
=
useState
<
TreeDataNode
>
();
const
[
rightClickNode
,
setRightClickNode
]
=
useState
<
TreeDataNode
>
();
const
[
available
,
setAvailable
]
=
useState
<
boolean
>
(
true
);
const
[
available
,
setAvailable
]
=
useState
<
boolean
>
(
true
);
let
sref
=
React
.
createRef
<
Scrollbars
>
();
const
getTreeData
=
async
()
=>
{
const
getTreeData
=
async
()
=>
{
const
result
=
await
getCatalogueTreeData
();
const
result
=
await
getCatalogueTreeData
();
...
@@ -95,9 +96,6 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -95,9 +96,6 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
getTreeData
();
getTreeData
();
},
[]);
},
[]);
const
onChange
=
(
e
:
any
)
=>
{
};
const
handleMenuClick
=
(
key
:
string
)
=>
{
const
handleMenuClick
=
(
key
:
string
)
=>
{
if
(
key
==
'Open'
){
if
(
key
==
'Open'
){
...
@@ -308,13 +306,18 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -308,13 +306,18 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
return
(
treeData
&&
treeData
.
length
==
0
)?
empty
:
''
;
return
(
treeData
&&
treeData
.
length
==
0
)?
empty
:
''
;
};
};
const
onRightClick
=
(
e
:
any
)
=>
{
const
handleContextMenu
=
(
e
:
React
.
MouseEvent
,
node
:
TreeDataNode
)
=>
{
setRightClickNode
(
e
.
node
);
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
({
setRightClickNodeTreeItem
({
pageX
:
e
.
event
.
pageX
,
pageX
:
e
.
pageX
,
pageY
:
e
.
event
.
pageY
,
pageY
:
position
.
top
+
sref
.
current
.
getScrollTop
()
,
id
:
e
.
node
.
id
,
id
:
node
.
id
,
categoryName
:
e
.
node
.
name
categoryName
:
node
.
name
});
});
dispatch
&&
dispatch
({
dispatch
&&
dispatch
({
type
:
"Studio/showRightClickMenu"
,
type
:
"Studio/showRightClickMenu"
,
...
@@ -360,11 +363,13 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -360,11 +363,13 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
</
Tooltip
>
</
Tooltip
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Scrollbars
style=
{
{
height
:(
toolHeight
-
32
)}
}
>
<
Scrollbars
style=
{
{
height
:(
toolHeight
-
32
)}
}
ref=
{
sref
}
>
{
/*<Search style={{marginBottom: 8}} placeholder="Search" onChange={onChange}/>*/
}
{
/*<Search style={{marginBottom: 8}} placeholder="Search" onChange={onChange}/>*/
}
<
DirectoryTree
<
DirectoryTree
multiple
multiple
onRightClick=
{
onRightClick
}
onRightClick=
{
({
event
,
node
}:
any
)
=>
{
handleContextMenu
(
event
,
node
)
}
}
onSelect=
{
onSelect
}
onSelect=
{
onSelect
}
switcherIcon=
{
<
DownOutlined
/>
}
switcherIcon=
{
<
DownOutlined
/>
}
treeData=
{
treeData
}
treeData=
{
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