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
b384f59b
Commit
b384f59b
authored
Aug 22, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加回车搜索
parent
11d05219
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
index.tsx
...kbench/workbenchTemplate/components/AddTemplate/index.tsx
+12
-4
No files found.
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.tsx
View file @
b384f59b
...
@@ -144,7 +144,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -144,7 +144,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
};
};
// 获取模板列表
// 获取模板列表
const
getAddTemplateListFun
=
useCallback
(()
=>
{
const
getAddTemplateListFun
=
useCallback
((
newTitle
?:
string
)
=>
{
const
userName
=
JSON
.
parse
(
localStorage
.
getItem
(
"userInfo"
)
||
"{}"
)?.
name
;
const
userName
=
JSON
.
parse
(
localStorage
.
getItem
(
"userInfo"
)
||
"{}"
)?.
name
;
setSelectTemplateData
([]);
setSelectTemplateData
([]);
setAddTemplateList
([]);
setAddTemplateList
([]);
...
@@ -153,14 +153,14 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -153,14 +153,14 @@ const AddTemplate = (props: IAddTemplateProps) => {
projectId
:
projectId
as
string
,
projectId
:
projectId
as
string
,
productId
:
productId
as
string
,
productId
:
productId
as
string
,
creator
:
"root"
,
creator
:
"root"
,
keyword
:
t
itle
,
keyword
:
newT
itle
,
});
});
}
else
{
}
else
{
getAddTemplateList
({
getAddTemplateList
({
projectId
:
projectId
as
string
,
projectId
:
projectId
as
string
,
productId
:
productId
as
string
,
productId
:
productId
as
string
,
creator
:
userName
,
creator
:
userName
,
keyword
:
t
itle
,
keyword
:
newT
itle
,
});
});
}
}
},
[
},
[
...
@@ -169,7 +169,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -169,7 +169,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
productId
,
productId
,
projectId
,
projectId
,
templateType
,
templateType
,
title
,
//
title,
]);
]);
//模板启用切换
//模板启用切换
...
@@ -193,6 +193,13 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -193,6 +193,13 @@ const AddTemplate = (props: IAddTemplateProps) => {
getAddTemplateListFun
();
getAddTemplateListFun
();
},
[
getAddTemplateListFun
]);
},
[
getAddTemplateListFun
]);
// 按回车搜索
const
handleKeyWordChangeKeyUp
=
(
e
:
any
)
=>
{
if
(
e
.
keyCode
===
13
)
{
getAddTemplateListFun
(
e
.
target
.
value
);
}
};
const
hiddenBoxArr
=
useMemo
(()
=>
{
const
hiddenBoxArr
=
useMemo
(()
=>
{
const
length
=
const
length
=
templateType
===
"public"
templateType
===
"public"
...
@@ -231,6 +238,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
...
@@ -231,6 +238,7 @@ const AddTemplate = (props: IAddTemplateProps) => {
onChange=
{
(
e
:
any
)
=>
{
onChange=
{
(
e
:
any
)
=>
{
setTitle
(
e
.
target
.
value
);
setTitle
(
e
.
target
.
value
);
}
}
}
}
onKeyUp=
{
handleKeyWordChangeKeyUp
}
placeholder=
"输入关键词搜索"
placeholder=
"输入关键词搜索"
size=
"small"
size=
"small"
sx=
{
{
width
:
340
,
height
:
32
}
}
sx=
{
{
width
:
340
,
height
:
32
}
}
...
...
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