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
bf2eb6ce
Commit
bf2eb6ce
authored
Aug 08, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-20220801' of
http://120.77.149.83/root/bkunyun
into feat-20220801
parents
21ab45ae
5522d3b7
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
253 additions
and
208 deletions
+253
-208
MyDialog.tsx
src/components/mui/MyDialog.tsx
+7
-3
MyPopconfirm.tsx
src/components/mui/MyPopconfirm.tsx
+2
-1
index.module.css
...s/CustomOperator/components/OperatorList/index.module.css
+9
-0
index.tsx
src/views/CustomOperator/components/OperatorList/index.tsx
+36
-24
index.tsx
src/views/CustomOperator/components/SaveOperator/index.tsx
+75
-54
index.tsx
src/views/CustomOperator/index.tsx
+24
-26
index.tsx
src/views/MenuLayout/index.tsx
+2
-2
index.tsx
src/views/Project/ProjectData/AddFolder/index.tsx
+1
-1
index.tsx
src/views/Project/ProjectData/index.tsx
+1
-1
index.module.css
src/views/Project/ProjectSetting/BaseInfo/index.module.css
+1
-1
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+3
-0
index.tsx
src/views/Project/ProjectSetting/ProjectMembers/index.tsx
+1
-1
templateBox.tsx
...ectWorkbench/workbenchTemplate/components/templateBox.tsx
+73
-71
index.module.css
...oject/ProjectWorkbench/workbenchTemplate/index.module.css
+14
-20
index.tsx
...iews/Project/ProjectWorkbench/workbenchTemplate/index.tsx
+2
-2
index.tsx
...iews/WorkFlowEdit/components/SaveCustomTemplate/index.tsx
+1
-1
index.tsx
src/views/WorkFlowEdit/index.tsx
+1
-0
No files found.
src/components/mui/MyDialog.tsx
View file @
bf2eb6ce
...
@@ -122,12 +122,16 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
...
@@ -122,12 +122,16 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
"& .MuiPaper-root"
:
{
"& .MuiPaper-root"
:
{
// 设置最大宽度, 实际宽度让子元素撑大
// 设置最大宽度, 实际宽度让子元素撑大
maxWidth
:
"1920px"
,
maxWidth
:
"1920px"
,
borderRadius
:
"8px"
},
},
},
},
}
}
}
}
>
>
{
isHideHeader
?
null
:
(
{
isHideHeader
?
null
:
(
<
DialogTitle
id=
"alert-dialog-title"
>
<
DialogTitle
id=
"alert-dialog-title"
sx=
{
{
padding
:
"20px 24px"
}
}
>
<
div
<
div
style=
{
{
style=
{
{
display
:
"flex"
,
display
:
"flex"
,
...
@@ -136,10 +140,10 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
...
@@ -136,10 +140,10 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
fontWeight
:
600
,
fontWeight
:
600
,
}
}
}
}
>
>
<
span
style=
{
{
fontSize
:
16
,
lineHeight
:
'24px'
,
color
:
'#1E2633'
}
}
>
{
title
}
</
span
>
<
span
style=
{
{
fontSize
:
16
,
lineHeight
:
'24px'
,
color
:
'#1E2633'
}
}
>
{
title
}
</
span
>
<
CloseIcon
<
CloseIcon
onClick=
{
onClose
}
onClick=
{
onClose
}
sx=
{
{
color
:
"#C2C6CC"
,
cursor
:
"pointer"
,
":hover"
:
{
background
:
"#f0f2f5"
,
borderRadius
:
'2px'
}
}
}
sx=
{
{
color
:
"#C2C6CC"
,
cursor
:
"pointer"
,
":hover"
:
{
background
:
"#f0f2f5"
,
borderRadius
:
'2px'
}
}
}
/>
/>
</
div
>
</
div
>
</
DialogTitle
>
</
DialogTitle
>
...
...
src/components/mui/MyPopconfirm.tsx
View file @
bf2eb6ce
...
@@ -68,7 +68,8 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
...
@@ -68,7 +68,8 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
zIndex
:
2000
,
zIndex
:
2000
,
bgcolor
:
"#fff"
,
bgcolor
:
"#fff"
,
minWidth
:
"200px"
,
minWidth
:
"200px"
,
borderRadius
:
"2px"
,
borderRadius
:
"4px"
,
fontSize
:
"14px"
,
padding
:
"20px 16px"
,
padding
:
"20px 16px"
,
boxShadow
:
"0px 3px 10px 0px rgba(0, 24, 57, 0.14)"
,
boxShadow
:
"0px 3px 10px 0px rgba(0, 24, 57, 0.14)"
,
}
}
}
}
...
...
src/views/CustomOperator/components/OperatorList/index.module.css
View file @
bf2eb6ce
...
@@ -81,3 +81,12 @@
...
@@ -81,3 +81,12 @@
height
:
2px
;
height
:
2px
;
background-color
:
rgba
(
86
,
92
,
102
,
1
);
background-color
:
rgba
(
86
,
92
,
102
,
1
);
}
}
.loading
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
line-height
:
20px
;
font-size
:
12px
;
color
:
rgba
(
86
,
92
,
102
,
1
);
padding
:
4px
;
}
src/views/CustomOperator/components/OperatorList/index.tsx
View file @
bf2eb6ce
...
@@ -5,6 +5,7 @@ import cloneDeep from "lodash/cloneDeep";
...
@@ -5,6 +5,7 @@ import cloneDeep from "lodash/cloneDeep";
import
{
getScrollLoader
}
from
"@/utils/util"
;
import
{
getScrollLoader
}
from
"@/utils/util"
;
import
{
useState
,
useCallback
,
useEffect
}
from
"react"
;
import
{
useState
,
useCallback
,
useEffect
}
from
"react"
;
import
{
getOperatorList
}
from
"@/api/project_api"
;
import
{
getOperatorList
}
from
"@/api/project_api"
;
import
CircularProgress
from
"@mui/material/CircularProgress"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
useStores
}
from
"@/store"
;
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
{
toJS
}
from
"mobx"
;
...
@@ -17,7 +18,6 @@ type IProps = {
...
@@ -17,7 +18,6 @@ type IProps = {
setOperatorList
:
any
;
setOperatorList
:
any
;
};
};
let
isInRequest
=
false
;
const
OperatorList
=
(
props
:
IProps
)
=>
{
const
OperatorList
=
(
props
:
IProps
)
=>
{
const
{
operatorList
,
setOperatorList
}
=
props
;
// 流程图中流算子列表
const
{
operatorList
,
setOperatorList
}
=
props
;
// 流程图中流算子列表
const
{
currentProjectStore
}
=
useStores
();
const
{
currentProjectStore
}
=
useStores
();
...
@@ -27,11 +27,9 @@ const OperatorList = (props: IProps) => {
...
@@ -27,11 +27,9 @@ const OperatorList = (props: IProps) => {
const
[
dragItem
,
setDragItem
]
=
useState
<
any
>
({});
// 拖拽的算子
const
[
dragItem
,
setDragItem
]
=
useState
<
any
>
({});
// 拖拽的算子
const
[
page
,
setPage
]
=
useState
(
0
);
//
const
[
page
,
setPage
]
=
useState
(
0
);
//
const
[
isLastPage
,
setIsLastPage
]
=
useState
(
false
);
const
[
isLastPage
,
setIsLastPage
]
=
useState
(
false
);
const
{
run
:
getOperatorListRun
}
=
useMyRequest
(
getOperatorList
,
{
// todo 加载中 没有更多了样式
const
{
run
:
getOperatorListRun
,
loading
}
=
useMyRequest
(
getOperatorList
,
{
onSuccess
:
(
res
)
=>
{
onSuccess
:
(
res
)
=>
{
isInRequest
=
false
;
console
.
log
(
"res"
,
res
);
let
arr
=
res
?.
data
?.
content
;
let
arr
=
res
?.
data
?.
content
;
setIsLastPage
(
res
?.
data
?.
last
);
setIsLastPage
(
res
?.
data
?.
last
);
arr
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
arr
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -42,7 +40,7 @@ const OperatorList = (props: IProps) => {
...
@@ -42,7 +40,7 @@ const OperatorList = (props: IProps) => {
classTypeName
:
"String"
,
classTypeName
:
"String"
,
defaultValue
:
null
,
defaultValue
:
null
,
description
:
""
,
description
:
""
,
domType
:
"
INPUT
"
,
domType
:
"
dataset
"
,
hidden
:
false
,
hidden
:
false
,
isnull
:
false
,
isnull
:
false
,
level
:
null
,
level
:
null
,
...
@@ -65,7 +63,7 @@ const OperatorList = (props: IProps) => {
...
@@ -65,7 +63,7 @@ const OperatorList = (props: IProps) => {
classTypeName
:
"String"
,
classTypeName
:
"String"
,
defaultValue
:
null
,
defaultValue
:
null
,
description
:
""
,
description
:
""
,
domType
:
"
INPUT
"
,
domType
:
"
dataset
"
,
hidden
:
false
,
hidden
:
false
,
isnull
:
false
,
isnull
:
false
,
level
:
null
,
level
:
null
,
...
@@ -81,26 +79,20 @@ const OperatorList = (props: IProps) => {
...
@@ -81,26 +79,20 @@ const OperatorList = (props: IProps) => {
validators
:
[],
validators
:
[],
});
});
});
});
setList
(
arr
);
setList
(
[...
list
,
...
arr
]
);
// setList(res?.data?.content || []);
// setList(res?.data?.content || []);
},
},
onError
:
()
=>
{
isInRequest
=
false
;
},
});
});
const
getOperatorListFun
=
useCallback
(
const
getOperatorListFun
=
useCallback
(
(
keyword
:
string
=
""
,
page
=
0
)
=>
{
(
keyword
:
string
=
""
,
page
=
0
)
=>
{
if
(
isInRequest
)
{
getOperatorListRun
({
return
;
productId
:
productId
as
string
,
}
else
{
keyword
,
getOperatorListRun
({
page
,
productId
:
productId
as
string
,
size
:
5
,
keyword
,
});
page
,
// size: 20 todo
size
:
5
,
});
}
},
},
[
productId
,
getOperatorListRun
]
[
productId
,
getOperatorListRun
]
);
);
...
@@ -109,8 +101,15 @@ const OperatorList = (props: IProps) => {
...
@@ -109,8 +101,15 @@ const OperatorList = (props: IProps) => {
getOperatorListFun
();
getOperatorListFun
();
},
[
getOperatorListFun
]);
},
[
getOperatorListFun
]);
const
keywordChange
=
(
e
:
any
)
=>
{
if
(
e
.
target
.
value
.
length
<=
30
)
{
setKeyword
(
e
.
target
.
value
);
}
};
const
handleKeywordKeyUp
=
(
e
:
any
)
=>
{
const
handleKeywordKeyUp
=
(
e
:
any
)
=>
{
if
(
e
.
keyCode
===
13
)
{
if
(
e
.
keyCode
===
13
)
{
setList
([]);
setKeyword
(
e
.
target
.
value
);
setKeyword
(
e
.
target
.
value
);
setPage
(
0
);
setPage
(
0
);
getOperatorListFun
(
e
.
target
.
value
,
0
);
getOperatorListFun
(
e
.
target
.
value
,
0
);
...
@@ -170,7 +169,7 @@ const OperatorList = (props: IProps) => {
...
@@ -170,7 +169,7 @@ const OperatorList = (props: IProps) => {
const
handleScroll
=
(
e
:
any
)
=>
{
const
handleScroll
=
(
e
:
any
)
=>
{
if
(
getScrollLoader
(
e
))
{
if
(
getScrollLoader
(
e
))
{
console
.
log
(
"加载1"
);
console
.
log
(
"加载1"
);
if
(
isInRequest
||
isLastPage
)
{
if
(
loading
||
isLastPage
)
{
return
;
return
;
}
else
{
}
else
{
console
.
log
(
"加载2"
);
console
.
log
(
"加载2"
);
...
@@ -316,8 +315,8 @@ const OperatorList = (props: IProps) => {
...
@@ -316,8 +315,8 @@ const OperatorList = (props: IProps) => {
<
InputBase
<
InputBase
className=
{
styles
.
searchInput
}
className=
{
styles
.
searchInput
}
placeholder=
"请输入算子名称"
placeholder=
"请输入算子名称"
//
value={keyword}
value=
{
keyword
}
//
onChange={keywordChange}
onChange=
{
keywordChange
}
onKeyUp=
{
handleKeywordKeyUp
}
onKeyUp=
{
handleKeywordKeyUp
}
/>
/>
</
div
>
</
div
>
...
@@ -341,6 +340,19 @@ const OperatorList = (props: IProps) => {
...
@@ -341,6 +340,19 @@ const OperatorList = (props: IProps) => {
</
div
>
</
div
>
);
);
})
}
})
}
{
!
loading
&&
(
<
div
className=
{
styles
.
loading
}
>
<
CircularProgress
size=
{
12
}
sx=
{
{
color
:
"rgba(19, 112, 255, 1)"
,
marginRight
:
"8px"
,
}
}
/>
加载中...
</
div
>
)
}
{
!
isLastPage
&&
<
div
className=
{
styles
.
loading
}
>
已经到底了
</
div
>
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/views/CustomOperator/components/SaveOperator/index.tsx
View file @
bf2eb6ce
...
@@ -2,46 +2,40 @@ import { saveUserSpec } from "@/api/workbench_api";
...
@@ -2,46 +2,40 @@ import { saveUserSpec } from "@/api/workbench_api";
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
_
from
"lodash"
;
import
{
useState
}
from
"react"
;
import
{
useState
}
from
"react"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
saveBatchActor
}
from
"@/api/project_api"
;
import
{
useStores
}
from
"@/store"
;
import
{
useStores
}
from
"@/store"
;
import
styles
from
"./index.module.css"
;
//
import styles from "./index.module.css";
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
toJS
}
from
"mobx"
;
import
{
toJS
}
from
"mobx"
;
import
{
ITask
}
from
"@/views/Project/ProjectSubmitWork/interface"
;
import
{
ITask
}
from
"@/views/Project/ProjectSubmitWork/interface"
;
interface
IProps
{
interface
IProps
{
saveFormDialog
:
boolean
;
saveFormDialog
:
boolean
;
setSaveFormDialog
:
(
val
:
boolean
)
=>
void
;
setSaveFormDialog
:
(
val
:
boolean
)
=>
void
;
onBack
?:
()
=>
void
;
operatorList
:
ITask
[];
title
:
string
;
setTitle
:
(
val
:
string
)
=>
void
;
version
:
string
;
setVersion
:
(
val
:
string
)
=>
void
;
description
:
string
;
setDescription
:
(
val
:
string
)
=>
void
;
creator
?:
string
;
templateConfigInfo
:
ITask
[];
id
?:
string
;
}
}
const
SaveOperator
=
(
props
:
IProps
)
=>
{
const
SaveOperator
=
(
props
:
IProps
)
=>
{
const
{
const
{
saveFormDialog
,
setSaveFormDialog
,
operatorList
}
=
props
;
saveFormDialog
,
setSaveFormDialog
,
onBack
,
title
,
setTitle
,
version
,
setVersion
,
description
,
setDescription
,
templateConfigInfo
,
creator
,
id
,
}
=
props
;
const
{
currentProjectStore
}
=
useStores
();
const
{
currentProjectStore
}
=
useStores
();
const
Message
=
useMessage
();
const
Message
=
useMessage
();
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
[
title
,
setTitle
]
=
useState
(
""
);
const
[
version
,
setVersion
]
=
useState
(
"1.0.0"
);
const
[
description
,
setDescription
]
=
useState
(
""
);
// 保存批算子
const
{
run
:
saveBatchActorRun
}
=
useMyRequest
(
saveBatchActor
,
{
onSuccess
:
(
res
)
=>
{
Message
.
success
(
"保存算子成功"
);
setSaveFormDialog
(
false
);
sessionStorage
.
setItem
(
"operatorList"
,
"[]"
);
console
.
log
(
"res"
,
res
);
},
});
const
[
titleHelper
,
setTitleHelper
]
=
useState
({
const
[
titleHelper
,
setTitleHelper
]
=
useState
({
// 算子名称错误提示
// 算子名称错误提示
error
:
false
,
error
:
false
,
...
@@ -53,14 +47,6 @@ const SaveOperator = (props: IProps) => {
...
@@ -53,14 +47,6 @@ const SaveOperator = (props: IProps) => {
helperText
:
""
,
helperText
:
""
,
});
});
// 算子保存方法
const
{
run
:
saveUserSpecRun
}
=
useMyRequest
(
saveUserSpec
,
{
onSuccess
:
(
res
)
=>
{
Message
.
success
(
"保存成功!"
);
onBack
&&
onBack
();
},
});
// 关闭表单弹窗
// 关闭表单弹窗
const
handleCloseDialog
=
()
=>
{
const
handleCloseDialog
=
()
=>
{
setSaveFormDialog
(
false
);
setSaveFormDialog
(
false
);
...
@@ -124,6 +110,7 @@ const SaveOperator = (props: IProps) => {
...
@@ -124,6 +110,7 @@ const SaveOperator = (props: IProps) => {
error
:
false
,
error
:
false
,
helperText
:
""
,
helperText
:
""
,
});
});
return
true
;
}
else
{
}
else
{
setVersionHelper
({
setVersionHelper
({
error
:
true
,
error
:
true
,
...
@@ -133,28 +120,63 @@ const SaveOperator = (props: IProps) => {
...
@@ -133,28 +120,63 @@ const SaveOperator = (props: IProps) => {
}
}
};
};
// 坐标转换
const
positionTransform
=
()
=>
{
const
copyOperatorList
:
ITask
[]
=
_
.
cloneDeep
(
operatorList
);
const
positionXArr
=
copyOperatorList
.
map
((
operatorLi
)
=>
{
return
operatorLi
.
position
.
x
;
});
const
positionYArr
=
copyOperatorList
.
map
((
operatorLi
)
=>
{
return
operatorLi
.
position
.
y
;
});
let
minPositionX
=
Math
.
min
(...
positionXArr
);
let
minPositionY
=
Math
.
min
(...
positionYArr
);
let
startingPointX
=
minPositionX
-
40
;
let
startingPointY
=
minPositionY
-
10
;
return
copyOperatorList
.
map
((
operatorLi
)
=>
{
return
{
...
operatorLi
,
position
:
{
x
:
operatorLi
.
position
.
x
-
startingPointX
,
y
:
operatorLi
.
position
.
y
-
startingPointY
,
},
};
});
};
// 表单弹窗确定,新建算子
// 表单弹窗确定,新建算子
const
handleOncofirm
=
()
=>
{
const
handleOncofirm
=
()
=>
{
console
.
log
(
operatorList
);
if
(
checkTitle
(
title
)
&&
checkVersion
(
version
))
{
if
(
checkTitle
(
title
)
&&
checkVersion
(
version
))
{
if
(
id
)
{
saveBatchActorRun
({
saveUserSpecRun
({
query
:
{
title
,
productId
:
productId
as
string
,
version
,
batchName
:
title
,
description
,
batchVersion
:
version
,
tasks
:
templateConfigInfo
,
description
:
description
,
productId
,
},
id
,
body
:
positionTransform
(),
creator
,
});
});
// operatorList
}
else
{
// if (id) {
saveUserSpecRun
({
// saveUserSpecRun({
title
,
// title,
version
,
// version,
description
,
// description,
tasks
:
templateConfigInfo
,
// tasks: templateConfigInfo,
productId
,
// productId,
});
// id,
}
// creator,
// });
// } else {
// saveUserSpecRun({
// title,
// version,
// description,
// tasks: templateConfigInfo,
// productId,
// });
// }
}
}
};
};
...
@@ -165,7 +187,7 @@ const SaveOperator = (props: IProps) => {
...
@@ -165,7 +187,7 @@ const SaveOperator = (props: IProps) => {
onClose=
{
handleCloseDialog
}
onClose=
{
handleCloseDialog
}
onConfirm=
{
handleOncofirm
}
onConfirm=
{
handleOncofirm
}
>
>
<
div
className=
{
styles
.
saveBox
}
>
<
div
style=
{
{
width
:
"388px"
}
}
>
<
MyInput
<
MyInput
value=
{
title
}
value=
{
title
}
label=
"算子名称"
label=
"算子名称"
...
@@ -174,7 +196,6 @@ const SaveOperator = (props: IProps) => {
...
@@ -174,7 +196,6 @@ const SaveOperator = (props: IProps) => {
error=
{
titleHelper
.
error
}
error=
{
titleHelper
.
error
}
helperText=
{
titleHelper
.
helperText
}
helperText=
{
titleHelper
.
helperText
}
style=
{
{
margin
:
"20px 0"
}
}
style=
{
{
margin
:
"20px 0"
}
}
disabled=
{
id
?
true
:
false
}
></
MyInput
>
></
MyInput
>
<
MyInput
<
MyInput
value=
{
version
}
value=
{
version
}
...
...
src/views/CustomOperator/index.tsx
View file @
bf2eb6ce
...
@@ -4,12 +4,9 @@ import FullScreenDrawer from "@/components/CommonComponents/FullScreenDrawer";
...
@@ -4,12 +4,9 @@ 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
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
saveBatchActor
}
from
"@/api/project_api"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
{
useStores
}
from
"@/store"
;
import
BatchOperatorFlow
from
"../Project/components/Flow/components/BatchOperatorFlow"
;
import
BatchOperatorFlow
from
"../Project/components/Flow/components/BatchOperatorFlow"
;
import
{
toJS
}
from
"mobx
"
;
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"
;
...
@@ -21,9 +18,13 @@ type IProps = {
...
@@ -21,9 +18,13 @@ type IProps = {
const
CustomOperator
=
observer
((
props
:
IProps
)
=>
{
const
CustomOperator
=
observer
((
props
:
IProps
)
=>
{
const
{
setShowCustomOperator
}
=
props
;
const
{
setShowCustomOperator
}
=
props
;
const
Message
=
useMessage
();
const
Message
=
useMessage
();
const
[
operatorList
,
setOperatorList
]
=
useState
<
ITask
[]
>
([]);
const
sessionStorageOperatorList
=
JSON
.
parse
(
const
{
currentProjectStore
}
=
useStores
();
sessionStorage
.
getItem
(
"operatorList"
)
||
"[]"
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
);
const
[
operatorList
,
setOperatorList
]
=
useState
<
ITask
[]
>
(
sessionStorageOperatorList
);
const
[
saveFormDialog
,
setSaveFormDialog
]
=
useState
(
false
);
// const [showCustomOperator, setShowCustomOperator] = useState(false);
// const [showCustomOperator, setShowCustomOperator] = useState(false);
/** 设置选中唯一标识符 */
/** 设置选中唯一标识符 */
...
@@ -32,25 +33,6 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -32,25 +33,6 @@ const CustomOperator = observer((props: IProps) => {
// console.log(val);
// console.log(val);
},
[]);
},
[]);
// 保存批算子
const
{
run
:
saveBatchActorRun
}
=
useMyRequest
(
saveBatchActor
,
{
onSuccess
:
(
res
)
=>
{
console
.
log
(
"res"
,
res
);
},
});
const
handleSave
=
useCallback
(()
=>
{
saveBatchActorRun
({
query
:
{
productId
:
productId
as
string
,
batchName
:
"123456"
,
batchVersion
:
"1.0.0"
,
description
:
""
,
},
body
:
[],
});
},
[
saveBatchActorRun
,
productId
]);
// 判断 每个流算子必须至少有一条连接线。
// 判断 每个流算子必须至少有一条连接线。
const
checkHasOneLine
=
(
sourceArr
:
string
[],
targetArr
:
string
[])
=>
{
const
checkHasOneLine
=
(
sourceArr
:
string
[],
targetArr
:
string
[])
=>
{
const
all
=
_
.
uniq
([...
sourceArr
,
...
targetArr
]);
const
all
=
_
.
uniq
([...
sourceArr
,
...
targetArr
]);
...
@@ -124,6 +106,10 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -124,6 +106,10 @@ const CustomOperator = observer((props: IProps) => {
return
check
;
return
check
;
};
};
useEffect
(()
=>
{
sessionStorage
.
setItem
(
"operatorList"
,
JSON
.
stringify
(
operatorList
));
},
[
operatorList
]);
const
handleCheck
=
()
=>
{
const
handleCheck
=
()
=>
{
if
(
operatorList
.
length
===
0
)
{
if
(
operatorList
.
length
===
0
)
{
Message
.
error
(
"内容不能为空!"
);
Message
.
error
(
"内容不能为空!"
);
...
@@ -137,18 +123,25 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -137,18 +123,25 @@ const CustomOperator = observer((props: IProps) => {
edge
.
target
&&
targetArr
.
push
(
edge
.
target
);
edge
.
target
&&
targetArr
.
push
(
edge
.
target
);
});
});
});
});
console
.
log
(
"operatorList"
,
operatorList
);
console
.
log
(
"sourceArr"
,
sourceArr
);
console
.
log
(
"targetArr"
,
targetArr
);
if
(
!
checkHasOneLine
([...
sourceArr
],
[...
targetArr
]))
{
if
(
!
checkHasOneLine
([...
sourceArr
],
[...
targetArr
]))
{
console
.
log
(
"checkHasOneLine"
);
Message
.
error
(
"内容校验未通过,请检查!"
);
Message
.
error
(
"内容校验未通过,请检查!"
);
return
;
return
;
}
}
if
(
!
checkIn
([...
targetArr
]))
{
if
(
!
checkIn
([...
targetArr
]))
{
console
.
log
(
"checkIn"
);
Message
.
error
(
"内容校验未通过,请检查!"
);
Message
.
error
(
"内容校验未通过,请检查!"
);
return
;
return
;
}
}
if
(
!
checkOut
([...
sourceArr
]))
{
if
(
!
checkOut
([...
sourceArr
]))
{
console
.
log
(
"checkOut"
);
Message
.
error
(
"内容校验未通过,请检查!"
);
Message
.
error
(
"内容校验未通过,请检查!"
);
return
;
return
;
}
}
setSaveFormDialog
(
true
);
};
};
return
(
return
(
...
@@ -162,6 +155,11 @@ const CustomOperator = observer((props: IProps) => {
...
@@ -162,6 +155,11 @@ const CustomOperator = observer((props: IProps) => {
handleCheck
();
handleCheck
();
}
}
}
}
></
MyButton
>
></
MyButton
>
<
SaveOperator
saveFormDialog=
{
saveFormDialog
}
setSaveFormDialog=
{
setSaveFormDialog
}
operatorList=
{
operatorList
}
></
SaveOperator
>
</
div
>
</
div
>
<
div
className=
{
styles
.
coContent
}
id=
"customOperatorFlow"
>
<
div
className=
{
styles
.
coContent
}
id=
"customOperatorFlow"
>
<
OperatorList
<
OperatorList
...
...
src/views/MenuLayout/index.tsx
View file @
bf2eb6ce
...
@@ -41,7 +41,7 @@ const MenuLayout = observer(() => {
...
@@ -41,7 +41,7 @@ const MenuLayout = observer(() => {
return
(
return
(
<
Box
className=
{
style
.
container
}
>
<
Box
className=
{
style
.
container
}
>
<
Box
className=
{
style
.
aside
}
>
<
Box
className=
{
style
.
aside
}
>
{
{
pathname
.
indexOf
(
'userCenter'
)
<
0
&&
<
CurrentProject
/>
pathname
.
indexOf
(
'userCenter'
)
<
0
&&
<
CurrentProject
/>
}
}
<
List
<
List
...
@@ -62,7 +62,7 @@ const MenuLayout = observer(() => {
...
@@ -62,7 +62,7 @@ const MenuLayout = observer(() => {
onClick=
{
()
=>
item
.
type
===
"page"
&&
navigate
(
item
.
path
)
}
onClick=
{
()
=>
item
.
type
===
"page"
&&
navigate
(
item
.
path
)
}
>
>
<
img
className=
{
style
.
routerIcon
}
src=
{
routerIcon
(
item
.
id
||
''
,
`/v3${item.path}`
===
pathname
)
||
undefined
}
alt=
''
/>
<
img
className=
{
style
.
routerIcon
}
src=
{
routerIcon
(
item
.
id
||
''
,
`/v3${item.path}`
===
pathname
)
||
undefined
}
alt=
''
/>
<
span
style=
{
{
verticalAlign
:
'middle'
}
}
>
{
item
.
name
}
</
span
>
<
span
style=
{
{
verticalAlign
:
'middle'
,
fontWeight
:
'500'
}
}
>
{
item
.
name
}
</
span
>
</
li
>
</
li
>
);
);
}
}
...
...
src/views/Project/ProjectData/AddFolder/index.tsx
View file @
bf2eb6ce
...
@@ -97,7 +97,7 @@ const AddFolder = (props: IAddFolderProps) => {
...
@@ -97,7 +97,7 @@ const AddFolder = (props: IAddFolderProps) => {
<
MyButton
<
MyButton
text=
"新建文件夹"
text=
"新建文件夹"
variant=
"outlined"
variant=
"outlined"
size=
"
small
"
size=
"
medium
"
onClick=
{
()
=>
setDeleteDialogOpen
(
true
)
}
onClick=
{
()
=>
setDeleteDialogOpen
(
true
)
}
disabled=
{
disabled=
{
selectIds
.
length
!==
0
||
!
isPass
(
"PROJECT_DATA_ADDDIR"
,
"USER"
)
selectIds
.
length
!==
0
||
!
isPass
(
"PROJECT_DATA_ADDDIR"
,
"USER"
)
...
...
src/views/Project/ProjectData/index.tsx
View file @
bf2eb6ce
...
@@ -515,7 +515,7 @@ const ProjectData = observer(() => {
...
@@ -515,7 +515,7 @@ const ProjectData = observer(() => {
<
MyButton
<
MyButton
text=
"上传文件"
text=
"上传文件"
variant=
"contained"
variant=
"contained"
size=
"
small
"
size=
"
medium
"
style=
{
{
marginRight
:
"12px"
}
}
style=
{
{
marginRight
:
"12px"
}
}
onClick=
{
()
=>
setUploaderDialogOpen
(
true
)
}
onClick=
{
()
=>
setUploaderDialogOpen
(
true
)
}
disabled=
{
disabled=
{
...
...
src/views/Project/ProjectSetting/BaseInfo/index.module.css
View file @
bf2eb6ce
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
line-height
:
22px
;
line-height
:
22px
;
font-size
:
14px
;
font-size
:
14px
;
font-weight
:
550
;
font-weight
:
550
;
margin-bottom
:
12
px
;
margin-bottom
:
8
px
;
}
}
.projectInfoName
::after
{
.projectInfoName
::after
{
content
:
"*"
;
content
:
"*"
;
...
...
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
bf2eb6ce
...
@@ -429,6 +429,9 @@ const BaseInfo = observer(() => {
...
@@ -429,6 +429,9 @@ const BaseInfo = observer(() => {
className=
{
style
.
updateButton
}
className=
{
style
.
updateButton
}
onClick=
{
handleClickUpdate
}
onClick=
{
handleClickUpdate
}
loading=
{
updateLoading
}
loading=
{
updateLoading
}
sx=
{
{
height
:
"32px"
}
}
>
>
保存修改
保存修改
</
LoadingButton
>
</
LoadingButton
>
...
...
src/views/Project/ProjectSetting/ProjectMembers/index.tsx
View file @
bf2eb6ce
...
@@ -164,7 +164,7 @@ const ProjectMembers = observer(() => {
...
@@ -164,7 +164,7 @@ const ProjectMembers = observer(() => {
variant=
"contained"
variant=
"contained"
onClick=
{
onAddMember
}
onClick=
{
onAddMember
}
startIcon=
{
<
Add
/>
}
startIcon=
{
<
Add
/>
}
size=
"
small
"
size=
"
medium
"
/>
/>
)
:
null
}
)
:
null
}
</
Box
>
</
Box
>
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/templateBox.tsx
View file @
bf2eb6ce
...
@@ -28,86 +28,88 @@ const TemplateBox = (props: any) => {
...
@@ -28,86 +28,88 @@ const TemplateBox = (props: any) => {
);
);
return
(
return
(
<
Box
className=
{
styles
.
templateBlock
}
>
<
Box
className=
{
styles
.
template
}
>
<
Box
>
<
Box
className=
{
styles
.
templateBlock
}
>
<
Box
<
Box
>
sx=
{
{
<
Box
display
:
"flex"
,
justifyContent
:
"space-between"
,
alignItems
:
"center"
,
}
}
>
<
Typography
sx=
{
{
sx=
{
{
fontSize
:
"14px"
,
display
:
"flex"
,
fontWeight
:
"600"
,
justifyContent
:
"space-between"
,
color
:
"#1E2633"
,
alignItems
:
"center"
,
marginBottom
:
"4px"
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
}
}
}
}
>
>
{
info
.
title
}
<
Typography
</
Typography
>
sx=
{
{
{
info
.
creator
!==
"root"
&&
(
fontSize
:
"14px"
,
<
Box
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=
{
{
sx=
{
{
backgroundColor
:
"rgba(227, 250, 236, 1)"
,
color
:
"rgba(2, 171, 131, 1)"
,
lineHeight
:
"20px"
,
padding
:
"1px 9px"
,
fontSize
:
"12px"
,
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
,
marginRight
:
"24px"
,
}
}
}
}
>
>
自定义
版本:
{
info
.
version
}
</
Box
>
</
Typography
>
)
}
<
Typography
</
Box
>
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
}
}
<
Box
sx=
{
{
display
:
"flex"
,
marginBottom
:
"8px"
}
}
>
>
<
Typography
更新时间:
{
info
.
updatedTime
}
sx=
{
{
</
Typography
>
fontSize
:
"12px"
,
</
Box
>
fontWeight
:
"400"
,
<
Typography
className=
{
styles
.
templateDescText
}
>
color
:
"#1370FF"
,
{
info
.
description
?
info
.
description
:
"此模板暂无描述。"
}
marginRight
:
"24px"
,
}
}
>
版本:
{
info
.
version
}
</
Typography
>
<
Typography
sx=
{
{
fontSize
:
"12px"
,
fontWeight
:
"400"
,
color
:
"#1370FF"
}
}
>
更新时间:
{
info
.
updatedTime
}
</
Typography
>
</
Typography
>
</
Box
>
</
Box
>
<
Typography
className=
{
styles
.
templateDescText
}
>
<
Box
{
info
.
description
?
info
.
description
:
"此模板暂无描述。"
}
sx=
{
{
</
Typography
>
display
:
"flex"
,
</
Box
>
justifyContent
:
"end"
,
<
Box
}
}
sx=
{
{
>
display
:
"flex"
,
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"MANAGER"
)
&&
(
justifyContent
:
"end"
,
<
MyButton
}
}
size=
"medium"
>
text=
"删除模版"
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"MANAGER"
)
&&
(
onClick=
{
()
=>
{
<
MyButton
props
.
startDialog
(
info
.
id
);
size=
{
"small"
}
}
}
text=
{
"删除模版"
}
style=
{
{
backgroundColor
:
"#F0F2F5"
,
color
:
"#565C66"
}
}
onClick=
{
()
=>
{
/>
props
.
startDialog
(
info
.
id
);
)
}
}
}
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"USER"
)
&&
(
style=
{
{
backgroundColor
:
"#F0F2F5"
,
color
:
"#565C66"
}
}
<
MyButton
/>
size=
"medium"
)
}
text=
"使用模版"
{
isPass
(
"PROJECT_WORKBENCH_FLOES_USE"
,
"USER"
)
&&
(
onClick=
{
()
=>
addTemplateBlock
(
info
.
id
)
}
<
MyButton
style=
{
{
marginLeft
:
"12px"
}
}
size=
{
"small"
}
/>
text=
{
"使用模版"
}
)
}
onClick=
{
()
=>
addTemplateBlock
(
info
.
id
)
}
</
Box
>
style=
{
{
marginLeft
:
"12px"
}
}
/>
)
}
</
Box
>
</
Box
>
</
Box
>
</
Box
>
);
);
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/index.module.css
View file @
bf2eb6ce
...
@@ -16,10 +16,15 @@
...
@@ -16,10 +16,15 @@
margin-bottom
:
24px
;
margin-bottom
:
24px
;
}
}
.template
{
padding
:
0
8px
;
box-sizing
:
border-box
;
}
.templateBlock
{
.templateBlock
{
height
:
194px
;
height
:
194px
;
background
:
#ffffff
;
background
:
#ffffff
;
box-shadow
:
0px
3px
10px
0px
rgba
(
0
,
24
,
57
,
0.0400
);
box-shadow
:
0px
3px
10px
0px
rgba
(
0
,
24
,
57
,
0.0400
);
border-radius
:
4px
;
border-radius
:
4px
;
border
:
1px
solid
#ebedf0
;
border
:
1px
solid
#ebedf0
;
padding
:
16px
20px
;
padding
:
16px
20px
;
...
@@ -32,32 +37,20 @@
...
@@ -32,32 +37,20 @@
}
}
@media
screen
and
(
max-width
:
1220px
)
{
@media
screen
and
(
max-width
:
1220px
)
{
.templateBlock
{
.template
{
width
:
49%
;
width
:
50%
;
margin-right
:
2%
;
}
.templateBlock
:nth-child
(
2n
)
{
margin-right
:
0
;
}
}
}
}
@media
screen
and
(
min-width
:
1220px
)
and
(
max-width
:
1600px
)
{
@media
screen
and
(
min-width
:
1220px
)
and
(
max-width
:
1600px
)
{
.templateBlock
{
.template
{
width
:
32.423%
;
width
:
33.33333%
;
margin-right
:
1.365%
;
}
.templateBlock
:nth-child
(
3n
)
{
margin-right
:
0
;
}
}
}
}
@media
screen
and
(
min-width
:
1600px
)
{
@media
screen
and
(
min-width
:
1600px
)
{
.templateBlock
{
.template
{
width
:
24%
;
width
:
25%
;
margin-right
:
1.333%
;
}
.templateBlock
:nth-child
(
4n
)
{
margin-right
:
0
;
}
}
}
}
...
@@ -120,4 +113,4 @@
...
@@ -120,4 +113,4 @@
align-items
:
center
;
align-items
:
center
;
flex-direction
:
column
;
flex-direction
:
column
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
\ No newline at end of file
src/views/Project/ProjectWorkbench/workbenchTemplate/index.tsx
View file @
bf2eb6ce
...
@@ -121,7 +121,7 @@ const ProjectMembers = observer(() => {
...
@@ -121,7 +121,7 @@ const ProjectMembers = observer(() => {
text=
{
"添加工作流模版"
}
text=
{
"添加工作流模版"
}
img=
{
<
Add
/>
}
img=
{
<
Add
/>
}
onClick=
{
addTemplateBlock
}
onClick=
{
addTemplateBlock
}
size=
{
"
small
"
}
size=
{
"
medium
"
}
/>
/>
)
}
)
}
</
Box
>
</
Box
>
...
@@ -145,7 +145,7 @@ const ProjectMembers = observer(() => {
...
@@ -145,7 +145,7 @@ const ProjectMembers = observer(() => {
</
Box
>
</
Box
>
)
}
)
}
{
templateList
.
length
>
0
&&
(
{
templateList
.
length
>
0
&&
(
<
Box
sx=
{
{
display
:
"flex"
,
flexWrap
:
"wrap"
}
}
>
<
Box
sx=
{
{
display
:
"flex"
,
flexWrap
:
"wrap"
,
margin
:
"0 -8px"
}
}
>
{
templateList
&&
{
templateList
&&
templateList
.
length
>
0
&&
templateList
.
length
>
0
&&
templateList
.
map
((
item
,
key
)
=>
{
templateList
.
map
((
item
,
key
)
=>
{
...
...
src/views/WorkFlowEdit/components/SaveCustomTemplate/index.tsx
View file @
bf2eb6ce
...
@@ -229,7 +229,7 @@ const SaveCustomTemplate = (props: IProps) => {
...
@@ -229,7 +229,7 @@ const SaveCustomTemplate = (props: IProps) => {
required
required
error=
{
titleHelper
.
error
}
error=
{
titleHelper
.
error
}
helperText=
{
titleHelper
.
helperText
}
helperText=
{
titleHelper
.
helperText
}
style=
{
{
margin
:
"
20px 0
"
}
}
style=
{
{
margin
:
"
8px 0 20px
"
}
}
disabled=
{
id
?
true
:
false
}
disabled=
{
id
?
true
:
false
}
></
MyInput
>
></
MyInput
>
<
MyInput
<
MyInput
...
...
src/views/WorkFlowEdit/index.tsx
View file @
bf2eb6ce
...
@@ -237,6 +237,7 @@ const WorkFlowEdit = observer((props: IProps) => {
...
@@ -237,6 +237,7 @@ const WorkFlowEdit = observer((props: IProps) => {
anchorEl=
{
anchorEl
}
anchorEl=
{
anchorEl
}
onCancel=
{
handleCancel
}
onCancel=
{
handleCancel
}
onConfirm=
{
handleConfirm
}
onConfirm=
{
handleConfirm
}
placement=
"bottom-end"
/>
/>
{
saveFormDialog
&&
(
{
saveFormDialog
&&
(
<
SaveCustomTemplate
<
SaveCustomTemplate
...
...
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