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
d2999545
Commit
d2999545
authored
Oct 31, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 模板卡片样式统一
parent
dfc077f7
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
248 additions
and
417 deletions
+248
-417
index.tsx
src/components/CommonComponents/CardTable/index.tsx
+16
-0
index.module.css
...workbenchTemplate/components/AddTemplate/index.module.css
+14
-76
index.tsx
...kbench/workbenchTemplate/components/AddTemplate/index.tsx
+22
-88
templateBox.tsx
...ectWorkbench/workbenchTemplate/components/templateBox.tsx
+0
-151
index.tsx
...iews/Project/ProjectWorkbench/workbenchTemplate/index.tsx
+80
-17
index.module.scss
...rces/UserResourcesTemplate/TemplateItem/index.module.scss
+56
-0
index.tsx
...serResources/UserResourcesTemplate/TemplateItem/index.tsx
+51
-0
index.module.css
...nter/UserResources/UserResourcesTemplate/index.module.css
+1
-58
index.tsx
...ourceCenter/UserResources/UserResourcesTemplate/index.tsx
+8
-27
No files found.
src/components/CommonComponents/CardTable/index.tsx
View file @
d2999545
...
@@ -9,6 +9,7 @@ interface ICardTableProps {
...
@@ -9,6 +9,7 @@ interface ICardTableProps {
numberOfColumns
?:
number
;
// 列数 每行渲染几个
numberOfColumns
?:
number
;
// 列数 每行渲染几个
horizontalSpacing
?:
number
;
// 水平方向的间隔
horizontalSpacing
?:
number
;
// 水平方向的间隔
verticalSpacing
?:
number
;
// 垂直方向的间隔
verticalSpacing
?:
number
;
// 垂直方向的间隔
renderBefore
?:
any
;
}
}
const
CardTable
=
(
props
:
ICardTableProps
)
=>
{
const
CardTable
=
(
props
:
ICardTableProps
)
=>
{
...
@@ -20,6 +21,7 @@ const CardTable = (props: ICardTableProps) => {
...
@@ -20,6 +21,7 @@ const CardTable = (props: ICardTableProps) => {
horizontalSpacing
=
20
,
horizontalSpacing
=
20
,
verticalSpacing
=
20
,
verticalSpacing
=
20
,
itemMinWidth
,
itemMinWidth
,
renderBefore
,
}
=
props
;
}
=
props
;
const
[
numberOfColumns
,
setNumberOfColumns
]
=
useState
(
3
);
const
[
numberOfColumns
,
setNumberOfColumns
]
=
useState
(
3
);
...
@@ -59,6 +61,20 @@ const CardTable = (props: ICardTableProps) => {
...
@@ -59,6 +61,20 @@ const CardTable = (props: ICardTableProps) => {
}
}
}
}
ref=
{
tableBoxRef
}
ref=
{
tableBoxRef
}
>
>
{
renderBefore
&&
(
<
div
className=
{
style
.
itemBox
}
style=
{
{
width
:
boxWidth
,
paddingLeft
:
`${horizontalSpacing / 2}px`
,
paddingRight
:
`${horizontalSpacing / 2}px`
,
paddingBottom
:
`${verticalSpacing}px`
,
boxSizing
:
"border-box"
,
}
}
>
{
renderBefore
()
}
</
div
>
)
}
{
data
.
map
((
item
,
index
)
=>
{
{
data
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
div
<
div
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.module.css
View file @
d2999545
...
@@ -20,42 +20,26 @@
...
@@ -20,42 +20,26 @@
overflow
:
overlay
;
overflow
:
overlay
;
}
}
.templateList
{
.addTemplate
{
/* height: 2000px; */
border
:
2px
solid
#fff
;
display
:
flex
;
box-shadow
:
0px
3px
12px
0px
rgba
(
3
,
47
,
105
,
0.09
);
justify-content
:
space-between
;
border-radius
:
6px
;
flex-wrap
:
wrap
;
background
:
linear-gradient
(
180deg
,
#f5f7fa
0%
,
#ffffff
100%
);
}
height
:
208px
;
.templateLi
{
height
:
170px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
16px
20px
;
padding
:
16px
20px
;
/* cursor: pointer; */
transition
:
box-shadow
0.2s
cubic-bezier
(
0
,
0
,
1
,
1
);
border
:
1px
solid
rgba
(
235
,
237
,
240
,
1
);
border-radius
:
4px
;
min-width
:
20%
;
flex
:
1
;
margin-right
:
16px
;
margin-bottom
:
16px
;
transition
:
box-shadow
.2s
cubic-bezier
(
0
,
0
,
1
,
1
);
}
.templateLiCustom
{
height
:
170px
;
}
.templateLiHidden
{
visibility
:
hidden
;
}
.addCustomTemplate
{
height
:
170px
;
box-sizing
:
border-box
;
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
flex-direction
:
column
;
flex-direction
:
column
;
height
:
208px
;
box-sizing
:
border-box
;
cursor
:
pointer
;
}
.addTemplate
:hover
{
box-shadow
:
0px
6px
24px
0px
rgb
(
3
47
105
/
14%
);
}
}
.addCustomTemplateText
{
.addCustomTemplateText
{
...
@@ -65,53 +49,7 @@
...
@@ -65,53 +49,7 @@
color
:
rgba
(
138
,
144
,
153
,
1
);
color
:
rgba
(
138
,
144
,
153
,
1
);
}
}
.templateLi
:hover
{
box-shadow
:
6px
8px
22px
0px
rgba
(
0
,
24
,
57
,
0.08
);
}
.templateLi
:nth-child
(
4n
)
{
margin-right
:
0
;
}
.templateLiTop
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.templateTitle
{
font-size
:
14px
;
font-weight
:
600
;
color
:
#1e2633
;
margin-bottom
:
4px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
line-height
:
22px
;
}
.templateLiInfo
{
margin-bottom
:
8px
;
}
.templateLiInfoText
{
line-height
:
20px
;
font-size
:
12px
;
color
:
rgba
(
19
,
112
,
255
,
1
);
}
.templateLiDesc
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
3
;
display
:
-webkit-box
;
height
:
54px
;
font-size
:
12px
;
color
:
rgba
(
138
,
144
,
153
,
1
);
}
.templateLiEditBox
{
.templateLiEditBox
{
display
:
flex
;
display
:
flex
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
/* margin-top: 16px; */
}
}
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.tsx
View file @
d2999545
...
@@ -12,6 +12,8 @@ import AddIcon from "@mui/icons-material/Add";
...
@@ -12,6 +12,8 @@ import AddIcon from "@mui/icons-material/Add";
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
noData
from
"../../../../../../assets/project/noTemplate.svg"
;
import
noData
from
"../../../../../../assets/project/noTemplate.svg"
;
import
{
ICustomTemplate
}
from
"../../interface"
;
import
{
ICustomTemplate
}
from
"../../interface"
;
import
TemplateItem
from
"@/views/ResourceCenter/UserResources/UserResourcesTemplate/TemplateItem"
;
import
CardTable
from
"@/components/CommonComponents/CardTable"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
import
{
getAddWorkbenchTemplate
,
getAddWorkbenchTemplate
,
...
@@ -203,16 +205,6 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -203,16 +205,6 @@ const AddTemplate = (props: IAddTemplateProps) => {
}
}
};
};
const
hiddenBoxArr
=
useMemo
(()
=>
{
const
length
=
templateType
===
"public"
?
addTemplateList
.
length
:
addTemplateList
.
length
+
1
;
const
hiddenBoxNumber
=
4
-
(
length
%
4
);
const
arr
=
new
Array
(
hiddenBoxNumber
).
fill
(
""
);
return
arr
;
},
[
addTemplateList
,
templateType
]);
return
(
return
(
<
FullScreenDrawer
handleClose=
{
setShowAddTemplate
}
>
<
FullScreenDrawer
handleClose=
{
setShowAddTemplate
}
>
<
div
className=
{
style
.
content
}
>
<
div
className=
{
style
.
content
}
>
...
@@ -259,19 +251,6 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -259,19 +251,6 @@ const AddTemplate = (props: IAddTemplateProps) => {
radioOptions=
{
radioOptions
}
radioOptions=
{
radioOptions
}
handleRadio=
{
handleRadio
}
handleRadio=
{
handleRadio
}
/>
/>
{
/* <MyButton
onClick={handleAddTemplate}
size={"small"}
style={{
marginLeft: "12px",
}}
text={
"添加模版" +
(selectTemplateData.length === 0
? ""
: `(${selectTemplateData.length})`)
}
/> */
}
</
Box
>
</
Box
>
</
Box
>
</
Box
>
</
div
>
</
div
>
...
@@ -294,12 +273,14 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -294,12 +273,14 @@ const AddTemplate = (props: IAddTemplateProps) => {
</
Typography
>
</
Typography
>
</
Box
>
</
Box
>
)
}
)
}
<
div
className=
{
style
.
templateList
}
>
<
CardTable
{
templateType
!==
"public"
&&
(
data=
{
addTemplateList
}
renderBefore=
{
()
=>
{
if
(
templateType
!==
"public"
)
{
return
(
<
div
<
div
className=
{
classNames
({
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
addTemplate
]:
true
,
[
style
.
addCustomTemplate
]:
true
,
})
}
})
}
onClick=
{
handleAddCustomTemplate
}
onClick=
{
handleAddCustomTemplate
}
>
>
...
@@ -308,76 +289,29 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -308,76 +289,29 @@ const AddTemplate = (props: IAddTemplateProps) => {
创建自定义模板
创建自定义模板
</
span
>
</
span
>
</
div
>
</
div
>
)
}
);
{
addTemplateList
.
map
((
item
:
any
,
index
)
=>
{
}
return
(
return
null
;
<
div
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
templateLiCustom
]:
templateType
!==
"public"
,
})
}
key=
{
index
}
onClick=
{
()
=>
{
handleSelectTemplate
(
item
.
id
);
}
}
}
}
>
renderItem=
{
(
item
:
any
)
=>
{
<
div
className=
{
style
.
templateLiTop
}
>
return
(
<
span
className=
{
style
.
templateTitle
}
>
{
item
.
title
}
</
span
>
<
TemplateItem
{
/* <Checkbox
templateInfo=
{
item
}
size="small"
footer=
{
()
=>
{
sx={{ padding: "0px" }}
return
(
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
className=
{
style
.
templateLiEditBox
}
>
<
div
className=
{
style
.
templateLiEditBox
}
>
<
MySwitch
<
MySwitch
defaultChecked=
{
item
.
favorited
}
defaultChecked=
{
item
.
favorited
}
onChange=
{
(
e
:
any
)
=>
templateSwitch
(
e
,
item
.
id
)
}
onChange=
{
(
e
:
any
)
=>
templateSwitch
(
e
,
item
.
id
)
}
></
MySwitch
>
></
MySwitch
>
</
div
>
</
div
>
{
/* {templateType !== "public" && (
<MyButton
onClick={() => handleEditTemplate(item)}
size={"small"}
style={{
height: "32px",
}}
color="inherit"
text="编辑模板"
/>
</div>
)} */
}
</
div
>
);
);
})
}
}
}
></
TemplateItem
>
{
hiddenBoxArr
.
length
!==
4
&&
hiddenBoxArr
.
map
((
item
,
index
)
=>
{
return
(
<
div
key=
{
`-${index}`
}
className=
{
classNames
({
[
style
.
templateLi
]:
true
,
[
style
.
templateLiHidden
]:
true
,
})
}
/>
);
);
})
}
}
}
</
div
>
itemMinWidth=
{
377
}
></
CardTable
>
</
div
>
</
div
>
</
div
>
</
div
>
{
customTemplateInfo
?.
show
?
(
{
customTemplateInfo
?.
show
?
(
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/templateBox.tsx
deleted
100644 → 0
View file @
dfc077f7
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-17 14:48:57
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-27 14:02:54
* @FilePath: /bkunyun/src/views/Project/ProjectWorkbench/workbenchTemplate/components/templateBox.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
memo
,
useCallback
,
useState
}
from
"react"
;
import
styles
from
"../index.module.css"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
usePass
from
"@/hooks/usePass"
;
import
RemindBudgetDialog
from
"./RemindBudgetDialog"
;
import
{
useNavigate
}
from
"react-router-dom"
;
import
{
toJS
}
from
"mobx"
;
import
{
useStores
}
from
"@/store"
;
import
{
observer
}
from
"mobx-react-lite"
;
const
TemplateBox
=
observer
((
props
:
any
)
=>
{
const
info
=
props
.
data
;
const
{
isParentUser
,
isOwner
,
greaterThan100
}
=
props
;
const
{
currentProjectStore
}
=
useStores
();
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
// 产品ID
const
isPass
=
usePass
();
const
navigate
=
useNavigate
();
const
[
rbOpen
,
setRbOpen
]
=
useState
(
false
);
const
[
id
,
setId
]
=
useState
(
""
);
const
goToProjectSubmitWork
=
useCallback
(
(
id
:
string
)
=>
{
navigate
(
`/product/
${
productId
||
"cadd"
}
/projectSubmitWork`
,
{
state
:
{
id
},
});
},
[
navigate
,
productId
]
);
const
handleJudgeBudget
=
useCallback
(
(
id
:
string
)
=>
{
setId
(
id
);
if
(
greaterThan100
)
{
goToProjectSubmitWork
(
id
);
}
else
{
setRbOpen
(
true
);
}
},
[
goToProjectSubmitWork
,
setRbOpen
,
setId
,
greaterThan100
]
);
return
(
<>
<
Box
className=
{
styles
.
template
}
>
<
Box
className=
{
styles
.
templateBlock
}
>
<
Box
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"space-between"
,
alignItems
:
"center"
,
}
}
>
<
Typography
sx=
{
{
fontSize
:
"14px"
,
fontWeight
:
"600"
,
color
:
"#1E2633"
,
marginBottom
:
"4px"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
}
}
>
{
info
.
title
}
</
Typography
>
{
info
.
creator
!==
"root"
&&
(
<
Box
sx=
{
{
backgroundColor
:
"rgba(227, 250, 236, 1)"
,
color
:
"rgba(2, 171, 131, 1)"
,
lineHeight
:
"20px"
,
padding
:
"1px 9px"
,
fontSize
:
"12px"
,
}
}
>
自定义
</
Box
>
)
}
</
Box
>
<
Box
sx=
{
{
display
:
"flex"
,
marginBottom
:
"8px"
}
}
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
,
marginRight
:
"24px"
,
}
}
>
版本:
{
info
.
version
}
</
Typography
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
}
}
>
更新时间:
{
info
.
updatedTime
}
</
Typography
>
</
Box
>
<
Typography
className=
{
styles
.
templateDescText
}
>
{
info
.
description
?
info
.
description
:
"此模板暂无描述。"
}
</
Typography
>
</
Box
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"end"
,
}
}
>
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"MANAGER"
)
&&
(
<
MyButton
size=
"medium"
text=
"移除模版"
onClick=
{
()
=>
{
props
.
startDialog
(
info
.
id
);
}
}
style=
{
{
backgroundColor
:
"#F0F2F5"
,
color
:
"#565C66"
}
}
/>
)
}
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"USER"
)
&&
(
<
MyButton
size=
"medium"
text=
"使用模版"
onClick=
{
()
=>
handleJudgeBudget
(
info
.
id
)
}
style=
{
{
marginLeft
:
"12px"
}
}
/>
)
}
</
Box
>
</
Box
>
</
Box
>
{
rbOpen
&&
(
<
RemindBudgetDialog
rbOpen=
{
rbOpen
}
rbClose=
{
()
=>
setRbOpen
(
false
)
}
id=
{
id
}
goToProjectSubmitWork=
{
goToProjectSubmitWork
}
isParentUser=
{
isParentUser
}
isOwner=
{
isOwner
}
></
RemindBudgetDialog
>
)
}
</>
);
});
export
default
memo
(
TemplateBox
);
src/views/Project/ProjectWorkbench/workbenchTemplate/index.tsx
View file @
d2999545
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
import
{
memo
,
useEffect
,
useState
}
from
"react"
;
import
{
memo
,
useEffect
,
useState
,
useCallback
}
from
"react"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
{
toJS
}
from
"mobx"
;
import
{
toJS
}
from
"mobx"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
...
@@ -16,10 +16,13 @@ import { getLoaclStorageOfKey } from "@/api/fileserver/utils";
...
@@ -16,10 +16,13 @@ import { getLoaclStorageOfKey } from "@/api/fileserver/utils";
import
MyButton
from
"@/components/mui/MyButton"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
SearchInput
from
"@/components/BusinessComponents/SearchInput"
;
import
SearchInput
from
"@/components/BusinessComponents/SearchInput"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
TemplateBox
from
"./components/templateBox"
;
import
{
useNavigate
}
from
"react-router-dom"
;
import
TemplateItem
from
"@/views/ResourceCenter/UserResources/UserResourcesTemplate/TemplateItem"
;
import
SimpleDialog
from
"./components/simpleDialog"
;
import
SimpleDialog
from
"./components/simpleDialog"
;
import
AddTemplate
from
"./components/AddTemplate/index"
;
import
AddTemplate
from
"./components/AddTemplate/index"
;
import
noData
from
"../../../../assets/project/noTemplate.svg"
;
import
noData
from
"../../../../assets/project/noTemplate.svg"
;
import
RemindBudgetDialog
from
"./components/RemindBudgetDialog"
;
import
CardTable
from
"@/components/CommonComponents/CardTable"
;
import
{
import
{
getWorkbenchTemplate
,
getWorkbenchTemplate
,
deleteWorkbenchTemplate
,
deleteWorkbenchTemplate
,
...
@@ -37,7 +40,10 @@ const ProjectMembers = observer(() => {
...
@@ -37,7 +40,10 @@ const ProjectMembers = observer(() => {
const
{
currentProjectStore
}
=
useStores
();
const
{
currentProjectStore
}
=
useStores
();
const
projectIdData
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
projectIdData
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
navigate
=
useNavigate
();
const
isPass
=
usePass
();
const
isPass
=
usePass
();
const
[
selectId
,
setSelectId
]
=
useState
(
""
);
const
[
rbOpen
,
setRbOpen
]
=
useState
(
false
);
/** 搜索模板名称 */
/** 搜索模板名称 */
const
[
templateName
,
setTemplateName
]
=
useState
(
""
);
const
[
templateName
,
setTemplateName
]
=
useState
(
""
);
...
@@ -156,6 +162,27 @@ const ProjectMembers = observer(() => {
...
@@ -156,6 +162,27 @@ const ProjectMembers = observer(() => {
});
});
},
[
currentProjectStore
.
currentProjectInfo
.
id
,
getProjectFn
]);
},
[
currentProjectStore
.
currentProjectInfo
.
id
,
getProjectFn
]);
const
goToProjectSubmitWork
=
useCallback
(
(
id
:
string
)
=>
{
navigate
(
`/product/
${
productId
||
"cadd"
}
/projectSubmitWork`
,
{
state
:
{
id
},
});
},
[
navigate
,
productId
]
);
const
handleJudgeBudget
=
useCallback
(
(
id
:
string
)
=>
{
setSelectId
(
id
);
if
(
greaterThan100
)
{
goToProjectSubmitWork
(
id
);
}
else
{
setRbOpen
(
true
);
}
},
[
goToProjectSubmitWork
,
setRbOpen
,
setSelectId
,
greaterThan100
]
);
return
(
return
(
<
Box
className=
{
styles
.
headerBox
}
>
<
Box
className=
{
styles
.
headerBox
}
>
<
Box
className=
{
styles
.
tabBox
}
>
<
Box
className=
{
styles
.
tabBox
}
>
...
@@ -188,24 +215,49 @@ const ProjectMembers = observer(() => {
...
@@ -188,24 +215,49 @@ const ProjectMembers = observer(() => {
</
Typography
>
</
Typography
>
</
Box
>
</
Box
>
)
}
)
}
{
templateList
.
length
>
0
&&
(
<
CardTable
<
Box
className=
{
styles
.
templateBox
}
>
data=
{
templateList
}
{
templateList
&&
renderItem=
{
(
item
:
any
)
=>
{
templateList
.
length
>
0
&&
templateList
.
map
((
item
,
key
)
=>
{
return
(
return
(
<
TemplateBox
<
TemplateItem
key=
{
key
}
templateInfo=
{
item
}
data=
{
item
}
footer=
{
()
=>
{
startDialog=
{
startDialog
}
return
(
isParentUser=
{
isParentUser
}
<
Box
isOwner=
{
isOwner
}
sx=
{
{
greaterThan100=
{
greaterThan100
}
display
:
"flex"
,
justifyContent
:
"end"
,
}
}
>
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"MANAGER"
)
&&
(
<
MyButton
size=
"medium"
text=
"移除模版"
onClick=
{
()
=>
{
startDialog
(
item
.
id
);
}
}
style=
{
{
backgroundColor
:
"#F0F2F5"
,
color
:
"#565C66"
,
}
}
/>
/>
);
})
}
</
Box
>
)
}
)
}
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"USER"
)
&&
(
<
MyButton
size=
"medium"
text=
"使用模版"
onClick=
{
()
=>
handleJudgeBudget
(
item
.
id
)
}
style=
{
{
marginLeft
:
"12px"
}
}
/>
)
}
</
Box
>
);
}
}
></
TemplateItem
>
);
}
}
itemMinWidth=
{
377
}
></
CardTable
>
{
showAddTemplate
&&
(
{
showAddTemplate
&&
(
<
AddTemplate
<
AddTemplate
...
@@ -222,6 +274,17 @@ const ProjectMembers = observer(() => {
...
@@ -222,6 +274,17 @@ const ProjectMembers = observer(() => {
/>
/>
)
}
)
}
{
rbOpen
&&
(
<
RemindBudgetDialog
rbOpen=
{
rbOpen
}
rbClose=
{
()
=>
setRbOpen
(
false
)
}
id=
{
selectId
}
goToProjectSubmitWork=
{
goToProjectSubmitWork
}
isParentUser=
{
isParentUser
}
isOwner=
{
isOwner
}
></
RemindBudgetDialog
>
)
}
<
SimpleDialog
<
SimpleDialog
text=
{
"确认移除该模板吗?"
}
text=
{
"确认移除该模板吗?"
}
title=
"移除模板"
title=
"移除模板"
...
...
src/views/ResourceCenter/UserResources/UserResourcesTemplate/TemplateItem/index.module.scss
0 → 100644
View file @
d2999545
.templateBox
{
border
:
2px
solid
#fff
;
box-shadow
:
0px
3px
12px
0px
rgba
(
3
,
47
,
105
,
0
.09
);
border-radius
:
6px
;
background
:
linear-gradient
(
180deg
,
#f5f7fa
0%
,
#ffffff
100%
);
height
:
208px
;
box-sizing
:
border-box
;
padding
:
16px
20px
;
transition
:
box-shadow
0
.2s
cubic-bezier
(
0
,
0
,
1
,
1
);
&
:hover
{
box-shadow
:
0px
6px
24px
0px
rgb
(
3
47
105
/
14%
);
}
.templateTop
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-start
;
margin-bottom
:
12px
;
.templateTopItem
{
font-size
:
12px
;
line-height
:
20px
;
color
:
rgba
(
138
,
144
,
153
,
1
);
}
.templateTopLine
{
width
:
1px
;
height
:
16px
;
background-color
:
rgba
(
221
,
225
,
230
,
1
);
margin
:
0
11px
;
}
}
.templateTitleBox
{
height
:
24px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-start
;
margin-bottom
:
12px
;
.templateTitle
{
font-size
:
15px
;
line-height
:
22px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
margin-left
:
8px
;
font-weight
:
550
;
}
}
.templateDesc
{
height
:
60px
;
font-size
:
12px
;
line-height
:
20px
;
color
:
rgba
(
86
,
92
,
102
,
1
);
margin-bottom
:
16px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
3
;
display
:
-
webkit-box
;
}
}
src/views/ResourceCenter/UserResources/UserResourcesTemplate/TemplateItem/index.tsx
0 → 100644
View file @
d2999545
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
templateIcon
from
"@/assets/resourceCenter/templateIcon.svg"
;
import
style
from
"./index.module.scss"
;
interface
ITemplateItemPorps
{
templateInfo
:
any
;
footer
:
any
;
}
const
TemplateItem
=
(
props
:
ITemplateItemPorps
)
=>
{
const
{
templateInfo
,
footer
}
=
props
;
const
{
productListStore
}
=
useStores
();
const
getProductName
=
(
productId
:
string
)
=>
{
let
res
=
"-"
;
toJS
(
productListStore
.
productList
).
forEach
((
item
)
=>
{
if
(
item
.
value
===
productId
)
{
res
=
item
.
label
;
}
});
return
res
;
};
return
(
<
div
className=
{
style
.
templateBox
}
>
<
div
className=
{
style
.
templateTop
}
>
<
div
className=
{
style
.
templateTopItem
}
>
{
getProductName
(
templateInfo
.
productId
)
}
</
div
>
{
templateInfo
.
creator
!==
"root"
&&
(
<>
<
div
className=
{
style
.
templateTopLine
}
></
div
>
<
div
className=
{
style
.
templateTopItem
}
>
自定义
</
div
>
</>
)
}
<
div
className=
{
style
.
templateTopLine
}
></
div
>
<
div
className=
{
style
.
templateTopItem
}
>
{
templateInfo
.
version
}
</
div
>
<
div
className=
{
style
.
templateTopLine
}
></
div
>
<
div
className=
{
style
.
templateTopItem
}
>
{
templateInfo
.
updatedTime
}
</
div
>
</
div
>
<
div
className=
{
style
.
templateTitleBox
}
>
<
img
src=
{
templateIcon
}
alt=
""
/>
<
div
className=
{
style
.
templateTitle
}
>
{
templateInfo
.
title
}
</
div
>
</
div
>
<
div
className=
{
style
.
templateDesc
}
>
{
templateInfo
.
description
}
</
div
>
{
footer
&&
footer
()
}
</
div
>
);
};
export
default
TemplateItem
;
src/views/ResourceCenter/UserResources/UserResourcesTemplate/index.module.css
View file @
d2999545
...
@@ -10,64 +10,7 @@
...
@@ -10,64 +10,7 @@
.tableBox
{
.tableBox
{
height
:
calc
(
100vh
-
177px
);
height
:
calc
(
100vh
-
177px
);
}
}
.templateBox
{
border
:
2px
solid
#fff
;
box-shadow
:
0px
3px
12px
0px
rgba
(
3
,
47
,
105
,
0.09
);
border-radius
:
6px
;
background
:
linear-gradient
(
180deg
,
#f5f7fa
0%
,
#ffffff
100%
);
height
:
208px
;
box-sizing
:
border-box
;
padding
:
16px
20px
;
transition
:
box-shadow
0.2s
cubic-bezier
(
0
,
0
,
1
,
1
);
}
.templateBox
:hover
{
box-shadow
:
0px
6px
24px
0px
rgb
(
3
47
105
/
14%
);
}
.templateTop
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-start
;
margin-bottom
:
12px
;
}
.templateTopItem
{
font-size
:
12px
;
line-height
:
20px
;
color
:
rgba
(
138
,
144
,
153
,
1
);
}
.templateTopLine
{
width
:
1px
;
height
:
16px
;
background-color
:
rgba
(
221
,
225
,
230
,
1
);
margin
:
0
11px
;
}
.templateTitleBox
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-start
;
margin-bottom
:
12px
;
}
.templateTitleBox
{
height
:
24px
;
}
.templateTitle
{
font-size
:
15px
;
line-height
:
22px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
margin-left
:
8px
;
font-weight
:
550
;
}
.templateDesc
{
height
:
60px
;
font-size
:
12px
;
line-height
:
20px
;
color
:
rgba
(
86
,
92
,
102
,
1
);
margin-bottom
:
16px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
3
;
display
:
-webkit-box
;
}
.templateButtons
{
.templateButtons
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
src/views/ResourceCenter/UserResources/UserResourcesTemplate/index.tsx
View file @
d2999545
...
@@ -8,14 +8,13 @@ import CardTable from "@/components/CommonComponents/CardTable";
...
@@ -8,14 +8,13 @@ import CardTable from "@/components/CommonComponents/CardTable";
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
getWorkflowspecList
,
deleteWorkflowspec
}
from
"@/api/resourceCenter"
;
import
{
getWorkflowspecList
,
deleteWorkflowspec
}
from
"@/api/resourceCenter"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
templateIcon
from
"@/assets/resourceCenter/templateIcon.svg"
;
import
{
useStores
}
from
"@/store"
;
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
ProductSelect
from
"@/components/BusinessComponents/ProductSelect"
;
import
ProductSelect
from
"@/components/BusinessComponents/ProductSelect"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
TemplateDetail
from
"./TemplateDetail"
;
import
TemplateDetail
from
"./TemplateDetail"
;
import
style
from
"./index.module.css"
;
import
style
from
"./index.module.css"
;
import
TemplateItem
from
"./TemplateItem"
;
import
NoData
from
"@/components/BusinessComponents/NoData"
;
import
NoData
from
"@/components/BusinessComponents/NoData"
;
const
UserResourcesTemplate
=
observer
(()
=>
{
const
UserResourcesTemplate
=
observer
(()
=>
{
...
@@ -30,32 +29,12 @@ const UserResourcesTemplate = observer(() => {
...
@@ -30,32 +29,12 @@ const UserResourcesTemplate = observer(() => {
const
[
productId
,
setProductId
]
=
useState
(
""
);
// 新增模板用
const
[
productId
,
setProductId
]
=
useState
(
""
);
// 新增模板用
const
[
list
,
setList
]
=
useState
([]);
const
[
list
,
setList
]
=
useState
([]);
const
{
productListStore
}
=
useStores
();
const
{
productListStore
}
=
useStores
();
const
getProductName
=
(
productId
:
string
)
=>
{
let
res
=
"-"
;
toJS
(
productListStore
.
productList
).
forEach
((
item
)
=>
{
if
(
item
.
value
===
productId
)
{
res
=
item
.
label
;
}
});
return
res
;
};
const
renderItem
=
(
item
:
any
)
=>
{
const
renderItem
=
(
item
:
any
)
=>
{
return
(
return
(
<
div
className=
{
style
.
templateBox
}
>
<
TemplateItem
<
div
className=
{
style
.
templateTop
}
>
templateInfo=
{
item
}
<
div
className=
{
style
.
templateTopItem
}
>
footer=
{
()
=>
{
{
getProductName
(
item
.
productId
)
}
return
(
</
div
>
<
div
className=
{
style
.
templateTopLine
}
></
div
>
<
div
className=
{
style
.
templateTopItem
}
>
{
item
.
version
}
</
div
>
<
div
className=
{
style
.
templateTopLine
}
></
div
>
<
div
className=
{
style
.
templateTopItem
}
>
{
item
.
updatedTime
}
</
div
>
</
div
>
<
div
className=
{
style
.
templateTitleBox
}
>
<
img
src=
{
templateIcon
}
alt=
""
/>
<
div
className=
{
style
.
templateTitle
}
>
{
item
.
title
}
</
div
>
</
div
>
<
div
className=
{
style
.
templateDesc
}
>
{
item
.
description
}
</
div
>
<
div
className=
{
style
.
templateButtons
}
>
<
div
className=
{
style
.
templateButtons
}
>
<
div
className=
{
style
.
templateBL
}
>
<
div
className=
{
style
.
templateBL
}
>
<
span
<
span
...
@@ -93,7 +72,9 @@ const UserResourcesTemplate = observer(() => {
...
@@ -93,7 +72,9 @@ const UserResourcesTemplate = observer(() => {
></
MyButton
>
></
MyButton
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
}
}
></
TemplateItem
>
);
);
};
};
...
...
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