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
c01e4fb8
Commit
c01e4fb8
authored
Sep 05, 2022
by
jiangzijing
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-20220801' of
http://120.77.149.83/root/bkunyun
into feat-20220801
parents
55033d05
d10e919b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
67 deletions
+66
-67
MySwitch.tsx
src/components/mui/MySwitch.tsx
+9
-19
index.module.css
src/views/Project/ProjectJobDetail/index.module.css
+7
-1
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+47
-43
index.module.css
src/views/Project/components/Flow/index.module.css
+2
-2
index.tsx
src/views/Project/components/Flow/index.tsx
+1
-2
No files found.
src/components/mui/MySwitch.tsx
View file @
c01e4fb8
...
@@ -27,23 +27,8 @@ const MySwitch = (props: IMySwitchProps) => {
...
@@ -27,23 +27,8 @@ const MySwitch = (props: IMySwitchProps) => {
...
other
...
other
}
=
props
;
}
=
props
;
const
bgColor
=
useMemo
(()
=>
{
const
theme
=
useMemo
(()
=>
{
if
(
disabled
)
{
return
createTheme
({
if
(
value
)
{
return
"rgba(166, 211, 255, 1)"
;
}
else
{
return
"rgba(221, 225, 230, 1)"
;
}
}
else
{
if
(
value
)
{
return
"rgba(19, 112, 255, 1)"
;
}
else
{
return
"rgba(221, 225, 230, 1)"
;
}
}
},
[
disabled
,
value
]);
const
theme
=
createTheme
({
components
:
{
components
:
{
MuiSwitch
:
{
MuiSwitch
:
{
styleOverrides
:
{
styleOverrides
:
{
...
@@ -58,7 +43,9 @@ const MySwitch = (props: IMySwitchProps) => {
...
@@ -58,7 +43,9 @@ const MySwitch = (props: IMySwitchProps) => {
"&.Mui-checked"
:
{
"&.Mui-checked"
:
{
left
:
"2px"
,
left
:
"2px"
,
"& + .MuiSwitch-track"
:
{
"& + .MuiSwitch-track"
:
{
backgroundColor
:
bgColor
,
backgroundColor
:
disabled
?
"rgba(166, 211, 255, 1)"
:
"rgba(19, 112, 255, 1)"
,
opacity
:
1
,
opacity
:
1
,
},
},
},
},
...
@@ -70,13 +57,16 @@ const MySwitch = (props: IMySwitchProps) => {
...
@@ -70,13 +57,16 @@ const MySwitch = (props: IMySwitchProps) => {
},
},
track
:
{
track
:
{
borderRadius
:
"11px"
,
borderRadius
:
"11px"
,
backgroundColor
:
"rgba(221, 225, 230, 1)"
,
backgroundColor
:
disabled
?
"RGBA(240, 242, 245, 1)"
:
"RGBA(221, 225, 230, 1)"
,
opacity
:
1
,
opacity
:
1
,
},
},
},
},
},
},
},
},
});
});
},
[
disabled
]);
return
(
return
(
<
ThemeProvider
theme=
{
theme
}
>
<
ThemeProvider
theme=
{
theme
}
>
...
...
src/views/Project/ProjectJobDetail/index.module.css
View file @
c01e4fb8
...
@@ -110,8 +110,14 @@
...
@@ -110,8 +110,14 @@
color
:
rgba
(
138
,
144
,
153
,
1
);
color
:
rgba
(
138
,
144
,
153
,
1
);
font-size
:
14px
;
font-size
:
14px
;
line-height
:
22px
;
line-height
:
22px
;
width
:
72
px
;
width
:
80
px
;
margin-right
:
44px
;
margin-right
:
44px
;
overflow
:
hidden
;
word-wrap
:
break-word
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
}
}
.taskInfoValue
{
.taskInfoValue
{
color
:
rgba
(
30
,
38
,
51
,
1
);
color
:
rgba
(
30
,
38
,
51
,
1
);
...
...
src/views/Project/ProjectJobDetail/index.tsx
View file @
c01e4fb8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-09-0
1 09:39:20
* @LastEditTime: 2022-09-0
5 17:33:58
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/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
*/
*/
...
@@ -75,10 +75,12 @@ const ProjectSubmitWork = observer(() => {
...
@@ -75,10 +75,12 @@ const ProjectSubmitWork = observer(() => {
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
[
workFlowJobInfo
,
setWorkFlowJobInfo
]
=
useState
<
ITaskInfo
>
();
const
[
workFlowJobInfo
,
setWorkFlowJobInfo
]
=
useState
<
ITaskInfo
>
();
const
[
patchInfo
,
setPatchInfo
]
=
useState
<
any
>
();
const
[
patchInfo
,
setPatchInfo
]
=
useState
<
any
>
();
const
[
activePatchId
,
setActivePatchId
]
=
useState
<
string
>
(
""
);
const
[
overviewActive
,
setOverviewActive
]
=
useState
(
true
);
const
[
overviewActive
,
setOverviewActive
]
=
useState
(
true
);
const
[
activeFlowIndex
,
setActiveFlowIndex
]
=
useState
<
number
>
(
0
);
/** 选中的node Id */
const
[
showOptions
,
setShowOptions
]
=
useState
<
boolean
>
(
false
);
const
[
activeFlowIndex
,
setActiveFlowIndex
]
=
useState
<
string
>
(
""
);
/** 选中的flow Title */
const
[
selectNodeTitle
,
setSelectNodeTitle
]
=
useState
(
'参数'
)
// const [showOptions, setShowOptions] = useState<boolean>(false);
const
[
randerOutputs1
,
setRanderOutputs
]
=
useState
<
Array
<
any
>>
([]);
const
[
randerOutputs1
,
setRanderOutputs
]
=
useState
<
Array
<
any
>>
([]);
const
locationInfo
:
any
=
useLocation
()?.
state
;
const
locationInfo
:
any
=
useLocation
()?.
state
;
// const locationInfo: any = location?.state;
// const locationInfo: any = location?.state;
...
@@ -337,32 +339,51 @@ const ProjectSubmitWork = observer(() => {
...
@@ -337,32 +339,51 @@ const ProjectSubmitWork = observer(() => {
},
},
});
});
const
handleBatch
=
(
id
:
string
)
=>
{
const
setExternalSelectedNodeId
=
(
id
:
string
)
=>
{
setActivePatchId
(
id
);
setActiveFlowIndex
(
id
);
if
(
id
)
{
workFlowJobInfo
?.
tasks
&&
setActiveFlowIndex
(
0
);
workFlowJobInfo
?.
tasks
?.
forEach
((
item
)
=>
{
if
(
item
.
id
===
id
)
{
getworkFlowTaskInfoRun
({
getworkFlowTaskInfoRun
({
jobId
:
workFlowJobInfo
?.
id
as
string
,
jobId
:
workFlowJobInfo
?.
id
as
string
,
taskId
:
id
,
taskId
:
item
.
parentNode
||
item
.
id
});
});
}
}
});
};
};
const
randerParameters
=
useMemo
(()
=>
{
const
selectedParameter
=
useCallback
(
if
(
patchInfo
?.
children
)
{
(
list
:
any
)
=>
{
if
(
patchInfo
.
children
.
length
>
0
)
{
let
result
:
any
=
[];
return
patchInfo
.
children
[
activeFlowIndex
].
parameters
;
if
(
patchInfo
?.
id
===
activeFlowIndex
)
{
setSelectNodeTitle
(
list
[
0
].
title
||
''
)
result
=
list
[
0
].
parameters
}
else
{
}
else
{
return
patchInfo
?.
parameters
;
list
?.
length
&&
list
?.
forEach
((
item
:
any
)
=>
{
if
(
item
.
id
===
activeFlowIndex
)
{
console
.
log
(
1111
)
setSelectNodeTitle
(
item
?.
title
||
''
)
result
=
item
.
parameters
;
}
}
});
}
return
result
;
},
[
activeFlowIndex
,
patchInfo
]
);
const
randerParameters
=
useMemo
(()
=>
{
if
(
patchInfo
?.
children
?.
length
)
{
return
selectedParameter
(
patchInfo
?.
children
);
}
else
{
}
else
{
return
patchInfo
?.
parameters
;
return
selectedParameter
(
patchInfo
?.
parameters
)
;
}
}
},
[
activeFlowIndex
,
patchInfo
]);
},
[
patchInfo
,
selectedParameter
]);
const
handleParams
=
()
=>
{
const
handleParams
=
()
=>
{
setOverviewActive
(
false
);
setOverviewActive
(
false
);
setShowOptions
(
!
showOptions
);
};
};
/** 终止任务 */
/** 终止任务 */
...
@@ -455,7 +476,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -455,7 +476,7 @@ const ProjectSubmitWork = observer(() => {
<
div
className=
{
styles
.
swContent
}
>
<
div
className=
{
styles
.
swContent
}
>
{
fullScreenShow
?
null
:
(
{
fullScreenShow
?
null
:
(
<
div
className=
{
styles
.
swFormBox
}
>
<
div
className=
{
styles
.
swFormBox
}
>
{
!
active
PatchId
&&
(
{
!
active
FlowIndex
&&
(
<
div
className=
{
styles
.
taskInfo
}
>
<
div
className=
{
styles
.
taskInfo
}
>
<
div
className=
{
styles
.
title
}
>
任务结果
</
div
>
<
div
className=
{
styles
.
title
}
>
任务结果
</
div
>
{
workFlowJobInfo
?.
outputs
&&
{
workFlowJobInfo
?.
outputs
&&
...
@@ -625,7 +646,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -625,7 +646,7 @@ const ProjectSubmitWork = observer(() => {
</
div
>
</
div
>
</
div
>
</
div
>
)
}
)
}
{
active
PatchId
&&
(
{
active
FlowIndex
&&
(
<
div
className=
{
styles
.
suanziInfo
}
>
<
div
className=
{
styles
.
suanziInfo
}
>
<
div
className=
{
styles
.
title
}
>
{
patchInfo
?.
title
}
</
div
>
<
div
className=
{
styles
.
title
}
>
{
patchInfo
?.
title
}
</
div
>
<
div
className=
{
styles
.
tabs
}
>
<
div
className=
{
styles
.
tabs
}
>
...
@@ -646,28 +667,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -646,28 +667,7 @@ const ProjectSubmitWork = observer(() => {
// onClick=
{()
=
>
setOverviewActive(false)}
// onClick=
{()
=
>
setOverviewActive(false)}
onClick=
{
()
=>
handleParams
()
}
onClick=
{
()
=>
handleParams
()
}
>
>
{
patchInfo
?.
children
.
length
>
0
{
selectNodeTitle
}
?
patchInfo
?.
children
[
activeFlowIndex
].
title
:
patchInfo
?.
title
}
{
showOptions
&&
patchInfo
?.
children
.
length
>
0
&&
(
<
div
className=
{
styles
.
options
}
>
{
patchInfo
?.
children
.
map
((
item
:
any
,
index
:
number
)
=>
{
return
(
<
div
key=
{
index
}
className=
{
classNames
({
[
styles
.
option
]:
true
,
[
styles
.
optionActive
]:
activeFlowIndex
===
index
,
})
}
onClick=
{
()
=>
setActiveFlowIndex
(
index
)
}
>
{
item
.
title
}
</
div
>
);
})
}
</
div
>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
{
overviewActive
&&
(
{
overviewActive
&&
(
...
@@ -720,7 +720,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -720,7 +720,7 @@ const ProjectSubmitWork = observer(() => {
)
}
)
}
{
!
overviewActive
&&
(
{
!
overviewActive
&&
(
<
div
className=
{
styles
.
params
}
>
<
div
className=
{
styles
.
params
}
>
{
randerParameters
.
map
((
parameter
:
any
)
=>
{
{
randerParameters
?
.
map
((
parameter
:
any
)
=>
{
return
(
return
(
<
div
className=
{
styles
.
taskInfoLi
}
key=
{
parameter
.
name
}
>
<
div
className=
{
styles
.
taskInfoLi
}
key=
{
parameter
.
name
}
>
<
div
className=
{
styles
.
taskInfoParams
}
>
<
div
className=
{
styles
.
taskInfoParams
}
>
...
@@ -742,7 +742,11 @@ const ProjectSubmitWork = observer(() => {
...
@@ -742,7 +742,11 @@ const ProjectSubmitWork = observer(() => {
className=
{
styles
.
swFlowBox
}
className=
{
styles
.
swFlowBox
}
style=
{
fullScreenShow
?
{
height
:
"100vh"
}
:
undefined
}
style=
{
fullScreenShow
?
{
height
:
"100vh"
}
:
undefined
}
>
>
<
Flow
tasks=
{
workFlowJobInfo
?.
tasks
}
onBatchClick=
{
handleBatch
}
/>
<
Flow
externalSelectedNodeId=
{
activeFlowIndex
}
tasks=
{
workFlowJobInfo
?.
tasks
}
setExternalSelectedNodeId=
{
setExternalSelectedNodeId
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
img
<
img
...
...
src/views/Project/components/Flow/index.module.css
View file @
c01e4fb8
.reactFlowBox
>
div
:last-child
{
.reactFlowBox
>
div
:last-child
{
display
:
none
;
display
:
none
;
}
}
.reactFlowBox
>
div
:first-child
{
/*
.reactFlowBox > div:first-child {
margin-top: 32px;
margin-top: 32px;
}
}
*/
src/views/Project/components/Flow/index.tsx
View file @
c01e4fb8
...
@@ -415,7 +415,7 @@ const Flow = (props: IProps) => {
...
@@ -415,7 +415,7 @@ const Flow = (props: IProps) => {
}
else
{
}
else
{
setInSideFlowNodeId
(
node
.
id
);
setInSideFlowNodeId
(
node
.
id
);
setInSideBatchNodeId
(
""
);
setInSideBatchNodeId
(
""
);
setExternalSelectedNodeId
&&
setExternalSelectedNodeId
(
""
);
setExternalSelectedNodeId
&&
setExternalSelectedNodeId
(
node
.
id
);
}
}
document
.
getElementById
(
`point
${
node
.
id
}
`
)?.
scrollIntoView
(
true
);
document
.
getElementById
(
`point
${
node
.
id
}
`
)?.
scrollIntoView
(
true
);
}
}
...
@@ -668,7 +668,6 @@ const Flow = (props: IProps) => {
...
@@ -668,7 +668,6 @@ const Flow = (props: IProps) => {
className=
{
styles
.
reactFlowBox
}
className=
{
styles
.
reactFlowBox
}
nodes=
{
nodes
}
nodes=
{
nodes
}
edges=
{
edges
}
edges=
{
edges
}
fitView=
{
flowType
===
"default"
?
true
:
false
}
{
...
reactFlowParams
}
{
...
reactFlowParams
}
// proOptions={{ hideAttribution: true, account: "" }}
// proOptions={{ hideAttribution: true, account: "" }}
nodeTypes=
{
nodeTypes
}
nodeTypes=
{
nodeTypes
}
...
...
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