Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
ff1ec5bb
Unverified
Commit
ff1ec5bb
authored
Aug 17, 2023
by
ZackYoung
Committed by
GitHub
Aug 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix][Web]fix_some_bug_web (#2234)
* fix_some_bug_web * optimize icon size
parent
25a65b9c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
48 deletions
+75
-48
CodeLanguageIcon.tsx
dinky-web/src/components/Icons/CodeLanguageIcon.tsx
+0
-0
index.tsx
dinky-web/src/components/Sidebar/MovableSidebar/index.tsx
+54
-23
function.tsx
...b/src/pages/DataStudio/LeftContainer/Project/function.tsx
+21
-25
No files found.
dinky-web/src/components/Icons/CodeLanguageIcon.tsx
View file @
ff1ec5bb
This diff is collapsed.
Click to expand it.
dinky-web/src/components/Sidebar/MovableSidebar/index.tsx
View file @
ff1ec5bb
import
React
,
{
Fragment
,
useState
}
from
"react"
;
import
{
MinusOutlined
,
MinusSquareOutlined
,
PlusSquareOutlined
}
from
"@ant-design/icons"
;
import
{
Enable
,
Resizable
,
ResizeCallback
,
Size
}
from
"re-resizable"
;
import
{
PageContainer
}
from
"@ant-design/pro-components"
;
import
{
l
}
from
"@/utils/intl"
;
import
{
Button
,
Space
,
TabPaneProps
,
theme
}
from
"antd"
;
import
{
MaxIcon
,
MinIcon
}
from
"@/components/Icons/StudioIcon"
;
import
{
CircleBtn
}
from
"@/components/CallBackButton/CircleBtn"
;
import
useThemeValue
from
"@/hooks/useThemeValue"
;
import
{
THEME
}
from
"@/types/Public/data"
;
import
{
CircleBtn
}
from
'@/components/CallBackButton/CircleBtn'
;
import
useThemeValue
from
'@/hooks/useThemeValue'
;
import
{
MinusOutlined
}
from
'@ant-design/icons'
;
import
{
Space
,
TabPaneProps
,
theme
}
from
'antd'
;
import
{
Enable
,
Resizable
,
ResizeCallback
,
Size
}
from
're-resizable'
;
import
React
,
{
useState
}
from
'react'
;
export
type
MovableSidebarProps
=
{
title
?:
React
.
ReactNode
;
...
...
@@ -22,28 +18,47 @@ export type MovableSidebarProps = {
children
?:
React
.
ReactNode
;
handlerMinimize
?:
()
=>
void
;
handlerMaxsize
?:
()
=>
void
;
btnGroup
?:
React
.
ReactNode
[];
btnGroup
?:
React
.
ReactNode
[];
onResize
?:
ResizeCallback
;
style
?:
React
.
CSSProperties
;
tagList
?:
TabPaneProps
[];
};
const
{
useToken
}
=
theme
;
const
MovableSidebar
:
React
.
FC
<
MovableSidebarProps
>
=
(
props
)
=>
{
const
{
token
}
=
useToken
();
const
{
token
}
=
useToken
();
const
themeValue
=
useThemeValue
();
const
{
style
,
visible
,
onResize
,
defaultSize
,
minWidth
,
maxWidth
,
minHeight
,
maxHeight
,
enable
,
children
,
title
,
contentHeight
,
handlerMinimize
,
handlerMaxsize
,
tagList
style
,
visible
,
onResize
,
defaultSize
,
minWidth
,
maxWidth
,
minHeight
,
maxHeight
,
enable
,
children
,
title
,
contentHeight
,
handlerMinimize
,
handlerMaxsize
,
tagList
,
}
=
props
;
const
[
showBtn
,
setShowBtn
]
=
useState
(
false
)
const
[
showBtn
,
setShowBtn
]
=
useState
(
false
);
return
(
<
div
onMouseEnter=
{
()
=>
setShowBtn
(
true
)
}
onMouseLeave=
{
()
=>
setShowBtn
(
false
)
}
>
<
div
onMouseEnter=
{
()
=>
setShowBtn
(
true
)
}
onMouseLeave=
{
()
=>
setShowBtn
(
false
)
}
>
<
Resizable
className=
{
'container'
}
style=
{
{...
style
,
display
:
visible
?
'block'
:
'none'
,
borderRadius
:
5
}
}
style=
{
{
...
style
,
display
:
visible
?
'block'
:
'none'
,
borderRadius
:
5
,
}
}
onResize=
{
onResize
}
defaultSize=
{
defaultSize
}
minWidth=
{
minWidth
}
...
...
@@ -74,18 +89,34 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
{
/* <div style={{height: contentHeight,marginBlock:-5,marginInline:-10}}>{children}</div>*/
}
{
/*</PageContainer>*/
}
<>
<
div
style=
{
{
backgroundColor
:
token
.
colorBgBase
,
borderBlockColor
:
themeValue
.
borderColor
}
}
className=
{
"container-header"
}
>
<
div
style=
{
{
backgroundColor
:
token
.
colorBgBase
,
borderBlockColor
:
themeValue
.
borderColor
,
}
}
className=
{
'container-header'
}
>
<
div
>
{
title
}
</
div
>
<
div
className=
{
showBtn
?
"show"
:
"hide"
}
>
<
div
className=
{
showBtn
?
'show'
:
'hide'
}
>
<
Space
size=
{
5
}
>
{
props
.
btnGroup
}
<
CircleBtn
onClick=
{
props
.
handlerMinimize
}
icon=
{
<
MinusOutlined
/>
}
/>
<
CircleBtn
onClick=
{
props
.
handlerMinimize
}
icon=
{
<
MinusOutlined
/>
}
/>
</
Space
>
</
div
>
</
div
>
<
div
style=
{
{
height
:
contentHeight
,
backgroundColor
:
token
.
colorBgBase
}
}
>
{
children
}
</
div
>
<
div
style=
{
{
height
:
contentHeight
,
backgroundColor
:
token
.
colorBgBase
,
overflow
:
"auto"
}
}
>
{
children
}
</
div
>
</>
</
Resizable
>
</
div
>
);
...
...
dinky-web/src/pages/DataStudio/LeftContainer/Project/function.tsx
View file @
ff1ec5bb
...
...
@@ -42,31 +42,27 @@ export const getParentKey = (key: number | string, tree: any): any => {
* @returns {any}
*/
export
const
buildProjectTree
=
(
data
:
Catalogue
[],
searchValue
:
string
=
''
,
path
?:
string
[]):
any
=>
data
.
filter
((
ca
:
Catalogue
)
=>
(
ca
.
name
.
toLowerCase
().
indexOf
(
searchValue
.
toLowerCase
())
>
-
1
)).
map
((
item
:
Catalogue
)
=>
{
// 使用 name 拼接 path todo: 有 bug ,需要修复
if
(
path
)
{
path
.
push
(...
path
,
item
.
name
)
}
return
{
// isLeaf: (item.type && item.children.length === 0) ,
isLeaf
:
item
.
isLeaf
,
name
:
item
.
name
,
parentId
:
item
.
parentId
,
label
:
searchTreeNode
(
item
.
name
,
searchValue
),
icon
:
(
item
.
type
&&
item
.
children
.
length
===
0
)
&&
getTabIcon
(
item
.
type
,
20
),
value
:
item
.
id
,
path
:
path
??
[],
type
:
item
.
type
,
title
:
<>
{
searchTreeNode
(
item
.
name
,
searchValue
)
}
</>,
fullInfo
:
item
,
key
:
item
.
id
,
id
:
item
.
id
,
taskId
:
item
.
taskId
,
children
:
buildProjectTree
(
item
.
children
,
searchValue
,
path
),
}
});
export
const
buildProjectTree
=
(
data
:
Catalogue
[],
searchValue
:
string
=
''
,
path
?:
string
[]):
any
=>
data
.
map
((
item
:
Catalogue
)
=>
{
const
currentPath
=
path
?
[...
path
,
item
.
name
]
:
[
item
.
name
];
return
{
// isLeaf: (item.type && item.children.length === 0) ,
isLeaf
:
item
.
isLeaf
,
name
:
item
.
name
,
parentId
:
item
.
parentId
,
label
:
searchTreeNode
(
item
.
name
,
searchValue
),
icon
:
(
item
.
type
&&
item
.
children
.
length
===
0
)
&&
getTabIcon
(
item
.
type
,
20
),
value
:
item
.
id
,
path
:
currentPath
,
type
:
item
.
type
,
title
:
<>
{
searchTreeNode
(
item
.
name
,
searchValue
)
}
</>,
fullInfo
:
item
,
key
:
item
.
id
,
id
:
item
.
id
,
taskId
:
item
.
taskId
,
children
:
buildProjectTree
(
item
.
children
,
searchValue
,
currentPath
),
}
});
export
const
isUDF
=
(
jobType
:
string
)
=>
{
...
...
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