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
0feb635d
Unverified
Commit
0feb635d
authored
Jan 14, 2022
by
aiwenmo
Committed by
GitHub
Jan 14, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #87 from zhu-mingye/dev
fixbug && add SQLStudio Right Menu
parents
2a2d4f6b
87addd4d
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
612 additions
and
22 deletions
+612
-22
CatalogueServiceImpl.java
...ain/java/com/dlink/service/impl/CatalogueServiceImpl.java
+1
-0
index.tsx
dlink-web/src/components/Studio/StudioTabs/index.tsx
+63
-22
model.ts
dlink-web/src/pages/FlinkSqlStudio/SqlExport/model.ts
+548
-0
No files found.
dlink-admin/src/main/java/com/dlink/service/impl/CatalogueServiceImpl.java
View file @
0feb635d
...
@@ -88,6 +88,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
...
@@ -88,6 +88,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
}
else
{
}
else
{
Task
task
=
new
Task
();
Task
task
=
new
Task
();
task
.
setId
(
oldCatalogue
.
getTaskId
());
task
.
setId
(
oldCatalogue
.
getTaskId
());
task
.
setName
(
catalogue
.
getName
());
task
.
setAlias
(
catalogue
.
getName
());
task
.
setAlias
(
catalogue
.
getName
());
taskService
.
updateById
(
task
);
taskService
.
updateById
(
task
);
this
.
updateById
(
catalogue
);
this
.
updateById
(
catalogue
);
...
...
dlink-web/src/components/Studio/StudioTabs/index.tsx
View file @
0feb635d
import
{
message
,
Tabs
}
from
'antd'
;
import
{
message
,
Tabs
,
Menu
,
Dropdown
}
from
'antd'
;
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
'umi'
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
'@/pages/FlinkSqlStudio/model'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
StudioEdit
from
'../StudioEdit'
;
import
StudioEdit
from
'../StudioEdit'
;
import
{
saveTask
}
from
"@/components/Studio/StudioEvent/DDL"
;
import
{
saveTask
}
from
'@/components/Studio/StudioEvent/DDL'
;
import
{
DIALECT
}
from
'../conf'
;
import
{
DIALECT
}
from
'../conf'
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
const
EditorTabs
=
(
props
:
any
)
=>
{
const
EditorTabs
=
(
props
:
any
)
=>
{
const
{
tabs
,
dispatch
,
current
,
toolHeight
,
width
}
=
props
;
const
{
tabs
,
dispatch
,
current
,
toolHeight
,
width
}
=
props
;
const
onChange
=
(
activeKey
:
any
)
=>
{
const
onChange
=
(
activeKey
:
any
)
=>
{
dispatch
&&
dispatch
({
dispatch
&&
type
:
"Studio/saveToolHeight"
,
dispatch
({
payload
:
toolHeight
-
0.0001
,
type
:
'Studio/saveToolHeight'
,
payload
:
toolHeight
-
0.0001
,
});
});
dispatch
({
dispatch
({
type
:
"Studio/changeActiveKey"
,
type
:
'Studio/changeActiveKey'
,
payload
:
activeKey
,
payload
:
activeKey
,
});
});
};
};
...
@@ -27,9 +28,10 @@ const EditorTabs = (props: any) => {
...
@@ -27,9 +28,10 @@ const EditorTabs = (props: any) => {
if
(
action
==
'add'
)
{
if
(
action
==
'add'
)
{
add
();
add
();
}
else
if
(
action
==
'remove'
)
{
}
else
if
(
action
==
'remove'
)
{
dispatch
&&
dispatch
({
dispatch
&&
type
:
"Studio/saveToolHeight"
,
dispatch
({
payload
:
toolHeight
-
0.0001
,
type
:
'Studio/saveToolHeight'
,
payload
:
toolHeight
-
0.0001
,
});
});
if
(
current
.
isModified
)
{
if
(
current
.
isModified
)
{
saveTask
(
current
,
dispatch
);
saveTask
(
current
,
dispatch
);
...
@@ -51,7 +53,7 @@ const EditorTabs = (props: any) => {
...
@@ -51,7 +53,7 @@ const EditorTabs = (props: any) => {
}
}
});
});
let
panes
=
tabs
.
panes
;
let
panes
=
tabs
.
panes
;
const
newPanes
=
panes
.
filter
(
pane
=>
pane
.
key
.
toString
()
!=
targetKey
);
const
newPanes
=
panes
.
filter
(
(
pane
)
=>
pane
.
key
.
toString
()
!=
targetKey
);
if
(
newPanes
.
length
&&
newActiveKey
.
toString
()
===
targetKey
)
{
if
(
newPanes
.
length
&&
newActiveKey
.
toString
()
===
targetKey
)
{
if
(
lastIndex
>
0
)
{
if
(
lastIndex
>
0
)
{
newActiveKey
=
newPanes
[
lastIndex
].
key
;
newActiveKey
=
newPanes
[
lastIndex
].
key
;
...
@@ -60,13 +62,49 @@ const EditorTabs = (props: any) => {
...
@@ -60,13 +62,49 @@ const EditorTabs = (props: any) => {
}
}
}
}
dispatch
({
dispatch
({
type
:
"Studio/saveTabs"
,
type
:
'Studio/saveTabs'
,
payload
:
{
payload
:
{
activeKey
:
newActiveKey
,
activeKey
:
newActiveKey
,
panes
:
newPanes
,
panes
:
newPanes
,
},
},
});
});
};
};
const
handleClickMenu
=
(
e
:
any
,
current
)
=>
{
dispatch
({
type
:
'Studio/closeTabs'
,
payload
:
{
deleteType
:
e
.
key
,
current
},
});
};
const
menu
=
(
pane
)
=>
(
<
Menu
onClick=
{
(
e
)
=>
handleClickMenu
(
e
,
pane
)
}
>
<
Menu
.
Item
key=
"CLOSE_OTHER"
>
<
span
>
关闭其他
</
span
>
</
Menu
.
Item
>
<
Menu
.
Item
key=
"CLOSE_ALL"
>
<
span
>
关闭所有
</
span
>
</
Menu
.
Item
>
</
Menu
>
);
const
Tab
=
(
pane
:
any
)
=>
(
<
span
>
{
pane
.
key
===
0
?
(
pane
.
title
)
:
(
<
Dropdown
overlay=
{
menu
(
pane
)
}
trigger=
{
[
'contextMenu'
]
}
>
<
span
className=
"ant-dropdown-link"
>
{
pane
.
title
}
</
span
>
</
Dropdown
>
)
}
</
span
>
);
return
(
return
(
<
Tabs
<
Tabs
hideAdd
hideAdd
...
@@ -75,18 +113,21 @@ const EditorTabs = (props: any) => {
...
@@ -75,18 +113,21 @@ const EditorTabs = (props: any) => {
onChange=
{
onChange
}
onChange=
{
onChange
}
activeKey=
{
tabs
.
activeKey
+
''
}
activeKey=
{
tabs
.
activeKey
+
''
}
onEdit=
{
onEdit
}
onEdit=
{
onEdit
}
className=
{
styles
[
"edit-tabs"
]
}
className=
{
styles
[
'edit-tabs'
]
}
style=
{
{
height
:
toolHeight
}
}
style=
{
{
height
:
toolHeight
}
}
>
>
{
tabs
.
panes
.
map
(
pane
=>
(
{
tabs
.
panes
.
map
((
pane
)
=>
(
<
TabPane
tab=
{
pane
.
title
}
key=
{
pane
.
key
}
closable=
{
pane
.
closable
}
>
<
TabPane
tab=
{
Tab
(
pane
)
}
key=
{
pane
.
key
}
closable=
{
pane
.
closable
}
>
<
StudioEdit
tabsKey=
{
pane
.
key
}
height=
{
(
toolHeight
-
32
)
}
width=
{
width
}
<
StudioEdit
language=
{
current
.
task
.
dialect
===
DIALECT
.
JAVA
?
'java'
:
'sql'
}
/>
tabsKey=
{
pane
.
key
}
height=
{
toolHeight
-
32
}
width=
{
width
}
language=
{
current
.
task
.
dialect
===
DIALECT
.
JAVA
?
'java'
:
'sql'
}
/>
</
TabPane
>
</
TabPane
>
))
}
))
}
</
Tabs
>
</
Tabs
>
);
)
};
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
...
...
dlink-web/src/pages/FlinkSqlStudio/SqlExport/model.ts
0 → 100644
View file @
0feb635d
This diff is collapsed.
Click to expand it.
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