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
2067a48a
Commit
2067a48a
authored
Jul 11, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!102
parents
574a21e4
0354eba7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
21 deletions
+75
-21
Tabs.tsx
src/components/mui/Tabs.tsx
+24
-18
index.tsx
src/views/Project/components/Flow/index.tsx
+2
-0
index.tsx
src/views/WorkFlowEdit/components/OperatorList/index.tsx
+1
-0
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+0
-0
index.tsx
src/views/WorkFlowEdit/index.tsx
+9
-3
util.ts
src/views/WorkFlowEdit/util.ts
+39
-0
No files found.
src/components/mui/Tabs.tsx
View file @
2067a48a
...
@@ -28,6 +28,7 @@ interface ITabList {
...
@@ -28,6 +28,7 @@ interface ITabList {
interface
IProps
{
interface
IProps
{
tabList
:
ITabList
[];
tabList
:
ITabList
[];
defaultValue
?:
string
;
defaultValue
?:
string
;
tabPanelSx
?:
any
;
allowNullValue
?:
boolean
;
// 是否允许空值
allowNullValue
?:
boolean
;
// 是否允许空值
}
}
...
@@ -38,35 +39,44 @@ const theme = createTheme({
...
@@ -38,35 +39,44 @@ const theme = createTheme({
root
:
{
root
:
{
paddingLeft
:
0
,
paddingLeft
:
0
,
paddingRight
:
0
,
paddingRight
:
0
,
paddingTop
:
'8px'
,
paddingTop
:
"8px"
,
paddingBottom
:
'8px'
,
paddingBottom
:
"8px"
,
minWidth
:
'20px'
,
minWidth
:
"20px"
,
marginRight
:
'32px'
,
marginRight
:
"32px"
,
color
:
'#8A9099'
,
color
:
"#8A9099"
,
selected
:
{
selected
:
{
color
:
'#1976d2'
color
:
"#1976d2"
,
},
},
"&.Mui-disabled"
:
{
"&.Mui-disabled"
:
{
color
:
'#C2C6CC'
,
color
:
"#C2C6CC"
,
},
},
},
},
},
},
},
},
// #C2C6CC
// #C2C6CC
MuiTabs
:{
MuiTabs
:
{
styleOverrides
:
{
styleOverrides
:
{
indicator
:
{
indicator
:
{
backgroundColor
:
'#1370FF'
,
backgroundColor
:
"#1370FF"
,
}
}
,
}
}
,
},
},
},
},
});
});
const
Tabs
=
(
props
:
IProps
)
=>
{
const
Tabs
=
(
props
:
IProps
)
=>
{
const
{
tabList
,
defaultValue
,
allowNullValue
=
false
}
=
props
;
const
{
tabList
,
defaultValue
,
allowNullValue
=
false
,
tabPanelSx
=
{
padding
:
"20px 0 0 0"
},
}
=
props
;
const
[
value
,
setValue
]
=
useState
(
const
[
value
,
setValue
]
=
useState
(
defaultValue
?
defaultValue
:
allowNullValue
?
''
:
tabList
.
filter
((
e
)
=>
!
e
.
hide
)[
0
].
value
defaultValue
?
defaultValue
:
allowNullValue
?
""
:
tabList
.
filter
((
e
)
=>
!
e
.
hide
)[
0
].
value
);
);
const
onChange
=
(
val
:
string
)
=>
{
const
onChange
=
(
val
:
string
)
=>
{
...
@@ -120,11 +130,7 @@ const Tabs = (props: IProps) => {
...
@@ -120,11 +130,7 @@ const Tabs = (props: IProps) => {
?.
filter
((
item
)
=>
!
item
.
hide
)
?.
filter
((
item
)
=>
!
item
.
hide
)
.
map
((
item
)
=>
{
.
map
((
item
)
=>
{
return
(
return
(
<
TabPanel
<
TabPanel
sx=
{
tabPanelSx
}
value=
{
item
.
value
}
key=
{
item
.
value
}
>
sx=
{
{
padding
:
"20px 0 0 0"
}
}
value=
{
item
.
value
}
key=
{
item
.
value
}
>
{
item
.
component
}
{
item
.
component
}
</
TabPanel
>
</
TabPanel
>
);
);
...
...
src/views/Project/components/Flow/index.tsx
View file @
2067a48a
...
@@ -154,6 +154,7 @@ const Flow = (props: IProps) => {
...
@@ -154,6 +154,7 @@ const Flow = (props: IProps) => {
/** 内部维护的选择的节点Id */
/** 内部维护的选择的节点Id */
const
[
inSideNodeId
,
setInSideNodeId
]
=
useState
<
string
>
(
""
);
const
[
inSideNodeId
,
setInSideNodeId
]
=
useState
<
string
>
(
""
);
/** 删除批节点 */
const
deleteSelectBatchNode
=
useCallback
(
const
deleteSelectBatchNode
=
useCallback
(
(
e
:
any
)
=>
{
(
e
:
any
)
=>
{
if
(
e
.
keyCode
===
8
)
{
if
(
e
.
keyCode
===
8
)
{
...
@@ -168,6 +169,7 @@ const Flow = (props: IProps) => {
...
@@ -168,6 +169,7 @@ const Flow = (props: IProps) => {
[
inSideNodeId
,
setTasks
,
tasks
]
[
inSideNodeId
,
setTasks
,
tasks
]
);
);
/** 监听鼠标按下事件 */
useEffect
(()
=>
{
useEffect
(()
=>
{
window
.
addEventListener
(
"keyup"
,
deleteSelectBatchNode
);
window
.
addEventListener
(
"keyup"
,
deleteSelectBatchNode
);
return
()
=>
{
return
()
=>
{
...
...
src/views/WorkFlowEdit/components/OperatorList/index.tsx
View file @
2067a48a
...
@@ -55,6 +55,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
...
@@ -55,6 +55,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
if
(
bol
&&
index
===
undefined
)
{
if
(
bol
&&
index
===
undefined
)
{
index
=
i
;
index
=
i
;
}
}
return
!
bol
;
return
!
bol
;
});
});
if
(
index
!==
undefined
)
{
if
(
index
!==
undefined
)
{
...
...
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
2067a48a
This diff is collapsed.
Click to expand it.
src/views/WorkFlowEdit/index.tsx
View file @
2067a48a
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
* @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-
09 15:11:17
* @LastEditTime: 2022-07-
11 11:31:14
* @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
*/
*/
import
React
,
{
useState
}
from
"react"
;
import
React
,
{
use
Callback
,
use
State
}
from
"react"
;
import
ArrowBackIosNewIcon
from
"@mui/icons-material/ArrowBackIosNew"
;
import
ArrowBackIosNewIcon
from
"@mui/icons-material/ArrowBackIosNew"
;
import
IconButton
from
"@mui/material/IconButton"
;
import
IconButton
from
"@mui/material/IconButton"
;
...
@@ -40,7 +40,6 @@ const WorkFlowEdit = (props: IProps) => {
...
@@ -40,7 +40,6 @@ const WorkFlowEdit = (props: IProps) => {
const
[
templateConfigInfo
,
setTemplateConfigInfo
]
=
useState
<
ITask
[]
>
([]);
const
[
templateConfigInfo
,
setTemplateConfigInfo
]
=
useState
<
ITask
[]
>
([]);
const
[
leftContentType
,
setLeftContentType
]
=
useState
(
"list"
);
const
[
leftContentType
,
setLeftContentType
]
=
useState
(
"list"
);
const
[
popperTitle
,
setPopperTitle
]
=
useState
(
const
[
popperTitle
,
setPopperTitle
]
=
useState
(
"返回后,当前页面已填写内容将不保存,确认返回吗?"
"返回后,当前页面已填写内容将不保存,确认返回吗?"
);
);
...
@@ -63,6 +62,13 @@ const WorkFlowEdit = (props: IProps) => {
...
@@ -63,6 +62,13 @@ const WorkFlowEdit = (props: IProps) => {
}
}
};
};
/** 选中的task 唯一标识符 */
const
[
selectTaskId
,
setSelectTaskId
]
=
useState
<
string
>
();
/** 设置选中唯一标识符 */
const
handleNodeClick
=
useCallback
((
val
:
string
)
=>
{
setSelectTaskId
(
val
);
},
[]);
return
(
return
(
<
div
className=
{
styles
.
swBox
}
>
<
div
className=
{
styles
.
swBox
}
>
<
div
className=
{
styles
.
swHeader
}
>
<
div
className=
{
styles
.
swHeader
}
>
...
...
src/views/WorkFlowEdit/util.ts
0 → 100644
View file @
2067a48a
import
{
IParameter
}
from
"../Project/ProjectSubmitWork/interface"
;
export
const
getCustomTemplateParameterCheckResult
=
(
parameter
:
IParameter
,
value
:
string
):
{
error
:
boolean
;
helperText
:
string
;
}
=>
{
let
error
=
false
;
let
helperText
=
""
;
// 表单校验
if
(
parameter
.
required
)
{
// 提交任务时不展示
if
(
parameter
.
hidden
)
{
if
(
Array
.
isArray
(
value
))
{
if
(
value
.
length
===
0
)
{
error
=
true
;
helperText
=
"该参数为必填,您必须为该参数赋予默认值"
;
}
}
else
if
(
value
===
""
||
value
===
null
||
value
===
undefined
)
{
error
=
true
;
helperText
=
"该参数为必填,您必须为该参数赋予默认值"
;
}
}
}
if
(
parameter
.
validators
.
length
>
0
)
{
parameter
.
validators
.
forEach
((
validator
)
=>
{
const
reg
=
new
RegExp
(
validator
.
regex
);
if
(
!
reg
.
test
(
value
))
{
error
=
true
;
helperText
=
validator
.
message
;
}
});
}
return
{
error
,
helperText
,
};
};
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