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
aaf17676
Commit
aaf17676
authored
Jul 22, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: MyTooltip组件开发
parent
82b8572e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
28 deletions
+84
-28
MyTooltip.tsx
src/components/mui/MyTooltip.tsx
+52
-0
index.tsx
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
+13
-11
index.tsx
...ws/Project/components/Flow/components/BatchNode/index.tsx
+6
-6
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+13
-11
No files found.
src/components/mui/MyTooltip.tsx
0 → 100644
View file @
aaf17676
/*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-11 11:56:58
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-22 10:51:10
* @FilePath: /bkunyun/src/components/mui/MyTooltip.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
Tooltip
,
TooltipProps
}
from
"@mui/material"
;
import
{
ThemeProvider
,
createTheme
}
from
"@mui/material/styles"
;
interface
IMyTooltipProps
extends
TooltipProps
{
title
:
string
;
}
const
theme
=
createTheme
({
components
:
{
MuiTooltip
:
{
styleOverrides
:
{
tooltip
:
{
backgroundColor
:
"rgba(7, 19, 38, .8)"
,
color
:
"#fff"
,
},
arrow
:
{
"&:before"
:
{
backgroundColor
:
"#071326"
,
opacity
:
"0.8"
,
},
},
},
},
},
});
const
MyTooltip
=
(
props
:
IMyTooltipProps
)
=>
{
const
{
title
,
children
,
placement
=
"top"
,
...
other
}
=
props
;
return
(
<
ThemeProvider
theme=
{
theme
}
>
<
Tooltip
// interactive={true}
arrow
title=
{
title
}
placement=
{
placement
}
{
...
other
}
>
{
children
}
</
Tooltip
>
</
ThemeProvider
>
);
};
export
default
MyTooltip
;
src/views/Project/ProjectSubmitWork/ConfigForm/index.tsx
View file @
aaf17676
import
{
ITemplateConfig
,
IRenderTasks
}
from
"../interface"
;
import
moment
from
"moment"
;
import
styles
from
"./index.module.css"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
Tooltip
from
"@mui/material/Tooltip"
;
import
classnames
from
"classnames"
;
import
classnames
from
"classnames"
;
import
{
useState
,
useMemo
,
useImperativeHandle
}
from
"react"
;
import
{
useState
,
useMemo
,
useImperativeHandle
}
from
"react"
;
import
{
ITemplateConfig
,
IRenderTasks
}
from
"../interface"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
FileSelect
,
{
import
FileSelect
,
{
FileSelectType
,
FileSelectType
,
}
from
"@/components/BusinessComponents/FileSelect"
;
}
from
"@/components/BusinessComponents/FileSelect"
;
import
moment
from
"moment"
;
import
MySelect
,
{
optionsTransform
}
from
"../components/MySelect"
;
import
MySelect
,
{
optionsTransform
}
from
"../components/MySelect"
;
import
MyCheckBox
from
"@/components/mui/MyCheckBox"
;
import
MyCheckBox
from
"@/components/mui/MyCheckBox"
;
import
MyRadio
from
"@/components/mui/MyRadio"
;
import
MyRadio
from
"@/components/mui/MyRadio"
;
...
@@ -17,6 +16,9 @@ import questionMark from "@/assets/project/questionMark.svg";
...
@@ -17,6 +16,9 @@ import questionMark from "@/assets/project/questionMark.svg";
import
tipsIcon
from
"@/assets/project/tipsIcon.svg"
;
import
tipsIcon
from
"@/assets/project/tipsIcon.svg"
;
import
jobSueIcon
from
"@/assets/project/jobSue.svg"
;
import
jobSueIcon
from
"@/assets/project/jobSue.svg"
;
import
{
IParameter
}
from
"../interface"
;
import
{
IParameter
}
from
"../interface"
;
import
MyTooltip
from
"@/components/mui/MyTooltip"
;
import
styles
from
"./index.module.css"
;
type
ConfigFormProps
=
{
type
ConfigFormProps
=
{
templateConfigInfo
?:
ITemplateConfig
;
templateConfigInfo
?:
ITemplateConfig
;
...
@@ -360,13 +362,13 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -360,13 +362,13 @@ const ConfigForm = (props: ConfigFormProps) => {
></
MyCheckBox
>
></
MyCheckBox
>
)
}
)
}
{
parameter
.
description
&&
(
{
parameter
.
description
&&
(
<
Tooltip
title=
{
parameter
.
description
}
placement=
"top"
>
<
My
Tooltip
title=
{
parameter
.
description
}
placement=
"top"
>
<
img
<
img
className=
{
styles
.
parameterDesc
}
className=
{
styles
.
parameterDesc
}
src=
{
questionMark
}
src=
{
questionMark
}
alt=
""
alt=
""
/>
/>
</
Tooltip
>
</
My
Tooltip
>
)
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -466,9 +468,9 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -466,9 +468,9 @@ const ConfigForm = (props: ConfigFormProps) => {
{
task
.
title
}
{
task
.
title
}
</
span
>
</
span
>
{
task
.
description
&&
(
{
task
.
description
&&
(
<
Tooltip
title=
{
task
.
description
}
placement=
"top"
>
<
My
Tooltip
title=
{
task
.
description
}
placement=
"top"
>
<
img
className=
{
styles
.
taskDescIcon
}
src=
{
tipsIcon
}
alt=
""
/>
<
img
className=
{
styles
.
taskDescIcon
}
src=
{
tipsIcon
}
alt=
""
/>
</
Tooltip
>
</
My
Tooltip
>
)
}
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
taskConfigBox
}
>
<
div
className=
{
styles
.
taskConfigBox
}
>
...
@@ -479,13 +481,13 @@ const ConfigForm = (props: ConfigFormProps) => {
...
@@ -479,13 +481,13 @@ const ConfigForm = (props: ConfigFormProps) => {
<
div
className=
{
styles
.
flowTitle
}
>
<
div
className=
{
styles
.
flowTitle
}
>
{
flow
.
title
}
{
flow
.
title
}
{
flow
.
description
&&
(
{
flow
.
description
&&
(
<
Tooltip
title=
{
flow
.
description
}
placement=
"top"
>
<
My
Tooltip
title=
{
flow
.
description
}
placement=
"top"
>
<
img
<
img
className=
{
styles
.
flowDescIcon
}
className=
{
styles
.
flowDescIcon
}
src=
{
tipsIcon
}
src=
{
tipsIcon
}
alt=
""
alt=
""
/>
/>
</
Tooltip
>
</
My
Tooltip
>
)
}
)
}
</
div
>
</
div
>
{
randerParameters
(
{
randerParameters
(
...
...
src/views/Project/components/Flow/components/BatchNode/index.tsx
View file @
aaf17676
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-12 11:20:29
* @Date: 2022-07-12 11:20:29
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-
15 10:48:22
* @LastEditTime: 2022-07-
22 10:43:28
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/BatchNode.tsx
* @FilePath: /bkunyun/src/views/Project/components/Flow/components/BatchNode.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
{
Tooltip
}
from
"@mui/material"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
{
useMemo
}
from
"react"
;
import
{
useMemo
}
from
"react"
;
import
{
Handle
,
Position
}
from
"react-flow-renderer"
;
import
{
Handle
,
Position
}
from
"react-flow-renderer"
;
...
@@ -16,6 +15,7 @@ import { uuid } from "@/utils/util";
...
@@ -16,6 +15,7 @@ import { uuid } from "@/utils/util";
import
{
IBatchNode
}
from
"../../interface"
;
import
{
IBatchNode
}
from
"../../interface"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
import
MyTooltip
from
"@/components/mui/MyTooltip"
;
/** 自定义batch节点 */
/** 自定义batch节点 */
const
BatchNode
=
(
props
:
IBatchNode
)
=>
{
const
BatchNode
=
(
props
:
IBatchNode
)
=>
{
...
@@ -63,7 +63,7 @@ const BatchNode = (props: IBatchNode) => {
...
@@ -63,7 +63,7 @@ const BatchNode = (props: IBatchNode) => {
{
inParamsArr
?.
length
{
inParamsArr
?.
length
?
inParamsArr
.
map
((
item
,
index
)
=>
{
?
inParamsArr
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
Tooltip
title=
{
item
.
name
}
key=
{
uuid
()
}
>
<
My
Tooltip
title=
{
item
.
name
}
key=
{
uuid
()
}
>
<
Handle
<
Handle
id=
{
item
.
name
}
id=
{
item
.
name
}
style=
{
{
style=
{
{
...
@@ -76,7 +76,7 @@ const BatchNode = (props: IBatchNode) => {
...
@@ -76,7 +76,7 @@ const BatchNode = (props: IBatchNode) => {
type=
"target"
type=
"target"
position=
{
Position
.
Top
}
position=
{
Position
.
Top
}
/>
/>
</
Tooltip
>
</
My
Tooltip
>
);
);
})
})
:
null
}
:
null
}
...
@@ -93,7 +93,7 @@ const BatchNode = (props: IBatchNode) => {
...
@@ -93,7 +93,7 @@ const BatchNode = (props: IBatchNode) => {
{
outParamsArr
?.
length
{
outParamsArr
?.
length
?
outParamsArr
.
map
((
item
,
index
)
=>
{
?
outParamsArr
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
Tooltip
title=
{
item
.
name
}
key=
{
uuid
()
}
>
<
My
Tooltip
title=
{
item
.
name
}
key=
{
uuid
()
}
>
<
Handle
<
Handle
id=
{
item
.
name
}
id=
{
item
.
name
}
style=
{
{
style=
{
{
...
@@ -104,7 +104,7 @@ const BatchNode = (props: IBatchNode) => {
...
@@ -104,7 +104,7 @@ const BatchNode = (props: IBatchNode) => {
type=
"source"
type=
"source"
position=
{
Position
.
Bottom
}
position=
{
Position
.
Bottom
}
/>
/>
</
Tooltip
>
</
My
Tooltip
>
);
);
})
})
:
null
}
:
null
}
...
...
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
aaf17676
import
styles
from
"./index.module.css"
;
import
_
from
"lodash"
;
import
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
classNames
from
"classnames"
;
import
{
import
{
ITask
,
ITask
,
IParameter
,
IParameter
,
}
from
"../../../Project/ProjectSubmitWork/interface"
;
}
from
"../../../Project/ProjectSubmitWork/interface"
;
import
noTemplate
from
"@/assets/project/noTemplate.svg"
;
import
noTemplate
from
"@/assets/project/noTemplate.svg"
;
import
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
"react"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
MyInput
from
"@/components/mui/MyInput"
;
import
Tooltip
from
"@mui/material/Tooltip"
;
import
MyCheckBox
from
"@/components/mui/MyCheckBox"
;
import
MyCheckBox
from
"@/components/mui/MyCheckBox"
;
import
MySelect
,
{
import
MySelect
,
{
optionsTransform
,
optionsTransform
,
}
from
"../../../Project/ProjectSubmitWork/components/MySelect"
;
}
from
"../../../Project/ProjectSubmitWork/components/MySelect"
;
import
_
from
"lodash"
;
import
FileSelect
,
{
import
FileSelect
,
{
FileSelectType
,
FileSelectType
,
}
from
"@/components/BusinessComponents/FileSelect"
;
}
from
"@/components/BusinessComponents/FileSelect"
;
...
@@ -20,8 +20,10 @@ import questionMark from "@/assets/project/questionMark.svg";
...
@@ -20,8 +20,10 @@ import questionMark from "@/assets/project/questionMark.svg";
import
fileSelectIcon
from
"@/assets/project/fileSelect.svg"
;
import
fileSelectIcon
from
"@/assets/project/fileSelect.svg"
;
import
MySwitch
from
"@/components/mui/MySwitch"
;
import
MySwitch
from
"@/components/mui/MySwitch"
;
import
Tabs
from
"@/components/mui/Tabs"
;
import
Tabs
from
"@/components/mui/Tabs"
;
import
classNames
from
"classnames"
;
import
{
getCustomTemplateParameterCheckResult
}
from
"../../util"
;
import
{
getCustomTemplateParameterCheckResult
}
from
"../../util"
;
import
MyTooltip
from
"@/components/mui/MyTooltip"
;
import
styles
from
"./index.module.css"
;
type
IParameterSettingProps
=
{
type
IParameterSettingProps
=
{
templateConfigInfo
:
ITask
[];
templateConfigInfo
:
ITask
[];
...
@@ -395,7 +397,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -395,7 +397,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
const
renderInput
=
useCallback
(
const
renderInput
=
useCallback
(
(
parameter
:
IParameter
)
=>
{
(
parameter
:
IParameter
)
=>
{
return
(
return
(
<
Tooltip
title=
{
parameter
.
description
}
placement=
"top"
>
<
My
Tooltip
title=
{
parameter
.
description
}
placement=
"top"
>
<
div
>
<
div
>
{
parameter
.
domType
.
toLowerCase
()
===
"file"
&&
(
{
parameter
.
domType
.
toLowerCase
()
===
"file"
&&
(
<
MyInput
<
MyInput
...
@@ -539,7 +541,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -539,7 +541,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
></
MyCheckBox
>
></
MyCheckBox
>
)
}
)
}
</
div
>
</
div
>
</
Tooltip
>
</
My
Tooltip
>
);
);
},
},
[
handleParameterChange
]
[
handleParameterChange
]
...
@@ -720,7 +722,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -720,7 +722,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
<
div
className=
{
styles
.
inOutBox
}
>
<
div
className=
{
styles
.
inOutBox
}
>
<
div
className=
{
styles
.
paramsTitle
}
>
<
div
className=
{
styles
.
paramsTitle
}
>
输入
输入
<
Tooltip
<
My
Tooltip
title=
"当某个输入项为启用状态时,代表该输入将由模板使用者在使用的时候填写赋值;当为关闭状态时,代表该输入不需要使用者来填写赋值,而是将其它流程的结果传入。"
title=
"当某个输入项为启用状态时,代表该输入将由模板使用者在使用的时候填写赋值;当为关闭状态时,代表该输入不需要使用者来填写赋值,而是将其它流程的结果传入。"
placement=
"right"
placement=
"right"
>
>
...
@@ -729,7 +731,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -729,7 +731,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
src=
{
questionMark
}
src=
{
questionMark
}
alt=
""
alt=
""
/>
/>
</
Tooltip
>
</
My
Tooltip
>
</
div
>
</
div
>
<
div
className=
{
styles
.
paramsList
}
>
<
div
className=
{
styles
.
paramsList
}
>
{
inParameters
.
map
((
parameter
,
index
)
=>
{
{
inParameters
.
map
((
parameter
,
index
)
=>
{
...
@@ -810,7 +812,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -810,7 +812,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
<
div
className=
{
styles
.
paramsGroup
}
>
<
div
className=
{
styles
.
paramsGroup
}
>
<
div
className=
{
styles
.
paramsTitle
}
>
<
div
className=
{
styles
.
paramsTitle
}
>
参数组
参数组
<
Tooltip
<
My
Tooltip
title=
"当某个参数项为启用状态时,代表该参数将由模板使用者在使用的时候填写赋值;当为关闭状态时,代表该参数不需要使用者来填写赋值。"
title=
"当某个参数项为启用状态时,代表该参数将由模板使用者在使用的时候填写赋值;当为关闭状态时,代表该参数不需要使用者来填写赋值。"
placement=
"right"
placement=
"right"
>
>
...
@@ -819,7 +821,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -819,7 +821,7 @@ const ParameterSetting = (props: IParameterSettingProps) => {
src=
{
questionMark
}
src=
{
questionMark
}
alt=
""
alt=
""
/>
/>
</
Tooltip
>
</
My
Tooltip
>
</
div
>
</
div
>
<
Tabs
<
Tabs
tabList=
{
paramsTabList
}
tabList=
{
paramsTabList
}
...
...
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