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
3c78df97
Commit
3c78df97
authored
Aug 31, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 展开收起实现优化
parent
d993a5b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
index.tsx
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
+7
-10
No files found.
src/views/WorkFlowEdit/components/ParameterSetting/index.tsx
View file @
3c78df97
import
_
from
"lodash"
;
import
_
from
"lodash"
;
import
{
useCallback
,
use
Effect
,
useMemo
,
useState
}
from
"react"
;
import
{
useCallback
,
use
Memo
,
useRef
,
useState
}
from
"react"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
{
import
{
...
@@ -20,6 +20,7 @@ import MySwitch from "@/components/mui/MySwitch";
...
@@ -20,6 +20,7 @@ import MySwitch from "@/components/mui/MySwitch";
import
Tabs
from
"@/components/mui/Tabs"
;
import
Tabs
from
"@/components/mui/Tabs"
;
import
{
getCustomTemplateParameterCheckResult
}
from
"../../util"
;
import
{
getCustomTemplateParameterCheckResult
}
from
"../../util"
;
import
MyTooltip
from
"@/components/mui/MyTooltip"
;
import
MyTooltip
from
"@/components/mui/MyTooltip"
;
import
{
useSize
}
from
"ahooks"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
...
@@ -30,18 +31,13 @@ type IParameterSettingProps = {
...
@@ -30,18 +31,13 @@ type IParameterSettingProps = {
};
};
const
ParameterSetting
=
(
props
:
IParameterSettingProps
)
=>
{
const
ParameterSetting
=
(
props
:
IParameterSettingProps
)
=>
{
const
{
templateConfigInfo
,
setTemplateConfigInfo
,
taskId
}
=
props
;
// 算子大数组
const
{
templateConfigInfo
,
setTemplateConfigInfo
,
taskId
}
=
props
;
// 算子大数组
const
[
descHeight
,
setDescHeight
]
=
useState
(
0
);
// 算子描述的高度 用来完成描述展开收起功能
const
[
isShowAllDese
,
setIsShowAllDese
]
=
useState
(
false
);
// 是否展示全部描述
const
[
isShowAllDese
,
setIsShowAllDese
]
=
useState
(
false
);
// 是否展示全部描述
const
[
fileSelectOpen
,
setFileSelectOpen
]
=
useState
(
false
);
// 选择输出路径的弹窗显示控制
const
[
fileSelectOpen
,
setFileSelectOpen
]
=
useState
(
false
);
// 选择输出路径的弹窗显示控制
const
[
fileSelectType
,
setFileSelectType
]
=
useState
<
FileSelectType
>
(
"path"
);
const
[
fileSelectType
,
setFileSelectType
]
=
useState
<
FileSelectType
>
(
"path"
);
const
[
parameterName
,
setParameterName
]
=
useState
(
""
);
// 当前算子中的parameters中正在编辑饿parameter(参数)
const
[
parameterName
,
setParameterName
]
=
useState
(
""
);
// 当前算子中的parameters中正在编辑饿parameter(参数)
const
resizeRef
=
useRef
<
HTMLDivElement
>
(
null
);
const
div
=
document
.
getElementById
(
"descHeight"
);
// 算子描述的元素(不限高)用来完成描述展开收起功能
useEffect
(()
=>
{
const
size
=
useSize
(
resizeRef
)
;
if
(
div
)
{
setDescHeight
(
div
.
offsetHeight
);
}
},
[
div
]);
// 文件夹路线选择器弹窗
// 文件夹路线选择器弹窗
const
handleFileSelectOnClose
=
()
=>
{
const
handleFileSelectOnClose
=
()
=>
{
...
@@ -525,13 +521,14 @@ const ParameterSetting = (props: IParameterSettingProps) => {
...
@@ -525,13 +521,14 @@ const ParameterSetting = (props: IParameterSettingProps) => {
{
taskInfo
.
description
||
"-"
}
{
taskInfo
.
description
||
"-"
}
</
div
>
</
div
>
<
div
<
div
ref=
{
resizeRef
}
className=
{
classNames
({
className=
{
classNames
({
[
styles
.
taskDescriptionAll
]:
isShowAllDese
,
[
styles
.
taskDescriptionAll
]:
isShowAllDese
,
[
styles
.
taskDescription
]:
!
isShowAllDese
,
[
styles
.
taskDescription
]:
!
isShowAllDese
,
})
}
})
}
>
>
{
taskInfo
.
description
||
"-"
}
{
taskInfo
.
description
||
"-"
}
{
descHeight
>
60
&&
(
{
size
&&
size
?.
height
>=
60
&&
(
<
span
<
span
className=
{
styles
.
descButton
}
className=
{
styles
.
descButton
}
onClick=
{
()
=>
setIsShowAllDese
(
!
isShowAllDese
)
}
onClick=
{
()
=>
setIsShowAllDese
(
!
isShowAllDese
)
}
...
...
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