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
0bea7bf6
Commit
0bea7bf6
authored
Aug 02, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完成自定义算子布局
parent
d78a13e2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
85 additions
and
221 deletions
+85
-221
index.tsx
src/components/CommonComponents/FullScreenDrawer/index.tsx
+2
-8
index.module.css
src/views/CustomOperator/index.module.css
+24
-0
index.tsx
src/views/CustomOperator/index.tsx
+28
-0
index.tsx
...kbench/workbenchTemplate/components/AddTemplate/index.tsx
+0
-1
addTemplate.tsx
...ectWorkbench/workbenchTemplate/components/addTemplate.tsx
+0
-208
index.module.css
...ews/WorkFlowEdit/components/OperatorList/index.module.css
+16
-0
index.tsx
src/views/WorkFlowEdit/components/OperatorList/index.tsx
+5
-3
interface.ts
src/views/WorkFlowEdit/components/OperatorList/interface.ts
+2
-0
index.tsx
src/views/WorkFlowEdit/index.tsx
+8
-1
No files found.
src/components/CommonComponents/FullScreenDrawer/index.tsx
View file @
0bea7bf6
...
@@ -7,30 +7,25 @@ import CloseOutlinedIcon from "@mui/icons-material/CloseOutlined";
...
@@ -7,30 +7,25 @@ import CloseOutlinedIcon from "@mui/icons-material/CloseOutlined";
type
IFullScreenDrawerProps
=
{
type
IFullScreenDrawerProps
=
{
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
handleClose
:
any
;
handleClose
:
any
;
zIndex
?:
any
;
};
};
const
FullScreenDrawer
=
(
props
:
IFullScreenDrawerProps
)
=>
{
const
FullScreenDrawer
=
(
props
:
IFullScreenDrawerProps
)
=>
{
const
{
children
,
handleClose
}
=
props
;
const
{
children
,
handleClose
}
=
props
;
// const [closeing, setCloseing] = useState(false);
const
handleReadyToClose
=
()
=>
{
const
handleReadyToClose
=
()
=>
{
// setCloseing(true);
// setCloseing(false);
handleClose
();
handleClose
();
// setTimeout(() => {
// }, 300);
};
};
return
(
return
(
<
div
<
div
className=
{
classNames
({
className=
{
classNames
({
[
style
.
drawerBox
]:
true
,
[
style
.
drawerBox
]:
true
,
// [style.drawerBoxHidden]: closeing,
})
}
})
}
style=
{
{
zIndex
:
props
.
zIndex
}
}
>
>
<
div
<
div
className=
{
classNames
({
className=
{
classNames
({
[
style
.
closeBox
]:
true
,
[
style
.
closeBox
]:
true
,
// [style.closeBoxHidden]: closeing,
})
}
})
}
>
>
<
CloseOutlinedIcon
<
CloseOutlinedIcon
...
@@ -41,7 +36,6 @@ const FullScreenDrawer = (props: IFullScreenDrawerProps) => {
...
@@ -41,7 +36,6 @@ const FullScreenDrawer = (props: IFullScreenDrawerProps) => {
<
div
<
div
className=
{
classNames
({
className=
{
classNames
({
[
style
.
contentBox
]:
true
,
[
style
.
contentBox
]:
true
,
// [style.contentBoxHidden]: closeing,
})
}
})
}
>
>
{
children
}
{
children
}
...
...
src/views/CustomOperator/index.module.css
0 → 100644
View file @
0bea7bf6
.customOperator
{
padding
:
4px
32px
24px
;
background-color
:
#fff
;
display
:
flex
;
flex-direction
:
column
;
height
:
100%
;
box-sizing
:
border-box
;
}
.coTop
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
17px
0
;
}
.coTitle
{
color
:
rgba
(
30
,
38
,
51
,
1
);
font-size
:
18px
;
line-height
:
26px
;
font-weight
:
600
;
}
.coContent
{
flex
:
1
;
background-color
:
RGBA
(
247
,
248
,
250
,
1
);
position
:
relative
;
}
src/views/CustomOperator/index.tsx
0 → 100644
View file @
0bea7bf6
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
"react"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
FullScreenDrawer
from
"@/components/CommonComponents/FullScreenDrawer"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
styles
from
"./index.module.css"
;
type
IProps
=
{
setShowCustomOperator
:
any
;
};
const
CustomOperator
=
observer
((
props
:
IProps
)
=>
{
const
{
setShowCustomOperator
}
=
props
;
// const [showCustomOperator, setShowCustomOperator] = useState(false);
return
(
<
FullScreenDrawer
handleClose=
{
setShowCustomOperator
}
zIndex=
{
1100
}
>
<
div
className=
{
styles
.
customOperator
}
>
<
div
className=
{
styles
.
coTop
}
>
<
div
className=
{
styles
.
coTitle
}
>
添加算子
</
div
>
<
MyButton
text=
"添加"
></
MyButton
>
</
div
>
<
div
className=
{
styles
.
coContent
}
>
123
</
div
>
</
div
>
</
FullScreenDrawer
>
);
});
export
default
CustomOperator
;
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.tsx
View file @
0bea7bf6
...
@@ -11,7 +11,6 @@ import Checkbox from "@mui/material/Checkbox";
...
@@ -11,7 +11,6 @@ import Checkbox from "@mui/material/Checkbox";
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
AddIcon
from
"@mui/icons-material/Add"
;
import
AddIcon
from
"@mui/icons-material/Add"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
_
from
"lodash"
;
import
noData
from
"../../../../../../assets/project/noTemplate.svg"
;
import
noData
from
"../../../../../../assets/project/noTemplate.svg"
;
import
{
ICustomTemplate
}
from
"../../interface"
;
import
{
ICustomTemplate
}
from
"../../interface"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/addTemplate.tsx
deleted
100644 → 0
View file @
d78a13e2
import
{
memo
,
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
styles
from
"../index.module.css"
;
import
{
Box
,
Typography
}
from
"@mui/material"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
OutlinedInput
from
"@mui/material/OutlinedInput"
;
import
RadioGroupOfButtonStyle
from
"@/components/CommonComponents/RadioGroupOfButtonStyle"
;
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
)
=>
{
const
{
openAddTemplate
,
closeAddTemplateBlock
,
addTemplateList
,
templateSelectCallback
,
selectTemplateData
,
addTemplateCallback
,
searchTemplateNameCallback
,
}
=
props
;
const
[
templateType
,
setTemplateType
]
=
useState
(
"public"
);
const
radioOptions
=
[
{
value
:
"public"
,
label
:
"公共"
,
},
{
value
:
"custom"
,
label
:
"自定义"
,
},
];
const
handleRadio
=
(
value
:
string
)
=>
{
setTemplateType
(
value
);
};
return
(
<
Box
className=
{
styles
.
addTemplateMask
}
sx=
{
{
display
:
openAddTemplate
?
"flex"
:
"none"
}
}
>
<
Box
sx=
{
{
height
:
"50px"
,
display
:
"flex"
,
alignItems
:
"center"
}
}
>
<
CloseOutlinedIcon
sx=
{
{
color
:
"#ffffff"
,
marginRight
:
"10px"
,
cursor
:
"pointer"
}
}
onClick=
{
()
=>
{
closeAddTemplateBlock
();
}
}
/>
</
Box
>
<
Box
className=
{
styles
.
addTemplateBlock
}
>
<
Box
sx=
{
{
padding
:
"24px 32px"
}
}
>
<
Typography
sx=
{
{
fontSize
:
"18px"
,
fontWeight
:
"600"
,
color
:
"#1E2633"
}
}
>
添加工作流模版
</
Typography
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"space-between"
,
alignItems
:
"center"
,
marginBottom
:
"20px"
,
}
}
>
<
OutlinedInput
onChange=
{
(
e
:
any
)
=>
{
_
.
debounce
(()
=>
{
searchTemplateNameCallback
(
e
.
target
.
value
);
},
200
)();
}
}
placeholder=
"输入关键词搜索"
size=
"small"
sx=
{
{
width
:
340
,
height
:
32
,
marginTop
:
"20px"
}
}
endAdornment=
{
<
SearchIcon
style=
{
{
color
:
"#8A9099"
}
}
/>
}
/>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"flex-end"
,
alignItems
:
"center"
,
}
}
>
<
RadioGroupOfButtonStyle
value=
{
templateType
}
radioOptions=
{
radioOptions
}
handleRadio=
{
handleRadio
}
></
RadioGroupOfButtonStyle
>
<
MyButton
onClick=
{
addTemplateCallback
}
size=
{
"small"
}
style=
{
{
marginLeft
:
"12px"
,
}
}
text=
{
"添加模版"
+
(
selectTemplateData
.
length
===
0
?
""
:
`(${selectTemplateData.length})`
)
}
/>
</
Box
>
</
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
)
=>
{
return
(
<
Box
className=
{
styles
.
addTemplateBox
}
onClick=
{
()
=>
{
templateSelectCallback
(
item
.
id
);
}
}
sx=
{
{
border
:
selectTemplateData
.
includes
(
item
.
id
)
?
"1px solid #1370FF"
:
"1px solid #EBEDF0;"
,
}
}
key=
{
item
.
id
}
>
<
Box
sx=
{
{
display
:
"flex"
,
justifyContent
:
"space-between"
,
alignItems
:
"center"
,
}
}
>
<
Typography
sx=
{
{
fontSize
:
"14px"
,
fontWeight
:
"600"
,
color
:
"#1E2633"
,
marginBottom
:
"4px"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
}
}
>
{
item
.
title
}
</
Typography
>
<
Checkbox
size=
"small"
sx=
{
{
padding
:
"0px"
}
}
checked=
{
selectTemplateData
.
includes
(
item
.
id
)
}
/>
</
Box
>
<
Box
sx=
{
{
display
:
"flex"
,
marginBottom
:
"8px"
}
}
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
,
marginRight
:
"24px"
,
}
}
>
版本:
{
item
.
version
}
</
Typography
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
,
}
}
>
更新时间:
{
item
.
updateTime
}
</
Typography
>
</
Box
>
<
Typography
className=
{
styles
.
templateDescText
}
>
{
item
.
description
}
</
Typography
>
</
Box
>
);
})
}
</
Box
>
</
Box
>
</
Box
>
</
Box
>
);
};
export
default
memo
(
AddTemplate
);
src/views/WorkFlowEdit/components/OperatorList/index.module.css
View file @
0bea7bf6
...
@@ -50,6 +50,22 @@
...
@@ -50,6 +50,22 @@
.listBox
{
.listBox
{
overflow-y
:
scroll
;
overflow-y
:
scroll
;
height
:
calc
(
100%
-
48px
);
height
:
calc
(
100%
-
48px
);
position
:
relative
;
}
.addOperator
{
position
:
absolute
;
right
:
24px
;
bottom
:
20px
;
width
:
36px
;
height
:
36px
;
border-radius
:
50%
;
box-shadow
:
0px
3px
10px
0px
rgba
(
0
,
24
,
57
,
0.14
);
font-size
:
30px
;
line-height
:
36px
;
text-align
:
center
;
color
:
RGBA
(
66
,
141
,
255
,
1
);
cursor
:
pointer
;
background-color
:
#fff
;
}
}
.versionBox
{
.versionBox
{
...
...
src/views/WorkFlowEdit/components/OperatorList/index.tsx
View file @
0bea7bf6
...
@@ -211,9 +211,8 @@ const OperatorItem = (props: IOperatorItemProps) => {
...
@@ -211,9 +211,8 @@ const OperatorItem = (props: IOperatorItemProps) => {
const
OperatorList
=
observer
((
props
:
IOperatorListProps
)
=>
{
const
OperatorList
=
observer
((
props
:
IOperatorListProps
)
=>
{
const
{
currentProjectStore
}
=
useStores
();
const
{
currentProjectStore
}
=
useStores
();
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
{
templateConfigInfo
,
setTemplateConfigInfo
,
setShowCustomOperator
}
=
const
{
templateConfigInfo
,
setTemplateConfigInfo
}
=
props
;
props
;
const
[
operatorListData
,
setOperatorListData
]
=
useState
<
ITask
[]
>
([]);
const
[
operatorListData
,
setOperatorListData
]
=
useState
<
ITask
[]
>
([]);
const
[
keyword
,
setKeyword
]
=
useState
<
string
>
(
""
);
const
[
keyword
,
setKeyword
]
=
useState
<
string
>
(
""
);
...
@@ -279,6 +278,9 @@ const OperatorList = observer((props: IOperatorListProps) => {
...
@@ -279,6 +278,9 @@ const OperatorList = observer((props: IOperatorListProps) => {
<
span
className=
{
styles
.
noDataText
}
>
没有找到相关算子
</
span
>
<
span
className=
{
styles
.
noDataText
}
>
没有找到相关算子
</
span
>
</
div
>
</
div
>
)
}
)
}
<
div
className=
{
styles
.
addOperator
}
onClick=
{
setShowCustomOperator
}
>
+
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/views/WorkFlowEdit/components/OperatorList/interface.ts
View file @
0bea7bf6
...
@@ -17,6 +17,7 @@ export interface IOperatorItemProps {
...
@@ -17,6 +17,7 @@ export interface IOperatorItemProps {
}
}
export
interface
IOperatorListProps
{
export
interface
IOperatorListProps
{
setShowCustomOperator
:
any
templateConfigInfo
:
ITask
[]
templateConfigInfo
:
ITask
[]
setTemplateConfigInfo
:
(
val
:
ITask
[])
=>
void
setTemplateConfigInfo
:
(
val
:
ITask
[])
=>
void
}
}
\ No newline at end of file
src/views/WorkFlowEdit/index.tsx
View file @
0bea7bf6
...
@@ -23,6 +23,7 @@ import { ITask } from "../Project/ProjectSubmitWork/interface";
...
@@ -23,6 +23,7 @@ import { ITask } from "../Project/ProjectSubmitWork/interface";
import
{
fetchTemplateConfigInfo
}
from
"@/api/project_api"
;
import
{
fetchTemplateConfigInfo
}
from
"@/api/project_api"
;
import
{
getCustomTemplateParameterCheckResult
}
from
"./util"
;
import
{
getCustomTemplateParameterCheckResult
}
from
"./util"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
CustomOperator
from
"../CustomOperator"
;
import
SaveCustomTemplate
from
"./components/SaveCustomTemplate"
;
import
SaveCustomTemplate
from
"./components/SaveCustomTemplate"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
...
@@ -47,7 +48,7 @@ const WorkFlowEdit = observer((props: IProps) => {
...
@@ -47,7 +48,7 @@ const WorkFlowEdit = observer((props: IProps) => {
const
{
onBack
,
id
}
=
props
;
const
{
onBack
,
id
}
=
props
;
const
Message
=
useMessage
();
const
Message
=
useMessage
();
const
[
templateConfigInfo
,
setTemplateConfigInfo
]
=
useState
<
ITask
[]
>
([]);
// 算子大数组
const
[
templateConfigInfo
,
setTemplateConfigInfo
]
=
useState
<
ITask
[]
>
([]);
// 算子大数组
const
[
showCustomOperator
,
setShowCustomOperator
]
=
useState
(
false
);
// 是否显示自定义算子
const
[
saveFormDialog
,
setSaveFormDialog
]
=
useState
(
false
);
// 保存弹窗显示与否控制
const
[
saveFormDialog
,
setSaveFormDialog
]
=
useState
(
false
);
// 保存弹窗显示与否控制
const
[
title
,
setTitle
]
=
useState
(
""
);
// 自定义模板名称
const
[
title
,
setTitle
]
=
useState
(
""
);
// 自定义模板名称
const
[
version
,
setVersion
]
=
useState
(
"1.0.0"
);
// 自定义模板版本
const
[
version
,
setVersion
]
=
useState
(
"1.0.0"
);
// 自定义模板版本
...
@@ -205,6 +206,7 @@ const WorkFlowEdit = observer((props: IProps) => {
...
@@ -205,6 +206,7 @@ const WorkFlowEdit = observer((props: IProps) => {
<
OperatorList
<
OperatorList
templateConfigInfo=
{
templateConfigInfo
}
templateConfigInfo=
{
templateConfigInfo
}
setTemplateConfigInfo=
{
setTemplateConfigInfo
}
setTemplateConfigInfo=
{
setTemplateConfigInfo
}
setShowCustomOperator=
{
()
=>
setShowCustomOperator
(
true
)
}
/>
/>
)
}
)
}
{
leftContentType
!==
"list"
&&
(
{
leftContentType
!==
"list"
&&
(
...
@@ -248,6 +250,11 @@ const WorkFlowEdit = observer((props: IProps) => {
...
@@ -248,6 +250,11 @@ const WorkFlowEdit = observer((props: IProps) => {
oldversion=
{
oldversion
}
oldversion=
{
oldversion
}
/>
/>
)
}
)
}
{
showCustomOperator
&&
(
<
CustomOperator
setShowCustomOperator=
{
()
=>
setShowCustomOperator
(
false
)
}
/>
)
}
</
div
>
</
div
>
);
);
});
});
...
...
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