Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
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
sunyihao
bkunyun
Commits
65dc0ec4
Commit
65dc0ec4
authored
Jun 11, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 文件传输布局开发
parent
d047d28e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
268 additions
and
0 deletions
+268
-0
MyPopover.tsx
src/components/mui/MyPopover.tsx
+85
-0
MySelect.tsx
src/components/mui/MySelect.tsx
+75
-0
MyTitle.tsx
src/components/mui/MyTitle.tsx
+44
-0
index.tsx
src/views/ConsoleLayout/components/FileItem/index.tsx
+13
-0
index.tsx
src/views/ConsoleLayout/components/TransferList/index.tsx
+51
-0
No files found.
src/components/mui/MyPopover.tsx
0 → 100644
View file @
65dc0ec4
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-11 09:33:46
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-11 11:33:17
* @FilePath: /bkunyun/src/components/mui/MyPopover.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
*
as
React
from
"react"
;
import
Popover
,
{
PopoverProps
}
from
"@mui/material/Popover"
;
import
Typography
from
"@mui/material/Typography"
;
interface
IProps
extends
Omit
<
PopoverProps
,
"open"
>
{
/** 触发行为 */
trigger
?:
"hover"
|
"click"
;
/** 触发dom */
children
:
React
.
ReactNode
;
/** 显示内容 */
content
:
React
.
ReactNode
;
}
const
MyPopover
=
(
props
:
IProps
)
=>
{
const
[
anchorEl
,
setAnchorEl
]
=
React
.
useState
<
any
|
null
>
(
null
);
const
{
trigger
=
"click"
,
children
,
content
,
anchorOrigin
,
transformOrigin
,
}
=
props
;
const
handlePopoverOpen
=
(
event
:
any
)
=>
{
setAnchorEl
(
event
.
currentTarget
);
};
const
handelClick
=
(
event
:
any
)
=>
{
setAnchorEl
(
event
?.
currentTarget
);
};
const
handlePopoverClose
=
()
=>
{
setAnchorEl
(
null
);
};
const
open
=
Boolean
(
anchorEl
);
const
id
=
open
?
"simple-popover"
:
undefined
;
return
(
<
div
>
<
Typography
aria
-
owns=
{
id
}
onClick=
{
trigger
===
"click"
?
handelClick
:
undefined
}
onMouseEnter=
{
trigger
===
"hover"
?
handlePopoverOpen
:
undefined
}
onMouseLeave=
{
trigger
===
"hover"
?
handlePopoverClose
:
undefined
}
>
{
children
}
</
Typography
>
<
Popover
id=
{
id
}
open=
{
open
}
anchorEl=
{
anchorEl
}
onClose=
{
handlePopoverClose
}
sx=
{
{
pointerEvents
:
trigger
===
"hover"
?
"none"
:
undefined
,
}
}
anchorOrigin=
{
anchorOrigin
||
{
vertical
:
"bottom"
,
horizontal
:
"center"
,
}
}
transformOrigin=
{
transformOrigin
||
{
vertical
:
"top"
,
horizontal
:
"center"
,
}
}
>
<
Typography
sx=
{
{
p
:
1
}
}
>
{
content
}
</
Typography
>
</
Popover
>
</
div
>
);
};
export
default
MyPopover
;
src/components/mui/MySelect.tsx
0 → 100644
View file @
65dc0ec4
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2021-12-04 15:46:25
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-11 18:22:50
* @FilePath: /lionet-slb-pc/src/components/SearchView/components/Collapse.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
*
as
React
from
"react"
;
import
Box
from
"@mui/material/Box"
;
import
InputLabel
from
"@mui/material/InputLabel"
;
import
MenuItem
from
"@mui/material/MenuItem"
;
import
FormControl
from
"@mui/material/FormControl"
;
import
Select
,
{
SelectProps
}
from
"@mui/material/Select"
;
export
interface
IOption
{
label
:
string
;
value
:
string
;
disabled
?:
boolean
;
}
interface
IProps
extends
Omit
<
SelectProps
,
"value"
|
"options"
|
"onChange"
|
"title"
>
{
value
?:
IOption
;
options
:
IOption
[];
onChange
?:
(
val
:
IOption
)
=>
void
;
/** 类型变种 */
variant
?:
"standard"
|
"outlined"
|
"filled"
;
/** title */
title
?:
string
;
/** 是否显示title */
isTitle
?:
boolean
;
}
export
default
function
MySelect
(
props
:
IProps
)
{
const
{
value
,
options
,
onChange
,
title
,
isTitle
=
false
,
variant
}
=
props
;
const
handleChange
=
(
event
:
any
)
=>
{
const
newValue
=
options
?.
filter
((
item
)
=>
{
return
item
.
value
===
event
.
target
.
value
;
});
if
(
onChange
)
{
onChange
(
newValue
[
0
]
||
{
label
:
""
,
value
:
""
});
}
};
return
(
<
Box
sx=
{
{
minWidth
:
120
}
}
>
<
FormControl
fullWidth
variant=
{
variant
}
>
{
isTitle
?
(
<
InputLabel
id=
"demo-simple-select-label"
>
{
title
||
"请选择"
}
</
InputLabel
>
)
:
null
}
<
Select
labelId=
"demo-simple-select-label"
id=
"demo-simple-select"
label=
{
title
||
"请选择"
}
size=
"small"
{
...
props
}
value=
{
value
?.
value
}
onChange=
{
handleChange
}
>
{
options
.
length
?
options
?.
map
((
item
:
IOption
)
=>
{
return
(
<
MenuItem
value=
{
item
.
value
}
disabled=
{
item
?.
disabled
}
>
{
item
.
label
}
</
MenuItem
>
);
})
:
null
}
</
Select
>
</
FormControl
>
</
Box
>
);
}
src/components/mui/MyTitle.tsx
0 → 100644
View file @
65dc0ec4
import
{
Box
}
from
"@mui/material"
;
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-11 11:35:22
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-11 15:10:56
* @FilePath: /bkunyun/src/components/mui/MyTitle.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
interface
IProps
{
/** 标题 */
title
:
string
;
/** 自定义类名 */
className
?:
string
;
/** 自定义样式 */
style
?:
React
.
CSSProperties
;
}
const
MyTitle
=
(
props
:
IProps
)
=>
{
const
{
title
}
=
props
;
return
(
<
Box
style=
{
{
padding
:
12
,
}
}
{
...
props
}
>
<
span
style=
{
{
display
:
"inline-block"
,
color
:
"#1E2633"
,
fontSize
:
16
,
fontWeight
:
600
,
padding
:
"0px 2px 8px 2px"
,
borderBottom
:
"3px solid #1370FF"
,
}
}
>
{
title
}
</
span
>
</
Box
>
);
};
export
default
MyTitle
;
src/views/ConsoleLayout/components/FileItem/index.tsx
0 → 100644
View file @
65dc0ec4
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-11 15:46:42
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-11 15:49:11
* @FilePath: /bkunyun/src/views/ConsoleLayout/components/FileItem/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const
FileItem
=
()
=>
{
return
<
div
>
dd
</
div
>;
};
export
default
FileItem
;
src/views/ConsoleLayout/components/TransferList/index.tsx
0 → 100644
View file @
65dc0ec4
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-10 18:05:21
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-11 18:08:27
* @FilePath: /bkunyun/src/views/ConsoleLayout/components/TransferList/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
Box
,
InputLabel
,
MenuItem
,
Select
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
MySelect
from
"@/components/mui/MySelect"
;
import
MyTitle
from
"@/components/mui/MyTitle"
;
import
FileItem
from
"../FileItem"
;
const
TranSferList
=
()
=>
{
return
(
<
Box
style=
{
{
width
:
520
,
padding
:
20
}
}
>
<
MyTitle
title=
"传输列表"
/>
<
Box
style=
{
{
display
:
"flex"
,
justifyContent
:
"space-between"
,
alignItems
:
"center"
,
}
}
>
<
Box
style=
{
{
color
:
"#8A9099"
}
}
>
请勿在上传过程中刷新页面!
</
Box
>
<
MySelect
variant=
"standard"
value=
{
{
label
:
"默认线路"
,
value
:
"default"
,
}
}
onChange=
{
()
=>
console
.
log
(
11
)
}
options=
{
[
{
label
:
"默认线路"
,
value
:
"default"
,
},
]
}
size=
"small"
/>
</
Box
>
<
Box
>
<
FileItem
/>
</
Box
>
</
Box
>
);
};
export
default
memo
(
TranSferList
);
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