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
5daf5172
Commit
5daf5172
authored
Oct 24, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 构建算子添加联调
parent
7d03e5ab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
413 additions
and
139 deletions
+413
-139
batchOperator.svg
src/assets/resourceCenter/batchOperator.svg
+61
-0
flowOperator.svg
src/assets/resourceCenter/flowOperator.svg
+81
-0
MyMenu.tsx
src/components/mui/MyMenu.tsx
+7
-2
MySelect.tsx
src/components/mui/MySelect.tsx
+5
-2
index.ts
src/router/index.ts
+3
-2
index.tsx
src/views/CustomOperator/index.tsx
+13
-114
useCheckOperator.tsx
src/views/CustomOperator/useCheckOperator.tsx
+139
-0
index.module.css
.../WorkflowOperator/components/AddOperator/index.module.css
+3
-0
index.tsx
...sources/WorkflowOperator/components/AddOperator/index.tsx
+0
-0
utils.ts
...esources/WorkflowOperator/components/AddOperator/utils.ts
+54
-5
index.module.css
...WorkflowOperator/components/OperatorCard/index.module.css
+1
-0
index.tsx
...ources/WorkflowOperator/components/OperatorCard/index.tsx
+16
-5
index.tsx
...s/ResourceCenter/UserResources/WorkflowOperator/index.tsx
+13
-4
interface.ts
...esourceCenter/UserResources/WorkflowOperator/interface.ts
+3
-2
index.tsx
...views/ResourceCenter/components/SwitchBatchFolw/index.tsx
+14
-3
No files found.
src/assets/resourceCenter/batchOperator.svg
0 → 100644
View file @
5daf5172
<?xml version="1.0" encoding="UTF-8"?>
<svg
width=
"240px"
height=
"249px"
viewBox=
"0 0 240 249"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<title>
矩形备份 26
</title>
<defs>
<rect
id=
"path-1"
x=
"0"
y=
"0"
width=
"240"
height=
"249"
rx=
"8"
></rect>
<filter
x=
"-14.5%"
y=
"-17.6%"
width=
"129.1%"
height=
"135.2%"
filterUnits=
"objectBoundingBox"
id=
"filter-3"
>
<feOffset
dx=
"0"
dy=
"2"
in=
"SourceAlpha"
result=
"shadowOffsetOuter1"
></feOffset>
<feGaussianBlur
stdDeviation=
"3"
in=
"shadowOffsetOuter1"
result=
"shadowBlurOuter1"
></feGaussianBlur>
<feColorMatrix
values=
"0 0 0 0 0.803607664 0 0 0 0 0.598314046 0 0 0 0 0.12907149 0 0 0 1 0"
type=
"matrix"
in=
"shadowBlurOuter1"
result=
"shadowMatrixOuter1"
></feColorMatrix>
<feMerge>
<feMergeNode
in=
"shadowMatrixOuter1"
></feMergeNode>
<feMergeNode
in=
"SourceGraphic"
></feMergeNode>
</feMerge>
</filter>
<rect
id=
"path-4"
x=
"0"
y=
"0"
width=
"110"
height=
"91"
rx=
"5.5"
></rect>
</defs>
<g
id=
"新"
stroke=
"none"
stroke-width=
"1"
fill=
"none"
fill-rule=
"evenodd"
>
<g
id=
"矩形备份-26"
>
<mask
id=
"mask-2"
fill=
"white"
>
<use
xlink:href=
"#path-1"
></use>
</mask>
<use
id=
"蒙版"
fill=
"#FFFFFF"
xlink:href=
"#path-1"
></use>
<rect
id=
"矩形备份-6"
fill=
"#FFB919"
mask=
"url(#mask-2)"
x=
"0"
y=
"0"
width=
"240"
height=
"165"
></rect>
<g
id=
"编组-8备份-3"
mask=
"url(#mask-2)"
>
<g
transform=
"translate(65.000000, 37.000000)"
id=
"编组-19"
>
<g
id=
"矩形"
filter=
"url(#filter-3)"
>
<mask
id=
"mask-5"
fill=
"white"
>
<use
xlink:href=
"#path-4"
></use>
</mask>
<use
id=
"蒙版"
fill=
"#FFFFFF"
xlink:href=
"#path-4"
></use>
<rect
fill=
"#136EFA"
mask=
"url(#mask-5)"
x=
"0"
y=
"0"
width=
"2.5"
height=
"91.4251263"
></rect>
<rect
fill=
"#C2C6CC"
mask=
"url(#mask-5)"
x=
"15"
y=
"8.76679293"
width=
"25"
height=
"5.00959596"
></rect>
</g>
<g
id=
"编组-7"
transform=
"translate(15.250000, 26.070581)"
>
<path
d=
"M11.25,5.51515152 L7.125,5.51515152 C5.60621694,5.51515152 4.375,6.74636845 4.375,8.26515152 L4.375,46.8863636 C4.375,48.4051467 5.60621694,49.6363636 7.125,49.6363636 L11.25,49.6363636 L11.25,49.6363636"
id=
"路径-4"
stroke=
"#979797"
stroke-width=
"1.375"
></path>
<rect
id=
"矩形备份-10"
fill=
"#F0F2F5"
x=
"0"
y=
"0"
width=
"45"
height=
"11.030303"
rx=
"2.75"
></rect>
<rect
id=
"矩形备份-11"
fill=
"#F0F2F5"
x=
"0"
y=
"22.0606061"
width=
"24.75"
height=
"11.030303"
rx=
"2.75"
></rect>
<rect
id=
"矩形备份-15"
fill=
"#F0F2F5"
x=
"39.875"
y=
"33.332197"
width=
"24.75"
height=
"11.030303"
rx=
"2.75"
></rect>
<rect
id=
"矩形备份-12"
fill=
"#F0F2F5"
x=
"0"
y=
"44.1212121"
width=
"24.75"
height=
"11.030303"
rx=
"2.75"
></rect>
<rect
id=
"矩形备份-4"
fill=
"#C2C6CC"
x=
"2.25"
y=
"3.20453283"
width=
"32.5"
height=
"3.75719697"
></rect>
<rect
id=
"矩形备份-5"
fill=
"#C2C6CC"
x=
"2.25"
y=
"25.7477146"
width=
"13.75"
height=
"3.75719697"
></rect>
<rect
id=
"矩形备份-8"
fill=
"#C2C6CC"
x=
"2.25"
y=
"48.2908965"
width=
"13.75"
height=
"3.75719697"
></rect>
<rect
id=
"矩形备份-9"
fill=
"#C2C6CC"
x=
"42.25"
y=
"37.0193056"
width=
"13.75"
height=
"3.75719697"
></rect>
<ellipse
id=
"椭圆形备份-3"
fill=
"#0DD09B"
cx=
"39"
cy=
"5.00959596"
rx=
"1.25"
ry=
"1.25239899"
></ellipse>
<ellipse
id=
"椭圆形备份-4"
fill=
"#0DD09B"
cx=
"20.25"
cy=
"27.5527778"
rx=
"1.25"
ry=
"1.25239899"
></ellipse>
<ellipse
id=
"椭圆形备份-5"
fill=
"#0DD09B"
cx=
"20.25"
cy=
"50.0959596"
rx=
"1.25"
ry=
"1.25239899"
></ellipse>
<ellipse
id=
"椭圆形备份-6"
fill=
"#0DD09B"
cx=
"60.25"
cy=
"38.8243687"
rx=
"1.25"
ry=
"1.25239899"
></ellipse>
<line
x1=
"4.125"
y1=
"38.7726641"
x2=
"39.875"
y2=
"38.8473485"
id=
"路径-6"
stroke=
"#979797"
stroke-width=
"1.375"
></line>
</g>
</g>
</g>
<text
id=
"构建批式算子"
mask=
"url(#mask-2)"
font-family=
"PingFangSC-Medium, PingFang SC"
font-size=
"16"
font-weight=
"400"
line-spacing=
"24"
fill=
"#1E2633"
>
<tspan
x=
"72"
y=
"198.000567"
>
构建批式算子
</tspan>
</text>
<text
id=
"仅支持shell脚本"
mask=
"url(#mask-2)"
font-family=
"PingFangSC-Regular, PingFang SC"
font-size=
"12"
font-weight=
"normal"
line-spacing=
"20"
fill=
"#8A9099"
>
<tspan
x=
"77.484"
y=
"222"
>
仅支持shell脚本
</tspan>
</text>
</g>
</g>
</svg>
\ No newline at end of file
src/assets/resourceCenter/flowOperator.svg
0 → 100644
View file @
5daf5172
<?xml version="1.0" encoding="UTF-8"?>
<svg
width=
"240px"
height=
"249px"
viewBox=
"0 0 240 249"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<title>
编组 40备份 8
</title>
<defs>
<rect
id=
"path-1"
x=
"0"
y=
"0"
width=
"240"
height=
"249"
rx=
"8"
></rect>
<rect
id=
"path-3"
x=
"0"
y=
"0"
width=
"96.2033898"
height=
"23.9201798"
rx=
"4.80638562"
></rect>
<filter
x=
"-8.8%"
y=
"-27.2%"
width=
"117.7%"
height=
"171.1%"
filterUnits=
"objectBoundingBox"
id=
"filter-5"
>
<feOffset
dx=
"0"
dy=
"2"
in=
"SourceAlpha"
result=
"shadowOffsetOuter1"
></feOffset>
<feGaussianBlur
stdDeviation=
"2.5"
in=
"shadowOffsetOuter1"
result=
"shadowBlurOuter1"
></feGaussianBlur>
<feColorMatrix
values=
"0 0 0 0 0.114151225 0 0 0 0 0.59037626 0 0 0 0 0.477660275 0 0 0 1 0"
type=
"matrix"
in=
"shadowBlurOuter1"
></feColorMatrix>
</filter>
<rect
id=
"path-6"
x=
"0"
y=
"0"
width=
"96.2033898"
height=
"23.9201798"
rx=
"4.80638562"
></rect>
<filter
x=
"-8.8%"
y=
"-27.2%"
width=
"117.7%"
height=
"171.1%"
filterUnits=
"objectBoundingBox"
id=
"filter-8"
>
<feOffset
dx=
"0"
dy=
"2"
in=
"SourceAlpha"
result=
"shadowOffsetOuter1"
></feOffset>
<feGaussianBlur
stdDeviation=
"2.5"
in=
"shadowOffsetOuter1"
result=
"shadowBlurOuter1"
></feGaussianBlur>
<feColorMatrix
values=
"0 0 0 0 0.114151225 0 0 0 0 0.59037626 0 0 0 0 0.477660275 0 0 0 1 0"
type=
"matrix"
in=
"shadowBlurOuter1"
></feColorMatrix>
</filter>
<rect
id=
"path-9"
x=
"0"
y=
"0"
width=
"96.2033898"
height=
"23.9201798"
rx=
"4.80638562"
></rect>
<filter
x=
"-8.8%"
y=
"-27.2%"
width=
"117.7%"
height=
"171.1%"
filterUnits=
"objectBoundingBox"
id=
"filter-11"
>
<feOffset
dx=
"0"
dy=
"2"
in=
"SourceAlpha"
result=
"shadowOffsetOuter1"
></feOffset>
<feGaussianBlur
stdDeviation=
"2.5"
in=
"shadowOffsetOuter1"
result=
"shadowBlurOuter1"
></feGaussianBlur>
<feColorMatrix
values=
"0 0 0 0 0.114151225 0 0 0 0 0.59037626 0 0 0 0 0.477660275 0 0 0 1 0"
type=
"matrix"
in=
"shadowBlurOuter1"
></feColorMatrix>
</filter>
</defs>
<g
id=
"新"
stroke=
"none"
stroke-width=
"1"
fill=
"none"
fill-rule=
"evenodd"
>
<g
id=
"编组-40备份-8"
>
<mask
id=
"mask-2"
fill=
"white"
>
<use
xlink:href=
"#path-1"
></use>
</mask>
<use
id=
"蒙版"
fill=
"#FFFFFF"
xlink:href=
"#path-1"
></use>
<rect
id=
"矩形"
fill=
"#02AB83"
mask=
"url(#mask-2)"
x=
"0"
y=
"0"
width=
"240"
height=
"165"
></rect>
<g
id=
"编组-2"
mask=
"url(#mask-2)"
>
<g
transform=
"translate(56.000000, 40.000000)"
>
<g
id=
"矩形"
>
<mask
id=
"mask-4"
fill=
"white"
>
<use
xlink:href=
"#path-3"
></use>
</mask>
<g
id=
"蒙版"
>
<use
fill=
"black"
fill-opacity=
"1"
filter=
"url(#filter-5)"
xlink:href=
"#path-3"
></use>
<use
fill=
"#FFFFFF"
fill-rule=
"evenodd"
xlink:href=
"#path-3"
></use>
</g>
<rect
fill=
"#136EFA"
mask=
"url(#mask-4)"
x=
"0"
y=
"0"
width=
"2.18644068"
height=
"24.0319281"
></rect>
<rect
fill=
"#C2C6CC"
mask=
"url(#mask-4)"
x=
"13.1186441"
y=
"7.64652257"
width=
"50.2881356"
height=
"8.73888294"
></rect>
<ellipse
id=
"椭圆形备份-3"
fill=
"#0DD09B"
mask=
"url(#mask-4)"
cx=
"77.6186441"
cy=
"12.015964"
rx=
"3.27966102"
ry=
"3.2770811"
></ellipse>
</g>
<g
id=
"矩形"
transform=
"translate(32.796610, 30.586090)"
>
<mask
id=
"mask-7"
fill=
"white"
>
<use
xlink:href=
"#path-6"
></use>
</mask>
<g
id=
"蒙版"
>
<use
fill=
"black"
fill-opacity=
"1"
filter=
"url(#filter-8)"
xlink:href=
"#path-6"
></use>
<use
fill=
"#FFFFFF"
fill-rule=
"evenodd"
xlink:href=
"#path-6"
></use>
</g>
<rect
fill=
"#136EFA"
mask=
"url(#mask-7)"
x=
"0"
y=
"0"
width=
"2.18644068"
height=
"24.0319281"
></rect>
<rect
fill=
"#C2C6CC"
mask=
"url(#mask-7)"
x=
"13.1186441"
y=
"7.64652257"
width=
"50.2881356"
height=
"8.73888294"
></rect>
<ellipse
id=
"椭圆形备份-3"
fill=
"#0DD09B"
mask=
"url(#mask-7)"
cx=
"77.6186441"
cy=
"12.015964"
rx=
"3.27966102"
ry=
"3.2770811"
></ellipse>
</g>
<g
id=
"矩形"
transform=
"translate(4.372881, 60.079820)"
>
<mask
id=
"mask-10"
fill=
"white"
>
<use
xlink:href=
"#path-9"
></use>
</mask>
<g
id=
"蒙版"
>
<use
fill=
"black"
fill-opacity=
"1"
filter=
"url(#filter-11)"
xlink:href=
"#path-9"
></use>
<use
fill=
"#FFFFFF"
fill-rule=
"evenodd"
xlink:href=
"#path-9"
></use>
</g>
<rect
fill=
"#136EFA"
mask=
"url(#mask-10)"
x=
"0"
y=
"0"
width=
"2.18644068"
height=
"24.0319281"
></rect>
<rect
fill=
"#C2C6CC"
mask=
"url(#mask-10)"
x=
"13.1186441"
y=
"7.64652257"
width=
"50.2881356"
height=
"8.73888294"
></rect>
<ellipse
id=
"椭圆形备份-3"
fill=
"#0DD09B"
mask=
"url(#mask-10)"
cx=
"77.6186441"
cy=
"12.015964"
rx=
"3.27966102"
ry=
"3.2770811"
></ellipse>
</g>
</g>
</g>
<text
id=
"构建流式算子"
mask=
"url(#mask-2)"
font-family=
"PingFangSC-Medium, PingFang SC"
font-size=
"16"
font-weight=
"400"
line-spacing=
"24"
fill=
"#1E2633"
>
<tspan
x=
"72"
y=
"198"
>
构建流式算子
</tspan>
</text>
<text
id=
"仅支持Python脚本"
mask=
"url(#mask-2)"
font-family=
"PingFangSC-Regular, PingFang SC"
font-size=
"12"
font-weight=
"normal"
line-spacing=
"20"
fill=
"#8A9099"
>
<tspan
x=
"70.836"
y=
"222"
>
仅支持Python脚本
</tspan>
</text>
</g>
</g>
</svg>
\ No newline at end of file
src/components/mui/MyMenu.tsx
View file @
5daf5172
...
@@ -77,14 +77,19 @@ const MyMenu = (props: IMyMenuProps) => {
...
@@ -77,14 +77,19 @@ const MyMenu = (props: IMyMenuProps) => {
const
open
=
Boolean
(
anchorEl
);
const
open
=
Boolean
(
anchorEl
);
const
handleClick
=
(
event
:
React
.
MouseEvent
<
HTMLDivElement
>
)
=>
{
const
handleClick
=
(
event
:
React
.
MouseEvent
<
HTMLDivElement
>
)
=>
{
setAnchorEl
(
event
.
currentTarget
);
setAnchorEl
(
event
.
currentTarget
);
event
.
stopPropagation
();
};
};
const
handleClose
=
(
value
:
string
)
=>
{
const
handleClose
=
(
value
:
string
)
=>
{
setAnchorEl
(
null
);
setAnchorEl
(
null
);
};
};
const
handleMenuClick
=
(
value
:
string
)
=>
{
const
handleMenuClick
=
(
value
:
string
,
event
:
React
.
MouseEvent
<
HTMLLIElement
,
MouseEvent
>
)
=>
{
setValue
&&
setValue
(
value
);
setValue
&&
setValue
(
value
);
setAnchorEl
(
null
);
setAnchorEl
(
null
);
event
.
stopPropagation
();
};
};
return
(
return
(
...
@@ -124,7 +129,7 @@ const MyMenu = (props: IMyMenuProps) => {
...
@@ -124,7 +129,7 @@ const MyMenu = (props: IMyMenuProps) => {
{
options
.
map
((
option
,
index
)
=>
{
{
options
.
map
((
option
,
index
)
=>
{
return
(
return
(
<
MenuItem
<
MenuItem
onClick=
{
(
)
=>
handleMenuClick
(
option
.
valu
e
)
}
onClick=
{
(
e
)
=>
handleMenuClick
(
option
.
value
,
e
)
}
selected=
{
value
===
option
.
value
}
selected=
{
value
===
option
.
value
}
key=
{
index
}
key=
{
index
}
>
>
...
...
src/components/mui/MySelect.tsx
View file @
5daf5172
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2021-12-04 15:46:25
* @Date: 2021-12-04 15:46:25
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-
19 18:41:0
4
* @LastEditTime: 2022-10-
24 17:39:2
4
* @FilePath: /lionet-slb-pc/src/components/SearchView/components/Collapse.tsx
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -49,6 +49,8 @@ interface IProps
...
@@ -49,6 +49,8 @@ interface IProps
isTitle
?:
boolean
;
isTitle
?:
boolean
;
/** 是否显示提示文案 */
/** 是否显示提示文案 */
error
?:
boolean
;
error
?:
boolean
;
/** 默认值 */
defaultValue
?:
string
;
/** 提示文案 */
/** 提示文案 */
helpertext
?:
string
;
helpertext
?:
string
;
}
}
...
@@ -64,6 +66,7 @@ export default function MySelect(props: IProps) {
...
@@ -64,6 +66,7 @@ export default function MySelect(props: IProps) {
fullWidth
,
fullWidth
,
error
=
false
,
error
=
false
,
helpertext
,
helpertext
,
defaultValue
,
...
other
...
other
}
=
props
;
}
=
props
;
...
@@ -193,7 +196,7 @@ export default function MySelect(props: IProps) {
...
@@ -193,7 +196,7 @@ export default function MySelect(props: IProps) {
},
},
});
});
const
[
insideValue
,
setInsideValue
]
=
useState
<
string
>
(
""
);
const
[
insideValue
,
setInsideValue
]
=
useState
<
string
>
(
defaultValue
||
""
);
const
handleChange
=
(
e
:
SelectChangeEvent
<
unknown
>
)
=>
{
const
handleChange
=
(
e
:
SelectChangeEvent
<
unknown
>
)
=>
{
setInsideValue
(
e
.
target
.
value
as
string
);
setInsideValue
(
e
.
target
.
value
as
string
);
...
...
src/router/index.ts
View file @
5daf5172
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-
18 10:54:54
* @LastEditTime: 2022-10-
24 20:23:02
* @FilePath: /bkunyun/src/router/index.ts
* @FilePath: /bkunyun/src/router/index.ts
* @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 { AnyMap } from "immer/dist/internal";
import { AnyMap } from "immer/dist/internal";
...
@@ -14,6 +14,7 @@ import * as React from "react";
...
@@ -14,6 +14,7 @@ import * as React from "react";
import
NotFound
from
"@/views/404"
;
import
NotFound
from
"@/views/404"
;
import
Demo
from
"@/views/demo"
;
import
Demo
from
"@/views/demo"
;
import
SeeEnv
from
"@/views/ResourceCenter/UserResources/UserResourcesEnvironment/SeeEnv"
;
import
SeeEnv
from
"@/views/ResourceCenter/UserResources/UserResourcesEnvironment/SeeEnv"
;
import
OperatorDetails
from
"@/views/ResourceCenter/UserResources/WorkflowOperator/components/OperatorDetails"
;
import
ProjectSetting
from
"@/views/Project/ProjectSetting"
;
import
ProjectSetting
from
"@/views/Project/ProjectSetting"
;
import
ProjectData
from
"@/views/Project/ProjectData"
;
import
ProjectData
from
"@/views/Project/ProjectData"
;
import
ProjectWorkbench
from
"@/views/Project/ProjectWorkbench"
;
import
ProjectWorkbench
from
"@/views/Project/ProjectWorkbench"
;
...
@@ -53,9 +54,9 @@ export const elements: {
...
@@ -53,9 +54,9 @@ export const elements: {
})
=>
JSX
.
Element
|
any
;
})
=>
JSX
.
Element
|
any
;
}
=
{
}
=
{
Demo
:
Demo
,
Demo
:
Demo
,
SeeTemplate
:
Demo
,
UserResources
:
UserResources
,
UserResources
:
UserResources
,
SeeEnv
:
SeeEnv
,
SeeEnv
:
SeeEnv
,
OperatorDetails
:
OperatorDetails
,
ProjectSetting
:
ProjectSetting
,
ProjectSetting
:
ProjectSetting
,
ProjectData
:
ProjectData
,
ProjectData
:
ProjectData
,
ProjectWorkbench
:
ProjectWorkbench
,
ProjectWorkbench
:
ProjectWorkbench
,
...
...
src/views/CustomOperator/index.tsx
View file @
5daf5172
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-24 17:32:00
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-24 19:42:23
* @FilePath: /bkunyun/src/views/CustomOperator/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
"react"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
FullScreenDrawer
from
"@/components/CommonComponents/FullScreenDrawer"
;
import
FullScreenDrawer
from
"@/components/CommonComponents/FullScreenDrawer"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
MyButton
from
"@/components/mui/MyButton"
;
import
OperatorList
from
"./components/OperatorList"
;
import
OperatorList
from
"./components/OperatorList"
;
// import Flow from "../Project/components/Flow";
// import Flow from "../Project/components/Flow";
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
BatchOperatorFlow
from
"../Project/components/Flow/components/BatchOperatorFlow"
;
import
BatchOperatorFlow
from
"../Project/components/Flow/components/BatchOperatorFlow"
;
import
SaveOperator
from
"./components/SaveOperator"
;
import
SaveOperator
from
"./components/SaveOperator"
;
import
{
ITask
}
from
"../Project/ProjectSubmitWork/interface"
;
import
{
ITask
}
from
"../Project/ProjectSubmitWork/interface"
;
import
_
from
"lodash"
;
import
_
from
"lodash"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
import
useCheckOperator
from
"./useCheckOperator"
;
type
IProps
=
{
type
IProps
=
{
setShowCustomOperator
:
any
;
setShowCustomOperator
:
any
;
...
@@ -19,133 +27,24 @@ type IProps = {
...
@@ -19,133 +27,24 @@ type IProps = {
const
CustomOperator
=
observer
((
props
:
IProps
)
=>
{
const
CustomOperator
=
observer
((
props
:
IProps
)
=>
{
const
{
setShowCustomOperator
,
initOperatorList
,
productId
}
=
props
;
const
{
setShowCustomOperator
,
initOperatorList
,
productId
}
=
props
;
const
Message
=
useMessage
();
const
[
operatorList
,
setOperatorList
]
=
useState
<
ITask
[]
>
(
initOperatorList
);
const
[
operatorList
,
setOperatorList
]
=
useState
<
ITask
[]
>
(
initOperatorList
);
const
[
saveFormDialog
,
setSaveFormDialog
]
=
useState
(
false
);
const
[
saveFormDialog
,
setSaveFormDialog
]
=
useState
(
false
);
const
[
inputActive
,
setInputActive
]
=
useState
(
false
);
const
[
inputActive
,
setInputActive
]
=
useState
(
false
);
// const [showCustomOperator, setShowCustomOperator] = useState(false);
// const [showCustomOperator, setShowCustomOperator] = useState(false);
const
{
handleCheck
}
=
useCheckOperator
(
operatorList
,
()
=>
setSaveFormDialog
(
true
)
);
/** 设置选中唯一标识符 */
/** 设置选中唯一标识符 */
const
handleNodeClick
=
useCallback
((
val
:
string
)
=>
{
const
handleNodeClick
=
useCallback
((
val
:
string
)
=>
{
// setSelectTaskId(val);
// setSelectTaskId(val);
},
[]);
},
[]);
// 判断 每个流算子必须至少有一条连接线。
const
checkHasOneLine
=
(
sourceArr
:
string
[],
targetArr
:
string
[])
=>
{
const
all
=
_
.
uniq
([...
sourceArr
,
...
targetArr
]);
if
(
all
.
length
===
operatorList
.
length
)
{
return
true
;
}
else
{
return
false
;
}
// _.uniq([2, 1, 2]);
};
// 判断 每个起始算子(可以有多个起始点)的输入必须为文件的路径输入或数据集的路径输入。
const
checkIn
=
(
targetArr
:
string
[])
=>
{
const
uniqTargetArr
=
_
.
uniq
(
targetArr
);
if
(
uniqTargetArr
.
length
===
operatorList
.
length
)
{
// 流节点连成一个圈了
return
false
;
}
let
check
=
true
;
operatorList
.
forEach
((
flowNode
)
=>
{
if
(
uniqTargetArr
.
indexOf
(
flowNode
.
id
)
===
-
1
)
{
// 该节点的输入没有连线 也就是说这个节点是起点
const
inArr
=
flowNode
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"in"
);
if
(
inArr
.
length
>
0
)
{
if
(
!
inArr
.
some
((
inItem
)
=>
{
return
(
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"dataset"
||
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"path"
||
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"file"
);
})
)
{
check
=
false
;
}
}
else
{
// 起点没有输入
check
=
false
;
}
}
});
return
check
;
};
// 判断 起码有一个结尾算子(可以有多个结尾点)的输出必须为文件保存或数据集保存。
const
checkOut
=
(
sourceArr
:
string
[])
=>
{
const
uniqSourceArr
=
_
.
uniq
(
sourceArr
);
if
(
uniqSourceArr
.
length
===
operatorList
.
length
)
{
// 流节点连成一个圈了
return
false
;
}
let
check
=
true
;
operatorList
.
forEach
((
flowNode
)
=>
{
if
(
uniqSourceArr
.
indexOf
(
flowNode
.
id
)
===
-
1
)
{
// 该节点的输入没有连线 也就是说这个节点是起点
const
outArr
=
flowNode
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"out"
);
if
(
outArr
.
length
>
0
)
{
if
(
!
outArr
.
some
((
outItem
)
=>
{
return
(
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"dataset"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"file"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"path"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"input"
);
})
)
{
check
=
false
;
}
}
else
{
// 起点没有输入
check
=
false
;
}
}
});
return
check
;
};
useEffect
(()
=>
{
useEffect
(()
=>
{
sessionStorage
.
setItem
(
"operatorList"
,
JSON
.
stringify
(
operatorList
));
sessionStorage
.
setItem
(
"operatorList"
,
JSON
.
stringify
(
operatorList
));
},
[
operatorList
]);
},
[
operatorList
]);
const
handleCheck
=
()
=>
{
if
(
operatorList
.
length
===
0
)
{
Message
.
error
(
"内容不能为空!"
);
return
;
}
let
sourceArr
:
string
[]
=
[];
let
targetArr
:
string
[]
=
[];
operatorList
.
forEach
((
flowNode
)
=>
{
flowNode
.
edges
.
forEach
((
edge
)
=>
{
edge
.
source
&&
sourceArr
.
push
(
edge
.
source
);
edge
.
target
&&
targetArr
.
push
(
edge
.
target
);
});
});
if
(
!
checkHasOneLine
([...
sourceArr
],
[...
targetArr
]))
{
Message
.
error
(
"部分算子没有流程线,请检查流程!"
);
return
;
}
if
(
!
checkIn
([...
targetArr
]))
{
Message
.
error
(
"每个流程第一步需读取文件/数据集,请检查流程!"
);
return
;
}
if
(
!
checkOut
([...
sourceArr
]))
{
Message
.
error
(
"每个流程最后一步必须将数据写入为文件/数据集,请检查流程!"
);
return
;
}
setSaveFormDialog
(
true
);
};
return
(
return
(
<
FullScreenDrawer
handleClose=
{
setShowCustomOperator
}
zIndex=
{
1100
}
>
<
FullScreenDrawer
handleClose=
{
setShowCustomOperator
}
zIndex=
{
1100
}
>
<
div
className=
{
styles
.
customOperator
}
>
<
div
className=
{
styles
.
customOperator
}
>
...
...
src/views/CustomOperator/useCheckOperator.tsx
0 → 100644
View file @
5daf5172
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
_
from
"lodash"
;
import
{
useState
}
from
"react"
;
import
{
ITask
}
from
"../Project/ProjectSubmitWork/interface"
;
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-24 18:08:47
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-24 18:31:12
* @FilePath: /bkunyun/src/views/CustomOperator/useCheckOperator.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const
useCheckOperator
=
(
operatorList
:
ITask
[],
successCallBack
?:
any
,
nullText
?:
string
)
=>
{
const
Message
=
useMessage
();
const
[
checkStatus
,
setCheckStatus
]
=
useState
<
boolean
>
(
false
);
// 判断 每个起始算子(可以有多个起始点)的输入必须为文件的路径输入或数据集的路径输入。
const
checkIn
=
(
targetArr
:
string
[])
=>
{
const
uniqTargetArr
=
_
.
uniq
(
targetArr
);
if
(
uniqTargetArr
.
length
===
operatorList
.
length
)
{
// 流节点连成一个圈了
return
false
;
}
let
check
=
true
;
operatorList
.
forEach
((
flowNode
)
=>
{
if
(
uniqTargetArr
.
indexOf
(
flowNode
.
id
)
===
-
1
)
{
// 该节点的输入没有连线 也就是说这个节点是起点
const
inArr
=
flowNode
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"in"
);
if
(
inArr
.
length
>
0
)
{
if
(
!
inArr
.
some
((
inItem
)
=>
{
return
(
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"dataset"
||
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"path"
||
(
inItem
.
domType
||
""
).
toLowerCase
()
===
"file"
);
})
)
{
check
=
false
;
}
}
else
{
// 起点没有输入
check
=
false
;
}
}
});
return
check
;
};
// 判断 起码有一个结尾算子(可以有多个结尾点)的输出必须为文件保存或数据集保存。
const
checkOut
=
(
sourceArr
:
string
[])
=>
{
const
uniqSourceArr
=
_
.
uniq
(
sourceArr
);
if
(
uniqSourceArr
.
length
===
operatorList
.
length
)
{
// 流节点连成一个圈了
return
false
;
}
let
check
=
true
;
operatorList
.
forEach
((
flowNode
)
=>
{
if
(
uniqSourceArr
.
indexOf
(
flowNode
.
id
)
===
-
1
)
{
// 该节点的输入没有连线 也就是说这个节点是起点
const
outArr
=
flowNode
.
parameters
.
filter
(
(
parameter
)
=>
parameter
.
parameterGroup
===
"out"
);
if
(
outArr
.
length
>
0
)
{
if
(
!
outArr
.
some
((
outItem
)
=>
{
return
(
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"dataset"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"file"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"path"
||
(
outItem
.
domType
||
""
).
toLowerCase
()
===
"input"
);
})
)
{
check
=
false
;
}
}
else
{
// 起点没有输入
check
=
false
;
}
}
});
return
check
;
};
// 判断 每个流算子必须至少有一条连接线。
const
checkHasOneLine
=
(
sourceArr
:
string
[],
targetArr
:
string
[])
=>
{
const
all
=
_
.
uniq
([...
sourceArr
,
...
targetArr
]);
if
(
all
.
length
===
operatorList
.
length
)
{
return
true
;
}
else
{
return
false
;
}
// _.uniq([2, 1, 2]);
};
const
handleCheck
=
()
=>
{
if
(
operatorList
.
length
===
0
)
{
Message
.
error
(
nullText
||
"内容不能为空!"
);
return
;
}
let
sourceArr
:
string
[]
=
[];
let
targetArr
:
string
[]
=
[];
operatorList
.
forEach
((
flowNode
)
=>
{
flowNode
.
edges
.
forEach
((
edge
)
=>
{
edge
.
source
&&
sourceArr
.
push
(
edge
.
source
);
edge
.
target
&&
targetArr
.
push
(
edge
.
target
);
});
});
if
(
!
checkHasOneLine
([...
sourceArr
],
[...
targetArr
]))
{
Message
.
error
(
"部分算子没有流程线,请检查流程!"
);
return
;
}
if
(
!
checkIn
([...
targetArr
]))
{
Message
.
error
(
"每个流程第一步需读取文件/数据集,请检查流程!"
);
return
;
}
if
(
!
checkOut
([...
sourceArr
]))
{
Message
.
error
(
"每个流程最后一步必须将数据写入为文件/数据集,请检查流程!"
);
return
;
}
setCheckStatus
(
true
);
successCallBack
();
};
return
{
handleCheck
,
checkStatus
};
};
export
default
useCheckOperator
;
src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/index.module.css
View file @
5daf5172
...
@@ -64,6 +64,9 @@
...
@@ -64,6 +64,9 @@
}
}
.codeTitle
{
.codeTitle
{
background-color
:
rgba
(
230
,
233
,
237
,
1
);
background-color
:
rgba
(
230
,
233
,
237
,
1
);
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
11px
20px
;
padding
:
11px
20px
;
color
:
rgba
(
30
,
38
,
51
,
1
);
color
:
rgba
(
30
,
38
,
51
,
1
);
font-size
:
14px
;
font-size
:
14px
;
...
...
src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/index.tsx
View file @
5daf5172
This diff is collapsed.
Click to expand it.
src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/utils.ts
View file @
5daf5172
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-20 17:36:14
* @Date: 2022-10-20 17:36:14
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-24 1
1:00:49
* @LastEditTime: 2022-10-24 1
5:52:56
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/utils.ts
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/utils.ts
* @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
*/
*/
...
@@ -10,7 +10,9 @@
...
@@ -10,7 +10,9 @@
import
{
IOperatorAddFormData
}
from
"../../interface"
;
import
{
IOperatorAddFormData
}
from
"../../interface"
;
export
const
checkFormData
=
(
formData
:
IOperatorAddFormData
,
taskType
:
'BATCH'
|
'FLOW'
)
=>
{
type
IBuildType
=
"ENVIRONMENT"
|
"OPERATOR"
;
export
const
checkFormData
=
(
formData
:
IOperatorAddFormData
,
taskType
:
IBuildType
)
=>
{
const
reg
=
new
RegExp
(
"^[A-Za-z0-9
\
u4e00-
\
u9fa5]{1,15}$"
);
const
reg
=
new
RegExp
(
"^[A-Za-z0-9
\
u4e00-
\
u9fa5]{1,15}$"
);
const
result
:
IOperatorAddFormData
=
{}
const
result
:
IOperatorAddFormData
=
{}
...
@@ -30,7 +32,7 @@ export const checkFormData = (formData: IOperatorAddFormData, taskType: 'BATCH'
...
@@ -30,7 +32,7 @@ export const checkFormData = (formData: IOperatorAddFormData, taskType: 'BATCH'
if
(
!
formData
?.
productId
){
if
(
!
formData
?.
productId
){
result
.
productId
=
'请选择所属产品'
result
.
productId
=
'请选择所属产品'
}
}
if
(
taskType
===
'
BATCH
'
&&
!
formData
?.
envId
){
if
(
taskType
===
'
ENVIRONMENT
'
&&
!
formData
?.
envId
){
result
.
envId
=
'请选择应用环境'
result
.
envId
=
'请选择应用环境'
}
}
...
@@ -96,4 +98,51 @@ export const initCode = [{
...
@@ -96,4 +98,51 @@ export const initCode = [{
"message" : "请输入PDB或PDBQT文件"
"message" : "请输入PDB或PDBQT文件"
}
}
]
]
}]
}]
\ No newline at end of file
export const text = `
{
// 参数名, 必填,在15字符以内,仅限大小写字母、数字、"_",且只能以大小写字母开头
"name"
:
"timeout"
,
/** 参数类型。可选值有 STRING:字符串、FILE:文件、DATASET:数据集、INT:整型、FLOAT:单精度浮点型、
* DOUBLE:多精度浮点型、BOOLEAN:布尔值、ARRAY_STRING:字符串数组、ARRAY_FILE:文件数组、ARRAY_DATASET:数据集数组、
* ARRAY_INT:整型数组、ARRAY_FLOAT:单精度浮点型数组、ARRAY_DOUBLE:多精度浮点型数组、ARRAY_BOOLEAN:布尔值数组
*/
"classType"
:
"INT"
,
// 是否必填。在使用该算子时是否必须输入改参数的值
"required"
:
false
,
// 默认值
"defaultValue"
:
10000
,
// 参数描述。在300字符以内
"description"
:
""
,
// 是否隐藏,隐藏就在页面不显示该参数 必填
"hidden"
:
true
,
// 页面展示的参数的名称
"title"
:
""
,
// 参数展示的顺序优先级
"order"
:
0
,
/**
* 前端填值的方式 PATH:路径选择器、DATASET:数据集选择器、FILE:文件选择器、INPUT:输入框、
* SELECT:下拉框、MULTIPLESELECT:多选下拉框、RADIO:单选按钮、CHECKBOX:多选按钮
*/
"domType"
:
"INPUT"
,
// 选项。当domType为SELECT、MULTIPLESELECT、RADIO、CHECKBOX时生效。以对象数组的形式保存
"choices"
:
[
{
// 在前端展示的值
"label"
:
"是"
,
//选中时传递服务使用的值
"value"
:
"true"
},
],
//用于校验输入值。以对象数组的形式保存
"validators"
:
[
{
//正则表达式
"regex"
:
"^.*
\\
.(pdb|PDB|pdbqt|PDBQT)$"
,
//不符合正则时的报错信息
"message"
:
"请输入PDB或PDBQT文件"
}
]
}
`
\ No newline at end of file
src/views/ResourceCenter/UserResources/WorkflowOperator/components/OperatorCard/index.module.css
View file @
5daf5172
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
height
:
108px
;
height
:
108px
;
padding
:
20px
;
padding
:
20px
;
margin
:
0
20px
20px
0
;
margin
:
0
20px
20px
0
;
cursor
:
pointer
;
background
:
linear-gradient
(
180deg
,
#f5f7fa
0%
,
#ffffff
100%
);
background
:
linear-gradient
(
180deg
,
#f5f7fa
0%
,
#ffffff
100%
);
box-shadow
:
0px
3px
12px
0px
rgba
(
3
,
47
,
105
,
0.09
);
box-shadow
:
0px
3px
12px
0px
rgba
(
3
,
47
,
105
,
0.09
);
border-radius
:
6px
;
border-radius
:
6px
;
...
...
src/views/ResourceCenter/UserResources/WorkflowOperator/components/OperatorCard/index.tsx
View file @
5daf5172
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-17 14:35:11
* @Date: 2022-10-17 14:35:11
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-2
0 11:39:55
* @LastEditTime: 2022-10-2
4 20:38:16
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/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
*/
*/
...
@@ -13,16 +13,20 @@ import { observer } from "mobx-react";
...
@@ -13,16 +13,20 @@ import { observer } from "mobx-react";
import
{
useStores
}
from
"@/store"
;
import
{
useStores
}
from
"@/store"
;
import
{
useMemo
}
from
"react"
;
import
{
useMemo
}
from
"react"
;
import
MyMenu
from
"@/components/mui/MyMenu"
;
import
MyMenu
from
"@/components/mui/MyMenu"
;
import
{
useNavigate
}
from
"react-router-dom"
;
interface
IProps
{
interface
IProps
{
operatorInfo
:
IOperatorInfo
;
operatorInfo
:
IOperatorInfo
;
setPageType
:
(
val
:
string
)
=>
void
;
setPageType
:
(
val
:
string
)
=>
void
;
setDetailsId
:
(
val
:
string
)
=>
void
;
}
}
const
OperatorCard
=
observer
((
props
:
IProps
)
=>
{
const
OperatorCard
=
observer
((
props
:
IProps
)
=>
{
const
navigate
=
useNavigate
();
const
{
const
{
operatorInfo
:
{
title
=
""
,
type
,
version
,
productId
,
create
Time
},
operatorInfo
:
{
title
=
""
,
type
,
version
,
productId
,
create
dTime
,
id
},
setPageType
,
setPageType
,
setDetailsId
,
}
=
props
;
}
=
props
;
/** 产品store */
/** 产品store */
const
{
productListStore
}
=
useStores
();
const
{
productListStore
}
=
useStores
();
...
@@ -37,11 +41,18 @@ const OperatorCard = observer((props: IProps) => {
...
@@ -37,11 +41,18 @@ const OperatorCard = observer((props: IProps) => {
const
onClickOperation
=
(
val
:
string
)
=>
{
const
onClickOperation
=
(
val
:
string
)
=>
{
if
(
val
===
"upgrade"
)
{
if
(
val
===
"upgrade"
)
{
setPageType
(
"edit"
);
setPageType
(
"edit"
);
setDetailsId
(
id
||
""
);
}
}
};
};
const
handleToSeeOperator
=
(
item
:
any
)
=>
{
navigate
(
"/utility/resourceCenter/userResources/seeFloe"
,
{
state
:
{
id
:
item
.
id
},
});
};
return
(
return
(
<
div
className=
{
styles
.
itemBox
}
>
<
div
className=
{
styles
.
itemBox
}
onClick=
{
handleToSeeOperator
}
>
<
div
className=
{
styles
.
itemHeaderBox
}
>
<
div
className=
{
styles
.
itemHeaderBox
}
>
<
div
className=
{
styles
.
startTitleBox
}
>
{
title
?.
slice
(
0
,
1
)
}
</
div
>
<
div
className=
{
styles
.
startTitleBox
}
>
{
title
?.
slice
(
0
,
1
)
}
</
div
>
<
div
style=
{
{
flex
:
1
,
marginLeft
:
12
}
}
>
<
div
style=
{
{
flex
:
1
,
marginLeft
:
12
}
}
>
...
@@ -59,7 +70,7 @@ const OperatorCard = observer((props: IProps) => {
...
@@ -59,7 +70,7 @@ const OperatorCard = observer((props: IProps) => {
zIndex
:
1601
,
zIndex
:
1601
,
}
}
}
}
>
>
<
span
className=
{
styles
.
operationBox
}
>
d
</
span
>
<
span
className=
{
styles
.
operationBox
}
>
大大
</
span
>
</
MyMenu
>
</
MyMenu
>
</
div
>
</
div
>
<
div
className=
{
styles
.
itemContentBox
}
>
<
div
className=
{
styles
.
itemContentBox
}
>
...
@@ -70,7 +81,7 @@ const OperatorCard = observer((props: IProps) => {
...
@@ -70,7 +81,7 @@ const OperatorCard = observer((props: IProps) => {
算子版本:
<
span
>
{
`V${version}`
}
</
span
>
算子版本:
<
span
>
{
`V${version}`
}
</
span
>
</
p
>
</
p
>
<
p
className=
{
styles
.
infoBox
}
>
<
p
className=
{
styles
.
infoBox
}
>
创建时间:
<
span
>
{
createTime
}
</
span
>
创建时间:
<
span
>
{
create
d
Time
}
</
span
>
</
p
>
</
p
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx
View file @
5daf5172
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-17 14:35:11
* @Date: 2022-10-17 14:35:11
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-2
0 17:11:22
* @LastEditTime: 2022-10-2
4 20:40:16
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/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
*/
*/
...
@@ -35,6 +35,8 @@ const WorkflowOperator = observer(() => {
...
@@ -35,6 +35,8 @@ const WorkflowOperator = observer(() => {
type
:
"all"
,
type
:
"all"
,
});
});
const
[
detailsId
,
setDetailsId
]
=
useState
<
string
>
(
""
);
const
[
list
,
setList
]
=
useState
<
IOperatorInfo
[]
>
();
const
[
list
,
setList
]
=
useState
<
IOperatorInfo
[]
>
();
const
{
run
:
getList
}
=
useMyRequest
(
getOperatorList
,
{
const
{
run
:
getList
}
=
useMyRequest
(
getOperatorList
,
{
...
@@ -121,20 +123,27 @@ const WorkflowOperator = observer(() => {
...
@@ -121,20 +123,27 @@ const WorkflowOperator = observer(() => {
<
MyButton
<
MyButton
text=
"构建算子"
text=
"构建算子"
startIcon=
{
<
Add
/>
}
startIcon=
{
<
Add
/>
}
onClick=
{
()
=>
setPageType
(
"add"
)
}
onClick=
{
()
=>
{
setPageType
(
"add"
);
setDetailsId
(
""
);
}
}
></
MyButton
>
></
MyButton
>
</
div
>
</
div
>
<
div
className=
{
styles
.
contentBox
}
>
<
div
className=
{
styles
.
contentBox
}
>
{
list
?.
map
((
item
)
=>
{
{
list
?.
map
((
item
)
=>
{
return
(
return
(
<
OperatorCard
operatorInfo=
{
item
}
setPageType=
{
setPageType
}
/>
<
OperatorCard
setDetailsId=
{
setDetailsId
}
operatorInfo=
{
item
}
setPageType=
{
setPageType
}
/>
);
);
})
}
})
}
</
div
>
</
div
>
</
div
>
</
div
>
{
pageType
&&
(
{
pageType
&&
(
<
AddOperator
<
AddOperator
productId=
"cadd"
detailsId=
{
detailsId
}
setPageType=
{
setPageType
}
setPageType=
{
setPageType
}
pageType=
{
pageType
}
pageType=
{
pageType
}
/>
/>
...
...
src/views/ResourceCenter/UserResources/WorkflowOperator/interface.ts
View file @
5daf5172
...
@@ -2,18 +2,19 @@
...
@@ -2,18 +2,19 @@
* @Author: 吴永生 15770852798@163.com
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-19 20:50:18
* @Date: 2022-10-19 20:50:18
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-24
11:29:18
* @LastEditTime: 2022-10-24
20:38:09
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/interface.ts
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/interface.ts
* @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
*/
*/
export
type
IOperatorType
=
'BATCH'
|
'FLOW'
export
type
IOperatorType
=
'BATCH'
|
'FLOW'
export
interface
IOperatorInfo
{
export
interface
IOperatorInfo
{
id
:
string
;
title
:
string
;
title
:
string
;
type
:
IOperatorType
;
type
:
IOperatorType
;
version
:
string
;
version
:
string
;
productId
:
string
;
productId
:
string
;
createTime
:
string
;
create
d
Time
:
string
;
}
}
export
enum
operatorType
{
export
enum
operatorType
{
...
...
src/views/ResourceCenter/components/SwitchBatchFolw/index.tsx
View file @
5daf5172
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-18 09:32:40
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-24 14:57:06
* @FilePath: /bkunyun/src/views/ResourceCenter/components/SwitchBatchFolw/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
batchImg
from
"@/assets/resourceCenter/batchImg.svg"
;
import
batchImg
from
"@/assets/resourceCenter/batchImg.svg"
;
import
flowImg
from
"@/assets/resourceCenter/flowImg.svg"
;
import
flowImg
from
"@/assets/resourceCenter/flowImg.svg"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
goback
from
"@/assets/project/goback.svg"
;
import
goback
from
"@/assets/project/goback.svg"
;
import
style
from
"./index.module.css"
;
import
style
from
"./index.module.css"
;
type
ISwitchBatchFolwProps
=
{
type
ISwitchBatchFolwProps
=
{
topImg
?:
string
;
bottomImg
?:
string
;
active
:
"BATCH"
|
"FLOW"
;
active
:
"BATCH"
|
"FLOW"
;
setActive
:
any
;
setActive
:
any
;
goBack
:
any
;
goBack
:
any
;
};
};
const
SwitchBatchFolw
=
(
props
:
ISwitchBatchFolwProps
)
=>
{
const
SwitchBatchFolw
=
(
props
:
ISwitchBatchFolwProps
)
=>
{
const
{
active
,
setActive
,
goBack
}
=
props
;
const
{
active
,
setActive
,
goBack
,
topImg
,
bottomImg
}
=
props
;
return
(
return
(
<
div
className=
{
style
.
switchBatchFolw
}
>
<
div
className=
{
style
.
switchBatchFolw
}
>
<
div
className=
{
style
.
goBackBox
}
>
<
div
className=
{
style
.
goBackBox
}
>
...
@@ -36,7 +47,7 @@ const SwitchBatchFolw = (props: ISwitchBatchFolwProps) => {
...
@@ -36,7 +47,7 @@ const SwitchBatchFolw = (props: ISwitchBatchFolwProps) => {
[
style
.
itemImg
]:
true
,
[
style
.
itemImg
]:
true
,
[
style
.
activeImg
]:
active
===
"BATCH"
,
[
style
.
activeImg
]:
active
===
"BATCH"
,
})
}
})
}
src=
{
batchImg
}
src=
{
topImg
||
batchImg
}
alt=
""
alt=
""
/>
/>
{
active
===
"BATCH"
&&
<
div
className=
{
style
.
arrow
}
></
div
>
}
{
active
===
"BATCH"
&&
<
div
className=
{
style
.
arrow
}
></
div
>
}
...
@@ -53,7 +64,7 @@ const SwitchBatchFolw = (props: ISwitchBatchFolwProps) => {
...
@@ -53,7 +64,7 @@ const SwitchBatchFolw = (props: ISwitchBatchFolwProps) => {
[
style
.
itemImg
]:
true
,
[
style
.
itemImg
]:
true
,
[
style
.
activeImg
]:
active
===
"FLOW"
,
[
style
.
activeImg
]:
active
===
"FLOW"
,
})
}
})
}
src=
{
flowImg
}
src=
{
bottomImg
||
flowImg
}
alt=
""
alt=
""
/>
/>
{
active
===
"FLOW"
&&
<
div
className=
{
style
.
arrow
}
></
div
>
}
{
active
===
"FLOW"
&&
<
div
className=
{
style
.
arrow
}
></
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