Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
8d5fd312
Commit
8d5fd312
authored
Aug 12, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: filter and order2
parent
f27a8f3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
src/ui/BuildDeck/index.module.scss
src/ui/BuildDeck/index.module.scss
+2
-0
src/ui/BuildDeck/index.tsx
src/ui/BuildDeck/index.tsx
+19
-9
No files found.
src/ui/BuildDeck/index.module.scss
View file @
8d5fd312
...
...
@@ -34,6 +34,7 @@
.select-btns
{
padding
:
5px
;
display
:
flex
;
gap
:
4px
;
}
}
}
...
...
@@ -103,6 +104,7 @@
aspect-ratio
:
var
(
--
card-ratio
);
position
:
relative
;
background-size
:
contain
;
content-visibility
:
auto
;
.cardname
{
font-size
:
12px
;
position
:
absolute
;
...
...
src/ui/BuildDeck/index.tsx
View file @
8d5fd312
...
...
@@ -45,6 +45,7 @@ import { editDeckStore } from "./editDeckStore";
import
{
Filter
}
from
"
./Filter
"
;
import
styles
from
"
./index.module.scss
"
;
import
{
editingDeckToIDeck
,
iDeckToEditingDeck
,
type
Type
}
from
"
./utils
"
;
import
{
isEqual
}
from
"
lodash-es
"
;
const
theme
:
ThemeConfig
=
{
components
:
{
...
...
@@ -206,14 +207,17 @@ const DeckEditor: React.FC<{
const
Search
:
React
.
FC
=
()
=>
{
const
{
modal
}
=
App
.
useApp
();
const
[
searchWord
,
setSearchWord
]
=
useState
(
""
);
const
[
searchConditions
,
setSearchConditions
]
=
useState
<
FtsConditions
>
(
{
const
emptySearchConditions
:
FtsConditions
=
{
atk
:
{
min
:
null
,
max
:
null
},
def
:
{
min
:
null
,
max
:
null
},
levels
:
[],
races
:
[],
attributes
:
[],
types
:
[],
});
};
const
[
searchConditions
,
setSearchConditions
]
=
useState
<
FtsConditions
>
(
emptySearchConditions
);
const
[
searchResult
,
setSearchResult
]
=
useState
<
CardMeta
[]
>
([]);
const
sortRef
=
useRef
<
(
a
:
CardMeta
,
b
:
CardMeta
)
=>
number
>
(
...
...
@@ -280,7 +284,7 @@ const Search: React.FC = () => {
onConfirm=
{
(
newConditions
)
=>
{
setSearchConditions
(
newConditions
);
destroy
();
setTimeout
(
handleSearch
,
5
0
);
// 先收起再搜索
setTimeout
(
handleSearch
,
20
0
);
// 先收起再搜索
}
}
onCancel=
{
()
=>
destroy
()
}
/>
...
...
@@ -311,13 +315,15 @@ const Search: React.FC = () => {
<
div
className=
{
styles
[
"
select-btns
"
]
}
>
<
Button
block
type=
"text"
type=
{
isEqual
(
emptySearchConditions
,
searchConditions
)
?
"
text
"
:
"
primary
"
}
icon=
{
<
FilterOutlined
/>
}
onClick=
{
showFilterModal
}
>
筛选
{
/* TODO: 下面这个Badge应根据有无筛选规则而显示 */
}
{
false
&&
<
Badge
dot
offset=
{
[
5
,
-
5
]
}
/>
}
</
Button
>
<
Dropdown
menu=
{
{
items
:
dropdownOptions
}
}
...
...
@@ -332,10 +338,14 @@ const Search: React.FC = () => {
(
{
searchResult
.
length
}
)
</
span
>
</
span
>
{
false
&&
<
Badge
dot
offset=
{
[
5
,
-
5
]
}
/>
}
</
Button
>
</
Dropdown
>
<
Button
block
type=
"text"
icon=
{
<
DeleteOutlined
/>
}
>
<
Button
block
type=
"text"
icon=
{
<
DeleteOutlined
/>
}
onClick=
{
()
=>
setSearchConditions
(
emptySearchConditions
)
}
>
重置
</
Button
>
</
div
>
...
...
@@ -441,7 +451,7 @@ const Card: React.FC<{
const
[{
isDragging
},
drag
]
=
useDrag
({
type
:
"
Card
"
,
item
:
{
value
,
source
},
collect
:
(
monitor
:
any
)
=>
({
collect
:
(
monitor
)
=>
({
isDragging
:
monitor
.
isDragging
(),
}),
});
...
...
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