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
sunyihao
bkunyun
Commits
8ea4c62e
Commit
8ea4c62e
authored
Jul 08, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 解决任务详情删除终止权限bug
parent
d4fb15ff
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
49 deletions
+93
-49
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+32
-20
index.tsx
src/views/Project/components/Flow/index.tsx
+9
-2
index.module.css
...ews/WorkFlowEdit/components/OperatorList/index.module.css
+1
-1
index.tsx
src/views/WorkFlowEdit/components/OperatorList/index.tsx
+42
-16
index.module.css
src/views/WorkFlowEdit/index.module.css
+1
-0
index.tsx
src/views/WorkFlowEdit/index.tsx
+8
-10
No files found.
src/views/Project/ProjectJobDetail/index.tsx
View file @
8ea4c62e
...
@@ -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: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-0
6 17:05:13
* @LastEditTime: 2022-07-0
8 15:02:08
* @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
*/
*/
...
@@ -37,6 +37,7 @@ import MyPopconfirm from "@/components/mui/MyPopconfirm";
...
@@ -37,6 +37,7 @@ import MyPopconfirm from "@/components/mui/MyPopconfirm";
import
{
storageUnitFromB
}
from
"@/utils/util"
;
import
{
storageUnitFromB
}
from
"@/utils/util"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
import
usePass
from
"@/hooks/usePass"
;
const
stateMap
=
{
const
stateMap
=
{
RUNNING
:
"正在运行"
,
RUNNING
:
"正在运行"
,
...
@@ -69,6 +70,7 @@ const ProjectSubmitWork = observer(() => {
...
@@ -69,6 +70,7 @@ const ProjectSubmitWork = observer(() => {
const
location
:
any
=
useLocation
();
const
location
:
any
=
useLocation
();
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
message
=
useMessage
();
const
message
=
useMessage
();
const
isPass
=
usePass
();
const
[
fullScreenShow
,
setFullScreenShow
]
=
useState
<
boolean
>
(
false
);
const
[
fullScreenShow
,
setFullScreenShow
]
=
useState
<
boolean
>
(
false
);
const
{
name
,
state
}
=
workFlowJobInfo
||
{};
const
{
name
,
state
}
=
workFlowJobInfo
||
{};
...
@@ -283,6 +285,14 @@ const ProjectSubmitWork = observer(() => {
...
@@ -283,6 +285,14 @@ const ProjectSubmitWork = observer(() => {
});
});
},
[
deleteWorkJob
,
workFlowJobInfo
?.
id
]);
},
[
deleteWorkJob
,
workFlowJobInfo
?.
id
]);
const
returnPermission
=
useMemo
(()
=>
{
if
(
state
===
"RUNNING"
)
{
return
isPass
(
"PROJECT_WORKBENCH_JOBS_STOP"
,
"USER"
);
}
else
{
return
isPass
(
"PROJECT_WORKBENCH_JOBS_DELETE"
,
"MANAGER"
);
}
},
[
isPass
,
state
]);
return
(
return
(
<
div
className=
{
styles
.
swBox
}
>
<
div
className=
{
styles
.
swBox
}
>
{
fullScreenShow
?
null
:
(
{
fullScreenShow
?
null
:
(
...
@@ -306,25 +316,27 @@ const ProjectSubmitWork = observer(() => {
...
@@ -306,25 +316,27 @@ const ProjectSubmitWork = observer(() => {
<
div
className=
{
styles
.
swTemplateTitle
}
>
{
name
}
</
div
>
<
div
className=
{
styles
.
swTemplateTitle
}
>
{
name
}
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
swHeaderRight
}
>
{
returnPermission
&&
(
<
MyPopconfirm
<
div
className=
{
styles
.
swHeaderRight
}
>
title=
{
<
MyPopconfirm
state
===
"RUNNING"
title=
{
?
"正在运行的任务终止后将无法重新运行,确认继续吗?"
state
===
"RUNNING"
:
"任务被删除后将无法恢复,确认继续吗?"
?
"正在运行的任务终止后将无法重新运行,确认继续吗?"
}
:
"任务被删除后将无法恢复,确认继续吗?"
onConfirm=
{
()
=>
{
}
state
===
"RUNNING"
?
onStopJob
()
:
onDeleteJob
();
onConfirm=
{
()
=>
{
}
}
state
===
"RUNNING"
?
onStopJob
()
:
onDeleteJob
();
>
}
}
<
ButtonComponent
>
text=
{
state
===
"RUNNING"
?
"终止"
:
"删除"
}
<
ButtonComponent
variant=
"outlined"
text=
{
state
===
"RUNNING"
?
"终止"
:
"删除"
}
color=
"secondary"
variant=
"outlined"
// click=
{
onStopJob
}
color=
"secondary"
></
ButtonComponent
>
// click=
{
onStopJob
}
</
MyPopconfirm
>
></
ButtonComponent
>
</
div
>
</
MyPopconfirm
>
</
div
>
)
}
</
div
>
</
div
>
)
}
)
}
<
div
className=
{
styles
.
swContent
}
>
<
div
className=
{
styles
.
swContent
}
>
...
...
src/views/Project/components/Flow/index.tsx
View file @
8ea4c62e
...
@@ -36,6 +36,7 @@ interface IProps extends ReactFlowProps {
...
@@ -36,6 +36,7 @@ interface IProps extends ReactFlowProps {
onBatchClick
?:
(
val
:
string
)
=>
void
;
onBatchClick
?:
(
val
:
string
)
=>
void
;
setSelectedNodeId
?:
(
val
:
string
)
=>
void
;
setSelectedNodeId
?:
(
val
:
string
)
=>
void
;
selectedNodeId
?:
string
;
selectedNodeId
?:
string
;
type
?:
"edit"
|
"default"
;
}
}
/** 获取imgUrl */
/** 获取imgUrl */
...
@@ -133,7 +134,13 @@ const FlowNode = (props: any) => {
...
@@ -133,7 +134,13 @@ const FlowNode = (props: any) => {
};
};
const
Flow
=
(
props
:
IProps
)
=>
{
const
Flow
=
(
props
:
IProps
)
=>
{
const
{
tasks
,
onBatchClick
,
setSelectedNodeId
,
selectedNodeId
}
=
props
;
const
{
tasks
,
onBatchClick
,
setSelectedNodeId
,
selectedNodeId
,
type
:
flowType
=
"default"
,
}
=
props
;
/** 自定义的节点类型 */
/** 自定义的节点类型 */
const
nodeTypes
=
useMemo
(()
=>
{
const
nodeTypes
=
useMemo
(()
=>
{
return
{
batchNode
:
BatchNode
,
flowNode
:
FlowNode
};
return
{
batchNode
:
BatchNode
,
flowNode
:
FlowNode
};
...
@@ -333,7 +340,7 @@ const Flow = (props: IProps) => {
...
@@ -333,7 +340,7 @@ const Flow = (props: IProps) => {
<
ReactFlow
<
ReactFlow
nodes=
{
nodes
}
nodes=
{
nodes
}
edges=
{
edges
}
edges=
{
edges
}
fitView
fitView
=
{
flowType
===
"default"
?
false
:
true
}
proOptions=
{
{
hideAttribution
:
true
,
account
:
""
}
}
proOptions=
{
{
hideAttribution
:
true
,
account
:
""
}
}
nodeTypes=
{
nodeTypes
}
nodeTypes=
{
nodeTypes
}
onPaneClick=
{
handlePaneClick
}
onPaneClick=
{
handlePaneClick
}
...
...
src/views/WorkFlowEdit/components/OperatorList/index.module.css
View file @
8ea4c62e
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
}
}
.operatorListBox
{
.operatorListBox
{
height
:
100%
;
height
:
calc
(
100%
-
84px
)
;
}
}
.listBox
{
.listBox
{
...
...
src/views/WorkFlowEdit/components/OperatorList/index.tsx
View file @
8ea4c62e
...
@@ -16,6 +16,7 @@ import { useStores } from "@/store";
...
@@ -16,6 +16,7 @@ import { useStores } from "@/store";
import
{
uuid
}
from
"@/utils/util"
;
import
{
uuid
}
from
"@/utils/util"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
import
MyMenu
from
"@/components/mui/MyMenu"
;
/*
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
...
@@ -42,25 +43,39 @@ const OperatorItem = (props: IOperatorItemProps) => {
...
@@ -42,25 +43,39 @@ const OperatorItem = (props: IOperatorItemProps) => {
const
onDragEnd
=
useCallback
(
const
onDragEnd
=
useCallback
(
(
e
:
React
.
DragEvent
<
HTMLDivElement
>
)
=>
{
(
e
:
React
.
DragEvent
<
HTMLDivElement
>
)
=>
{
const
dom
=
document
.
getElementById
(
"workFlowEditRight"
);
const
dom
=
document
.
getElementById
(
"workFlowEditRight"
);
const
clientX
=
e
.
clientX
;
const
clientY
=
e
.
clientY
;
const
upperLeftPointX
=
Number
(
dom
?.
offsetLeft
);
const
upperLeftPointX
=
Number
(
dom
?.
offsetLeft
);
const
upperLeftPointY
=
Number
(
dom
?.
offsetTop
);
const
upperLeftPointY
=
Number
(
dom
?.
offsetTop
);
const
lowerRightX
=
Number
(
upperLeftPointX
)
+
Number
(
dom
?.
offsetWidth
);
const
lowerRightX
=
Number
(
upperLeftPointX
)
+
Number
(
dom
?.
offsetWidth
);
const
lowerRightY
=
Number
(
upperLeftPointY
)
+
Number
(
dom
?.
offsetHeight
);
const
lowerRightY
=
Number
(
upperLeftPointY
)
+
Number
(
dom
?.
offsetHeight
);
if
(
if
(
e
.
clientX
>
upperLeftPointX
&&
clientX
>
upperLeftPointX
&&
e
.
clientY
>
upperLeftPointY
&&
clientY
>
upperLeftPointY
&&
e
.
clientX
<
lowerRightX
&&
clientX
<
lowerRightX
&&
e
.
clientY
<
lowerRightY
clientY
<
lowerRightY
)
{
)
{
console
.
log
(
clientX
-
upperLeftPointX
,
clientY
-
upperLeftPointY
,
"0000000"
);
const
newVal
=
[
const
newVal
=
[
...
cloneDeep
(
templateConfigInfo
),
...
cloneDeep
(
templateConfigInfo
),
{
...
props
.
info
,
uuid
:
uuid
()
},
{
...
props
.
info
,
uuid
:
uuid
(),
position
:
{
x
:
clientX
-
upperLeftPointX
,
y
:
clientY
-
upperLeftPointY
,
},
},
];
];
setTemplateConfigInfo
(
newVal
);
setTemplateConfigInfo
(
newVal
);
}
}
setIsDragStyle
(
false
);
setIsDragStyle
(
false
);
},
},
[
setTemplateConfigInfo
,
templateConfigInfo
]
[
props
.
info
,
setTemplateConfigInfo
,
templateConfigInfo
]
);
);
return
(
return
(
...
@@ -90,7 +105,9 @@ const OperatorItem = (props: IOperatorItemProps) => {
...
@@ -90,7 +105,9 @@ const OperatorItem = (props: IOperatorItemProps) => {
</
span
>
</
span
>
);
);
})
}
})
}
{
/* <MySelect options={[]} /> */
}
<
MyMenu
options=
{
[]
}
value=
"dd"
>
<
div
>
ddd
</
div
>
</
MyMenu
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
@@ -102,15 +119,13 @@ const OperatorList = observer((props: IOperatorListProps) => {
...
@@ -102,15 +119,13 @@ const OperatorList = observer((props: IOperatorListProps) => {
const
{
templateConfigInfo
,
setTemplateConfigInfo
}
=
props
;
const
{
templateConfigInfo
,
setTemplateConfigInfo
}
=
props
;
const
[
operatorListData
,
setOperatorListData
]
=
useState
<
ITask
[]
>
(
const
[
operatorListData
,
setOperatorListData
]
=
useState
<
ITask
[]
>
([]);
mockData
as
any
const
[
keyword
,
setKeyword
]
=
useState
<
string
>
(
""
);
);
console
.
log
(
templateConfigInfo
,
"templateConfigInfo"
);
// 取消作业
// 取消作业
const
{
run
}
=
useMyRequest
(
fetchOperatorList
,
{
const
{
run
}
=
useMyRequest
(
fetchOperatorList
,
{
onSuccess
:
(
res
:
IResponse
<
any
>
)
=>
{
onSuccess
:
(
res
:
IResponse
<
any
>
)
=>
{
console
.
log
(
res
,
"1111"
);
setOperatorListData
(
res
?.
data
||
[]
);
},
},
});
});
...
@@ -118,18 +133,29 @@ const OperatorList = observer((props: IOperatorListProps) => {
...
@@ -118,18 +133,29 @@ const OperatorList = observer((props: IOperatorListProps) => {
run
({
run
({
owner
:
"root"
,
owner
:
"root"
,
productId
:
"cadd"
||
""
,
productId
:
"cadd"
||
""
,
// keyword : ''
});
});
},
[
productId
,
run
]);
},
[
productId
,
run
]);
/** 处理回车键 */
const
handleEnterCode
=
(
e
:
React
.
KeyboardEvent
<
HTMLInputElement
>
)
=>
{
if
(
e
.
keyCode
===
13
)
{
run
({
owner
:
"root"
,
productId
:
"cadd"
||
""
,
keyword
,
});
}
};
return
(
return
(
<
div
className=
{
styles
.
operatorListBox
}
>
<
div
className=
{
styles
.
operatorListBox
}
>
<
div
className=
{
styles
.
searchBox
}
>
<
div
className=
{
styles
.
searchBox
}
>
<
OutlinedInput
<
OutlinedInput
onChange=
{
(
e
:
any
)
=>
{
onChange=
{
(
e
)
=>
{
console
.
log
(
e
.
target
.
value
);
setKeyword
(
e
.
target
.
value
);
}
}
}
}
placeholder=
"输入关键词搜索"
placeholder=
"输入关键词搜索"
onKeyUp=
{
handleEnterCode
}
size=
"small"
size=
"small"
sx=
{
{
height
:
32
,
width
:
"100%"
}
}
sx=
{
{
height
:
32
,
width
:
"100%"
}
}
endAdornment=
{
<
SearchIcon
style=
{
{
color
:
"#8A9099"
}
}
/>
}
endAdornment=
{
<
SearchIcon
style=
{
{
color
:
"#8A9099"
}
}
/>
}
...
@@ -137,7 +163,7 @@ const OperatorList = observer((props: IOperatorListProps) => {
...
@@ -137,7 +163,7 @@ const OperatorList = observer((props: IOperatorListProps) => {
</
div
>
</
div
>
<
div
className=
{
styles
.
listBox
}
>
<
div
className=
{
styles
.
listBox
}
>
{
operatorListData
{
operatorListData
.
filter
((
item
)
=>
item
.
type
===
"BATCH"
)
//
.filter((item) => item.type === "BATCH")
.
map
((
item
)
=>
{
.
map
((
item
)
=>
{
return
(
return
(
<
OperatorItem
<
OperatorItem
...
...
src/views/WorkFlowEdit/index.module.css
View file @
8ea4c62e
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
background-color
:
#fff
;
background-color
:
#fff
;
border-right
:
1
xp
solid
rgba
(
235
,
237
,
240
,
1
);
border-right
:
1
xp
solid
rgba
(
235
,
237
,
240
,
1
);
width
:
360px
;
width
:
360px
;
height
:
100%
;
/* overflow-y: scroll; */
/* overflow-y: scroll; */
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
...
...
src/views/WorkFlowEdit/index.tsx
View file @
8ea4c62e
...
@@ -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: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-08
09:25:42
* @LastEditTime: 2022-07-08
11:51:07
* @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
*/
*/
...
@@ -78,7 +78,7 @@ const WorkFlowEdit = (props: IProps) => {
...
@@ -78,7 +78,7 @@ const WorkFlowEdit = (props: IProps) => {
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
swContent
}
>
<
div
className=
{
styles
.
swContent
}
>
<
div
>
<
div
className=
{
styles
.
swFormBox
}
>
<
div
className=
{
styles
.
radiosBox
}
>
<
div
className=
{
styles
.
radiosBox
}
>
<
RadioGroupOfButtonStyle
<
RadioGroupOfButtonStyle
radioOptions=
{
radioOptions
}
radioOptions=
{
radioOptions
}
...
@@ -95,12 +95,10 @@ const WorkFlowEdit = (props: IProps) => {
...
@@ -95,12 +95,10 @@ const WorkFlowEdit = (props: IProps) => {
></
RadioGroupOfButtonStyle
>
></
RadioGroupOfButtonStyle
>
</
div
>
</
div
>
{
leftContentType
===
"list"
&&
(
{
leftContentType
===
"list"
&&
(
<
div
className=
{
styles
.
swFormBox
}
>
<
OperatorList
<
OperatorList
templateConfigInfo=
{
templateConfigInfo
}
templateConfigInfo=
{
templateConfigInfo
}
setTemplateConfigInfo=
{
setTemplateConfigInfo
}
setTemplateConfigInfo=
{
setTemplateConfigInfo
}
/>
/>
</
div
>
)
}
)
}
{
leftContentType
!==
"list"
&&
(
{
leftContentType
!==
"list"
&&
(
<
ParameterSetting
<
ParameterSetting
...
@@ -109,8 +107,8 @@ const WorkFlowEdit = (props: IProps) => {
...
@@ -109,8 +107,8 @@ const WorkFlowEdit = (props: IProps) => {
/>
/>
)
}
)
}
</
div
>
</
div
>
<
div
id=
"workFlowEditRight"
>
<
div
className=
{
styles
.
swFlowBox
}
id=
"workFlowEditRight"
>
<
Flow
tasks=
{
templateConfigInfo
}
/>
<
Flow
tasks=
{
templateConfigInfo
}
type=
"edit"
/>
</
div
>
</
div
>
</
div
>
</
div
>
</
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