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
Administrator
bkunyun
Commits
6d5033b9
Commit
6d5033b9
authored
Aug 05, 2022
by
jiangzijing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加模板样式
parent
c054d7f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
109 deletions
+131
-109
index.module.css
...workbenchTemplate/components/AddTemplate/index.module.css
+2
-2
index.tsx
...kbench/workbenchTemplate/components/AddTemplate/index.tsx
+129
-107
No files found.
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.module.css
View file @
6d5033b9
...
...
@@ -15,8 +15,8 @@
}
.templateBox
{
padding
:
20px
32px
0
;
height
:
calc
(
100vh
-
1
8
8px
);
padding
:
0
32px
;
height
:
calc
(
100vh
-
1
6
8px
);
overflow
:
auto
;
}
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.tsx
View file @
6d5033b9
...
...
@@ -52,6 +52,18 @@ const AddTemplate = (props: IAddTemplateProps) => {
const
[
templateType
,
setTemplateType
]
=
useState
(
"public"
);
// 滚轮是否到顶,判断是否显示阴影
const
[
isTop
,
setIsTop
]
=
useState
(
true
)
// 滚动滚轮时监听是否到顶
const
onscroll
=
(
e
:
any
)
=>
{
if
(
e
.
target
.
scrollTop
<=
0
)
{
setIsTop
(
true
)
}
else
{
setIsTop
(
false
)
}
}
const
handleRadio
=
(
value
:
string
)
=>
{
setTemplateType
(
value
);
};
...
...
@@ -194,42 +206,49 @@ const AddTemplate = (props: IAddTemplateProps) => {
return
(
<
FullScreenDrawer
handleClose=
{
setShowAddTemplate
}
>
<
div
className=
{
style
.
content
}
>
<
Typography
sx=
{
{
fontSize
:
"18px"
,
fontWeight
:
"600"
,
color
:
"#1E2633"
}
}
>
添加工作流模版
</
Typography
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"space-between"
,
alignItems
:
"center"
,
marginBottom
:
"20px"
,
}
}
<
div
className=
{
classNames
({
[
style
.
headerBox
]:
true
,
[
style
.
headerBoxShadow
]:
!
isTop
,
})
}
>
<
OutlinedInput
value=
{
title
}
onChange=
{
(
e
:
any
)
=>
{
setTitle
(
e
.
target
.
value
);
}
}
placeholder=
"输入关键词搜索"
size=
"small"
sx=
{
{
width
:
340
,
height
:
32
,
marginTop
:
"20px"
}
}
endAdornment=
{
<
SearchIcon
style=
{
{
color
:
"#8A9099"
}
}
/>
}
/>
<
Typography
sx=
{
{
fontSize
:
"18px"
,
fontWeight
:
"600"
,
color
:
"#1E2633"
}
}
>
添加工作流模版
</
Typography
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"
flex-end
"
,
justifyContent
:
"
space-between
"
,
alignItems
:
"center"
,
paddingBottom
:
"20px"
,
paddingTop
:
"20px"
,
}
}
>
<
RadioGroupOfButtonStyle
value=
{
templateType
}
radioOptions=
{
radioOptions
}
handleRadio=
{
handleRadio
}
></
RadioGroupOfButtonStyle
>
{
/* <MyButton
<
OutlinedInput
value=
{
title
}
onChange=
{
(
e
:
any
)
=>
{
setTitle
(
e
.
target
.
value
);
}
}
placeholder=
"输入关键词搜索"
size=
"small"
sx=
{
{
width
:
340
,
height
:
32
}
}
endAdornment=
{
<
SearchIcon
style=
{
{
color
:
"#8A9099"
}
}
/>
}
/>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"flex-end"
,
alignItems
:
"center"
,
}
}
>
<
RadioGroupOfButtonStyle
value=
{
templateType
}
radioOptions=
{
radioOptions
}
handleRadio=
{
handleRadio
}
></
RadioGroupOfButtonStyle
>
{
/* <MyButton
onClick={handleAddTemplate}
size={"small"}
style={{
...
...
@@ -242,84 +261,86 @@ const AddTemplate = (props: IAddTemplateProps) => {
: `(${selectTemplateData.length})`)
}
/> */
}
</
Box
>
</
Box
>
</
Box
>
{
templateType
===
"public"
&&
addTemplateList
.
length
===
0
&&
(
<
Box
sx=
{
{
display
:
"flex"
,
alignItems
:
"center"
,
flexDirection
:
"column"
,
minHeight
:
"calc(100vh - 376px)"
,
justifyContent
:
"center"
,
}
}
>
<
img
alt=
""
src=
{
noData
}
/>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#8A9099"
}
}
>
暂无相关模版
</
Typography
>
</
Box
>
)
}
<
div
className=
{
style
.
templateList
}
>
{
templateType
!==
"public"
&&
(
<
div
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
addCustomTemplate
]:
true
,
})
}
onClick=
{
handleAddCustomTemplate
}
</
div
>
<
div
className=
{
style
.
templateBox
}
onScroll=
{
onscroll
}
>
{
templateType
===
"public"
&&
addTemplateList
.
length
===
0
&&
(
<
Box
sx=
{
{
display
:
"flex"
,
alignItems
:
"center"
,
flexDirection
:
"column"
,
minHeight
:
"calc(100vh - 376px)"
,
justifyContent
:
"center"
,
}
}
>
<
AddIcon
/>
<
span
className=
{
style
.
addCustomTemplateText
}
>
创建自定义模板
</
span
>
</
div
>
<
img
alt=
""
src=
{
noData
}
/>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#8A9099"
}
}
>
暂无相关模版
</
Typography
>
</
Box
>
)
}
{
addTemplateList
.
map
((
item
:
any
,
index
)
=>
{
return
(
<
div
className=
{
style
.
templateList
}
>
{
templateType
!==
"public"
&&
(
<
div
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
templateLiCustom
]:
templateType
!==
"public"
,
[
style
.
addCustomTemplate
]:
true
,
})
}
key=
{
index
}
onClick=
{
()
=>
{
handleSelectTemplate
(
item
.
id
);
}
}
onClick=
{
handleAddCustomTemplate
}
>
<
div
className=
{
style
.
templateLiTop
}
>
<
span
className=
{
style
.
templateTitle
}
>
{
item
.
title
}
</
span
>
{
/* <Checkbox
<
AddIcon
/>
<
span
className=
{
style
.
addCustomTemplateText
}
>
创建自定义模板
</
span
>
</
div
>
)
}
{
addTemplateList
.
map
((
item
:
any
,
index
)
=>
{
return
(
<
div
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
templateLiCustom
]:
templateType
!==
"public"
,
})
}
key=
{
index
}
onClick=
{
()
=>
{
handleSelectTemplate
(
item
.
id
);
}
}
>
<
div
className=
{
style
.
templateLiTop
}
>
<
span
className=
{
style
.
templateTitle
}
>
{
item
.
title
}
</
span
>
{
/* <Checkbox
size="small"
sx={{ padding: "0px" }}
checked={selectTemplateData.includes(item.id)}
/> */
}
</
div
>
<
div
className=
{
style
.
templateLiInfo
}
>
<
span
className=
{
style
.
templateLiInfoText
}
style=
{
{
marginRight
:
"24px"
}
}
>
版本:
{
item
.
version
}
</
span
>
<
span
className=
{
style
.
templateLiInfoText
}
>
更新时间:
{
item
.
updatedTime
}
</
span
>
</
div
>
<
div
className=
{
style
.
templateLiDesc
}
>
{
item
.
description
}
</
div
>
</
div
>
<
div
className=
{
style
.
templateLiInfo
}
>
<
span
className=
{
style
.
templateLiInfoText
}
style=
{
{
marginRight
:
"24px"
}
}
>
版本:
{
item
.
version
}
</
span
>
<
span
className=
{
style
.
templateLiInfoText
}
>
更新时间:
{
item
.
updatedTime
}
</
span
>
</
div
>
<
div
className=
{
style
.
templateLiDesc
}
>
{
item
.
description
}
</
div
>
<
div
className=
{
style
.
templateLiEditBox
}
>
<
MySwitch
defaultChecked=
{
item
.
favorited
}
onChange=
{
(
e
:
any
)
=>
templateSwitch
(
e
,
item
.
id
)
}
></
MySwitch
>
</
div
>
<
div
className=
{
style
.
templateLiEditBox
}
>
<
MySwitch
defaultChecked=
{
item
.
favorited
}
onChange=
{
(
e
:
any
)
=>
templateSwitch
(
e
,
item
.
id
)
}
></
MySwitch
>
</
div
>
{
/* {templateType !== "public" && (
{
/* {templateType !== "public" && (
<MyButton
onClick={() => handleEditTemplate(item)}
size={"small"}
...
...
@@ -331,22 +352,23 @@ const AddTemplate = (props: IAddTemplateProps) => {
/>
</div>
)} */
}
</
div
>
);
})
}
{
hiddenBoxArr
.
length
!==
4
&&
hiddenBoxArr
.
map
((
item
,
index
)
=>
{
return
(
<
div
key=
{
`-${index}`
}
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
templateLiHidden
]:
true
,
})
}
/>
</
div
>
);
})
}
{
hiddenBoxArr
.
length
!==
4
&&
hiddenBoxArr
.
map
((
item
,
index
)
=>
{
return
(
<
div
key=
{
`-${index}`
}
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
templateLiHidden
]:
true
,
})
}
/>
);
})
}
</
div
>
</
div
>
</
div
>
{
customTemplateInfo
?.
show
?
(
...
...
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