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
73d75f33
Commit
73d75f33
authored
Jun 17, 2022
by
rocosen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:bug
parent
30de630e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
12 deletions
+38
-12
addTemplate.tsx
...ectWorkbench/workbenchTemplate/components/addTemplate.tsx
+11
-0
index.tsx
...iews/Project/ProjectWorkbench/workbenchTemplate/index.tsx
+27
-12
No files found.
src/views/Project/ProjectWorkbench/workbenchTemplate/components/addTemplate.tsx
View file @
73d75f33
...
...
@@ -8,6 +8,7 @@ import OutlinedInput from "@mui/material/OutlinedInput";
import
SearchIcon
from
"@mui/icons-material/Search"
;
import
Checkbox
from
'@mui/material/Checkbox'
;
import
CloseOutlinedIcon
from
'@mui/icons-material/CloseOutlined'
;
import
noData
from
'../../../../../assets/project/noTemplate.svg'
import
_
from
"lodash"
;
const
AddTemplate
=
(
props
:
any
)
=>
{
...
...
@@ -45,6 +46,16 @@ const AddTemplate = (props: any) => {
</
Button
>
</
Box
>
{
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
>
}
<
Box
sx=
{
{
display
:
"flex"
,
flexWrap
:
'wrap'
,
overflowX
:
'hidden'
,
overflowY
:
'overlay'
,
marginLeft
:
'-8px'
}
}
>
{
addTemplateList
.
map
((
item
:
any
,
key
:
any
)
=>
{
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/index.tsx
View file @
73d75f33
...
...
@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
memo
,
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
{
memo
,
SetStateAction
,
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
styles
from
"./index.module.css"
;
import
OutlinedInput
from
"@mui/material/OutlinedInput"
;
...
...
@@ -29,9 +29,13 @@ import _ from "lodash";
import
{
IResponse
,
useHttp
}
from
"@/api/http"
;
import
{
useStores
}
from
"@/store"
;
import
usePass
from
"@/hooks/usePass"
;
import
{
toJS
}
from
"mobx"
;
import
{
observer
}
from
"mobx-react-lite"
;
const
ProjectMembers
=
()
=>
{
const
ProjectMembers
=
observer
(
()
=>
{
const
{
currentProjectStore
}
=
useStores
();
const
projectIdData
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
isPass
=
usePass
();
/** 搜索模板名称 */
...
...
@@ -92,6 +96,12 @@ const ProjectMembers = () => {
});
},
[
currentProjectStore
.
currentProjectInfo
.
id
,
getTemplateInfo
]);
useEffect
(()
=>
{
console
.
log
(
'projectIdData: '
,
projectIdData
);
},
[
projectIdData
])
/** 点击添加工作流模版 */
const
onAddMember
=
()
=>
{
// setAddMemberDialog(true);
...
...
@@ -159,11 +169,17 @@ const ProjectMembers = () => {
}
const
searchChange
=
(
data
:
any
)
=>
{
setTemplateName
(
data
.
length
>
30
?
data
.
slice
(
0
,
30
)
:
data
);
}
useEffect
(()
=>
{
getTemplateInfo
({
projectId
:
currentProjectStore
.
currentProjectInfo
.
id
as
string
,
title
:
templateName
});
setTimeout
(()
=>
{
getTemplateInfo
({
projectId
:
currentProjectStore
.
currentProjectInfo
.
id
as
string
,
title
:
templateName
});
},
300
)
},
[
templateName
]);
return
(
...
...
@@ -172,10 +188,9 @@ const ProjectMembers = () => {
<
Box
className=
{
styles
.
tabBox
}
>
<
OutlinedInput
onChange=
{
(
e
:
any
)
=>
{
_
.
debounce
(()
=>
{
setTemplateName
(
e
.
target
.
value
);
},
200
)();
searchChange
(
e
.
target
.
value
)
}
}
value=
{
templateName
}
placeholder=
"输入关键词搜索"
size=
"small"
sx=
{
{
width
:
340
,
height
:
32
}
}
...
...
@@ -197,7 +212,7 @@ const ProjectMembers = () => {
</
Box
>
{
templateList
.
length
===
0
&&
!
isPass
(
"PROJECT_WORKBENCH_FLOES_ADD"
,
'MANAGER'
)
&&
templateList
.
length
===
0
&&
templateName
.
length
>
0
&&
<
Box
sx=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
flexDirection
:
'column'
,
minHeight
:
'calc(100vh - 376px)'
,
justifyContent
:
'center'
...
...
@@ -216,7 +231,7 @@ const ProjectMembers = () => {
</
Box
>
}
{
templateList
.
length
===
0
&&
isPass
(
"PROJECT_WORKBENCH_FLOES_ADD"
,
'MANAGER'
)
&&
<
Box
className=
{
styles
.
addNewTemplate
}
templateList
.
length
===
0
&&
templateName
.
length
===
0
&&
isPass
(
"PROJECT_WORKBENCH_FLOES_ADD"
,
'MANAGER'
)
&&
<
Box
className=
{
styles
.
addNewTemplate
}
onClick=
{
addTemplateBlock
}
>
<
Add
sx=
{
{
color
:
"#565C66"
,
fontSize
:
"20px"
,
width
:
"30px"
,
height
:
'30px'
}
}
/>
...
...
@@ -244,6 +259,6 @@ const ProjectMembers = () => {
</
Box
>
);
};
}
)
;
export
default
memo
(
ProjectMembers
);
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